~ubuntu-branches/ubuntu/natty/centerim/natty

« back to all changes in this revision

Viewing changes to libjabber/jutil.c

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2009-03-26 19:51:53 UTC
  • mfrom: (1.1.5 upstream) (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090326195153-dxo63t1lwbp2m592
Tags: 4.22.7-1ubuntu1
* Merge from debian unstable, Ubuntu remaining changes:
  - Packages that Depend/Recommend/Suggest firefox (metapackage) must
    must alternatively Depend/Recommend/Suggest abrowser.
* Bugfix-only release, fixed bugs: LP: #146308 and LP: #186381.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    return pres;
36
36
}
37
37
 
 
38
xmlnode jutil_iqnew2(int type) //create iq packet w/o query tag, required for later patches, such as file transfer, send version and etc. 
 
39
{
 
40
    xmlnode iq;
 
41
 
 
42
    iq = xmlnode_new_tag("iq");
 
43
    switch(type)
 
44
    {
 
45
    case JPACKET__GET:
 
46
        xmlnode_put_attrib(iq,"type","get");
 
47
        break;
 
48
    case JPACKET__SET:
 
49
        xmlnode_put_attrib(iq,"type","set");
 
50
        break;
 
51
    case JPACKET__RESULT:
 
52
        xmlnode_put_attrib(iq,"type","result");
 
53
        break;
 
54
    case JPACKET__ERROR:
 
55
        xmlnode_put_attrib(iq,"type","error");
 
56
        break;
 
57
    }
 
58
 
 
59
    return iq;
 
60
}
 
61
 
38
62
/* util for making IQ packets */
39
63
xmlnode jutil_iqnew(int type, char *ns)
40
64
{
80
104
    return msg;
81
105
}
82
106
 
 
107
/* util for making message receipt packets */
 
108
xmlnode jutil_receiptnew(const char *to, const char *id)
 
109
{
 
110
    xmlnode msg;
 
111
 
 
112
    msg = xmlnode_new_tag("message");
 
113
    xmlnode_put_attrib (msg, "to", to);
 
114
        if(id != NULL)
 
115
                xmlnode_put_attrib (msg, "id", id);
 
116
 
 
117
    xmlnode_put_attrib(xmlnode_insert_tag (msg, "received"), "xmlns", "urn:xmpp:receipts");
 
118
 
 
119
    return msg;
 
120
}
 
121
 
83
122
/* util for making stream packets */
84
123
xmlnode jutil_header(char* xmlns, char* server)
85
124
{