Wed, 30 Apr 2008 05:37:19 +0000
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
the XMPP conference. After some thought and discussion, I decided to have the
prpls create the hash table on each call. This allows some dynamic key
creation in case we would need it in the future.
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1 | /** |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2 | * @file msn.c The MSN protocol plugin |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
3 | * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
4 | * purple |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
5 | * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
6 | * Purple is the legal property of its developers, whose names are too numerous |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
8 | * source distribution. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
9 | * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
10 | * This program is free software; you can redistribute it and/or modify |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
11 | * it under the terms of the GNU General Public License as published by |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
12 | * the Free Software Foundation; either version 2 of the License, or |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
13 | * (at your option) any later version. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
14 | * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
15 | * This program is distributed in the hope that it will be useful, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
18 | * GNU General Public License for more details. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
19 | * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
20 | * You should have received a copy of the GNU General Public License |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
21 | * along with this program; if not, write to the Free Software |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
23 | */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
24 | #define PHOTO_SUPPORT 1 |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
25 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
26 | #include <glib.h> |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
27 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
28 | #include "msn.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
29 | #include "accountopt.h" |
|
22351
6ca0640b3d31
Change some g_idle_add(...) calls in libpurple to purple_timeout_add(0, ...)
Mark Doliner <markdoliner@pidgin.im>
parents:
22268
diff
changeset
|
30 | #include "eventloop.h" |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
31 | #include "msg.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
32 | #include "page.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
33 | #include "pluginpref.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
34 | #include "prefs.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
35 | #include "session.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
36 | #include "state.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
37 | #include "util.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
38 | #include "cmds.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
39 | #include "core.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
40 | #include "prpl.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
41 | #include "msn-utils.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
42 | #include "version.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
43 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
44 | #include "switchboard.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
45 | #include "notification.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
46 | #include "sync.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
47 | #include "slplink.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
48 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
49 | #if PHOTO_SUPPORT |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
50 | #include "imgstore.h" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
51 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
52 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
53 | typedef struct |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
54 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
55 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
56 | const char *passport; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
57 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
58 | } MsnMobileData; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
59 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
60 | typedef struct |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
61 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
62 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
63 | char *name; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
64 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
65 | } MsnGetInfoData; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
66 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
67 | typedef struct |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
68 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
69 | MsnGetInfoData *info_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
70 | char *stripped; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
71 | char *url_buffer; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
72 | PurpleNotifyUserInfo *user_info; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
73 | char *photo_url_text; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
74 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
75 | } MsnGetInfoStepTwoData; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
76 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
77 | typedef struct |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
78 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
79 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
80 | const char *who; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
81 | char *msg; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
82 | PurpleMessageFlags flags; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
83 | time_t when; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
84 | } MsnIMData; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
85 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
86 | static const char * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
87 | msn_normalize(const PurpleAccount *account, const char *str) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
88 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
89 | static char buf[BUF_LEN]; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
90 | char *tmp; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
91 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
92 | g_return_val_if_fail(str != NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
93 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
94 | g_snprintf(buf, sizeof(buf), "%s%s", str, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
95 | (strchr(str, '@') ? "" : "@hotmail.com")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
96 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
97 | tmp = g_utf8_strdown(buf, -1); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
98 | strncpy(buf, tmp, sizeof(buf)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
99 | g_free(tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
100 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
101 | return buf; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
102 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
103 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
104 | static gboolean |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
105 | msn_send_attention(PurpleConnection *gc, const char *username, guint type) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
106 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
107 | MsnMessage *msg; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
108 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
109 | MsnSwitchBoard *swboard; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
110 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
111 | msg = msn_message_new_nudge(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
112 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
113 | swboard = msn_session_get_swboard(session, username, MSN_SB_FLAG_IM); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
114 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
115 | if (swboard == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
116 | return FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
117 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
118 | msn_switchboard_send_msg(swboard, msg, TRUE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
119 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
120 | return TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
121 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
122 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
123 | static GList * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
124 | msn_attention_types(PurpleAccount *account) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
125 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
126 | static GList *list = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
127 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
128 | if (!list) { |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22164
diff
changeset
|
129 | list = g_list_append(list, purple_attention_type_new("Nudge", _("Nudge"), |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22164
diff
changeset
|
130 | _("%s has nudged you!"), _("Nudging %s..."))); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
131 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
132 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
133 | return list; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
134 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
135 | |
|
22926
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
136 | static GHashTable * |
|
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
137 | msn_get_account_text_table() |
|
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
138 | { |
|
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
139 | GHashTable *table; |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
140 | |
|
22926
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
141 | table = g_hash_table_new(g_str_hash, g_str_equal); |
|
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
142 | |
|
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
143 | g_hash_table_insert(table, "login_label", (gpointer)_("E-mail Address...")); |
|
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
144 | |
|
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
145 | return table; |
|
22924
48018e2c0eec
This patch from Jaywalker enables text to appear in the screen name entry box.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22622
diff
changeset
|
146 | } |
|
48018e2c0eec
This patch from Jaywalker enables text to appear in the screen name entry box.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22622
diff
changeset
|
147 | |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
148 | static PurpleCmdRet |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
149 | msn_cmd_nudge(PurpleConversation *conv, const gchar *cmd, gchar **args, gchar **error, void *data) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
150 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
151 | PurpleAccount *account = purple_conversation_get_account(conv); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
152 | PurpleConnection *gc = purple_account_get_connection(account); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
153 | const gchar *username; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
154 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
155 | username = purple_conversation_get_name(conv); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
156 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
157 | serv_send_attention(gc, username, MSN_NUDGE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
158 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
159 | return PURPLE_CMD_RET_OK; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
160 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
161 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
162 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
163 | msn_act_id(PurpleConnection *gc, const char *entry) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
164 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
165 | MsnCmdProc *cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
166 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
167 | PurpleAccount *account; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
168 | const char *alias; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
169 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
170 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
171 | cmdproc = session->notification->cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
172 | account = purple_connection_get_account(gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
173 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
174 | if(entry && strlen(entry)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
175 | alias = purple_url_encode(entry); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
176 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
177 | alias = ""; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
178 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
179 | if (strlen(alias) > BUDDY_ALIAS_MAXLEN) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
180 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
181 | purple_notify_error(gc, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
182 | _("Your new MSN friendly name is too long."), NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
183 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
184 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
185 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
186 | msn_cmdproc_send(cmdproc, "REA", "%s %s", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
187 | purple_account_get_username(account), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
188 | alias); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
189 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
190 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
191 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
192 | msn_set_prp(PurpleConnection *gc, const char *type, const char *entry) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
193 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
194 | MsnCmdProc *cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
195 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
196 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
197 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
198 | cmdproc = session->notification->cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
199 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
200 | if (entry == NULL || *entry == '\0') |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
201 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
202 | msn_cmdproc_send(cmdproc, "PRP", "%s", type); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
203 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
204 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
205 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
206 | msn_cmdproc_send(cmdproc, "PRP", "%s %s", type, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
207 | purple_url_encode(entry)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
208 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
209 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
210 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
211 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
212 | msn_set_home_phone_cb(PurpleConnection *gc, const char *entry) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
213 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
214 | msn_set_prp(gc, "PHH", entry); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
215 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
216 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
217 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
218 | msn_set_work_phone_cb(PurpleConnection *gc, const char *entry) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
219 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
220 | msn_set_prp(gc, "PHW", entry); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
221 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
222 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
223 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
224 | msn_set_mobile_phone_cb(PurpleConnection *gc, const char *entry) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
225 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
226 | msn_set_prp(gc, "PHM", entry); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
227 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
228 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
229 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
230 | enable_msn_pages_cb(PurpleConnection *gc) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
231 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
232 | msn_set_prp(gc, "MOB", "Y"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
233 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
234 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
235 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
236 | disable_msn_pages_cb(PurpleConnection *gc) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
237 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
238 | msn_set_prp(gc, "MOB", "N"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
239 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
240 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
241 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
242 | send_to_mobile(PurpleConnection *gc, const char *who, const char *entry) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
243 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
244 | MsnTransaction *trans; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
245 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
246 | MsnCmdProc *cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
247 | MsnPage *page; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
248 | char *payload; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
249 | size_t payload_len; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
250 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
251 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
252 | cmdproc = session->notification->cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
253 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
254 | page = msn_page_new(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
255 | msn_page_set_body(page, entry); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
256 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
257 | payload = msn_page_gen_payload(page, &payload_len); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
258 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
259 | trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %d", who, payload_len); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
260 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
261 | msn_transaction_set_payload(trans, payload, payload_len); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
262 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
263 | msn_page_destroy(page); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
264 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
265 | msn_cmdproc_send_trans(cmdproc, trans); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
266 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
267 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
268 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
269 | send_to_mobile_cb(MsnMobileData *data, const char *entry) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
270 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
271 | send_to_mobile(data->gc, data->passport, entry); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
272 | g_free(data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
273 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
274 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
275 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
276 | close_mobile_page_cb(MsnMobileData *data, const char *entry) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
277 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
278 | g_free(data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
279 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
280 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
281 | /* -- */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
282 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
283 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
284 | msn_show_set_friendly_name(PurplePluginAction *action) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
285 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
286 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
287 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
288 | gc = (PurpleConnection *) action->context; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
289 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
290 | purple_request_input(gc, NULL, _("Set your friendly name."), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
291 | _("This is the name that other MSN buddies will " |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
292 | "see you as."), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
293 | purple_connection_get_display_name(gc), FALSE, FALSE, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
294 | _("OK"), G_CALLBACK(msn_act_id), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
295 | _("Cancel"), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
296 | purple_connection_get_account(gc), NULL, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
297 | gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
298 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
299 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
300 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
301 | msn_show_set_home_phone(PurplePluginAction *action) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
302 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
303 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
304 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
305 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
306 | gc = (PurpleConnection *) action->context; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
307 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
308 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
309 | purple_request_input(gc, NULL, _("Set your home phone number."), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
310 | msn_user_get_home_phone(session->user), FALSE, FALSE, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
311 | _("OK"), G_CALLBACK(msn_set_home_phone_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
312 | _("Cancel"), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
313 | purple_connection_get_account(gc), NULL, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
314 | gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
315 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
316 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
317 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
318 | msn_show_set_work_phone(PurplePluginAction *action) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
319 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
320 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
321 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
322 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
323 | gc = (PurpleConnection *) action->context; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
324 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
325 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
326 | purple_request_input(gc, NULL, _("Set your work phone number."), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
327 | msn_user_get_work_phone(session->user), FALSE, FALSE, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
328 | _("OK"), G_CALLBACK(msn_set_work_phone_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
329 | _("Cancel"), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
330 | purple_connection_get_account(gc), NULL, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
331 | gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
332 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
333 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
334 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
335 | msn_show_set_mobile_phone(PurplePluginAction *action) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
336 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
337 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
338 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
339 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
340 | gc = (PurpleConnection *) action->context; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
341 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
342 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
343 | purple_request_input(gc, NULL, _("Set your mobile phone number."), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
344 | msn_user_get_mobile_phone(session->user), FALSE, FALSE, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
345 | _("OK"), G_CALLBACK(msn_set_mobile_phone_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
346 | _("Cancel"), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
347 | purple_connection_get_account(gc), NULL, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
348 | gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
349 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
350 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
351 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
352 | msn_show_set_mobile_pages(PurplePluginAction *action) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
353 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
354 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
355 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
356 | gc = (PurpleConnection *) action->context; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
357 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
358 | purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
359 | _("Do you want to allow or disallow people on " |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
360 | "your buddy list to send you MSN Mobile pages " |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
361 | "to your cell phone or other mobile device?"), |
|
22268
a6f48dec4ca5
A few more "purple_request_action" default action corrections
Mark Doliner <markdoliner@pidgin.im>
parents:
22225
diff
changeset
|
362 | PURPLE_DEFAULT_ACTION_NONE, |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
363 | purple_connection_get_account(gc), NULL, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
364 | gc, 3, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
365 | _("Allow"), G_CALLBACK(enable_msn_pages_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
366 | _("Disallow"), G_CALLBACK(disable_msn_pages_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
367 | _("Cancel"), NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
368 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
369 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
370 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
371 | msn_show_hotmail_inbox(PurplePluginAction *action) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
372 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
373 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
374 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
375 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
376 | gc = (PurpleConnection *) action->context; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
377 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
378 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
379 | if (session->passport_info.file == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
380 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
381 | purple_notify_error(gc, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
382 | _("This Hotmail account may not be active."), NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
383 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
384 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
385 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
386 | purple_notify_uri(gc, session->passport_info.file); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
387 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
388 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
389 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
390 | show_send_to_mobile_cb(PurpleBlistNode *node, gpointer ignored) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
391 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
392 | PurpleBuddy *buddy; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
393 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
394 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
395 | MsnMobileData *data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
396 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
397 | g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
398 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
399 | buddy = (PurpleBuddy *) node; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
400 | gc = purple_account_get_connection(buddy->account); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
401 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
402 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
403 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
404 | data = g_new0(MsnMobileData, 1); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
405 | data->gc = gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
406 | data->passport = buddy->name; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
407 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
408 | purple_request_input(gc, NULL, _("Send a mobile message."), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
409 | NULL, TRUE, FALSE, NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
410 | _("Page"), G_CALLBACK(send_to_mobile_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
411 | _("Close"), G_CALLBACK(close_mobile_page_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
412 | purple_connection_get_account(gc), purple_buddy_get_name(buddy), NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
413 | data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
414 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
415 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
416 | static gboolean |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
417 | msn_offline_message(const PurpleBuddy *buddy) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
418 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
419 | if (buddy == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
420 | return FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
421 | user = buddy->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
422 | return user && user->mobile; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
423 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
424 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
425 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
426 | initiate_chat_cb(PurpleBlistNode *node, gpointer data) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
427 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
428 | PurpleBuddy *buddy; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
429 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
430 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
431 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
432 | MsnSwitchBoard *swboard; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
433 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
434 | g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
435 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
436 | buddy = (PurpleBuddy *) node; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
437 | gc = purple_account_get_connection(buddy->account); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
438 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
439 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
440 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
441 | swboard = msn_switchboard_new(session); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
442 | msn_switchboard_request(swboard); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
443 | msn_switchboard_request_add_user(swboard, buddy->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
444 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
445 | /* TODO: This might move somewhere else, after USR might be */ |
|
22164
2307c0c05225
Use a unique chat id across all sessions for multi-user chats, probably
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21720
diff
changeset
|
446 | swboard->chat_id = msn_switchboard_get_chat_id(); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
447 | swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
448 | swboard->flag = MSN_SB_FLAG_IM; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
449 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
450 | purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
451 | purple_account_get_username(buddy->account), NULL, PURPLE_CBFLAGS_NONE, TRUE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
452 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
453 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
454 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
455 | t_msn_xfer_init(PurpleXfer *xfer) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
456 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
457 | MsnSlpLink *slplink = xfer->data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
458 | msn_slplink_request_ft(slplink, xfer); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
459 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
460 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
461 | static PurpleXfer* |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
462 | msn_new_xfer(PurpleConnection *gc, const char *who) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
463 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
464 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
465 | MsnSlpLink *slplink; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
466 | PurpleXfer *xfer; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
467 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
468 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
469 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
470 | xfer = purple_xfer_new(gc->account, PURPLE_XFER_SEND, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
471 | if (xfer) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
472 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
473 | slplink = msn_session_get_slplink(session, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
474 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
475 | xfer->data = slplink; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
476 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
477 | purple_xfer_set_init_fnc(xfer, t_msn_xfer_init); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
478 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
479 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
480 | return xfer; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
481 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
482 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
483 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
484 | msn_send_file(PurpleConnection *gc, const char *who, const char *file) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
485 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
486 | PurpleXfer *xfer = msn_new_xfer(gc, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
487 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
488 | if (file) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
489 | purple_xfer_request_accepted(xfer, file); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
490 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
491 | purple_xfer_request(xfer); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
492 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
493 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
494 | static gboolean |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
495 | msn_can_receive_file(PurpleConnection *gc, const char *who) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
496 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
497 | PurpleAccount *account; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
498 | char *normal; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
499 | gboolean ret; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
500 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
501 | account = purple_connection_get_account(gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
502 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
503 | normal = g_strdup(msn_normalize(account, purple_account_get_username(account))); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
504 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
505 | ret = strcmp(normal, msn_normalize(account, who)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
506 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
507 | g_free(normal); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
508 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
509 | return ret; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
510 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
511 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
512 | /************************************************************************** |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
513 | * Protocol Plugin ops |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
514 | **************************************************************************/ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
515 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
516 | static const char * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
517 | msn_list_icon(PurpleAccount *a, PurpleBuddy *b) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
518 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
519 | return "msn"; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
520 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
521 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
522 | static char * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
523 | msn_status_text(PurpleBuddy *buddy) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
524 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
525 | PurplePresence *presence; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
526 | PurpleStatus *status; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
527 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
528 | presence = purple_buddy_get_presence(buddy); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
529 | status = purple_presence_get_active_status(presence); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
530 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
531 | if (!purple_presence_is_available(presence) && !purple_presence_is_idle(presence)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
532 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
533 | return g_strdup(purple_status_get_name(status)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
534 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
535 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
536 | return NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
537 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
538 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
539 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
540 | msn_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
541 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
542 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
543 | PurplePresence *presence = purple_buddy_get_presence(buddy); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
544 | PurpleStatus *status = purple_presence_get_active_status(presence); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
545 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
546 | user = buddy->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
547 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
548 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
549 | if (purple_presence_is_online(presence)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
550 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
551 | purple_notify_user_info_add_pair(user_info, _("Status"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
552 | (purple_presence_is_idle(presence) ? _("Idle") : purple_status_get_name(status))); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
553 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
554 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
555 | if (full && user) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
556 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
557 | purple_notify_user_info_add_pair(user_info, _("Has you"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
558 | ((user->list_op & (1 << MSN_LIST_RL)) ? _("Yes") : _("No"))); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
559 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
560 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
561 | /* XXX: This is being shown in non-full tooltips because the |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
562 | * XXX: blocked icon overlay isn't always accurate for MSN. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
563 | * XXX: This can die as soon as purple_privacy_check() knows that |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
564 | * XXX: this prpl always honors both the allow and deny lists. */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
565 | /* While the above comment may be strictly correct (the privacy API needs |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
566 | * rewriteing), purple_privacy_check() is going to be more accurate at |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
567 | * indicating whether a particular buddy is going to be able to message |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
568 | * you, which is the important information that this is trying to convey. */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
569 | if (full && user) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
570 | { |
|
22387
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
571 | const char *phone; |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
572 | |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
573 | purple_notify_user_info_add_pair(user_info, _("Blocked"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
574 | ((user->list_op & (1 << MSN_LIST_BL)) ? _("Yes") : _("No"))); |
|
22387
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
575 | |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
576 | phone = msn_user_get_home_phone(user); |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
577 | if (phone != NULL) |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
578 | purple_notify_user_info_add_pair(user_info, _("Home Phone Number"), phone); |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
579 | |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
580 | phone = msn_user_get_work_phone(user); |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
581 | if (phone != NULL) |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
582 | purple_notify_user_info_add_pair(user_info, _("Work Phone Number"), phone); |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
583 | |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
584 | phone = msn_user_get_mobile_phone(user); |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
585 | if (phone != NULL) |
|
47aab6e7eae8
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22351
diff
changeset
|
586 | purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), phone); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
587 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
588 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
589 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
590 | static GList * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
591 | msn_status_types(PurpleAccount *account) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
592 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
593 | PurpleStatusType *status; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
594 | GList *types = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
595 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
596 | status = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
597 | NULL, NULL, FALSE, TRUE, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
598 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
599 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
600 | status = purple_status_type_new_full(PURPLE_STATUS_AWAY, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
601 | NULL, NULL, FALSE, TRUE, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
602 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
603 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
604 | status = purple_status_type_new_full(PURPLE_STATUS_AWAY, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
605 | "brb", _("Be Right Back"), FALSE, TRUE, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
606 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
607 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
608 | status = purple_status_type_new_full(PURPLE_STATUS_UNAVAILABLE, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
609 | "busy", _("Busy"), FALSE, TRUE, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
610 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
611 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
612 | status = purple_status_type_new_full(PURPLE_STATUS_UNAVAILABLE, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
613 | "phone", _("On the Phone"), FALSE, TRUE, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
614 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
615 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
616 | status = purple_status_type_new_full(PURPLE_STATUS_AWAY, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
617 | "lunch", _("Out to Lunch"), FALSE, TRUE, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
618 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
619 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
620 | status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
621 | NULL, NULL, FALSE, TRUE, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
622 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
623 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
624 | status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
625 | NULL, NULL, FALSE, TRUE, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
626 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
627 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
628 | status = purple_status_type_new_full(PURPLE_STATUS_MOBILE, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
629 | "mobile", NULL, FALSE, FALSE, TRUE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
630 | types = g_list_append(types, status); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
631 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
632 | return types; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
633 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
634 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
635 | static GList * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
636 | msn_actions(PurplePlugin *plugin, gpointer context) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
637 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
638 | PurpleConnection *gc = (PurpleConnection *)context; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
639 | PurpleAccount *account; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
640 | const char *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
641 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
642 | GList *m = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
643 | PurplePluginAction *act; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
644 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
645 | act = purple_plugin_action_new(_("Set Friendly Name..."), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
646 | msn_show_set_friendly_name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
647 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
648 | m = g_list_append(m, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
649 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
650 | act = purple_plugin_action_new(_("Set Home Phone Number..."), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
651 | msn_show_set_home_phone); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
652 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
653 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
654 | act = purple_plugin_action_new(_("Set Work Phone Number..."), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
655 | msn_show_set_work_phone); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
656 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
657 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
658 | act = purple_plugin_action_new(_("Set Mobile Phone Number..."), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
659 | msn_show_set_mobile_phone); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
660 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
661 | m = g_list_append(m, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
662 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
663 | #if 0 |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
664 | act = purple_plugin_action_new(_("Enable/Disable Mobile Devices..."), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
665 | msn_show_set_mobile_support); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
666 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
667 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
668 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
669 | act = purple_plugin_action_new(_("Allow/Disallow Mobile Pages..."), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
670 | msn_show_set_mobile_pages); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
671 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
672 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
673 | account = purple_connection_get_account(gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
674 | user = msn_normalize(account, purple_account_get_username(account)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
675 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
676 | if ((strstr(user, "@hotmail.") != NULL) || |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
677 | (strstr(user, "@msn.com") != NULL)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
678 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
679 | m = g_list_append(m, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
680 | act = purple_plugin_action_new(_("Open Hotmail Inbox"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
681 | msn_show_hotmail_inbox); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
682 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
683 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
684 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
685 | return m; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
686 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
687 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
688 | static GList * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
689 | msn_buddy_menu(PurpleBuddy *buddy) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
690 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
691 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
692 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
693 | GList *m = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
694 | PurpleMenuAction *act; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
695 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
696 | g_return_val_if_fail(buddy != NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
697 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
698 | user = buddy->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
699 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
700 | if (user != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
701 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
702 | if (user->mobile) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
703 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
704 | act = purple_menu_action_new(_("Send to Mobile"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
705 | PURPLE_CALLBACK(show_send_to_mobile_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
706 | NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
707 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
708 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
709 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
710 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
711 | if (g_ascii_strcasecmp(buddy->name, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
712 | purple_account_get_username(buddy->account))) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
713 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
714 | act = purple_menu_action_new(_("Initiate _Chat"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
715 | PURPLE_CALLBACK(initiate_chat_cb), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
716 | NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
717 | m = g_list_append(m, act); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
718 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
719 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
720 | return m; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
721 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
722 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
723 | static GList * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
724 | msn_blist_node_menu(PurpleBlistNode *node) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
725 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
726 | if(PURPLE_BLIST_NODE_IS_BUDDY(node)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
727 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
728 | return msn_buddy_menu((PurpleBuddy *) node); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
729 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
730 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
731 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
732 | return NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
733 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
734 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
735 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
736 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
737 | msn_login(PurpleAccount *account) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
738 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
739 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
740 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
741 | const char *username; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
742 | const char *host; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
743 | gboolean http_method = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
744 | int port; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
745 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
746 | gc = purple_account_get_connection(account); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
747 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
748 | if (!purple_ssl_is_supported()) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
749 | { |
|
21513
02642f4cb3df
Switch to purple_connection_error_reason in msnp9, and a few places I missed in
Will Thompson <resiak@pidgin.im>
parents:
21481
diff
changeset
|
750 | purple_connection_error_reason(gc, |
|
02642f4cb3df
Switch to purple_connection_error_reason in msnp9, and a few places I missed in
Will Thompson <resiak@pidgin.im>
parents:
21481
diff
changeset
|
751 | PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, |
|
02642f4cb3df
Switch to purple_connection_error_reason in msnp9, and a few places I missed in
Will Thompson <resiak@pidgin.im>
parents:
21481
diff
changeset
|
752 | |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
753 | _("SSL support is needed for MSN. Please install a supported " |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
754 | "SSL library.")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
755 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
756 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
757 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
758 | http_method = purple_account_get_bool(account, "http_method", FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
759 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
760 | if (http_method) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
761 | host = purple_account_get_string(account, "http_method_server", MSN_HTTPCONN_SERVER); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
762 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
763 | host = purple_account_get_string(account, "server", MSN_SERVER); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
764 | port = purple_account_get_int(account, "port", MSN_PORT); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
765 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
766 | session = msn_session_new(account); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
767 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
768 | gc->proto_data = session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
769 | gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
770 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
771 | msn_session_set_login_step(session, MSN_LOGIN_STEP_START); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
772 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
773 | /* Hmm, I don't like this. */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
774 | /* XXX shx: Me neither */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
775 | username = msn_normalize(account, purple_account_get_username(account)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
776 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
777 | if (strcmp(username, purple_account_get_username(account))) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
778 | purple_account_set_username(account, username); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
779 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
780 | if (!msn_session_connect(session, host, port, http_method)) |
|
21513
02642f4cb3df
Switch to purple_connection_error_reason in msnp9, and a few places I missed in
Will Thompson <resiak@pidgin.im>
parents:
21481
diff
changeset
|
781 | purple_connection_error_reason(gc, |
|
02642f4cb3df
Switch to purple_connection_error_reason in msnp9, and a few places I missed in
Will Thompson <resiak@pidgin.im>
parents:
21481
diff
changeset
|
782 | PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
02642f4cb3df
Switch to purple_connection_error_reason in msnp9, and a few places I missed in
Will Thompson <resiak@pidgin.im>
parents:
21481
diff
changeset
|
783 | _("Failed to connect to server.")); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
784 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
785 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
786 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
787 | msn_close(PurpleConnection *gc) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
788 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
789 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
790 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
791 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
792 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
793 | g_return_if_fail(session != NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
794 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
795 | msn_session_destroy(session); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
796 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
797 | gc->proto_data = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
798 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
799 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
800 | static gboolean |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
801 | msn_send_me_im(gpointer data) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
802 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
803 | MsnIMData *imdata = data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
804 | serv_got_im(imdata->gc, imdata->who, imdata->msg, imdata->flags, imdata->when); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
805 | g_free(imdata->msg); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
806 | g_free(imdata); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
807 | return FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
808 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
809 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
810 | static int |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
811 | msn_send_im(PurpleConnection *gc, const char *who, const char *message, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
812 | PurpleMessageFlags flags) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
813 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
814 | PurpleAccount *account; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
815 | PurpleBuddy *buddy = purple_find_buddy(gc->account, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
816 | MsnMessage *msg; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
817 | char *msgformat; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
818 | char *msgtext; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
819 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
820 | account = purple_connection_get_account(gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
821 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
822 | if (buddy) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
823 | PurplePresence *p = purple_buddy_get_presence(buddy); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
824 | if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
825 | char *text = purple_markup_strip_html(message); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
826 | send_to_mobile(gc, who, text); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
827 | g_free(text); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
828 | return 1; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
829 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
830 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
831 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
832 | msn_import_html(message, &msgformat, &msgtext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
833 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
834 | if (strlen(msgtext) + strlen(msgformat) + strlen(DISPLAY_VERSION) > 1564) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
835 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
836 | g_free(msgformat); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
837 | g_free(msgtext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
838 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
839 | return -E2BIG; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
840 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
841 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
842 | msg = msn_message_new_plain(msgtext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
843 | msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
844 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
845 | g_free(msgformat); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
846 | g_free(msgtext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
847 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
848 | if (g_ascii_strcasecmp(who, purple_account_get_username(account))) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
849 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
850 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
851 | MsnSwitchBoard *swboard; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
852 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
853 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
854 | swboard = msn_session_get_swboard(session, who, MSN_SB_FLAG_IM); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
855 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
856 | msn_switchboard_send_msg(swboard, msg, TRUE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
857 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
858 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
859 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
860 | char *body_str, *body_enc, *pre, *post; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
861 | const char *format; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
862 | MsnIMData *imdata = g_new0(MsnIMData, 1); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
863 | /* |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
864 | * In MSN, you can't send messages to yourself, so |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
865 | * we'll fake like we received it ;) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
866 | */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
867 | body_str = msn_message_to_string(msg); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
868 | body_enc = g_markup_escape_text(body_str, -1); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
869 | g_free(body_str); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
870 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
871 | format = msn_message_get_attr(msg, "X-MMS-IM-Format"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
872 | msn_parse_format(format, &pre, &post); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
873 | body_str = g_strdup_printf("%s%s%s", pre ? pre : "", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
874 | body_enc ? body_enc : "", post ? post : ""); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
875 | g_free(body_enc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
876 | g_free(pre); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
877 | g_free(post); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
878 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
879 | serv_got_typing_stopped(gc, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
880 | imdata->gc = gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
881 | imdata->who = who; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
882 | imdata->msg = body_str; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
883 | imdata->flags = flags; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
884 | imdata->when = time(NULL); |
|
22351
6ca0640b3d31
Change some g_idle_add(...) calls in libpurple to purple_timeout_add(0, ...)
Mark Doliner <markdoliner@pidgin.im>
parents:
22268
diff
changeset
|
885 | purple_timeout_add(0, msn_send_me_im, imdata); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
886 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
887 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
888 | msn_message_destroy(msg); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
889 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
890 | return 1; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
891 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
892 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
893 | static unsigned int |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
894 | msn_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
895 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
896 | PurpleAccount *account; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
897 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
898 | MsnSwitchBoard *swboard; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
899 | MsnMessage *msg; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
900 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
901 | account = purple_connection_get_account(gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
902 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
903 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
904 | /* |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
905 | * TODO: I feel like this should be "if (state != PURPLE_TYPING)" |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
906 | * but this is how it was before, and I don't want to break |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
907 | * anything. --KingAnt |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
908 | */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
909 | if (state == PURPLE_NOT_TYPING) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
910 | return 0; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
911 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
912 | if (!g_ascii_strcasecmp(who, purple_account_get_username(account))) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
913 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
914 | /* We'll just fake it, since we're sending to ourself. */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
915 | serv_got_typing(gc, who, MSN_TYPING_RECV_TIMEOUT, PURPLE_TYPING); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
916 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
917 | return MSN_TYPING_SEND_TIMEOUT; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
918 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
919 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
920 | swboard = msn_session_find_swboard(session, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
921 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
922 | if (swboard == NULL || !msn_switchboard_can_send(swboard)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
923 | return 0; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
924 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
925 | swboard->flag |= MSN_SB_FLAG_IM; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
926 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
927 | msg = msn_message_new(MSN_MSG_TYPING); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
928 | msn_message_set_content_type(msg, "text/x-msmsgscontrol"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
929 | msn_message_set_flag(msg, 'U'); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
930 | msn_message_set_attr(msg, "TypingUser", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
931 | purple_account_get_username(account)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
932 | msn_message_set_bin_data(msg, "\r\n", 2); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
933 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
934 | msn_switchboard_send_msg(swboard, msg, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
935 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
936 | msn_message_destroy(msg); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
937 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
938 | return MSN_TYPING_SEND_TIMEOUT; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
939 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
940 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
941 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
942 | msn_set_status(PurpleAccount *account, PurpleStatus *status) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
943 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
944 | PurpleConnection *gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
945 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
946 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
947 | gc = purple_account_get_connection(account); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
948 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
949 | if (gc != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
950 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
951 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
952 | msn_change_status(session); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
953 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
954 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
955 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
956 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
957 | msn_set_idle(PurpleConnection *gc, int idle) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
958 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
959 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
960 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
961 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
962 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
963 | msn_change_status(session); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
964 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
965 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
966 | #if 0 |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
967 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
968 | fake_userlist_add_buddy(MsnUserList *userlist, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
969 | const char *who, int list_id, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
970 | const char *group_name) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
971 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
972 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
973 | static int group_id_c = 1; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
974 | int group_id; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
975 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
976 | group_id = -1; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
977 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
978 | if (group_name != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
979 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
980 | MsnGroup *group; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
981 | group = msn_group_new(userlist, group_id_c, group_name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
982 | group_id = group_id_c++; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
983 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
984 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
985 | user = msn_userlist_find_user(userlist, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
986 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
987 | if (user == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
988 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
989 | user = msn_user_new(userlist, who, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
990 | msn_userlist_add_user(userlist, user); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
991 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
992 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
993 | if (user->list_op & (1 << list_id)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
994 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
995 | if (list_id == MSN_LIST_FL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
996 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
997 | if (group_id >= 0) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
998 | if (g_list_find(user->group_ids, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
999 | GINT_TO_POINTER(group_id))) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1000 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1001 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1002 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1003 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1004 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1005 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1006 | if (group_id >= 0) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1007 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1008 | user->group_ids = g_list_append(user->group_ids, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1009 | GINT_TO_POINTER(group_id)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1010 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1011 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1012 | user->list_op |= (1 << list_id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1013 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1014 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1015 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1016 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1017 | msn_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1018 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1019 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1020 | MsnUserList *userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1021 | const char *who; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1022 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1023 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1024 | userlist = session->userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1025 | who = msn_normalize(gc->account, buddy->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1026 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1027 | if (!session->logged_in) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1028 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1029 | #if 0 |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1030 | fake_userlist_add_buddy(session->sync_userlist, who, MSN_LIST_FL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1031 | group ? group->name : NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1032 | #else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1033 | purple_debug_error("msn", "msn_add_buddy called before connected\n"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1034 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1035 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1036 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1037 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1038 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1039 | #if 0 |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1040 | if (group != NULL && group->name != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1041 | purple_debug_info("msn", "msn_add_buddy: %s, %s\n", who, group->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1042 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1043 | purple_debug_info("msn", "msn_add_buddy: %s\n", who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1044 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1045 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1046 | #if 0 |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1047 | /* Which is the max? */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1048 | if (session->fl_users_count >= 150) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1049 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1050 | purple_debug_info("msn", "Too many buddies\n"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1051 | /* Buddy list full */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1052 | /* TODO: purple should be notified of this */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1053 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1054 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1055 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1056 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1057 | /* XXX - Would group ever be NULL here? I don't think so... |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1058 | * shx: Yes it should; MSN handles non-grouped buddies, and this is only |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1059 | * internal. */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1060 | msn_userlist_add_buddy(userlist, who, MSN_LIST_FL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1061 | group ? group->name : NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1062 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1063 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1064 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1065 | msn_rem_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1066 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1067 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1068 | MsnUserList *userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1069 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1070 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1071 | userlist = session->userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1072 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1073 | if (!session->logged_in) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1074 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1075 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1076 | /* XXX - Does buddy->name need to be msn_normalize'd here? --KingAnt */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1077 | msn_userlist_rem_buddy(userlist, buddy->name, MSN_LIST_FL, group->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1078 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1079 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1080 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1081 | msn_add_permit(PurpleConnection *gc, const char *who) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1082 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1083 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1084 | MsnUserList *userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1085 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1086 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1087 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1088 | userlist = session->userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1089 | user = msn_userlist_find_user(userlist, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1090 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1091 | if (!session->logged_in) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1092 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1093 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1094 | if (user != NULL && user->list_op & MSN_LIST_BL_OP) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1095 | msn_userlist_rem_buddy(userlist, who, MSN_LIST_BL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1096 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1097 | msn_userlist_add_buddy(userlist, who, MSN_LIST_AL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1098 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1099 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1100 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1101 | msn_add_deny(PurpleConnection *gc, const char *who) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1102 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1103 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1104 | MsnUserList *userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1105 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1106 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1107 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1108 | userlist = session->userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1109 | user = msn_userlist_find_user(userlist, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1110 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1111 | if (!session->logged_in) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1112 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1113 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1114 | if (user != NULL && user->list_op & MSN_LIST_AL_OP) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1115 | msn_userlist_rem_buddy(userlist, who, MSN_LIST_AL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1116 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1117 | msn_userlist_add_buddy(userlist, who, MSN_LIST_BL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1118 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1119 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1120 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1121 | msn_rem_permit(PurpleConnection *gc, const char *who) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1122 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1123 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1124 | MsnUserList *userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1125 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1126 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1127 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1128 | userlist = session->userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1129 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1130 | if (!session->logged_in) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1131 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1132 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1133 | user = msn_userlist_find_user(userlist, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1134 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1135 | msn_userlist_rem_buddy(userlist, who, MSN_LIST_AL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1136 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1137 | if (user != NULL && user->list_op & MSN_LIST_RL_OP) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1138 | msn_userlist_add_buddy(userlist, who, MSN_LIST_BL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1139 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1140 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1141 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1142 | msn_rem_deny(PurpleConnection *gc, const char *who) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1143 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1144 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1145 | MsnUserList *userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1146 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1147 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1148 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1149 | userlist = session->userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1150 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1151 | if (!session->logged_in) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1152 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1153 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1154 | user = msn_userlist_find_user(userlist, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1155 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1156 | msn_userlist_rem_buddy(userlist, who, MSN_LIST_BL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1157 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1158 | if (user != NULL && user->list_op & MSN_LIST_RL_OP) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1159 | msn_userlist_add_buddy(userlist, who, MSN_LIST_AL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1160 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1161 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1162 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1163 | msn_set_permit_deny(PurpleConnection *gc) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1164 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1165 | PurpleAccount *account; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1166 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1167 | MsnCmdProc *cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1168 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1169 | account = purple_connection_get_account(gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1170 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1171 | cmdproc = session->notification->cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1172 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1173 | if (account->perm_deny == PURPLE_PRIVACY_ALLOW_ALL || |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1174 | account->perm_deny == PURPLE_PRIVACY_DENY_USERS) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1175 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1176 | msn_cmdproc_send(cmdproc, "BLP", "%s", "AL"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1177 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1178 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1179 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1180 | msn_cmdproc_send(cmdproc, "BLP", "%s", "BL"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1181 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1182 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1183 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1184 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1185 | msn_chat_invite(PurpleConnection *gc, int id, const char *msg, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1186 | const char *who) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1187 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1188 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1189 | MsnSwitchBoard *swboard; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1190 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1191 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1192 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1193 | swboard = msn_session_find_swboard_with_id(session, id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1194 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1195 | if (swboard == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1196 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1197 | /* if we have no switchboard, everyone else left the chat already */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1198 | swboard = msn_switchboard_new(session); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1199 | msn_switchboard_request(swboard); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1200 | swboard->chat_id = id; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1201 | swboard->conv = purple_find_chat(gc, id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1202 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1203 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1204 | swboard->flag |= MSN_SB_FLAG_IM; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1205 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1206 | msn_switchboard_request_add_user(swboard, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1207 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1208 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1209 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1210 | msn_chat_leave(PurpleConnection *gc, int id) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1211 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1212 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1213 | MsnSwitchBoard *swboard; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1214 | PurpleConversation *conv; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1215 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1216 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1217 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1218 | swboard = msn_session_find_swboard_with_id(session, id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1219 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1220 | /* if swboard is NULL we were the only person left anyway */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1221 | if (swboard == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1222 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1223 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1224 | conv = swboard->conv; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1225 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1226 | msn_switchboard_release(swboard, MSN_SB_FLAG_IM); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1227 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1228 | /* If other switchboards managed to associate themselves with this |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1229 | * conv, make sure they know it's gone! */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1230 | if (conv != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1231 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1232 | while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1233 | swboard->conv = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1234 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1235 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1236 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1237 | static int |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1238 | msn_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1239 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1240 | PurpleAccount *account; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1241 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1242 | MsnSwitchBoard *swboard; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1243 | MsnMessage *msg; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1244 | char *msgformat; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1245 | char *msgtext; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1246 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1247 | account = purple_connection_get_account(gc); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1248 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1249 | swboard = msn_session_find_swboard_with_id(session, id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1250 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1251 | if (swboard == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1252 | return -EINVAL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1253 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1254 | if (!swboard->ready) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1255 | return 0; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1256 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1257 | swboard->flag |= MSN_SB_FLAG_IM; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1258 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1259 | msn_import_html(message, &msgformat, &msgtext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1260 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1261 | if (strlen(msgtext) + strlen(msgformat) + strlen(DISPLAY_VERSION) > 1564) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1262 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1263 | g_free(msgformat); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1264 | g_free(msgtext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1265 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1266 | return -E2BIG; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1267 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1268 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1269 | msg = msn_message_new_plain(msgtext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1270 | msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1271 | msn_switchboard_send_msg(swboard, msg, FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1272 | msn_message_destroy(msg); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1273 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1274 | g_free(msgformat); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1275 | g_free(msgtext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1276 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1277 | serv_got_chat_in(gc, id, purple_account_get_username(account), 0, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1278 | message, time(NULL)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1279 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1280 | return 0; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1281 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1282 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1283 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1284 | msn_keepalive(PurpleConnection *gc) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1285 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1286 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1287 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1288 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1289 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1290 | if (!session->http_method) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1291 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1292 | MsnCmdProc *cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1293 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1294 | cmdproc = session->notification->cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1295 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1296 | msn_cmdproc_send_quick(cmdproc, "PNG", NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1297 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1298 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1299 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1300 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1301 | msn_group_buddy(PurpleConnection *gc, const char *who, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1302 | const char *old_group_name, const char *new_group_name) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1303 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1304 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1305 | MsnUserList *userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1306 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1307 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1308 | userlist = session->userlist; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1309 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1310 | msn_userlist_move_buddy(userlist, who, old_group_name, new_group_name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1311 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1312 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1313 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1314 | msn_rename_group(PurpleConnection *gc, const char *old_name, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1315 | PurpleGroup *group, GList *moved_buddies) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1316 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1317 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1318 | MsnCmdProc *cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1319 | int old_gid; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1320 | const char *enc_new_group_name; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1321 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1322 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1323 | cmdproc = session->notification->cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1324 | enc_new_group_name = purple_url_encode(group->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1325 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1326 | old_gid = msn_userlist_find_group_id(session->userlist, old_name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1327 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1328 | if (old_gid >= 0) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1329 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1330 | msn_cmdproc_send(cmdproc, "REG", "%d %s 0", old_gid, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1331 | enc_new_group_name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1332 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1333 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1334 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1335 | msn_cmdproc_send(cmdproc, "ADG", "%s 0", enc_new_group_name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1336 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1337 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1338 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1339 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1340 | msn_convo_closed(PurpleConnection *gc, const char *who) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1341 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1342 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1343 | MsnSwitchBoard *swboard; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1344 | PurpleConversation *conv; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1345 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1346 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1347 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1348 | swboard = msn_session_find_swboard(session, who); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1349 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1350 | /* |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1351 | * Don't perform an assertion here. If swboard is NULL, then the |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1352 | * switchboard was either closed by the other party, or the person |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1353 | * is talking to himself. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1354 | */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1355 | if (swboard == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1356 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1357 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1358 | conv = swboard->conv; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1359 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1360 | /* If we release the switchboard here, it may still have messages |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1361 | pending ACK which would result in incorrect unsent message errors. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1362 | Just let it timeout... This is *so* going to screw with people who |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1363 | use dumb clients that report "User has closed the conversation window" */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1364 | /* msn_switchboard_release(swboard, MSN_SB_FLAG_IM); */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1365 | swboard->conv = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1366 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1367 | /* If other switchboards managed to associate themselves with this |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1368 | * conv, make sure they know it's gone! */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1369 | if (conv != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1370 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1371 | while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1372 | swboard->conv = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1373 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1374 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1375 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1376 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1377 | msn_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1378 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1379 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1380 | MsnUser *user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1381 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1382 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1383 | user = session->user; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1384 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1385 | msn_user_set_buddy_icon(user, img); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1386 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1387 | msn_change_status(session); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1388 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1389 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1390 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1391 | msn_remove_group(PurpleConnection *gc, PurpleGroup *group) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1392 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1393 | MsnSession *session; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1394 | MsnCmdProc *cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1395 | int group_id; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1396 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1397 | session = gc->proto_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1398 | cmdproc = session->notification->cmdproc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1399 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1400 | if ((group_id = msn_userlist_find_group_id(session->userlist, group->name)) >= 0) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1401 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1402 | msn_cmdproc_send(cmdproc, "RMG", "%d", group_id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1403 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1404 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1405 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1406 | /** |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1407 | * Extract info text from info_data and add it to user_info |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1408 | */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1409 | static gboolean |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1410 | msn_tooltip_extract_info_text(PurpleNotifyUserInfo *user_info, MsnGetInfoData *info_data) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1411 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1412 | PurpleBuddy *b; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1413 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1414 | b = purple_find_buddy(purple_connection_get_account(info_data->gc), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1415 | info_data->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1416 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1417 | if (b) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1418 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1419 | char *tmp; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1420 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1421 | if (b->alias && b->alias[0]) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1422 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1423 | char *aliastext = g_markup_escape_text(b->alias, -1); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1424 | purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1425 | g_free(aliastext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1426 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1427 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1428 | if (b->server_alias) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1429 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1430 | char *nicktext = g_markup_escape_text(b->server_alias, -1); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1431 | tmp = g_strdup_printf("<font sml=\"msn\">%s</font><br>", nicktext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1432 | purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1433 | g_free(tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1434 | g_free(nicktext); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1435 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1436 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1437 | /* Add the tooltip information */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1438 | msn_tooltip_text(b, user_info, TRUE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1439 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1440 | return TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1441 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1442 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1443 | return FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1444 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1445 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1446 | #if PHOTO_SUPPORT |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1447 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1448 | static char * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1449 | msn_get_photo_url(const char *url_text) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1450 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1451 | char *p, *q; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1452 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1453 | if ((p = strstr(url_text, " contactparams:photopreauthurl=\"")) != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1454 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1455 | p += strlen(" contactparams:photopreauthurl=\""); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1456 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1457 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1458 | if (p && (strncmp(p, "http://", 8) == 0) && ((q = strchr(p, '"')) != NULL)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1459 | return g_strndup(p, q - p); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1460 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1461 | return NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1462 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1463 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1464 | static void msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer data, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1465 | const gchar *url_text, size_t len, const gchar *error_message); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1466 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1467 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1468 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1469 | #if 0 |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1470 | static char *msn_info_date_reformat(const char *field, size_t len) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1471 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1472 | char *tmp = g_strndup(field, len); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1473 | time_t t = purple_str_to_time(tmp, FALSE, NULL, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1474 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1475 | g_free(tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1476 | return g_strdup(purple_date_format_short(localtime(&t))); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1477 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1478 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1479 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1480 | #define MSN_GOT_INFO_GET_FIELD(a, b) \ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1481 | found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1482 | "\n" a ":", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1483 | if (found) \ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1484 | sect_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1485 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1486 | #define MSN_GOT_INFO_GET_FIELD_NO_SEARCH(a, b) \ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1487 | found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1488 | "\n" a ":", 0, "\n", 0, "Undisclosed", b, 0, NULL, msn_info_strip_search_link); \ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1489 | if (found) \ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1490 | sect_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1491 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1492 | static char * |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1493 | msn_info_strip_search_link(const char *field, size_t len) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1494 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1495 | const char *c; |
|
22581
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1496 | if ((c = strstr(field, " (http://")) == NULL) |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1497 | return g_strndup(field, len); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1498 | return g_strndup(field, c - field); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1499 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1500 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1501 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1502 | msn_got_info(PurpleUtilFetchUrlData *url_data, gpointer data, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1503 | const gchar *url_text, size_t len, const gchar *error_message) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1504 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1505 | MsnGetInfoData *info_data = (MsnGetInfoData *)data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1506 | PurpleNotifyUserInfo *user_info; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1507 | char *stripped, *p, *q, *tmp; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1508 | char *user_url = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1509 | gboolean found; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1510 | gboolean has_tooltip_text = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1511 | gboolean has_info = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1512 | gboolean sect_info = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1513 | gboolean has_contact_info = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1514 | char *url_buffer; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1515 | int stripped_len; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1516 | #if PHOTO_SUPPORT |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1517 | char *photo_url_text = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1518 | MsnGetInfoStepTwoData *info2_data = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1519 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1520 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1521 | purple_debug_info("msn", "In msn_got_info\n"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1522 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1523 | /* Make sure the connection is still valid */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1524 | if (g_list_find(purple_connections_get_all(), info_data->gc) == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1525 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1526 | purple_debug_warning("msn", "invalid connection. ignoring buddy info.\n"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1527 | g_free(info_data->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1528 | g_free(info_data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1529 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1530 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1531 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1532 | user_info = purple_notify_user_info_new(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1533 | has_tooltip_text = msn_tooltip_extract_info_text(user_info, info_data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1534 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1535 | if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1536 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1537 | tmp = g_strdup_printf("<b>%s</b>", _("Error retrieving profile")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1538 | purple_notify_user_info_add_pair(user_info, NULL, tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1539 | g_free(tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1540 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1541 | purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1542 | purple_notify_user_info_destroy(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1543 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1544 | g_free(info_data->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1545 | g_free(info_data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1546 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1547 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1548 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1549 | url_buffer = g_strdup(url_text); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1550 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1551 | /* If they have a homepage link, MSN masks it such that we need to |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1552 | * fetch the url out before purple_markup_strip_html() nukes it */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1553 | /* I don't think this works with the new spaces profiles - Stu 3/2/06 */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1554 | if ((p = strstr(url_text, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1555 | "Take a look at my </font><A class=viewDesc title=\"")) != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1556 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1557 | p += 50; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1558 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1559 | if ((q = strchr(p, '"')) != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1560 | user_url = g_strndup(p, q - p); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1561 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1562 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1563 | /* |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1564 | * purple_markup_strip_html() doesn't strip out character entities like |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1565 | * and · |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1566 | */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1567 | while ((p = strstr(url_buffer, " ")) != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1568 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1569 | *p = ' '; /* Turn 's into ordinary blanks */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1570 | p += 1; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1571 | memmove(p, p + 5, strlen(p + 5)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1572 | url_buffer[strlen(url_buffer) - 5] = '\0'; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1573 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1574 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1575 | while ((p = strstr(url_buffer, "·")) != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1576 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1577 | memmove(p, p + 6, strlen(p + 6)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1578 | url_buffer[strlen(url_buffer) - 6] = '\0'; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1579 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1580 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1581 | /* Nuke the nasty \r's that just get in the way */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1582 | purple_str_strip_char(url_buffer, '\r'); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1583 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1584 | /* MSN always puts in ' for apostrophes...replace them */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1585 | while ((p = strstr(url_buffer, "'")) != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1586 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1587 | *p = '\''; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1588 | memmove(p + 1, p + 5, strlen(p + 5)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1589 | url_buffer[strlen(url_buffer) - 4] = '\0'; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1590 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1591 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1592 | /* Nuke the html, it's easier than trying to parse the horrid stuff */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1593 | stripped = purple_markup_strip_html(url_buffer); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1594 | stripped_len = strlen(stripped); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1595 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1596 | purple_debug_misc("msn", "stripped = %p\n", stripped); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1597 | purple_debug_misc("msn", "url_buffer = %p\n", url_buffer); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1598 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1599 | /* General section header */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1600 | if (has_tooltip_text) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1601 | purple_notify_user_info_add_section_break(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1602 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1603 | purple_notify_user_info_add_section_header(user_info, _("General")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1604 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1605 | /* Extract their Name and put it in */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1606 | MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1607 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1608 | /* General */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1609 | MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1610 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Age", _("Age")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1611 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Gender", _("Gender")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1612 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Occupation", _("Occupation")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1613 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Location", _("Location")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1614 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1615 | /* Extract their Interests and put it in */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1616 | found = purple_markup_extract_info_field(stripped, stripped_len, user_info, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1617 | "\nInterests\t", 0, " (/default.aspx?page=searchresults", 0, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1618 | "Undisclosed", _("Hobbies and Interests") /* _("Interests") */, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1619 | 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1620 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1621 | if (found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1622 | sect_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1623 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1624 | MSN_GOT_INFO_GET_FIELD("More about me", _("A Little About Me")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1625 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1626 | if (sect_info) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1627 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1628 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1629 | sect_info = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1630 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1631 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1632 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1633 | /* Remove the section header */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1634 | purple_notify_user_info_remove_last_item(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1635 | if (has_tooltip_text) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1636 | purple_notify_user_info_remove_last_item(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1637 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1638 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1639 | /* Social */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1640 | purple_notify_user_info_add_section_break(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1641 | purple_notify_user_info_add_section_header(user_info, _("Social")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1642 | |
|
22581
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1643 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Marital status", _("Marital Status")); |
|
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1644 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Interested in", _("Interests")); |
|
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1645 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Pets", _("Pets")); |
|
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1646 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Hometown", _("Hometown")); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1647 | MSN_GOT_INFO_GET_FIELD("Places lived", _("Places Lived")); |
|
22581
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1648 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Fashion", _("Fashion")); |
|
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1649 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Humor", _("Humor")); |
|
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1650 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Music", _("Music")); |
|
bab4b3f8299a
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
22387
diff
changeset
|
1651 | MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Favorite quote", _("Favorite Quote")); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1652 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1653 | if (sect_info) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1654 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1655 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1656 | sect_info = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1657 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1658 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1659 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1660 | /* Remove the section header */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1661 | purple_notify_user_info_remove_last_item(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1662 | purple_notify_user_info_remove_last_item(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1663 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1664 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1665 | /* Contact Info */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1666 | /* Personal */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1667 | purple_notify_user_info_add_section_break(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1668 | purple_notify_user_info_add_section_header(user_info, _("Contact Info")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1669 | purple_notify_user_info_add_section_header(user_info, _("Personal")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1670 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1671 | MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1672 | MSN_GOT_INFO_GET_FIELD("Significant other", _("Significant Other")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1673 | MSN_GOT_INFO_GET_FIELD("Home phone", _("Home Phone")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1674 | MSN_GOT_INFO_GET_FIELD("Home phone 2", _("Home Phone 2")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1675 | MSN_GOT_INFO_GET_FIELD("Home address", _("Home Address")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1676 | MSN_GOT_INFO_GET_FIELD("Personal Mobile", _("Personal Mobile")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1677 | MSN_GOT_INFO_GET_FIELD("Home fax", _("Home Fax")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1678 | MSN_GOT_INFO_GET_FIELD("Personal e-mail", _("Personal E-Mail")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1679 | MSN_GOT_INFO_GET_FIELD("Personal IM", _("Personal IM")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1680 | MSN_GOT_INFO_GET_FIELD("Birthday", _("Birthday")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1681 | MSN_GOT_INFO_GET_FIELD("Anniversary", _("Anniversary")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1682 | MSN_GOT_INFO_GET_FIELD("Notes", _("Notes")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1683 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1684 | if (sect_info) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1685 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1686 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1687 | sect_info = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1688 | has_contact_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1689 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1690 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1691 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1692 | /* Remove the section header */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1693 | purple_notify_user_info_remove_last_item(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1694 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1695 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1696 | /* Business */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1697 | purple_notify_user_info_add_section_header(user_info, _("Work")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1698 | MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1699 | MSN_GOT_INFO_GET_FIELD("Job title", _("Job Title")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1700 | MSN_GOT_INFO_GET_FIELD("Company", _("Company")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1701 | MSN_GOT_INFO_GET_FIELD("Department", _("Department")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1702 | MSN_GOT_INFO_GET_FIELD("Profession", _("Profession")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1703 | MSN_GOT_INFO_GET_FIELD("Work phone 1", _("Work Phone")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1704 | MSN_GOT_INFO_GET_FIELD("Work phone 2", _("Work Phone 2")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1705 | MSN_GOT_INFO_GET_FIELD("Work address", _("Work Address")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1706 | MSN_GOT_INFO_GET_FIELD("Work mobile", _("Work Mobile")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1707 | MSN_GOT_INFO_GET_FIELD("Work pager", _("Work Pager")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1708 | MSN_GOT_INFO_GET_FIELD("Work fax", _("Work Fax")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1709 | MSN_GOT_INFO_GET_FIELD("Work e-mail", _("Work E-Mail")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1710 | MSN_GOT_INFO_GET_FIELD("Work IM", _("Work IM")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1711 | MSN_GOT_INFO_GET_FIELD("Start date", _("Start Date")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1712 | MSN_GOT_INFO_GET_FIELD("Notes", _("Notes")); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1713 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1714 | if (sect_info) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1715 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1716 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1717 | sect_info = FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1718 | has_contact_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1719 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1720 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1721 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1722 | /* Remove the section header */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1723 | purple_notify_user_info_remove_last_item(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1724 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1725 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1726 | if (!has_contact_info) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1727 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1728 | /* Remove the Contact Info section header */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1729 | purple_notify_user_info_remove_last_item(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1730 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1731 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1732 | #if 0 /* these probably don't show up any more */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1733 | /* |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1734 | * The fields, 'A Little About Me', 'Favorite Things', 'Hobbies |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1735 | * and Interests', 'Favorite Quote', and 'My Homepage' may or may |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1736 | * not appear, in any combination. However, they do appear in |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1737 | * certain order, so we can successively search to pin down the |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1738 | * distinct values. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1739 | */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1740 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1741 | /* Check if they have A Little About Me */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1742 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1743 | " A Little About Me \n\n", 0, "Favorite Things", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1744 | _("A Little About Me"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1745 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1746 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1747 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1748 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1749 | " A Little About Me \n\n", 0, "Hobbies and Interests", '\n', |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1750 | NULL, _("A Little About Me"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1751 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1752 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1753 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1754 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1755 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1756 | " A Little About Me \n\n", 0, "Favorite Quote", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1757 | _("A Little About Me"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1758 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1759 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1760 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1761 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1762 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1763 | " A Little About Me \n\n", 0, "My Homepage \n\nTake a look", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1764 | '\n', |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1765 | NULL, _("A Little About Me"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1766 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1767 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1768 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1769 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1770 | purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1771 | " A Little About Me \n\n", 0, "last updated", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1772 | _("A Little About Me"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1773 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1774 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1775 | if (found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1776 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1777 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1778 | /* Check if they have Favorite Things */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1779 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1780 | " Favorite Things \n\n", 0, "Hobbies and Interests", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1781 | _("Favorite Things"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1782 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1783 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1784 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1785 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1786 | " Favorite Things \n\n", 0, "Favorite Quote", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1787 | _("Favorite Things"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1788 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1789 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1790 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1791 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1792 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1793 | " Favorite Things \n\n", 0, "My Homepage \n\nTake a look", '\n', |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1794 | NULL, _("Favorite Things"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1795 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1796 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1797 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1798 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1799 | purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1800 | " Favorite Things \n\n", 0, "last updated", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1801 | _("Favorite Things"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1802 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1803 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1804 | if (found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1805 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1806 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1807 | /* Check if they have Hobbies and Interests */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1808 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1809 | " Hobbies and Interests \n\n", 0, "Favorite Quote", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1810 | _("Hobbies and Interests"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1811 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1812 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1813 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1814 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1815 | " Hobbies and Interests \n\n", 0, "My Homepage \n\nTake a look", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1816 | '\n', NULL, _("Hobbies and Interests"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1817 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1818 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1819 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1820 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1821 | purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1822 | " Hobbies and Interests \n\n", 0, "last updated", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1823 | _("Hobbies and Interests"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1824 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1825 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1826 | if (found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1827 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1828 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1829 | /* Check if they have Favorite Quote */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1830 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1831 | "Favorite Quote \n\n", 0, "My Homepage \n\nTake a look", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1832 | _("Favorite Quote"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1833 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1834 | if (!found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1835 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1836 | purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1837 | "Favorite Quote \n\n", 0, "last updated", '\n', NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1838 | _("Favorite Quote"), 0, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1839 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1840 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1841 | if (found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1842 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1843 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1844 | /* Extract the last updated date and put it in */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1845 | found = purple_markup_extract_info_field(stripped, stripped_len, s, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1846 | " last updated:", 1, "\n", 0, NULL, _("Last Updated"), 0, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1847 | NULL, msn_info_date_reformat); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1848 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1849 | if (found) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1850 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1851 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1852 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1853 | /* If we were able to fetch a homepage url earlier, stick it in there */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1854 | if (user_url != NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1855 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1856 | tmp = g_strdup_printf("<a href=\"%s\">%s</a>", user_url, user_url); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1857 | purple_notify_user_info_add_pair(user_info, _("Homepage"), tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1858 | g_free(tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1859 | g_free(user_url); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1860 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1861 | has_info = TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1862 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1863 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1864 | if (!has_info) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1865 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1866 | /* MSN doesn't actually distinguish between "unknown member" and |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1867 | * a known member with an empty profile. Try to explain this fact. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1868 | * Note that if we have a nonempty tooltip_text, we know the user |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1869 | * exists. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1870 | */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1871 | /* This doesn't work with the new spaces profiles - Stu 3/2/06 |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1872 | char *p = strstr(url_buffer, "Unknown Member </TITLE>"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1873 | * This might not work for long either ... */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1874 | /* Nope, it failed some time before 5/2/07 :( |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1875 | char *p = strstr(url_buffer, "form id=\"SpacesSearch\" name=\"SpacesSearch\""); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1876 | * Let's see how long this one holds out for ... */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1877 | char *p = strstr(url_buffer, "<form id=\"profile_form\" name=\"profile_form\" action=\"http://spaces.live.com/profile.aspx?cid=0\""); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1878 | PurpleBuddy *b = purple_find_buddy |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1879 | (purple_connection_get_account(info_data->gc), info_data->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1880 | purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1881 | ((p && b) ? _("The user has not created a public profile.") : |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1882 | (p ? _("MSN reported not being able to find the user's profile. " |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1883 | "This either means that the user does not exist, " |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1884 | "or that the user exists " |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1885 | "but has not created a public profile.") : |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1886 | _("Could not find " /* This should never happen */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1887 | "any information in the user's profile. " |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1888 | "The user most likely does not exist.")))); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1889 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1890 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1891 | /* put a link to the actual profile URL */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1892 | tmp = g_strdup_printf("<a href=\"%s%s\">%s%s</a>", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1893 | PROFILE_URL, info_data->name, PROFILE_URL, info_data->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1894 | purple_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1895 | g_free(tmp); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1896 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1897 | #if PHOTO_SUPPORT |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1898 | /* Find the URL to the photo; must be before the marshalling [Bug 994207] */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1899 | photo_url_text = msn_get_photo_url(url_text); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1900 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1901 | /* Marshall the existing state */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1902 | info2_data = g_malloc0(sizeof(MsnGetInfoStepTwoData)); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1903 | info2_data->info_data = info_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1904 | info2_data->stripped = stripped; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1905 | info2_data->url_buffer = url_buffer; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1906 | info2_data->user_info = user_info; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1907 | info2_data->photo_url_text = photo_url_text; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1908 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1909 | /* Try to put the photo in there too, if there's one */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1910 | if (photo_url_text) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1911 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1912 | purple_util_fetch_url(photo_url_text, FALSE, NULL, FALSE, msn_got_photo, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1913 | info2_data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1914 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1915 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1916 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1917 | /* Emulate a callback */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1918 | /* TODO: Huh? */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1919 | msn_got_photo(NULL, info2_data, NULL, 0, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1920 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1921 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1922 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1923 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1924 | msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1925 | const gchar *url_text, size_t len, const gchar *error_message) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1926 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1927 | MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)user_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1928 | int id = -1; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1929 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1930 | /* Unmarshall the saved state */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1931 | MsnGetInfoData *info_data = info2_data->info_data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1932 | char *stripped = info2_data->stripped; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1933 | char *url_buffer = info2_data->url_buffer; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1934 | PurpleNotifyUserInfo *user_info = info2_data->user_info; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1935 | char *photo_url_text = info2_data->photo_url_text; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1936 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1937 | /* Make sure the connection is still valid if we got here by fetching a photo url */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1938 | if (url_text && (error_message != NULL || |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1939 | g_list_find(purple_connections_get_all(), info_data->gc) == NULL)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1940 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1941 | purple_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1942 | g_free(stripped); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1943 | g_free(url_buffer); |
|
21720
235394d5c7f4
Pull a bunch of bugfix only changes to im.pidgin.pidgin.2.3.1,
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21663
diff
changeset
|
1944 | purple_notify_user_info_destroy(user_info); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1945 | g_free(info_data->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1946 | g_free(info_data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1947 | g_free(photo_url_text); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1948 | g_free(info2_data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1949 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1950 | return; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1951 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1952 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1953 | /* Try to put the photo in there too, if there's one and is readable */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1954 | if (user_data && url_text && len != 0) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1955 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1956 | if (strstr(url_text, "400 Bad Request") |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1957 | || strstr(url_text, "403 Forbidden") |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1958 | || strstr(url_text, "404 Not Found")) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1959 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1960 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1961 | purple_debug_info("msn", "Error getting %s: %s\n", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1962 | photo_url_text, url_text); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1963 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1964 | else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1965 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1966 | char buf[1024]; |
|
22622
1ecb840b5101
Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <markdoliner@pidgin.im>
parents:
22581
diff
changeset
|
1967 | purple_debug_info("msn", "%s is %" G_GSIZE_FORMAT |
|
1ecb840b5101
Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <markdoliner@pidgin.im>
parents:
22581
diff
changeset
|
1968 | " bytes\n", photo_url_text, len); |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1969 | id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1970 | g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1971 | purple_notify_user_info_prepend_pair(user_info, NULL, buf); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1972 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1973 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1974 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1975 | /* We continue here from msn_got_info, as if nothing has happened */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1976 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1977 | purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1978 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1979 | g_free(stripped); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1980 | g_free(url_buffer); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1981 | purple_notify_user_info_destroy(user_info); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1982 | g_free(info_data->name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1983 | g_free(info_data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1984 | #if PHOTO_SUPPORT |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1985 | g_free(photo_url_text); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1986 | g_free(info2_data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1987 | if (id != -1) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1988 | purple_imgstore_unref_by_id(id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1989 | #endif |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1990 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1991 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1992 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1993 | msn_get_info(PurpleConnection *gc, const char *name) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1994 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1995 | MsnGetInfoData *data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1996 | char *url; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1997 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1998 | data = g_new0(MsnGetInfoData, 1); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
1999 | data->gc = gc; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2000 | data->name = g_strdup(name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2001 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2002 | url = g_strdup_printf("%s%s", PROFILE_URL, name); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2003 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2004 | purple_util_fetch_url(url, FALSE, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2005 | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2006 | TRUE, msn_got_info, data); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2007 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2008 | g_free(url); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2009 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2010 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2011 | static gboolean msn_load(PurplePlugin *plugin) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2012 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2013 | msn_notification_init(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2014 | msn_switchboard_init(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2015 | msn_sync_init(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2016 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2017 | return TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2018 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2019 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2020 | static gboolean msn_unload(PurplePlugin *plugin) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2021 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2022 | msn_notification_end(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2023 | msn_switchboard_end(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2024 | msn_sync_end(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2025 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2026 | return TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2027 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2028 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2029 | static PurpleAccount *find_acct(const char *prpl, const char *acct_id) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2030 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2031 | PurpleAccount *acct = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2032 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2033 | /* If we have a specific acct, use it */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2034 | if (acct_id) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2035 | acct = purple_accounts_find(acct_id, prpl); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2036 | if (acct && !purple_account_is_connected(acct)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2037 | acct = NULL; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2038 | } else { /* Otherwise find an active account for the protocol */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2039 | GList *l = purple_accounts_get_all(); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2040 | while (l) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2041 | if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2042 | && purple_account_is_connected(l->data)) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2043 | acct = l->data; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2044 | break; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2045 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2046 | l = l->next; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2047 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2048 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2049 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2050 | return acct; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2051 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2052 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2053 | static gboolean msn_uri_handler(const char *proto, const char *cmd, GHashTable *params) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2054 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2055 | char *acct_id = g_hash_table_lookup(params, "account"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2056 | PurpleAccount *acct; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2057 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2058 | if (g_ascii_strcasecmp(proto, "msnim")) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2059 | return FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2060 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2061 | acct = find_acct("prpl-msn", acct_id); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2062 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2063 | if (!acct) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2064 | return FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2065 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2066 | /* msnim:chat?contact=user@domain.tld */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2067 | if (!g_ascii_strcasecmp(cmd, "Chat")) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2068 | char *sname = g_hash_table_lookup(params, "contact"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2069 | if (sname) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2070 | PurpleConversation *conv = purple_find_conversation_with_account( |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2071 | PURPLE_CONV_TYPE_IM, sname, acct); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2072 | if (conv == NULL) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2073 | conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, sname); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2074 | purple_conversation_present(conv); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2075 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2076 | /*else |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2077 | **If pidgindialogs_im() was in the core, we could use it here. |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2078 | * It is all purple_request_* based, but I'm not sure it really belongs in the core |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2079 | pidgindialogs_im();*/ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2080 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2081 | return TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2082 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2083 | /* msnim:add?contact=user@domain.tld */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2084 | else if (!g_ascii_strcasecmp(cmd, "Add")) { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2085 | char *name = g_hash_table_lookup(params, "contact"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2086 | purple_blist_request_add_buddy(acct, name, NULL, NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2087 | return TRUE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2088 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2089 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2090 | return FALSE; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2091 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2092 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2093 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2094 | static PurplePluginProtocolInfo prpl_info = |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2095 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2096 | OPT_PROTO_MAIL_CHECK, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2097 | NULL, /* user_splits */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2098 | NULL, /* protocol_options */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2099 | {"png", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_SEND}, /* icon_spec */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2100 | msn_list_icon, /* list_icon */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2101 | NULL, /* list_emblems */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2102 | msn_status_text, /* status_text */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2103 | msn_tooltip_text, /* tooltip_text */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2104 | msn_status_types, /* away_states */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2105 | msn_blist_node_menu, /* blist_node_menu */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2106 | NULL, /* chat_info */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2107 | NULL, /* chat_info_defaults */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2108 | msn_login, /* login */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2109 | msn_close, /* close */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2110 | msn_send_im, /* send_im */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2111 | NULL, /* set_info */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2112 | msn_send_typing, /* send_typing */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2113 | msn_get_info, /* get_info */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2114 | msn_set_status, /* set_away */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2115 | msn_set_idle, /* set_idle */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2116 | NULL, /* change_passwd */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2117 | msn_add_buddy, /* add_buddy */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2118 | NULL, /* add_buddies */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2119 | msn_rem_buddy, /* remove_buddy */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2120 | NULL, /* remove_buddies */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2121 | msn_add_permit, /* add_permit */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2122 | msn_add_deny, /* add_deny */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2123 | msn_rem_permit, /* rem_permit */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2124 | msn_rem_deny, /* rem_deny */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2125 | msn_set_permit_deny, /* set_permit_deny */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2126 | NULL, /* join_chat */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2127 | NULL, /* reject chat invite */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2128 | NULL, /* get_chat_name */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2129 | msn_chat_invite, /* chat_invite */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2130 | msn_chat_leave, /* chat_leave */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2131 | NULL, /* chat_whisper */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2132 | msn_chat_send, /* chat_send */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2133 | msn_keepalive, /* keepalive */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2134 | NULL, /* register_user */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2135 | NULL, /* get_cb_info */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2136 | NULL, /* get_cb_away */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2137 | NULL, /* alias_buddy */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2138 | msn_group_buddy, /* group_buddy */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2139 | msn_rename_group, /* rename_group */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2140 | NULL, /* buddy_free */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2141 | msn_convo_closed, /* convo_closed */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2142 | msn_normalize, /* normalize */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2143 | msn_set_buddy_icon, /* set_buddy_icon */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2144 | msn_remove_group, /* remove_group */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2145 | NULL, /* get_cb_real_name */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2146 | NULL, /* set_chat_topic */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2147 | NULL, /* find_blist_chat */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2148 | NULL, /* roomlist_get_list */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2149 | NULL, /* roomlist_cancel */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2150 | NULL, /* roomlist_expand_category */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2151 | msn_can_receive_file, /* can_receive_file */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2152 | msn_send_file, /* send_file */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2153 | msn_new_xfer, /* new_xfer */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2154 | msn_offline_message, /* offline_message */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2155 | NULL, /* whiteboard_prpl_ops */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2156 | NULL, /* send_raw */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2157 | NULL, /* roomlist_room_serialize */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2158 | NULL, /* unregister_user */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2159 | msn_send_attention, /* send_attention */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2160 | msn_attention_types, /* attention_types */ |
|
22926
daeb422c391b
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22924
diff
changeset
|
2161 | msn_get_account_text_table /* get_account_text_table */ |
|
21481
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2162 | }; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2163 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2164 | static PurplePluginInfo info = |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2165 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2166 | PURPLE_PLUGIN_MAGIC, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2167 | PURPLE_MAJOR_VERSION, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2168 | PURPLE_MINOR_VERSION, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2169 | PURPLE_PLUGIN_PROTOCOL, /**< type */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2170 | NULL, /**< ui_requirement */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2171 | 0, /**< flags */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2172 | NULL, /**< dependencies */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2173 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2174 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2175 | "prpl-msn", /**< id */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2176 | "MSN", /**< name */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2177 | DISPLAY_VERSION, /**< version */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2178 | /** summary */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2179 | N_("MSN Protocol Plugin"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2180 | /** description */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2181 | N_("MSN Protocol Plugin"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2182 | "Christian Hammond <chipx86@gnupdate.org>", /**< author */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2183 | PURPLE_WEBSITE, /**< homepage */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2184 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2185 | msn_load, /**< load */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2186 | msn_unload, /**< unload */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2187 | NULL, /**< destroy */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2188 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2189 | NULL, /**< ui_info */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2190 | &prpl_info, /**< extra_info */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2191 | NULL, /**< prefs_info */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2192 | msn_actions, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2193 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2194 | /* padding */ |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2195 | NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2196 | NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2197 | NULL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2198 | NULL |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2199 | }; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2200 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2201 | static void |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2202 | init_plugin(PurplePlugin *plugin) |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2203 | { |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2204 | PurpleAccountOption *option; |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2205 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2206 | option = purple_account_option_string_new(_("Server"), "server", |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2207 | MSN_SERVER); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2208 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2209 | option); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2210 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2211 | option = purple_account_option_int_new(_("Port"), "port", 1863); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2212 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2213 | option); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2214 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2215 | option = purple_account_option_bool_new(_("Use HTTP Method"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2216 | "http_method", FALSE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2217 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2218 | option); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2219 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2220 | option = purple_account_option_string_new(_("HTTP Method Server"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2221 | "http_method_server", MSN_HTTPCONN_SERVER); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2222 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2223 | option); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2224 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2225 | option = purple_account_option_bool_new(_("Show custom smileys"), |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2226 | "custom_smileys", TRUE); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2227 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2228 | option); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2229 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2230 | purple_cmd_register("nudge", "", PURPLE_CMD_P_PRPL, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2231 | PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PRPL_ONLY, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2232 | "prpl-msn", msn_cmd_nudge, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2233 | _("nudge: nudge a user to get their attention"), NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2234 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2235 | purple_prefs_remove("/plugins/prpl/msn"); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2236 | |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2237 | purple_signal_connect(purple_get_core(), "uri-handler", plugin, |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2238 | PURPLE_CALLBACK(msn_uri_handler), NULL); |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2239 | } |
|
d52b697eaae7
Add MSNP9 back as an alternative alongside the existing MSN prpl. Cowardly
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
diff
changeset
|
2240 | |
|
21663
a0fda1381e9b
Fixed static linkage of msnp9 in the most straightforward way I could see, which is to have the purple_init_##pluginname##_plugin() function match the directory name, msnp9
Evan Schoenberg <evands@pidgin.im>
parents:
21655
diff
changeset
|
2241 | PURPLE_INIT_PLUGIN(msnp9, init_plugin, info); |