Sun, 03 May 2009 19:53:53 +0000
Add ability to list roles/affiliations in a chat via slash-commands and
modify roles/affiliations of multiple users at a time. Closes #5649.
Slightly modified patch from Andrei Mozzhuhin. The multiple-user support
is inefficient; all the changes can go in one stanza. We should also
actually track roles/affiliations of members since ejabberd's MUC won't
respond to the list query for a non-admin.
| 7014 | 1 | /** |
| 2 | * @file chat.h Chat stuff | |
| 3 | * | |
| 15884 | 4 | * purple |
| 7014 | 5 | * |
| 6 | * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com> | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * 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
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7014 | 21 | */ |
|
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
|
22 | #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
|
23 | #define PURPLE_JABBER_CHAT_H_ |
| 7014 | 24 | |
| 25 | #include "internal.h" | |
| 26 | #include "connection.h" | |
| 27 | #include "conversation.h" | |
| 8396 | 28 | #include "request.h" |
| 8113 | 29 | #include "roomlist.h" |
| 7014 | 30 | |
| 31 | #include "jabber.h" | |
| 32 | ||
| 9152 | 33 | typedef struct _JabberChatMember { |
| 34 | char *handle; | |
| 35 | char *jid; | |
| 36 | } JabberChatMember; | |
| 37 | ||
| 7014 | 38 | |
| 39 | typedef struct _JabberChat { | |
| 40 | JabberStream *js; | |
| 41 | char *room; | |
| 42 | char *server; | |
| 8400 | 43 | 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
|
44 | GHashTable *components; |
| 7014 | 45 | int id; |
| 15884 | 46 | PurpleConversation *conv; |
| 7014 | 47 | gboolean muc; |
| 7345 | 48 | gboolean xhtml; |
| 15884 | 49 | PurpleRequestType config_dialog_type; |
| 8396 | 50 | void *config_dialog_handle; |
| 9152 | 51 | 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
|
52 | gboolean left; |
| 7014 | 53 | } JabberChat; |
| 54 | ||
| 15884 | 55 | GList *jabber_chat_info(PurpleConnection *gc); |
| 56 | 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
|
57 | char *jabber_get_chat_name(GHashTable *data); |
| 15884 | 58 | void jabber_chat_join(PurpleConnection *gc, GHashTable *data); |
| 7014 | 59 | JabberChat *jabber_chat_find(JabberStream *js, const char *room, |
| 60 | const char *server); | |
| 61 | JabberChat *jabber_chat_find_by_id(JabberStream *js, int id); | |
| 15884 | 62 | JabberChat *jabber_chat_find_by_conv(PurpleConversation *conv); |
| 7014 | 63 | void jabber_chat_destroy(JabberChat *chat); |
| 8396 | 64 | void jabber_chat_free(JabberChat *chat); |
| 15884 | 65 | gboolean jabber_chat_find_buddy(PurpleConversation *conv, const char *name); |
| 66 | void jabber_chat_invite(PurpleConnection *gc, int id, const char *message, | |
| 7014 | 67 | const char *name); |
| 15884 | 68 | void jabber_chat_leave(PurpleConnection *gc, int id); |
| 69 | char *jabber_chat_buddy_real_name(PurpleConnection *gc, int id, const char *who); | |
| 7923 | 70 | void jabber_chat_request_room_configure(JabberChat *chat); |
| 7895 | 71 | void jabber_chat_create_instant_room(JabberChat *chat); |
| 7971 | 72 | void jabber_chat_register(JabberChat *chat); |
| 73 | void jabber_chat_change_topic(JabberChat *chat, const char *topic); | |
| 15884 | 74 | void jabber_chat_set_topic(PurpleConnection *gc, int id, const char *topic); |
| 7972 | 75 | void jabber_chat_change_nick(JabberChat *chat, const char *nick); |
| 7974 | 76 | void jabber_chat_part(JabberChat *chat, const char *msg); |
| 9152 | 77 | void jabber_chat_track_handle(JabberChat *chat, const char *handle, |
| 78 | const char *jid, const char *affiliation, const char *role); | |
| 79 | void jabber_chat_remove_handle(JabberChat *chat, const char *handle); | |
| 80 | gboolean jabber_chat_ban_user(JabberChat *chat, const char *who, | |
| 81 | const char *why); | |
| 11393 | 82 | gboolean jabber_chat_affiliate_user(JabberChat *chat, const char *who, |
| 83 | 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
|
84 | 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
|
85 | gboolean jabber_chat_role_user(JabberChat *chat, const char *who, |
|
b98439d90903
[gaim-migrate @ 15603]
Andrej Krivulčík <thefox692@users.sourceforge.net>
parents:
11393
diff
changeset
|
86 | const char *role); |
|
27027
f3129efa65ea
Add ability to list roles/affiliations in a chat via slash-commands and
Paul Aurich <darkrain42@pidgin.im>
parents:
26703
diff
changeset
|
87 | gboolean jabber_chat_role_list(JabberChat *chat, const char *role); |
| 9152 | 88 | gboolean jabber_chat_kick_user(JabberChat *chat, const char *who, |
| 89 | const char *why); | |
| 7398 | 90 | |
| 15884 | 91 | PurpleRoomlist *jabber_roomlist_get_list(PurpleConnection *gc); |
| 92 | void jabber_roomlist_cancel(PurpleRoomlist *list); | |
| 8113 | 93 | |
| 10941 | 94 | void jabber_chat_disco_traffic(JabberChat *chat); |
| 95 | ||
| 15884 | 96 | char *jabber_roomlist_room_serialize(PurpleRoomlistRoom *room); |
| 15185 | 97 | |
| 7014 | 98 | |
|
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
|
99 | #endif /* PURPLE_JABBER_CHAT_H_ */ |