Mercurial > pidgin
annotate libpurple/protocols/myspace/myspace.h @ 19243:a242e014ab8c
Re-apply the msimprpl-specific parts of revision
b888bc5c0494c9dd0398baba81e4d602ac88948f, my initial proposal of an attention
API. So now libpurple isn't changed, only msimprpl.
This patch is also available here:
http://msimprpl.darkthoughts.net/attention1-msimprpl-only.diff
Libpurple's changes: http://msimprpl.darkthoughts.net/attention1.diff
(Now 'mtn disapprove'd, so that im.pidgin.soc.2007.msimprpl can be merged
into im.pidgin.pidgin before 2.2.0, since it is an API addition.)
Both patches: http://msimprpl.darkthoughts.net/attention1-full.diff
(Complete diff of revision b888bc...)
See also: http://pidgin.im/pipermail/devel/2007-August/002636.html
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Tue, 14 Aug 2007 02:54:31 +0000 |
parents | 6ea5602643ea |
children | b29788c6d269 |
rev | line source |
---|---|
17286
58b4d103a5b8
Use symbolic constants for persist messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17280
diff
changeset
|
1 /* MySpaceIM Protocol Plugin, header file |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
2 * |
17680
d87916bd1d73
Fix email address.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17679
diff
changeset
|
3 * Copyright (C) 2007, Jeff Connelly <jeff2@soc.pidgin.im> |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
4 * |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
7 * the Free Software Foundation; either version 2 of the License, or |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
8 * (at your option) any later version. |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
9 * |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
13 * GNU General Public License for more details. |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
14 * |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
18 */ |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
19 |
16735
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
20 #ifndef _MYSPACE_MYSPACE_H |
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
21 #define _MYSPACE_MYSPACE_H |
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
22 |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
23 /* Other includes */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
24 #include <string.h> |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
25 #include <errno.h>/* for EAGAIN */ |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
26 #include <stdarg.h> |
17971
13a4f57f53a9
Implement round() if it is not available, using floor().
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17970
diff
changeset
|
27 #include <math.h> |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
28 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
29 #include <glib.h> |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
30 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
31 #ifdef _WIN32 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
32 #include "win32dep.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
33 #else |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
34 /* For recv() and send(); needed to match Win32 */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
35 #include <sys/types.h> |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
36 #include <sys/socket.h> |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
37 #endif |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
38 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
39 #include "internal.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
40 |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
41 #include "notify.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
42 #include "plugin.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
43 #include "accountopt.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
44 #include "version.h" |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
45 #include "cipher.h" /* for SHA-1 */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
46 #include "util.h" /* for base64 */ |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
47 #include "debug.h" /* for purple_debug_info */ |
17662
7b890c79aabf
Add msim_markup_to_html() to convert MySpaceIM-style markup to Purple-compatible
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17660
diff
changeset
|
48 #include "xmlnode.h" |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
49 |
17266
793301c04e3a
(Incomplete - plugin does not load) Begin migrating protocol message receiving to MsimMessage.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16738
diff
changeset
|
50 /* MySpaceIM includes */ |
793301c04e3a
(Incomplete - plugin does not load) Begin migrating protocol message receiving to MsimMessage.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16738
diff
changeset
|
51 #include "message.h" |
793301c04e3a
(Incomplete - plugin does not load) Begin migrating protocol message receiving to MsimMessage.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16738
diff
changeset
|
52 |
16725
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16723
diff
changeset
|
53 /* Conditional compilation options */ |
17974
3d400b022acc
Disable sending third-party client version to oncoming buddies.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17971
diff
changeset
|
54 /* Send third-party client version? (Recognized by us and Miranda's plugin) */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
55 /*#define MSIM_SEND_CLIENT_VERSION */ |
16725
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16723
diff
changeset
|
56 |
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16723
diff
changeset
|
57 /* Debugging options */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
58 /*#define MSIM_DEBUG_MSG */ |
16407
bb649c52fc19
Replace printf() in MySpaceIM prpl with purple_debug_info().
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16405
diff
changeset
|
59 /* Low-level and rarely needed */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
60 /*#define MSIM_DEBUG_PARSE */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
61 /*#define MSIM_DEBUG_LOGIN_CHALLENGE*/ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
62 /*#define MSIM_DEBUG_RXBUF */ |
16725
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16723
diff
changeset
|
63 |
17651
333fe6ac1046
Add msim_unrecognized() to handle unhandled messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17649
diff
changeset
|
64 /* Define to cause init_plugin() to run some tests and print |
333fe6ac1046
Add msim_unrecognized() to handle unhandled messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17649
diff
changeset
|
65 * the results to the Purple debug log, then exit. Useful to |
333fe6ac1046
Add msim_unrecognized() to handle unhandled messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17649
diff
changeset
|
66 * run with 'pidgin -d' to see the output. Don't define if |
333fe6ac1046
Add msim_unrecognized() to handle unhandled messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17649
diff
changeset
|
67 * you want to actually use the plugin! */ |
18906
8b3ca7be9b72
Re-enable non-test mode. This revision now correctly handles links with paths.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18905
diff
changeset
|
68 /*#define MSIM_SELF_TEST */ |
17651
333fe6ac1046
Add msim_unrecognized() to handle unhandled messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17649
diff
changeset
|
69 |
19243
a242e014ab8c
Re-apply the msimprpl-specific parts of revision
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18917
diff
changeset
|
70 /* Use the attention API for zaps? */ |
a242e014ab8c
Re-apply the msimprpl-specific parts of revision
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18917
diff
changeset
|
71 #define MSIM_USE_ATTENTION_API |
a242e014ab8c
Re-apply the msimprpl-specific parts of revision
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18917
diff
changeset
|
72 |
16725
58cd11fcd84f
Re-add RC4 code from Samba, whose use is enabled by not defining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16723
diff
changeset
|
73 /* Constants */ |
16407
bb649c52fc19
Replace printf() in MySpaceIM prpl with purple_debug_info().
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16405
diff
changeset
|
74 |
17684
e440846f9a21
Increase password length limit to 10 and update changes file.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17683
diff
changeset
|
75 /* Maximum length of a password that is acceptable. This is the limit |
e440846f9a21
Increase password length limit to 10 and update changes file.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17683
diff
changeset
|
76 * on the official client (build 679) and on the 'new password' field at |
e440846f9a21
Increase password length limit to 10 and update changes file.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17683
diff
changeset
|
77 * http://settings.myspace.com/index.cfm?fuseaction=user.changepassword |
e440846f9a21
Increase password length limit to 10 and update changes file.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17683
diff
changeset
|
78 * (though curiously, not on the 'current password' field). */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
79 #define MSIM_MAX_PASSWORD_LENGTH 10 |
17665
5c2720824798
Fail with our own error message if an entered password is greater than 8
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17662
diff
changeset
|
80 |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
81 /* Build version of MySpaceIM to report to servers (1.0.xxx.0) */ |
17967
c9acdf96e74e
Update login process to more closely match official client.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17966
diff
changeset
|
82 #define MSIM_CLIENT_VERSION 697 |
c9acdf96e74e
Update login process to more closely match official client.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17966
diff
changeset
|
83 |
c9acdf96e74e
Update login process to more closely match official client.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17966
diff
changeset
|
84 /* Language codes from http://www.microsoft.com/globaldev/reference/oslocversion.mspx */ |
c9acdf96e74e
Update login process to more closely match official client.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17966
diff
changeset
|
85 #define MSIM_LANGUAGE_ID_ENGLISH 1033 |
c9acdf96e74e
Update login process to more closely match official client.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17966
diff
changeset
|
86 #define MSIM_LANGUAGE_NAME_ENGLISH "ENGLISH" |
17953
bde17299004b
Support unofficial bm code 200, also used by Miranda IM plugin, to report
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17952
diff
changeset
|
87 |
bde17299004b
Support unofficial bm code 200, also used by Miranda IM plugin, to report
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17952
diff
changeset
|
88 /* msimprpl version string of this plugin */ |
18910 | 89 #define MSIM_PRPL_VERSION_STRING "0.14" |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
90 |
17687
d0c8b7748065
Add msim_check_alive(), called every MSIM_KEEPALIVE_INTERVAL_CHECK milliseconds,
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17686
diff
changeset
|
91 /* Default server */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
92 #define MSIM_SERVER "im.myspace.akadns.net" |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
93 #define MSIM_PORT 1863 /* TODO: alternate ports and automatic */ |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
94 |
17687
d0c8b7748065
Add msim_check_alive(), called every MSIM_KEEPALIVE_INTERVAL_CHECK milliseconds,
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17686
diff
changeset
|
95 /* Time between keepalives (seconds) - if no data within this time, is dead. */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
96 #define MSIM_KEEPALIVE_INTERVAL (3 * 60) |
17687
d0c8b7748065
Add msim_check_alive(), called every MSIM_KEEPALIVE_INTERVAL_CHECK milliseconds,
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17686
diff
changeset
|
97 |
d0c8b7748065
Add msim_check_alive(), called every MSIM_KEEPALIVE_INTERVAL_CHECK milliseconds,
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17686
diff
changeset
|
98 /* Time to check if alive (milliseconds) */ |
17690
44de942bd762
Lower timeout to 2 minutes (to be closer to keepalive of 124 s).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17689
diff
changeset
|
99 #define MSIM_KEEPALIVE_INTERVAL_CHECK (30 * 1000) |
17687
d0c8b7748065
Add msim_check_alive(), called every MSIM_KEEPALIVE_INTERVAL_CHECK milliseconds,
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17686
diff
changeset
|
100 |
17947
ac7066ffa109
Add msim_check_mail to check for new mail (called periodically), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17946
diff
changeset
|
101 /* Time to check for new mail (milliseconds) */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
102 #define MSIM_MAIL_INTERVAL_CHECK (60 * 1000) |
17947
ac7066ffa109
Add msim_check_mail to check for new mail (called periodically), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17946
diff
changeset
|
103 |
ac7066ffa109
Add msim_check_mail to check for new mail (called periodically), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17946
diff
changeset
|
104 |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
105 /* Constants */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
106 #define HASH_SIZE 0x14 /**< Size of SHA-1 hash for login */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
107 #define NONCE_SIZE 0x20 /**< Half of decoded 'nc' field */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
108 #define MSIM_READ_BUF_SIZE (15 * 1024) /**< Receive buffer size */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
109 #define MSIM_FINAL_STRING "\\final\\" /**< Message end marker */ |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
110 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
111 /* Messages */ |
17953
bde17299004b
Support unofficial bm code 200, also used by Miranda IM plugin, to report
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17952
diff
changeset
|
112 #define MSIM_BM_INSTANT 1 |
bde17299004b
Support unofficial bm code 200, also used by Miranda IM plugin, to report
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17952
diff
changeset
|
113 #define MSIM_BM_STATUS 100 |
bde17299004b
Support unofficial bm code 200, also used by Miranda IM plugin, to report
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17952
diff
changeset
|
114 #define MSIM_BM_ACTION 121 |
bde17299004b
Support unofficial bm code 200, also used by Miranda IM plugin, to report
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17952
diff
changeset
|
115 #define MSIM_BM_MEDIA 122 |
bde17299004b
Support unofficial bm code 200, also used by Miranda IM plugin, to report
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17952
diff
changeset
|
116 #define MSIM_BM_PROFILE 124 |
bde17299004b
Support unofficial bm code 200, also used by Miranda IM plugin, to report
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17952
diff
changeset
|
117 #define MSIM_BM_UNOFFICIAL_CLIENT 200 |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
118 |
16734
3f53f8f502b2
Replacement magic numbers by symbolic constants.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16732
diff
changeset
|
119 /* Authentication algorithm for login2 */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
120 #define MSIM_AUTH_ALGORITHM 196610 |
16734
3f53f8f502b2
Replacement magic numbers by symbolic constants.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16732
diff
changeset
|
121 |
17941
dcbb535e8d55
Lowercase password before sending it. Closes #2066.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17695
diff
changeset
|
122 /* Recognized challenge length */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
123 #define MSIM_AUTH_CHALLENGE_LENGTH 0x40 |
17941
dcbb535e8d55
Lowercase password before sending it. Closes #2066.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17695
diff
changeset
|
124 |
17652
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
125 /* TODO: obtain IPs of network interfaces from user's machine, instead of |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
126 * hardcoding these values below (used in msim_compute_login_response). |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
127 * This is not immediately |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
128 * important because you can still connect and perform basic |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
129 * functions of the protocol. There is also a high chance that the addreses |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
130 * are RFC1918 private, so the servers couldn't do anything with them |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
131 * anyways except make note of that fact. Probably important for any |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
132 * kind of direct connection, or file transfer functionality. |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
133 */ |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
134 |
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
135 #define MSIM_LOGIN_IP_LIST "\x00\x00\x00\x00\x05\x7f\x00\x00\x01\x00\x00\x00\x00\x0a\x00\x00\x40\xc0\xa8\x58\x01\xc0\xa8\x3c\x01" |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
136 #define MSIM_LOGIN_IP_LIST_LEN 25 |
17652
06d60201e371
Use constants for IP address list, defined in myspace.h.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17651
diff
changeset
|
137 |
17289
73720427b132
Show online buddies on buddy list as online.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17286
diff
changeset
|
138 /* Indexes into status string (0|1|2|3|..., but 0 always empty) */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
139 #define MSIM_STATUS_ORDINAL_EMPTY 0 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
140 #define MSIM_STATUS_ORDINAL_UNKNOWNs 1 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
141 #define MSIM_STATUS_ORDINAL_ONLINE 2 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
142 #define MSIM_STATUS_ORDINAL_UNKNOWNss 3 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
143 #define MSIM_STATUS_ORDINAL_HEADLINE 4 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
144 #define MSIM_STATUS_ORDINAL_UNKNOWNls 5 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
145 #define MSIM_STATUS_ORDINAL_UNKNOWN 6 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
146 #define MSIM_STATUS_ORDINAL_UNKNOWN1 7 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
147 #define MSIM_STATUS_ORDINAL_UNKNOWNp 8 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
148 #define MSIM_STATUS_ORDINAL_UNKNOWN2 9 |
17289
73720427b132
Show online buddies on buddy list as online.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17286
diff
changeset
|
149 |
17674
e24d44e3b6d2
Recognize online/away status of buddies on buddy list.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17670
diff
changeset
|
150 /* Status codes - states a buddy (or you!) can be in. */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
151 #define MSIM_STATUS_CODE_OFFLINE_OR_HIDDEN 0 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
152 #define MSIM_STATUS_CODE_ONLINE 1 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
153 #define MSIM_STATUS_CODE_IDLE 2 |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
154 #define MSIM_STATUS_CODE_AWAY 5 |
17691
b9fd55903979
General clean up and adding more error-checking.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17690
diff
changeset
|
155 |
b9fd55903979
General clean up and adding more error-checking.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17690
diff
changeset
|
156 /* Text formatting bits for <f s=#> */ |
b9fd55903979
General clean up and adding more error-checking.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17690
diff
changeset
|
157 #define MSIM_TEXT_BOLD 1 |
17695
13bba54b429d
Support sending some formatted text in instant messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17692
diff
changeset
|
158 #define MSIM_TEXT_ITALIC 2 |
17691
b9fd55903979
General clean up and adding more error-checking.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17690
diff
changeset
|
159 #define MSIM_TEXT_UNDERLINE 4 |
17674
e24d44e3b6d2
Recognize online/away status of buddies on buddy list.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17670
diff
changeset
|
160 |
17952
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
161 /* Default baseline size of purple's fonts, in points. What is size 3 in points. |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
162 * _font_scale specifies scaling factor relative to this point size. Note this |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
163 * is only the default; it is configurable in account options. */ |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
164 #define MSIM_BASE_FONT_POINT_SIZE 8 |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
165 |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
166 /* Default display's DPI. 96 is common but it can differ. Also configurable |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
167 * in account options. */ |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
168 #define MSIM_DEFAULT_DPI 96 |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
169 |
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
170 |
17269
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
171 /* Random number in every MsimSession, to ensure it is valid. */ |
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
172 #define MSIM_SESSION_STRUCT_MAGIC 0xe4a6752b |
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
173 |
17948
c23122e0af91
Notify of new inbox messages (friend requests, inbox messages, comments),
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17947
diff
changeset
|
174 /* Inbox status bitfield values for MsimSession.inbox_status */ |
c23122e0af91
Notify of new inbox messages (friend requests, inbox messages, comments),
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17947
diff
changeset
|
175 #define MSIM_INBOX_MAIL (1 << 0) |
c23122e0af91
Notify of new inbox messages (friend requests, inbox messages, comments),
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17947
diff
changeset
|
176 #define MSIM_INBOX_BLOG_COMMENT (1 << 1) |
c23122e0af91
Notify of new inbox messages (friend requests, inbox messages, comments),
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17947
diff
changeset
|
177 #define MSIM_INBOX_PROFILE_COMMENT (1 << 2) |
c23122e0af91
Notify of new inbox messages (friend requests, inbox messages, comments),
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17947
diff
changeset
|
178 #define MSIM_INBOX_FRIEND_REQUEST (1 << 3) |
c23122e0af91
Notify of new inbox messages (friend requests, inbox messages, comments),
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17947
diff
changeset
|
179 #define MSIM_INBOX_PICTURE_COMMENT (1 << 4) |
c23122e0af91
Notify of new inbox messages (friend requests, inbox messages, comments),
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17947
diff
changeset
|
180 |
18905
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
181 /* Everything needed to keep track of a session (proto_data field in PurpleConnection) */ |
17269
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
182 typedef struct _MsimSession |
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
183 { |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
184 guint magic; /**< MSIM_SESSION_STRUCT_MAGIC */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
185 PurpleAccount *account; |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
186 PurpleConnection *gc; |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
187 guint sesskey; /**< Session key from server */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
188 guint userid; /**< This user's numeric user ID */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
189 gchar *username; /**< This user's unique username */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
190 gint fd; /**< File descriptor to/from server */ |
17269
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
191 |
17313
7a0061f4845d
Add msim_uid2username_from_blist() to lookup a username by userid, by
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17309
diff
changeset
|
192 /* TODO: Remove. */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
193 GHashTable *user_lookup_cb; /**< Username -> userid lookup callback */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
194 GHashTable *user_lookup_cb_data; /**< Username -> userid lookup callback data */ |
17269
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
195 |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
196 GHashTable *server_info; /**< Parameters from server */ |
17966
f1827c3dc65a
Add msim_process_server_info() to save the server information dictionary
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17965
diff
changeset
|
197 |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
198 gchar *rxbuf; /**< Receive buffer */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
199 guint rxoff; /**< Receive buffer offset */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
200 guint next_rid; /**< Next request/response ID */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
201 time_t last_comm; /**< Time received last communication */ |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
202 guint inbox_status; /**< Bit field of inbox notifications */ |
17269
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
203 } MsimSession; |
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
204 |
18905
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
205 /* Hold ephemeral information about buddies, for proto_data of PurpleBuddy. */ |
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
206 /* GHashTable? */ |
18912
7519560095f7
Use MsimUser structure for storing ephemeral information on users, instead
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18910
diff
changeset
|
207 typedef struct _MsimUser |
18905
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
208 { |
18912
7519560095f7
Use MsimUser structure for storing ephemeral information on users, instead
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18910
diff
changeset
|
209 PurpleBuddy *buddy; |
18905
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
210 guint client_cv; |
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
211 gchar *client_info; |
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
212 guint age; |
18912
7519560095f7
Use MsimUser structure for storing ephemeral information on users, instead
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18910
diff
changeset
|
213 gchar *gender; |
7519560095f7
Use MsimUser structure for storing ephemeral information on users, instead
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18910
diff
changeset
|
214 gchar *location; |
18905
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
215 guint total_friends; |
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
216 gchar *headline; |
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
217 gchar *display_name; |
18912
7519560095f7
Use MsimUser structure for storing ephemeral information on users, instead
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18910
diff
changeset
|
218 /* Note: uid is in &buddy->node (set_blist_node_int), since it never changes */ |
18905
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
219 gchar *username; |
18912
7519560095f7
Use MsimUser structure for storing ephemeral information on users, instead
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18910
diff
changeset
|
220 gchar *band_name, *song_name; |
7519560095f7
Use MsimUser structure for storing ephemeral information on users, instead
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18910
diff
changeset
|
221 gchar *image_url; |
7519560095f7
Use MsimUser structure for storing ephemeral information on users, instead
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18910
diff
changeset
|
222 } MsimUser; |
18905
3f95e691bad2
Rewrite escaping so that it is more correct, in order to fix #2521. Test it.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18895
diff
changeset
|
223 |
17269
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
224 /* Check if an MsimSession is valid */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
225 #define MSIM_SESSION_VALID(s) (session != NULL && session->magic == MSIM_SESSION_STRUCT_MAGIC) |
17269
57bde8784308
(Plugin loads, but cannot do anything useful)
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17266
diff
changeset
|
226 |
17969
8983b8340fdc
Make msimprpl-internal functions static.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17968
diff
changeset
|
227 gchar *str_replace(const gchar *str, const gchar *old, const gchar *new); |
8983b8340fdc
Make msimprpl-internal functions static.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17968
diff
changeset
|
228 |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
229 /* Callback function pointer type for when a user's information is received, |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
230 * initiated from a user lookup. */ |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
231 typedef void (*MSIM_USER_LOOKUP_CB)(MsimSession *session, MsimMessage *userinfo, gpointer data); |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
232 |
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
233 /* Functions */ |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
234 gboolean msim_load(PurplePlugin *plugin); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
235 GList *msim_status_types(PurpleAccount *acct); |
17963
8305709dd0b9
Allow sending zaps through buddy list menu.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17962
diff
changeset
|
236 |
19243
a242e014ab8c
Re-apply the msimprpl-specific parts of revision
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18917
diff
changeset
|
237 GList *msim_attention_types(PurpleAccount *acct); |
a242e014ab8c
Re-apply the msimprpl-specific parts of revision
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18917
diff
changeset
|
238 gboolean msim_send_attention(PurpleConnection *gc, gchar *username, guint code); |
a242e014ab8c
Re-apply the msimprpl-specific parts of revision
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18917
diff
changeset
|
239 |
17963
8305709dd0b9
Allow sending zaps through buddy list menu.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17962
diff
changeset
|
240 GList *msim_blist_node_menu(PurpleBlistNode *node); |
8305709dd0b9
Allow sending zaps through buddy list menu.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17962
diff
changeset
|
241 |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
242 const gchar *msim_list_icon(PurpleAccount *acct, PurpleBuddy *buddy); |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
243 |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
244 gboolean msim_send_raw(MsimSession *session, const gchar *msg); |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
245 |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
246 void msim_login(PurpleAccount *acct); |
17290
aa8e70fa1edc
Add, but do not use, incomplete functions for using typing notifications.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17289
diff
changeset
|
247 |
17326
f057837085b0
Change to use const gchar * where appropriate.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17325
diff
changeset
|
248 int msim_send_im(PurpleConnection *gc, const gchar *who, const gchar *message, |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
249 PurpleMessageFlags flags); |
17695
13bba54b429d
Support sending some formatted text in instant messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17692
diff
changeset
|
250 |
17952
4001661344e4
Make DPI and base font point size configurable in account options. This
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17949
diff
changeset
|
251 typedef void (*MSIM_XMLNODE_CONVERT)(MsimSession *, xmlnode *, gchar **, gchar **); |
17290
aa8e70fa1edc
Add, but do not use, incomplete functions for using typing notifications.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17289
diff
changeset
|
252 |
17326
f057837085b0
Change to use const gchar * where appropriate.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17325
diff
changeset
|
253 unsigned int msim_send_typing(PurpleConnection *gc, const gchar *name, PurpleTypingState state); |
f057837085b0
Change to use const gchar * where appropriate.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17325
diff
changeset
|
254 void msim_get_info(PurpleConnection *gc, const gchar *name); |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
255 |
17679
608e4b47dfae
Allow setting status to away or online.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17674
diff
changeset
|
256 void msim_set_status(PurpleAccount *account, PurpleStatus *status); |
17686
87b77f1ea086
Add support for idle.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17684
diff
changeset
|
257 void msim_set_idle(PurpleConnection *gc, int time); |
17679
608e4b47dfae
Allow setting status to away or online.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17674
diff
changeset
|
258 |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
259 void msim_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); |
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
260 void msim_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group); |
17293
bfda36bd957a
Add incomplete msim_add_buddy() implementation.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17291
diff
changeset
|
261 |
17324
df93e8773981
Add msim_offline_message() for offline message status. Always return TRUE,
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17322
diff
changeset
|
262 gboolean msim_offline_message(const PurpleBuddy *buddy); |
df93e8773981
Add msim_offline_message() for offline message status. Always return TRUE,
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17322
diff
changeset
|
263 |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
264 MsimSession *msim_session_new(PurpleAccount *acct); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
265 void msim_session_destroy(MsimSession *session); |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
266 |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
267 void msim_close(PurpleConnection *gc); |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
268 |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
269 char *msim_status_text(PurpleBuddy *buddy); |
18895
f732d072b118
Change all code to better match the style of libpurple - use 8-space tabs
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18881
diff
changeset
|
270 void msim_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full); |
17965
e3687194f2b2
Use MsimMessage's new list type for status messages.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17963
diff
changeset
|
271 GList *msim_actions(PurplePlugin *plugin, gpointer context); |
16405
8063f163f411
Add MySpaceIM header file and reorganize functions.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
diff
changeset
|
272 |
17662
7b890c79aabf
Add msim_markup_to_html() to convert MySpaceIM-style markup to Purple-compatible
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17660
diff
changeset
|
273 #ifdef MSIM_SELF_TEST |
7b890c79aabf
Add msim_markup_to_html() to convert MySpaceIM-style markup to Purple-compatible
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17660
diff
changeset
|
274 void msim_test_all(void) __attribute__((__noreturn__)); |
17648
23f57d36cb65
Add msim_test_all() and related procedures, to perform basic functionality
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17326
diff
changeset
|
275 int msim_test_msg(void); |
23f57d36cb65
Add msim_test_all() and related procedures, to perform basic functionality
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17326
diff
changeset
|
276 int msim_test_escaping(void); |
17662
7b890c79aabf
Add msim_markup_to_html() to convert MySpaceIM-style markup to Purple-compatible
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17660
diff
changeset
|
277 #endif |
17648
23f57d36cb65
Add msim_test_all() and related procedures, to perform basic functionality
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
17326
diff
changeset
|
278 |
16736
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
279 void init_plugin(PurplePlugin *plugin); |
496855295bd7
Use MsimMessage via msim_send(), instead of msim_send_raw(). This is a more
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16735
diff
changeset
|
280 |
16735
52357f6392a4
Add partial implementation of MsimMessage (not used anywhere yet).
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
16734
diff
changeset
|
281 #endif /* !_MYSPACE_MYSPACE_H */ |