Ejemplo n.º 1
0
        public static string TypeToStr(XmppIqType type)
        {
            switch (type)
            {
            case XmppIqType.Get: return("get");

            case XmppIqType.Set: return("set");

            case XmppIqType.Result: return("result");

            case XmppIqType.Error: return("error");

            default: return(string.Empty);
            }
        }
Ejemplo n.º 2
0
        public string ToStream(XmppJid from, XmppJid to, XmppIqType type, string id, string content)
        {
            StringBuilder result = new StringBuilder("<iq ");

            if (from != null && !string.IsNullOrWhiteSpace(from.Value))
            {
                result.AppendFormat("from=\"{0}\" ", from.Value);
            }
            if (to != null && !string.IsNullOrWhiteSpace(to.Value))
            {
                result.AppendFormat("to=\"{0}\" ", to.Value);
            }
            result.AppendFormat("id=\"{0}\" ", id);
            result.AppendFormat("type=\"{0}\">{1}</iq>", XmppIq.TypeToStr(type), content);
            return(result.ToString());
        }
Ejemplo n.º 3
0
 public XmppIqSignalEventArgs(int id, XmppIqType type, XmppIQ xStream)
 {
     this.ID      = id;
     this.Type    = type;
     this.xStream = xStream;
 }
Ejemplo n.º 4
0
 public XmppRosterEventArgs(List <XmppRosterItem> roster, XmppIqType type)
 {
     Roster = roster;
     Type   = type;
 }
Ejemplo n.º 5
0
 private int SendIq(XmppJid from, XmppJid to, XmppIqType type, string content)
 {
     sendStream(new XmppIq().ToStream(from, to, type, iqCount.ToString(), content));
     return(iqCount++);
 }