Beispiel #1
0
        public XmppResourceModel GetOrCreateMucResource(Jid jid)
        {
            Trace.Call(jid);
            XmppResourceModel ret;

            if (MucResources.TryGetValue(jid, out ret))
            {
                return(ret);
            }
            ret      = new XmppResourceModel();
            ret.Name = jid;
            MucResources.Add(jid, ret);
            return(ret);
        }
Beispiel #2
0
        public XmppResourceModel GetOrCreateResource(Jid jid)
        {
            XmppResourceModel ret;
            string            res = jid.Resource ?? "";

            if (Resources.TryGetValue(res, out ret))
            {
                return(ret);
            }
            ret      = new XmppResourceModel();
            ret.Name = res;
            Resources.Add(res, ret);
            return(ret);
        }
Beispiel #3
0
        public XmppResourceModel GetOrCreateResource(Jid jid, out bool isNew)
        {
            XmppResourceModel ret;
            string            res = jid.Resource ?? "";

            if (Resources.TryGetValue(res, out ret))
            {
                isNew = false;
                return(ret);
            }
            ret      = new XmppResourceModel();
            ret.Name = res;
            Resources.Add(res, ret);
            isNew = true;
            return(ret);
        }
Beispiel #4
0
 void printResource(MessageBuilder builder, XmppResourceModel res)
 {
     builder.AppendText("\n\tName: {0}", res.Name);
     var pres = res.Presence;
     builder.AppendText("\n\tPresence:");
     builder.AppendText("\n\t\tShow:\t{0}", pres.Show);
     builder.AppendText("\n\t\tStatus:\t{0}", pres.Status);
     builder.AppendText("\n\t\tLast:\t{0}", (pres.Last!=null)?pres.Last.Seconds.ToString():"");
     builder.AppendText("\n\t\tPriority:\t{0}", pres.Priority);
     builder.AppendText("\n\t\tType:\t{0}", pres.Type);
     builder.AppendText("\n\t\tXDelay:\t{0}", (pres.XDelay!=null)?pres.XDelay.Stamp.ToString():"");
     if (res.Disco != null) {
         builder.AppendText("\n\tFeatures:");
         foreach(var feat in res.Disco.GetFeatures()) {
             builder.AppendText("\n\t\t{0}", feat.Var);
         }
     }
 }
Beispiel #5
0
 public XmppResourceModel GetOrCreateResource(Jid jid, out bool isNew)
 {
     XmppResourceModel ret;
     string res = jid.Resource ?? "";
     if (Resources.TryGetValue(res, out ret)) {
         isNew = false;
         return ret;
     }
     ret = new XmppResourceModel();
     ret.Name = res;
     Resources.Add(res, ret);
     isNew = true;
     return ret;
 }
Beispiel #6
0
 public XmppResourceModel GetOrCreateResource(Jid jid)
 {
     XmppResourceModel ret;
     string res = jid.Resource ?? "";
     if (Resources.TryGetValue(res, out ret)) {
         return ret;
     }
     ret = new XmppResourceModel();
     ret.Name = res;
     Resources.Add(res, ret);
     return ret;
 }
Beispiel #7
0
 public XmppResourceModel GetOrCreateMucResource(Jid jid)
 {
     Trace.Call(jid);
     XmppResourceModel ret;
     if (MucResources.TryGetValue(jid, out ret)) {
         return ret;
     }
     ret = new XmppResourceModel();
     ret.Name = jid;
     MucResources.Add(jid, ret);
     return ret;
 }