rename accountopt.[ch] to purpleaccountoption.[ch]
[pidgin-git.git] / libpurple / protocols / jabber / chat.h
blob4582567cb8d5e1aacf65b998def2e95d2133b104
1 /**
2 * @file chat.h Chat stuff
4 * purple
6 * Purple is the legal property of its developers, whose names are too numerous
7 * to list here. Please refer to the COPYRIGHT file distributed with this
8 * source distribution.
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.
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.
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
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 #ifndef PURPLE_JABBER_CHAT_H
26 #define PURPLE_JABBER_CHAT_H
28 #include "internal.h"
29 #include "connection.h"
30 #include "conversation.h"
31 #include "request.h"
32 #include "roomlist.h"
34 #include "jabber.h"
36 typedef struct {
37 char *handle;
38 char *jid;
39 } JabberChatMember;
42 typedef struct {
43 JabberStream *js;
44 char *room;
45 char *server;
46 char *handle;
47 GHashTable *components;
48 int id;
49 PurpleChatConversation *conv;
50 gboolean muc;
51 gboolean xhtml;
52 PurpleRequestType config_dialog_type;
53 void *config_dialog_handle;
54 GHashTable *members;
55 gboolean left;
56 time_t joined;
57 } JabberChat;
59 GList *jabber_chat_info(PurpleConnection *gc);
60 GHashTable *jabber_chat_info_defaults(PurpleConnection *gc, const char *chat_name);
61 char *jabber_get_chat_name(GHashTable *data);
63 /**
64 * in-protocol function for joining a chat room. Doesn't require sticking goop
65 * into a hash table.
67 * @param room The room to join. This MUST be normalized already.
68 * @param server The server the room is on. This MUST be normalized already.
69 * @param password The password (if required) to join the room. May be NULL.
70 * @param data The chat hash table. May be NULL (it will be generated
71 * for current core<>protocol API interface.)
73 JabberChat *jabber_join_chat(JabberStream *js, const char *room,
74 const char *server, const char *handle,
75 const char *password, GHashTable *data);
77 void jabber_chat_join(PurpleConnection *gc, GHashTable *data);
78 JabberChat *jabber_chat_find(JabberStream *js, const char *room,
79 const char *server);
80 JabberChat *jabber_chat_find_by_id(JabberStream *js, int id);
81 JabberChat *jabber_chat_find_by_conv(PurpleChatConversation *conv);
82 void jabber_chat_destroy(JabberChat *chat);
83 void jabber_chat_free(JabberChat *chat);
84 gboolean jabber_chat_find_buddy(PurpleChatConversation *conv, const char *name);
85 void jabber_chat_invite(PurpleConnection *gc, int id, const char *message,
86 const char *name);
87 void jabber_chat_leave(PurpleConnection *gc, int id);
88 char *jabber_chat_user_real_name(PurpleConnection *gc, int id, const char *who);
89 void jabber_chat_request_room_configure(JabberChat *chat);
90 void jabber_chat_create_instant_room(JabberChat *chat);
91 void jabber_chat_register(JabberChat *chat);
92 void jabber_chat_change_topic(JabberChat *chat, const char *topic);
93 void jabber_chat_set_topic(PurpleConnection *gc, int id, const char *topic);
94 gboolean jabber_chat_change_nick(JabberChat *chat, const char *nick);
95 void jabber_chat_part(JabberChat *chat, const char *msg);
96 void jabber_chat_track_handle(JabberChat *chat, const char *handle,
97 const char *jid, const char *affiliation, const char *role);
98 void jabber_chat_remove_handle(JabberChat *chat, const char *handle);
99 gboolean jabber_chat_ban_user(JabberChat *chat, const char *who,
100 const char *why);
101 gboolean jabber_chat_affiliate_user(JabberChat *chat, const char *who,
102 const char *affiliation);
103 gboolean jabber_chat_affiliation_list(JabberChat *chat, const char *affiliation);
104 gboolean jabber_chat_role_user(JabberChat *chat, const char *who,
105 const char *role, const char *why);
106 gboolean jabber_chat_role_list(JabberChat *chat, const char *role);
108 PurpleRoomlist *jabber_roomlist_get_list(PurpleConnection *gc);
109 void jabber_roomlist_cancel(PurpleRoomlist *list);
111 void jabber_chat_disco_traffic(JabberChat *chat);
113 char *jabber_roomlist_room_serialize(PurpleRoomlistRoom *room);
115 gboolean jabber_chat_all_participants_have_capability(const JabberChat *chat,
116 const gchar *cap);
117 guint jabber_chat_get_num_participants(const JabberChat *chat);
119 #endif /* PURPLE_JABBER_CHAT_H */