Frameworks/libpurple.framework/Versions/2.10.12r8d2874a79747/Headers/chat.h
branchadium-1.5.11
changeset 6014 fcb71cb71a3d
parent 5941 307f53385811
parent 6013 f8d0dc659e3f
child 6016 325e2ab3406f
equal deleted inserted replaced
5941:307f53385811 6014:fcb71cb71a3d
     1 /**
       
     2  * @file chat.h Chat stuff
       
     3  *
       
     4  * purple
       
     5  *
       
     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.
       
     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
       
    22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
       
    23  */
       
    24 #ifndef PURPLE_JABBER_CHAT_H_
       
    25 #define PURPLE_JABBER_CHAT_H_
       
    26 
       
    27 #include "internal.h"
       
    28 #include "connection.h"
       
    29 #include "conversation.h"
       
    30 #include "request.h"
       
    31 #include "roomlist.h"
       
    32 
       
    33 #include "jabber.h"
       
    34 
       
    35 typedef struct _JabberChatMember {
       
    36 	char *handle;
       
    37 	char *jid;
       
    38 } JabberChatMember;
       
    39 
       
    40 
       
    41 typedef struct _JabberChat {
       
    42 	JabberStream *js;
       
    43 	char *room;
       
    44 	char *server;
       
    45 	char *handle;
       
    46 	GHashTable *components;
       
    47 	int id;
       
    48 	PurpleConversation *conv;
       
    49 	gboolean muc;
       
    50 	gboolean xhtml;
       
    51 	PurpleRequestType config_dialog_type;
       
    52 	void *config_dialog_handle;
       
    53 	GHashTable *members;
       
    54 	gboolean left;
       
    55 	time_t joined;
       
    56 } JabberChat;
       
    57 
       
    58 GList *jabber_chat_info(PurpleConnection *gc);
       
    59 GHashTable *jabber_chat_info_defaults(PurpleConnection *gc, const char *chat_name);
       
    60 char *jabber_get_chat_name(GHashTable *data);
       
    61 
       
    62 /**
       
    63  * in-prpl function for joining a chat room. Doesn't require sticking goop
       
    64  * into a hash table.
       
    65  *
       
    66  * @param room     The room to join. This MUST be normalized already.
       
    67  * @param server   The server the room is on. This MUST be normalized already.
       
    68  * @param password The password (if required) to join the room. May be NULL.
       
    69  * @param data     The chat hash table.  May be NULL (it will be generated
       
    70  *                 for current core<>prpl API interface.)
       
    71  */
       
    72 JabberChat *jabber_join_chat(JabberStream *js, const char *room,
       
    73                              const char *server, const char *handle,
       
    74                              const char *password, GHashTable *data);
       
    75 
       
    76 void jabber_chat_join(PurpleConnection *gc, GHashTable *data);
       
    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);
       
    80 JabberChat *jabber_chat_find_by_conv(PurpleConversation *conv);
       
    81 void jabber_chat_destroy(JabberChat *chat);
       
    82 void jabber_chat_free(JabberChat *chat);
       
    83 gboolean jabber_chat_find_buddy(PurpleConversation *conv, const char *name);
       
    84 void jabber_chat_invite(PurpleConnection *gc, int id, const char *message,
       
    85 		const char *name);
       
    86 void jabber_chat_leave(PurpleConnection *gc, int id);
       
    87 char *jabber_chat_buddy_real_name(PurpleConnection *gc, int id, const char *who);
       
    88 void jabber_chat_request_room_configure(JabberChat *chat);
       
    89 void jabber_chat_create_instant_room(JabberChat *chat);
       
    90 void jabber_chat_register(JabberChat *chat);
       
    91 void jabber_chat_change_topic(JabberChat *chat, const char *topic);
       
    92 void jabber_chat_set_topic(PurpleConnection *gc, int id, const char *topic);
       
    93 gboolean jabber_chat_change_nick(JabberChat *chat, const char *nick);
       
    94 void jabber_chat_part(JabberChat *chat, const char *msg);
       
    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);
       
   100 gboolean jabber_chat_affiliate_user(JabberChat *chat, const char *who,
       
   101 		const char *affiliation);
       
   102 gboolean jabber_chat_affiliation_list(JabberChat *chat, const char *affiliation);
       
   103 gboolean jabber_chat_role_user(JabberChat *chat, const char *who,
       
   104 		const char *role, const char *why);
       
   105 gboolean jabber_chat_role_list(JabberChat *chat, const char *role);
       
   106 
       
   107 PurpleRoomlist *jabber_roomlist_get_list(PurpleConnection *gc);
       
   108 void jabber_roomlist_cancel(PurpleRoomlist *list);
       
   109 
       
   110 void jabber_chat_disco_traffic(JabberChat *chat);
       
   111 
       
   112 char *jabber_roomlist_room_serialize(PurpleRoomlistRoom *room);
       
   113 
       
   114 gboolean jabber_chat_all_participants_have_capability(const JabberChat *chat,
       
   115 	const gchar *cap);
       
   116 guint jabber_chat_get_num_participants(const JabberChat *chat);
       
   117 
       
   118 #endif /* PURPLE_JABBER_CHAT_H_ */