annotate mcabber/src/jabglue.h @ 1305:9bc68473f8a3

-n and -f flags to message-sending commands Allows sending normal and headline messages
author Michal 'vorner' Vaner <vorner@ucw.cz>
date Sat, 08 Sep 2007 13:21:07 +0200
parents 6f602d3270a4
children 32077249de77
rev   line source
29
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
1 #ifndef __JABGLUE_H__
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
2 #define __JABGLUE_H__ 1
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
3
159
ba51d1737086 [/trunk] Changeset 171 by mikael
mikael
parents: 124
diff changeset
4 #include <glib.h>
ba51d1737086 [/trunk] Changeset 171 by mikael
mikael
parents: 124
diff changeset
5
572
afc2bd38b15c Implement affiliations handling, add "/room whois"
Mikael Berthe <mikael@lilotux.net>
parents: 568
diff changeset
6 #include "roster.h"
29
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
7 #include "../libjabber/jabber.h"
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
8
237
c8df64f43625 [/trunk] Changeset 250 by mikael
mikael
parents: 208
diff changeset
9 #if HAVE_CONFIG_H
c8df64f43625 [/trunk] Changeset 250 by mikael
mikael
parents: 208
diff changeset
10 # include <config.h>
c8df64f43625 [/trunk] Changeset 250 by mikael
mikael
parents: 208
diff changeset
11 #endif
c8df64f43625 [/trunk] Changeset 250 by mikael
mikael
parents: 208
diff changeset
12
c8df64f43625 [/trunk] Changeset 250 by mikael
mikael
parents: 208
diff changeset
13 #if ! HAVE_DECL_STRPTIME
c8df64f43625 [/trunk] Changeset 250 by mikael
mikael
parents: 208
diff changeset
14 extern char *strptime ();
c8df64f43625 [/trunk] Changeset 250 by mikael
mikael
parents: 208
diff changeset
15 #endif
c8df64f43625 [/trunk] Changeset 250 by mikael
mikael
parents: 208
diff changeset
16
29
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
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
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
19
46
f22e1d120606 [/trunk] Changeset 62 by mikael
mikael
parents: 41
diff changeset
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
f22e1d120606 [/trunk] Changeset 62 by mikael
mikael
parents: 41
diff changeset
22
37
1441ba37a5c1 [/trunk] Changeset 53 by mikael
mikael
parents: 35
diff changeset
23 enum agtype {
693
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
24 unknown,
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
25 groupchat,
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
26 transport,
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
27 search
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
28 };
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
29
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
30 enum iqreq_type {
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
31 iqreq_none,
e98abd3ce28c Add /request command
Mikael Berthe <mikael@lilotux.net>
parents: 689
diff changeset
32 iqreq_version,
1003
c8b1a52b2fd6 Initial VCard retrieval support
Mikael Berthe <mikael@lilotux.net>
parents: 990
diff changeset
33 iqreq_time,
1015
579299b1c9b2 Add /request last
Mikael Berthe <mikael@lilotux.net>
parents: 1014
diff changeset
34 iqreq_last,
1003
c8b1a52b2fd6 Initial VCard retrieval support
Mikael Berthe <mikael@lilotux.net>
parents: 990
diff changeset
35 iqreq_vcard
37
1441ba37a5c1 [/trunk] Changeset 53 by mikael
mikael
parents: 35
diff changeset
36 };
1441ba37a5c1 [/trunk] Changeset 53 by mikael
mikael
parents: 35
diff changeset
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);
1058
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
47 jconn jb_connect(const char *fjid, const char *server, unsigned int port,
403
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
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
50 void jb_disconnect(void);
952
527d6f234924 Small code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 900
diff changeset
51 void jb_main(void);
1058
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
52 void jb_subscr_send_auth(const char *bjid);
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
53 void jb_subscr_cancel_auth(const char *bjid);
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
54 void jb_subscr_request_auth(const char *bjid);
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
55 void jb_subscr_request_cancel(const char *bjid);
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
56 void jb_addbuddy(const char *bjid, const char *name, const char *group);
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
57 void jb_delbuddy(const char *bjid);
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
58 void jb_updatebuddy(const char *bjid, const char *name, const char *group);
952
527d6f234924 Small code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 900
diff changeset
59 inline enum imstatus jb_getstatus(void);
527d6f234924 Small code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 900
diff changeset
60 inline const char *jb_getstatusmsg(void);
1050
ea71d31a2607 PGP: Do not sign presence messages to chatrooms
Mikael Berthe <mikael@lilotux.net>
parents: 1023
diff changeset
61 void jb_setstatus(enum imstatus st, const char *recipient, const char *msg,
ea71d31a2607 PGP: Do not sign presence messages to chatrooms
Mikael Berthe <mikael@lilotux.net>
parents: 1023
diff changeset
62 int do_not_sign);
1014
99c5278bf6b8 Keep the status and status messages when we're disconnected
Mikael Berthe <mikael@lilotux.net>
parents: 1009
diff changeset
63 inline void jb_setprevstatus(void);
1058
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
64 void jb_send_msg(const char *fjid, const char *text, int type,
1305
9bc68473f8a3 -n and -f flags to message-sending commands
Michal 'vorner' Vaner <vorner@ucw.cz>
parents: 1197
diff changeset
65 const char *subject, const char *id, gint *encrypted,
9bc68473f8a3 -n and -f flags to message-sending commands
Michal 'vorner' Vaner <vorner@ucw.cz>
parents: 1197
diff changeset
66 const char *type_overwrite);
436
802da817a684 Add /rawxml command
Mikael Berthe <mikael@lilotux.net>
parents: 403
diff changeset
67 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
68 void jb_send_chatstate(gpointer buddy, guint chatstate);
952
527d6f234924 Small code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 900
diff changeset
69 void jb_keepalive(void);
527d6f234924 Small code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 900
diff changeset
70 inline void jb_reset_keepalive(void);
112
edb5591e2e64 [/trunk] Changeset 126 by mikael
mikael
parents: 46
diff changeset
71 void jb_set_keepalive_delay(unsigned int delay);
900
b41684465283 MUC: join password-protected room
Mikael Berthe <mikael@lilotux.net>
parents: 834
diff changeset
72 void jb_room_join(const char *room, const char *nickname, const char *passwd);
449
e08b0c2d0e54 Add "/room unlock"
Mikael Berthe <mikael@lilotux.net>
parents: 447
diff changeset
73 void jb_room_unlock(const char *room);
599
fb67bf62f4eb Add "/room destroy"
Mikael Berthe <mikael@lilotux.net>
parents: 584
diff changeset
74 void jb_room_destroy(const char *room, const char *venue, const char *reason);
1058
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
75 void jb_room_invite(const char *room, const char *fjid, const char *reason);
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
76 int jb_room_setattrib(const char *roomid, const char *fjid, const char *nick,
584
414fbf558f1e jb_room_setattrib()
Mikael Berthe <mikael@lilotux.net>
parents: 580
diff changeset
77 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
78 void jb_iqs_display_list(void);
1058
c0d44a9a99bc Code cleanup
Mikael Berthe <mikael@lilotux.net>
parents: 1055
diff changeset
79 void jb_request(const char *fjid, enum iqreq_type reqtype);
1163
2913310a7be6 Make /roster bookmark in the status buffer show all bookmarks
Mikael Berthe <mikael@lilotux.net>
parents: 1058
diff changeset
80 GSList *jb_get_all_storage_bookmarks(void);
1009
c112423ac012 Add /room bookmark
Mikael Berthe <mikael@lilotux.net>
parents: 1003
diff changeset
81 void jb_set_storage_bookmark(const char *roomid, const char *name,
c112423ac012 Add /room bookmark
Mikael Berthe <mikael@lilotux.net>
parents: 1003
diff changeset
82 const char *nick, const char *passwd,
c112423ac012 Add /room bookmark
Mikael Berthe <mikael@lilotux.net>
parents: 1003
diff changeset
83 int autojoin);
1023
94d9a3cbb211 Remove useless message
Mikael Berthe <mikael@lilotux.net>
parents: 1022
diff changeset
84 struct annotation *jb_get_storage_rosternotes(const char *barejid, int silent);
1022
4c8d7b558e83 Annotations listing (/roster note in the status buffer)
Mikael Berthe <mikael@lilotux.net>
parents: 1019
diff changeset
85 GSList *jb_get_all_storage_rosternotes(void);
1016
4d3c48844746 Add /roster note
Mikael Berthe <mikael@lilotux.net>
parents: 1015
diff changeset
86 void jb_set_storage_rosternotes(const char *barejid, const char *note);
29
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
87
86837ff0554c [/trunk] Changeset 45 by mikael
mikael
parents:
diff changeset
88 #endif /* __JABGLUE_H__ */
576
8b3db0b555a1 Add Vim modelines
Mikael Berthe <mikael@lilotux.net>
parents: 572
diff changeset
89
580
fed6d1e4d7a9 Fix modelines
Mikael Berthe <mikael@lilotux.net>
parents: 576
diff changeset
90 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */