annotate libpurple/protocols/myspace/persist.h @ 17967:c9acdf96e74e

Update login process to more closely match official client.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Sun, 22 Jul 2007 06:53:48 +0000
parents d87916bd1d73
children f732d072b118
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17343
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
1 /* MySpaceIM Protocol Plugin, persist commands
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
2 *
17923
d87916bd1d73 Fix email address.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 17373
diff changeset
3 * Copyright (C) 2007, Jeff Connelly <jeff2@soc.pidgin.im>
17343
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
4 *
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
8 * (at your option) any later version.
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
9 *
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
13 * GNU General Public License for more details.
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
14 *
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
18 */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
19
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
20 #ifndef _MYSPACE_PERSIST_H
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
21 #define _MYSPACE_PERSIST_H
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
22
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
23 /** Command codes */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
24 #define MSIM_CMD_GET 1
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
25 #define MSIM_CMD_PUT 2
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
26 #define MSIM_CMD_DELETE 3
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
27
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
28 /** Command bit fields */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
29 #define MSIM_CMD_BIT_CODE 255 /*< Bits specifying command code */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
30 #define MSIM_CMD_BIT_REPLY 256 /**< 1=reply, 0=request */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
31 #define MSIM_CMD_BIT_ACTION 512 /**< 1=action, 0=information */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
32 #define MSIM_CMD_BIT_ERROR 1024 /**< 1=error, 0=normal */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
33
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
34 /** Macros to read cmd bitfield. */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
35 #define MSIM_CMD_GET_CODE(x) (x & MSIM_CMD_BIT_CODE)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
36 #define MSIM_CMD_IS_REPLY(x) (x & MSIM_CMD_BIT_REPLY)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
37 #define MSIM_CMD_IS_REQUEST(x) !(x & MSIM_CMD_BIT_REPLY)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
38 #define MSIM_CMD_IS_ACTION(x) (x & MSIM_CMD_BIT_ACTION)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
39 #define MSIM_CMD_IS_INFO(x) !(x & MSIM_CMD_BIT_ACTION)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
40 #define MSIM_CMD_IS_ERROR(x) (x & MSIM_CMD_BIT_ERROR)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
41 #define MSIM_CMD_IS_NORMAL(x) !(x & MSIM_CMD_BIT_ERROR)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
42
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
43 /** Define a set of _DSN and _LID constants for a persistance request. */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
44 #define MSIM_PERSIST_DSN_LID(name,dsn,lid) \
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
45 const int name##_DSN = dsn; \
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
46 const int name##_LID = lid;
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
47
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
48 /* Can't do this, errors:
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
49 * persist.h:51:3: error: '#' is not followed by a macro parameter
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
50 * In file included from myspace.c:37:
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
51 * persist.h:56: error: expected ')' before numeric constant
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
52 * So instead, I define const ints above.
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
53 #define MSIM_PERSIST_DSN_LID(name,dsn,lid) \
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
54 #define name##_DSN dsn \
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
55 #define name##_LID lid
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
56 #endif
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
57 */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
58
17967
c9acdf96e74e Update login process to more closely match official client.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 17923
diff changeset
59 /** Messages to Get information dsn lid */
17343
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
60 MSIM_PERSIST_DSN_LID(MG_LIST_ALL_CONTACTS, 0, 1)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
61 MSIM_PERSIST_DSN_LID(MG_USER_INFO_BY_ID, 0, 2)
17967
c9acdf96e74e Update login process to more closely match official client.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 17923
diff changeset
62 MSIM_PERSIST_DSN_LID(MG_OWN_IM_INFO, 1, 4)
17343
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
63 MSIM_PERSIST_DSN_LID(MG_IM_INFO_BY_ID, 1, 17)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
64 MSIM_PERSIST_DSN_LID(MG_LIST_ALL_GROUPS, 2, 6)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
65 MSIM_PERSIST_DSN_LID(MG_MYSPACE_INFO_BY_ID, 4, 3)
17373
2aff11bb5e72 Several small changes to work towards a working msim_remove_buddy():
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 17345
diff changeset
66 MSIM_PERSIST_DSN_LID(MG_OWN_MYSPACE_INFO, 4, 5)
17343
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
67 MSIM_PERSIST_DSN_LID(MG_MYSPACE_INFO_BY_STRING, 5, 7)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
68 MSIM_PERSIST_DSN_LID(MG_CHECK_MAIL, 7, 18)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
69 MSIM_PERSIST_DSN_LID(MG_WEB_CHALLENGE, 17, 26)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
70 MSIM_PERSIST_DSN_LID(MG_USER_SONG, 21, 28)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
71 MSIM_PERSIST_DSN_LID(MG_SERVER_INFO, 101, 20)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
72
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
73 /** Messages to Change/send information */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
74 MSIM_PERSIST_DSN_LID(MC_USER_PREFERENCES, 1, 10)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
75 MSIM_PERSIST_DSN_LID(MC_CONTACT_INFO, 0, 9)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
76 MSIM_PERSIST_DSN_LID(MC_INVITE, 16, 25)
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
77
17345
d353afe1aa12 Add delete buddy.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 17343
diff changeset
78 /** Messages to Delete information */
d353afe1aa12 Add delete buddy.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 17343
diff changeset
79 MSIM_PERSIST_DSN_LID(MD_DELETE_BUDDY, 0, 8)
d353afe1aa12 Add delete buddy.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 17343
diff changeset
80
17343
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
81 /** Error codes */
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
82 #define MERR_PARSE 1
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
83 #define MERR_NOT_LOGGED_IN 2
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
84 #define MERR_ANOTHER_LOGIN 6
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
85 #define MERR_BAD_EMAIL 259
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
86 #define MERR_BAD_PASSWORD 260
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
87 #define MERR_BAD_UID_IN_PERSISTR 4352
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
88
58b4d103a5b8 Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff changeset
89 #endif /* !_MYSPACE_PERSIST_H */