Mon, 10 Feb 2014 16:22:00 +0530
Merged default branch
| 7014 | 1 | /** |
| 2 | * @file chat.h Chat stuff | |
| 3 | * | |
| 15884 | 4 | * purple |
| 7014 | 5 | * |
|
28322
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
27110
diff
changeset
|
6 | * Purple is the legal property of its developers, whose names are too numerous |
|
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
27110
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
27110
diff
changeset
|
8 | * source distribution. |
| 7014 | 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify | |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7014 | 23 | */ |
|
26703
17f9a4bef2a3
Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents:
23403
diff
changeset
|
24 | #ifndef PURPLE_JABBER_CHAT_H_ |
|
17f9a4bef2a3
Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents:
23403
diff
changeset
|
25 | #define PURPLE_JABBER_CHAT_H_ |
| 7014 | 26 | |
| 27 | #include "internal.h" | |
| 28 | #include "connection.h" | |
| 29 | #include "conversation.h" | |
| 8396 | 30 | #include "request.h" |
| 8113 | 31 | #include "roomlist.h" |
| 7014 | 32 | |
| 33 | #include "jabber.h" | |
| 34 | ||
| 9152 | 35 | typedef struct _JabberChatMember { |
| 36 | char *handle; | |
| 37 | char *jid; | |
| 38 | } JabberChatMember; | |
| 39 | ||
| 7014 | 40 | |
| 41 | typedef struct _JabberChat { | |
| 42 | JabberStream *js; | |
| 43 | char *room; | |
| 44 | char *server; | |
| 8400 | 45 | char *handle; |
|
23270
2b7db16e721a
As discussed on the devel list, purple_serv_got_join_chat_failed() and the
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
46 | GHashTable *components; |
| 7014 | 47 | int id; |
|
34634
90fa70aa7e28
Refactored the jabber protocol to use GObject-based PurpleConversation
Ankit Vani <a@nevitus.org>
parents:
31442
diff
changeset
|
48 | PurpleChatConversation *conv; |
| 7014 | 49 | gboolean muc; |
| 7345 | 50 | gboolean xhtml; |
| 15884 | 51 | PurpleRequestType config_dialog_type; |
| 8396 | 52 | void *config_dialog_handle; |
| 9152 | 53 | GHashTable *members; |
|
23403
a8704d47889f
Fix the chat-room rejoining bug where the list appears empty.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23270
diff
changeset
|
54 | gboolean left; |
|
31442
fd16ffae2043
jabber: Treat the presence storm on joining a room as not new arrivals.
Thijs Alkemade <thijsalkemade@gmail.com>
parents:
30351
diff
changeset
|
55 | time_t joined; |
| 7014 | 56 | } JabberChat; |
| 57 | ||
| 15884 | 58 | GList *jabber_chat_info(PurpleConnection *gc); |
| 59 | GHashTable *jabber_chat_info_defaults(PurpleConnection *gc, const char *chat_name); | |
|
9917
2fbb3c9fab2b
[gaim-migrate @ 10809]
Daniel Atallah <datallah@pidgin.im>
parents:
9754
diff
changeset
|
60 | char *jabber_get_chat_name(GHashTable *data); |
|
28668
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
61 | |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
62 | /** |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
63 | * in-protocol function for joining a chat room. Doesn't require sticking goop |
|
28668
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
64 | * into a hash table. |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
65 | * |
|
28687
9de3f49f3b30
jabber: Remove useless jabber_normalize calls now that the data in the hash table
Paul Aurich <darkrain42@pidgin.im>
parents:
28669
diff
changeset
|
66 | * @param room The room to join. This MUST be normalized already. |
|
9de3f49f3b30
jabber: Remove useless jabber_normalize calls now that the data in the hash table
Paul Aurich <darkrain42@pidgin.im>
parents:
28669
diff
changeset
|
67 | * @param server The server the room is on. This MUST be normalized already. |
|
28668
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
68 | * @param password The password (if required) to join the room. May be NULL. |
|
28669
f67839ca0064
jabber: Use the newly refactored code to simplify "Initiate Chat".
Paul Aurich <darkrain42@pidgin.im>
parents:
28668
diff
changeset
|
69 | * @param data The chat hash table. May be NULL (it will be generated |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
70 | * for current core<>protocol API interface.) |
|
28668
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
71 | */ |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
72 | JabberChat *jabber_join_chat(JabberStream *js, const char *room, |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
73 | const char *server, const char *handle, |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
74 | const char *password, GHashTable *data); |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
75 | |
| 15884 | 76 | void jabber_chat_join(PurpleConnection *gc, GHashTable *data); |
| 7014 | 77 | JabberChat *jabber_chat_find(JabberStream *js, const char *room, |
| 78 | const char *server); | |
| 79 | JabberChat *jabber_chat_find_by_id(JabberStream *js, int id); | |
|
34634
90fa70aa7e28
Refactored the jabber protocol to use GObject-based PurpleConversation
Ankit Vani <a@nevitus.org>
parents:
31442
diff
changeset
|
80 | JabberChat *jabber_chat_find_by_conv(PurpleChatConversation *conv); |
| 7014 | 81 | void jabber_chat_destroy(JabberChat *chat); |
| 8396 | 82 | void jabber_chat_free(JabberChat *chat); |
|
34634
90fa70aa7e28
Refactored the jabber protocol to use GObject-based PurpleConversation
Ankit Vani <a@nevitus.org>
parents:
31442
diff
changeset
|
83 | gboolean jabber_chat_find_buddy(PurpleChatConversation *conv, const char *name); |
| 15884 | 84 | void jabber_chat_invite(PurpleConnection *gc, int id, const char *message, |
| 7014 | 85 | const char *name); |
| 15884 | 86 | void jabber_chat_leave(PurpleConnection *gc, int id); |
|
34670
9bd5bd903dc7
Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents:
34634
diff
changeset
|
87 | char *jabber_chat_user_real_name(PurpleConnection *gc, int id, const char *who); |
| 7923 | 88 | void jabber_chat_request_room_configure(JabberChat *chat); |
| 7895 | 89 | void jabber_chat_create_instant_room(JabberChat *chat); |
| 7971 | 90 | void jabber_chat_register(JabberChat *chat); |
| 91 | void jabber_chat_change_topic(JabberChat *chat, const char *topic); | |
| 15884 | 92 | void jabber_chat_set_topic(PurpleConnection *gc, int id, const char *topic); |
|
28734
886d6c5e8f9a
jabber: Reject invalid chat nicks in /nick command. Fixes #10532.
Paul Aurich <darkrain42@pidgin.im>
parents:
28687
diff
changeset
|
93 | gboolean jabber_chat_change_nick(JabberChat *chat, const char *nick); |
| 7974 | 94 | void jabber_chat_part(JabberChat *chat, const char *msg); |
| 9152 | 95 | void jabber_chat_track_handle(JabberChat *chat, const char *handle, |
| 96 | const char *jid, const char *affiliation, const char *role); | |
| 97 | void jabber_chat_remove_handle(JabberChat *chat, const char *handle); | |
| 98 | gboolean jabber_chat_ban_user(JabberChat *chat, const char *who, | |
| 99 | const char *why); | |
| 11393 | 100 | gboolean jabber_chat_affiliate_user(JabberChat *chat, const char *who, |
| 101 | const char *affiliation); | |
|
27027
f3129efa65ea
Add ability to list roles/affiliations in a chat via slash-commands and
Paul Aurich <darkrain42@pidgin.im>
parents:
26703
diff
changeset
|
102 | gboolean jabber_chat_affiliation_list(JabberChat *chat, const char *affiliation); |
|
13238
b98439d90903
[gaim-migrate @ 15603]
Andrej Krivulčík <thefox692@users.sourceforge.net>
parents:
11393
diff
changeset
|
103 | gboolean jabber_chat_role_user(JabberChat *chat, const char *who, |
|
29400
8d8ad40c9c7d
jabber: Kick by in-room nick, not JID. Reduces code, but is still in-spec (and seems to be the preferred method)
Paul Aurich <darkrain42@pidgin.im>
parents:
28734
diff
changeset
|
104 | const char *role, const char *why); |
|
27027
f3129efa65ea
Add ability to list roles/affiliations in a chat via slash-commands and
Paul Aurich <darkrain42@pidgin.im>
parents:
26703
diff
changeset
|
105 | gboolean jabber_chat_role_list(JabberChat *chat, const char *role); |
| 7398 | 106 | |
| 15884 | 107 | PurpleRoomlist *jabber_roomlist_get_list(PurpleConnection *gc); |
| 108 | void jabber_roomlist_cancel(PurpleRoomlist *list); | |
| 8113 | 109 | |
| 10941 | 110 | void jabber_chat_disco_traffic(JabberChat *chat); |
| 111 | ||
| 15884 | 112 | char *jabber_roomlist_room_serialize(PurpleRoomlistRoom *room); |
| 15185 | 113 | |
|
27110
05ca719b901b
Support custom smileys in MUCs (when all participants support BoB and a maximum
Marcus Lundblad <malu@pidgin.im>
parents:
27027
diff
changeset
|
114 | gboolean jabber_chat_all_participants_have_capability(const JabberChat *chat, |
|
05ca719b901b
Support custom smileys in MUCs (when all participants support BoB and a maximum
Marcus Lundblad <malu@pidgin.im>
parents:
27027
diff
changeset
|
115 | const gchar *cap); |
|
05ca719b901b
Support custom smileys in MUCs (when all participants support BoB and a maximum
Marcus Lundblad <malu@pidgin.im>
parents:
27027
diff
changeset
|
116 | guint jabber_chat_get_num_participants(const JabberChat *chat); |
| 7014 | 117 | |
|
26703
17f9a4bef2a3
Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents:
23403
diff
changeset
|
118 | #endif /* PURPLE_JABBER_CHAT_H_ */ |