author | Mikael Berthe <mikael@lilotux.net> |
Sat, 18 Nov 2006 10:44:58 +0100 | |
changeset 1022 | 4c8d7b558e83 |
parent 1019 | 9d5f6e0ea7b3 |
child 1023 | 94d9a3cbb211 |
permissions | -rw-r--r-- |
29 | 1 |
#ifndef __JABGLUE_H__ |
2 |
#define __JABGLUE_H__ 1 |
|
3 |
||
159 | 4 |
#include <glib.h> |
5 |
||
572
afc2bd38b15c
Implement affiliations handling, add "/room whois"
Mikael Berthe <mikael@lilotux.net>
parents:
568
diff
changeset
|
6 |
#include "roster.h" |
29 | 7 |
#include "../libjabber/jabber.h" |
8 |
||
237 | 9 |
#if HAVE_CONFIG_H |
10 |
# include <config.h> |
|
11 |
#endif |
|
12 |
||
13 |
#if ! HAVE_DECL_STRPTIME |
|
14 |
extern char *strptime (); |
|
15 |
#endif |
|
16 |
||
29 | 17 |
extern jconn jc; |
1014
99c5278bf6b8
Keep the status and status messages when we're disconnected
Mikael Berthe <mikael@lilotux.net>
parents:
1009
diff
changeset
|
18 |
extern guint AutoConnection; |
29 | 19 |
|
46 | 20 |
extern char imstatus2char[]; |
277
4d7040cff8ee
Remove busy/occupied status, which does not really exist
Mikael Berthe <mikael@lilotux.net>
parents:
272
diff
changeset
|
21 |
// Status chars: '_', 'o', 'i', 'f', 'd', 'n', 'a' |
46 | 22 |
|
37 | 23 |
enum agtype { |
693 | 24 |
unknown, |
25 |
groupchat, |
|
26 |
transport, |
|
27 |
search |
|
28 |
}; |
|
29 |
||
30 |
enum iqreq_type { |
|
31 |
iqreq_none, |
|
32 |
iqreq_version, |
|
1003
c8b1a52b2fd6
Initial VCard retrieval support
Mikael Berthe <mikael@lilotux.net>
parents:
990
diff
changeset
|
33 |
iqreq_time, |
1015 | 34 |
iqreq_last, |
1003
c8b1a52b2fd6
Initial VCard retrieval support
Mikael Berthe <mikael@lilotux.net>
parents:
990
diff
changeset
|
35 |
iqreq_vcard |
37 | 36 |
}; |
37 |
||
1019
9d5f6e0ea7b3
XEP-0145: display note dates
Mikael Berthe <mikael@lilotux.net>
parents:
1016
diff
changeset
|
38 |
struct annotation { |
9d5f6e0ea7b3
XEP-0145: display note dates
Mikael Berthe <mikael@lilotux.net>
parents:
1016
diff
changeset
|
39 |
time_t cdate; |
9d5f6e0ea7b3
XEP-0145: display note dates
Mikael Berthe <mikael@lilotux.net>
parents:
1016
diff
changeset
|
40 |
time_t mdate; |
1022
4c8d7b558e83
Annotations listing (/roster note in the status buffer)
Mikael Berthe <mikael@lilotux.net>
parents:
1019
diff
changeset
|
41 |
gchar *jid; |
1019
9d5f6e0ea7b3
XEP-0145: display note dates
Mikael Berthe <mikael@lilotux.net>
parents:
1016
diff
changeset
|
42 |
gchar *text; |
9d5f6e0ea7b3
XEP-0145: display note dates
Mikael Berthe <mikael@lilotux.net>
parents:
1016
diff
changeset
|
43 |
}; |
9d5f6e0ea7b3
XEP-0145: display note dates
Mikael Berthe <mikael@lilotux.net>
parents:
1016
diff
changeset
|
44 |
|
298
35cda94e570d
Add /connect and /disconnect commands
Mikael Berthe <mikael@lilotux.net>
parents:
294
diff
changeset
|
45 |
char *compose_jid(const char *username, const char *servername, |
35cda94e570d
Add /connect and /disconnect commands
Mikael Berthe <mikael@lilotux.net>
parents:
294
diff
changeset
|
46 |
const char *resource); |
403
17aa60c6dc63
Allow a different server name than the jid domain name
Mikael Berthe <mikael@lilotux.net>
parents:
300
diff
changeset
|
47 |
jconn jb_connect(const char *jid, const char *server, unsigned int port, |
17aa60c6dc63
Allow a different server name than the jid domain name
Mikael Berthe <mikael@lilotux.net>
parents:
300
diff
changeset
|
48 |
int ssl, const char *pass); |
472
75442262c082
Disable some commands when not connected
Mikael Berthe <mikael@lilotux.net>
parents:
469
diff
changeset
|
49 |
inline unsigned char jb_getonline(void); |
29 | 50 |
void jb_disconnect(void); |
952 | 51 |
void jb_main(void); |
617
d3a8b43bf9e7
Add "/authorization" command
Mikael Berthe <mikael@lilotux.net>
parents:
599
diff
changeset
|
52 |
void jb_subscr_send_auth(const char *jid); |
d3a8b43bf9e7
Add "/authorization" command
Mikael Berthe <mikael@lilotux.net>
parents:
599
diff
changeset
|
53 |
void jb_subscr_cancel_auth(const char *jid); |
d3a8b43bf9e7
Add "/authorization" command
Mikael Berthe <mikael@lilotux.net>
parents:
599
diff
changeset
|
54 |
void jb_subscr_request_auth(const char *jid); |
834
6f913f4fbb2a
Use jb_subscr_ in jb_delbuddy()
Mikael Berthe <mikael@lilotux.net>
parents:
693
diff
changeset
|
55 |
void jb_subscr_request_cancel(const char *jid); |
244 | 56 |
void jb_addbuddy(const char *jid, const char *name, const char *group); |
205 | 57 |
void jb_delbuddy(const char *jid); |
208 | 58 |
void jb_updatebuddy(const char *jid, const char *name, const char *group); |
952 | 59 |
inline enum imstatus jb_getstatus(void); |
60 |
inline const char *jb_getstatusmsg(void); |
|
444 | 61 |
void jb_setstatus(enum imstatus st, const char *recipient, const char *msg); |
1014
99c5278bf6b8
Keep the status and status messages when we're disconnected
Mikael Berthe <mikael@lilotux.net>
parents:
1009
diff
changeset
|
62 |
inline void jb_setprevstatus(void); |
475
fa49ac0bb8f3
Add "/room topic", and display topic changes
Mikael Berthe <mikael@lilotux.net>
parents:
472
diff
changeset
|
63 |
void jb_send_msg(const char *jid, const char *text, int type, |
988
6e2bfd1ffded
Add ids to message stanzas if needed
Mikael Berthe <mikael@lilotux.net>
parents:
952
diff
changeset
|
64 |
const char *subject, const char *id); |
436 | 65 |
void jb_send_raw(const char *str); |
990
35e7913affb7
Send events/chatstates notifications (JEP-22/JEP-85)
Mikael Berthe <mikael@lilotux.net>
parents:
988
diff
changeset
|
66 |
void jb_send_chatstate(gpointer buddy, guint chatstate); |
952 | 67 |
void jb_keepalive(void); |
68 |
inline void jb_reset_keepalive(void); |
|
112 | 69 |
void jb_set_keepalive_delay(unsigned int delay); |
900
b41684465283
MUC: join password-protected room
Mikael Berthe <mikael@lilotux.net>
parents:
834
diff
changeset
|
70 |
void jb_room_join(const char *room, const char *nickname, const char *passwd); |
449 | 71 |
void jb_room_unlock(const char *room); |
599 | 72 |
void jb_room_destroy(const char *room, const char *venue, const char *reason); |
486 | 73 |
void jb_room_invite(const char *room, const char *jid, const char *reason); |
584 | 74 |
int jb_room_setattrib(const char *roomid, const char *jid, const char *nick, |
75 |
struct role_affil ra, const char *reason); |
|
689
281aab5aef50
Introduce jb_iqs_display_list() helper function for debugging
Mikael Berthe <mikael@lilotux.net>
parents:
617
diff
changeset
|
76 |
void jb_iqs_display_list(void); |
693 | 77 |
void jb_request(const char *jid, enum iqreq_type reqtype); |
1009 | 78 |
void jb_set_storage_bookmark(const char *roomid, const char *name, |
79 |
const char *nick, const char *passwd, |
|
80 |
int autojoin); |
|
1019
9d5f6e0ea7b3
XEP-0145: display note dates
Mikael Berthe <mikael@lilotux.net>
parents:
1016
diff
changeset
|
81 |
struct annotation *jb_get_storage_rosternotes(const char *barejid); |
1022
4c8d7b558e83
Annotations listing (/roster note in the status buffer)
Mikael Berthe <mikael@lilotux.net>
parents:
1019
diff
changeset
|
82 |
GSList *jb_get_all_storage_rosternotes(void); |
1016 | 83 |
void jb_set_storage_rosternotes(const char *barejid, const char *note); |
29 | 84 |
|
85 |
#endif /* __JABGLUE_H__ */ |
|
576 | 86 |
|
580 | 87 |
/* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |