-
Notifications
You must be signed in to change notification settings - Fork 3
/
stabbertest.c
46 lines (38 loc) · 1.52 KB
/
stabbertest.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stabber.h>
#include <pthread.h>
#include <stdlib.h>
#include "stabber.h"
int main(void)
{
stbbr_start(STBBR_LOGDEBUG, 5230, 5231);
stbbr_auth_passwd("password");
stbbr_for_id("roster",
"<iq id=\"roster\" type=\"result\" to=\"stabber@localhost/profanity\">"
"<query xmlns=\"jabber:iq:roster\" ver=\"362\">"
"<item jid=\"buddy1@localhost\" subscription=\"both\" name=\"Buddy1\"/>"
"<item jid=\"buddy2@localhost\" subscription=\"both\" name=\"Buddy2\"/>"
"</query>"
"</iq>");
stbbr_for_id("prof_presence_1",
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\">"
"<show>dnd</show>"
"<status>busy!</status>"
"</presence>"
"<presence to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\">"
"<show>chat</show>"
"<status>Talk to me!</status>"
"</presence>"
"<presence to=\"stabber@localhost\" from=\"buddy2@localhost/work\">"
"<show>away</show>"
"<status>Out of office</status>"
"</presence>");
stbbr_for_id("prof_msg_2",
"<message id=\"message1\" to=\"stabber@localhost\" from=\"buddy1@localhost/mobile\" type=\"chat\">"
"<body>Welcome!!</body>"
"</message>");
stbbr_for_id("prof_msg_3",
"<message id=\"message2\" to=\"stabber@localhost\" from=\"buddy1@localhost/laptop\" type=\"chat\">"
"<body>From me laptop</body>"
"</message>");
pthread_exit(NULL);
}