d4470e02d38c89012d7027c4756d86013b927c69
[citadel.git] / citadel / modules / xmpp / token.def
1
2 #define NAMESPACE_iq "jabber:client"
3 TOKEN(iq,
4       {
5               STRPROP(iq, type);
6               STRPROP(iq, id);
7               STRPROP(iq, from);
8               STRPROP(iq, to);
9       });
10
11
12 #define NAMESPACE_piq "bub"
13
14 TOKEN(piq,
15       {
16               STRPROP(piq, type);
17               STRPROP(piq, id);
18               STRPROP(piq, from);
19               STRPROP(piq, to);
20       });
21
22 #define NAMESPACE_message "jabber:client"
23 TOKEN(message,
24         {
25                 STRPROP(message, to);
26                 STRPROP(message, type);
27                 STRPROP(message, id);
28                 PAYLOAD(message, body);
29         });
30
31 #define NAMESPACE_message_chatstate "http://jabber.org/protocol/chatstates"
32
33 SUBTOKEN(message,
34          chatstate,
35          active,
36          {
37                  CALLBACK(active);
38          });
39
40 SUBTOKEN(message,
41          chatstate,
42          composing,
43          {
44                  CALLBACK(composing);
45          });
46
47 SUBTOKEN(message,
48          chatstate,
49          paused,
50          {
51                  CALLBACK(paused);
52          });
53
54 SUBTOKEN(message,
55          chatstate,
56          inactive,
57          {
58                  CALLBACK(inactive);
59          });
60
61 SUBTOKEN(message,
62          chatstate,
63          gone,
64          {
65                  CALLBACK(gone);
66          });
67
68 // <message type='chat' id='purplef5a7ed34' to='testuser@blarg.potzblitz.outgesourced.org'><active xmlns='http://jabber.org/protocol/chatstates'/><body>gci</body></message>
69
70 // <iq type="result" id="unsolicited_2"><query xmlns="jabber:iq:roster"><item subscription="both" jid="willi@potzblitz.outgesourced.org" name="testuser"><group>potzblitz</group></item></query></iq><presence>testuser@blarg.potzblitz.outgesourced.org to="willi@potzblitz.outgesourced.org/potzblitz"</presence><message type="chat" to="willi@potzblitz.outgesourced.org/potzblitz" from="testuser@blarg.potzblitz.outgesourced.org"><body>rgilgci</body></message>