comparison libpurple/protocols/mxit/multimx.h @ 28903:69aa4660401a

Initial addition of the MXit protocol plugin, provided by the MXit folks themselves.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 08 Nov 2009 23:55:56 +0000
parents
children 5139aa9b4077
comparison
equal deleted inserted replaced
28901:13e668ef158d 28903:69aa4660401a
1 /*
2 * MXit Protocol libPurple Plugin
3 *
4 * -- MultiMx GroupChat --
5 *
6 * Andrew Victor <libpurple@mxit.com>
7 *
8 * (C) Copyright 2009 MXit Lifestyle (Pty) Ltd.
9 * <http://www.mxitlifestyle.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
24 */
25
26 #ifndef _MXIT_MULTIMX_H_
27 #define _MXIT_MULTIMX_H_
28
29 #include "roster.h"
30
31
32 /* GroupChat Room state */
33 #define STATE_CREATOR 0
34 #define STATE_INVITED 1
35 #define STATE_JOINED 2
36
37 /*
38 * a MultiMX room
39 */
40 struct multimx {
41 char roomname[MXIT_CP_MAX_ALIAS_LEN]; /* name of the room */
42 char roomid[MXIT_CP_MAX_JID_LEN]; /* internal JID for room */
43 int chatid; /* libpurple chat ID */
44 short state; /* state */
45 };
46
47
48 /*
49 * Received a Subscription Request to a MultiMX room.
50 */
51 void multimx_invite(struct MXitSession* session, struct contact* contact, const char* creator);
52
53 /*
54 * MultiMX room has been added to the roster.
55 */
56 void multimx_created(struct MXitSession* session, struct contact* contact);
57
58 /*
59 * Is this username a MultiMX contact?
60 */
61 gboolean is_multimx_contact(struct MXitSession* session, const char* username);
62
63 /*
64 * Received a message from a MultiMX room.
65 */
66 void multimx_message_received(struct RXMsgData* mx, char* message, int len, short msgtype, int msgflags);
67
68 /*
69 * User has selected "Add Chat" from the main menu.
70 */
71 GList* mxit_chat_info(PurpleConnection *gc);
72
73 /*
74 * User has joined a chatroom, either because they are creating it or they accepted an invite.
75 */
76 void mxit_chat_join(PurpleConnection *gc, GHashTable *data);
77
78 /*
79 * User has rejected an invite to join a MultiMX room.
80 */
81 void mxit_chat_reject(PurpleConnection *gc, GHashTable* components);
82
83 /*
84 * Return name of chatroom (on mouse hover)
85 */
86 char* mxit_chat_name(GHashTable *data);
87
88 /*
89 * User has selected to invite somebody to a chatroom.
90 */
91 void mxit_chat_invite(PurpleConnection *gc, int id, const char *msg, const char *name);
92
93 /*
94 * User as closed the chat window, and the chatroom is not marked as persistent.
95 */
96 void mxit_chat_leave(PurpleConnection *gc, int id);
97
98 /*
99 * User has entered a message in a chatroom window, send it to the MXit server.
100 */
101 int mxit_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags);
102
103
104 #endif /* _MXIT_MULTIMX_H_ */