libpurple/protocols/myspace/persist.h

Mon, 13 Jul 2009 05:01:42 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Mon, 13 Jul 2009 05:01:42 +0000
changeset 27776
60d79d68cde1
parent 25217
ea7833f04188
child 34304
faf0414a8b51
permissions
-rw-r--r--

On MSN, pop up an "invite message" request similar to oscar, and send that
in the add request. We really should try and move this into the add buddy
dialog instead of an extra prompt.

Fixes #8503.

17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
1 /* MySpaceIM Protocol Plugin, persist commands
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
2 *
18013
3238cfe8d879 Fix email address.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17960
diff changeset
3 * Copyright (C) 2007, Jeff Connelly <jeff2@soc.pidgin.im>
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
4 *
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
8 * (at your option) any later version.
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
9 *
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
13 * GNU General Public License for more details.
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
14 *
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
16 * 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: 19619
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
18 */
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
19
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
20 #ifndef _MYSPACE_PERSIST_H
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
21 #define _MYSPACE_PERSIST_H
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
22
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
23 /** Command codes */
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
24 #define MSIM_CMD_GET 1
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
25 #define MSIM_CMD_PUT 2
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
26 #define MSIM_CMD_DELETE 3
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
27
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
28 /** Command bit fields */
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
29 #define MSIM_CMD_BIT_CODE 255 /*< Bits specifying command code */
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
30 #define MSIM_CMD_BIT_REPLY 256 /**< 1=reply, 0=request */
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
31 #define MSIM_CMD_BIT_ACTION 512 /**< 1=action, 0=information */
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
32 #define MSIM_CMD_BIT_ERROR 1024 /**< 1=error, 0=normal */
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
33
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
34 /** Macros to read cmd bitfield. */
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
35 #define MSIM_CMD_GET_CODE(x) (x & MSIM_CMD_BIT_CODE)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
36 #define MSIM_CMD_IS_REPLY(x) (x & MSIM_CMD_BIT_REPLY)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
37 #define MSIM_CMD_IS_REQUEST(x) !(x & MSIM_CMD_BIT_REPLY)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
38 #define MSIM_CMD_IS_ACTION(x) (x & MSIM_CMD_BIT_ACTION)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
39 #define MSIM_CMD_IS_INFO(x) !(x & MSIM_CMD_BIT_ACTION)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
40 #define MSIM_CMD_IS_ERROR(x) (x & MSIM_CMD_BIT_ERROR)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
41 #define MSIM_CMD_IS_NORMAL(x) !(x & MSIM_CMD_BIT_ERROR)
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
42
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
43 /** Define a set of _DSN and _LID constants for a persistance request. */
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
44 #define MSIM_PERSIST_DSN_LID(name,dsn,lid) \
19619
e9ac2df3fd1b In msimprpl, move user-related code to a new user module, and move other
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 19512
diff changeset
45 static const int name##_DSN = dsn; \
25197
077b4d6fc595 No functionality change--just cleanup.
Mark Doliner <markdoliner@pidgin.im>
parents: 22435
diff changeset
46 static const int name##_LID = lid;
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
47
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
48 /* Can't do this, errors:
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
49 * persist.h:51:3: error: '#' is not followed by a macro parameter
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
50 * In file included from myspace.c:37:
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
51 * persist.h:56: error: expected ')' before numeric constant
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
52 * So instead, I define const ints above.
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
53 #define MSIM_PERSIST_DSN_LID(name,dsn,lid) \
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
54 #define name##_DSN dsn \
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
55 #define name##_LID lid
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
56 #endif
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
57 */
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
58
18057
77eb36712aca Update login process to more closely match official client.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18013
diff changeset
59 /** Messages to Get information dsn lid */
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
60 MSIM_PERSIST_DSN_LID(MG_LIST_ALL_CONTACTS, 0, 1)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
61 MSIM_PERSIST_DSN_LID(MG_USER_INFO_BY_ID, 0, 2)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
62 MSIM_PERSIST_DSN_LID(MG_OWN_IM_INFO, 1, 4)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
63 MSIM_PERSIST_DSN_LID(MG_IM_INFO_BY_ID, 1, 17)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
64 MSIM_PERSIST_DSN_LID(MG_LIST_ALL_GROUPS, 2, 6)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
65 MSIM_PERSIST_DSN_LID(MG_MYSPACE_INFO_BY_ID, 4, 3)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
66 MSIM_PERSIST_DSN_LID(MG_OWN_MYSPACE_INFO, 4, 5)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
67 MSIM_PERSIST_DSN_LID(MG_MYSPACE_INFO_BY_STRING, 5, 7)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
68 MSIM_PERSIST_DSN_LID(MG_CHECK_MAIL, 7, 18)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
69 MSIM_PERSIST_DSN_LID(MG_WEB_CHALLENGE, 17, 26)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
70 MSIM_PERSIST_DSN_LID(MG_USER_SONG, 21, 28)
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
71 MSIM_PERSIST_DSN_LID(MG_SERVER_INFO, 101, 20)
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
72
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
73 /** Messages to Change/send information */
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
74 MSIM_PERSIST_DSN_LID(MC_USER_PREFERENCES, 1, 10)
25217
ea7833f04188 Add support for blocking buddies on MySpace
Mark Doliner <markdoliner@pidgin.im>
parents: 25197
diff changeset
75 MSIM_PERSIST_DSN_LID(MC_DELETE_CONTACT_INFO, 0, 8)
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
76 MSIM_PERSIST_DSN_LID(MC_CONTACT_INFO, 0, 9)
22435
602abcb53ab0 In msimprpl, define a new set of symbolic constants for the command to
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 19859
diff changeset
77 MSIM_PERSIST_DSN_LID(MC_SET_USERNAME, 9, 14)
602abcb53ab0 In msimprpl, define a new set of symbolic constants for the command to
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 19859
diff changeset
78 MSIM_PERSIST_DSN_LID(MC_IMPORT_ALL_FRIENDS, 14, 21)
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
79 MSIM_PERSIST_DSN_LID(MC_INVITE, 16, 25)
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
80
17932
0d1fa8f1bf22 Add delete buddy.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
81 /** Messages to Delete information */
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
82 MSIM_PERSIST_DSN_LID(MD_DELETE_BUDDY, 0, 8)
17932
0d1fa8f1bf22 Add delete buddy.
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 17930
diff changeset
83
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
84 /** Error codes */
19149
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
85 #define MERR_PARSE 1
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
86 #define MERR_NOT_LOGGED_IN 2
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
87 #define MERR_ANOTHER_LOGIN 6
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
88 #define MERR_BAD_EMAIL 259
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
89 #define MERR_BAD_PASSWORD 260
b9e554509131 Change all code to better match the style of libpurple - use 8-space tabs
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18057
diff changeset
90 #define MERR_BAD_UID_IN_PERSISTR 4352
17930
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
91
d8908611bf64 Use symbolic constants for persist messages.
Jeff Connelly <jeff2@soc.pidgin.im>
parents:
diff changeset
92 #endif /* !_MYSPACE_PERSIST_H */

mercurial