libpurple/protocols/msn/msn.c

Thu, 02 Dec 2010 06:14:19 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Thu, 02 Dec 2010 06:14:19 +0000
changeset 31201
97dbb1e30ee1
parent 31189
82ef255d2c01
child 31203
721fd8f272a8
permissions
-rw-r--r--

Read the MPOP setting from the AB.

Refs #13017.

4542
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
1 /**
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
2 * @file msn.c The MSN protocol plugin
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
3 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
4 * purple
4542
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
5 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
8 * source distribution.
6701
7e2db9273748 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6695
diff changeset
9 *
4542
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
10 * This program is free software; you can redistribute it and/or modify
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
11 * it under the terms of the GNU General Public License as published by
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
13 * (at your option) any later version.
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
14 *
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
15 * This program is distributed in the hope that it will be useful,
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
18 * GNU General Public License for more details.
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
19 *
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
20 * You should have received a copy of the GNU General Public License
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
21 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19643
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
4542
05a476dec582 [gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents: 4508
diff changeset
23 */
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
24 #define PHOTO_SUPPORT 1
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
25
30960
82373650bd86 Add internal here so it brings config.h that make it possible to load the plugin. Fixes a regresion introduced in b875cf477e192c095c23983490d166e5ee39fc22.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30956
diff changeset
26 #include "internal.h"
82373650bd86 Add internal here so it brings config.h that make it possible to load the plugin. Fixes a regresion introduced in b875cf477e192c095c23983490d166e5ee39fc22.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30956
diff changeset
27
30945
b875cf477e19 Remove unnecesary includes from msn.h.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30944
diff changeset
28 #include "debug.h"
b875cf477e19 Remove unnecesary includes from msn.h.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30944
diff changeset
29 #include "request.h"
b875cf477e19 Remove unnecesary includes from msn.h.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30944
diff changeset
30
5638
53e752c88ea1 [gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents: 5626
diff changeset
31 #include "accountopt.h"
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23768
diff changeset
32 #include "contact.h"
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
33 #include "msg.h"
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
34 #include "page.h"
8713
8a7baa8f8460 [gaim-migrate @ 9467]
Gary Kramlich <grim@pidgin.im>
parents: 8697
diff changeset
35 #include "pluginpref.h"
5626
6e6fc61ea2db [gaim-migrate @ 6033]
Christian Hammond <chipx86@chipx86.com>
parents: 5567
diff changeset
36 #include "prefs.h"
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
37 #include "session.h"
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
38 #include "smiley.h"
5361
a964b856e97f [gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents: 5351
diff changeset
39 #include "state.h"
13629
36b386194367 [gaim-migrate @ 16015]
Daniel Atallah <datallah@pidgin.im>
parents: 13628
diff changeset
40 #include "util.h"
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
41 #include "cmds.h"
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
42 #include "core.h"
9713
bb37562302a1 [gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents: 9684
diff changeset
43 #include "prpl.h"
20475
0b3826f0e687 The first msn-p13-merge-head.diff.gz from SF Patch #1621854 from Ka-Hing Cheung.
Richard Laager <rlaager@pidgin.im>
parents: 20474
diff changeset
44 #include "msnutils.h"
9943
b54a762f60fa [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9917
diff changeset
45 #include "version.h"
4546
d14ad00fe294 [gaim-migrate @ 4825]
Herman Bloggs <herman@bluedigits.com>
parents: 4542
diff changeset
46
30956
74ba2cc3e760 A little header cleanup.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30948
diff changeset
47 #include "error.h"
24420
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
48 #include "msg.h"
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
49 #include "switchboard.h"
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
50 #include "notification.h"
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
51 #include "slplink.h"
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
52
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
53 #if PHOTO_SUPPORT
24013
44c189da652d A similar size limit for MSN buddy icon retrieval from arbitrary urls.
Daniel Atallah <datallah@pidgin.im>
parents: 24006
diff changeset
54 #define MAX_HTTP_BUDDYICON_BYTES (200 * 1024)
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
55 #include "imgstore.h"
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
56 #endif
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
57
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
58 typedef struct
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
59 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
60 PurpleConnection *gc;
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
61 const char *passport;
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
62
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
63 } MsnMobileData;
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
64
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
65 typedef struct
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
66 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
67 PurpleConnection *gc;
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
68 char *name;
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
69
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
70 } MsnGetInfoData;
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
71
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
72 typedef struct
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
73 {
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
74 MsnGetInfoData *info_data;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
75 char *stripped;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
76 char *url_buffer;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
77 PurpleNotifyUserInfo *user_info;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
78 char *photo_url_text;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
79
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
80 } MsnGetInfoStepTwoData;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
81
17103
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
82 typedef struct
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
83 {
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
84 PurpleConnection *gc;
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
85 const char *who;
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
86 char *msg;
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
87 PurpleMessageFlags flags;
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
88 time_t when;
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
89 } MsnIMData;
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
90
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
91 typedef struct
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
92 {
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
93 char *smile;
28351
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
94 PurpleSmiley *ps;
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
95 MsnObject *obj;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
96 } MsnEmoticon;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
97
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
98 typedef struct
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
99 {
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
100 PurpleConnection *pc;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
101 PurpleBuddy *buddy;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
102 PurpleGroup *group;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
103 } MsnAddReqData;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
104
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
105 static const char *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
106 msn_normalize(const PurpleAccount *account, const char *str)
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
107 {
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
108 static char buf[BUF_LEN];
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
109 char *tmp;
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
110
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
111 g_return_val_if_fail(str != NULL, NULL);
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
112
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
113 g_snprintf(buf, sizeof(buf), "%s%s", str,
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
114 (strchr(str, '@') ? "" : "@hotmail.com"));
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
115
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
116 tmp = g_utf8_strdown(buf, -1);
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
117 strncpy(buf, tmp, sizeof(buf));
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
118 g_free(tmp);
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
119
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
120 return buf;
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
121 }
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
122
19643
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
123 static gboolean
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
124 msn_send_attention(PurpleConnection *gc, const char *username, guint type)
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
125 {
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
126 MsnMessage *msg;
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
127 MsnSession *session;
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
128 MsnSwitchBoard *swboard;
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
129
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
130 msg = msn_message_new_nudge();
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
131 session = gc->proto_data;
19643
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
132 swboard = msn_session_get_swboard(session, username, MSN_SB_FLAG_IM);
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
133
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
134 msn_switchboard_send_msg(swboard, msg, TRUE);
31162
2c596217766b msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <markdoliner@pidgin.im>
parents: 31161
diff changeset
135 msn_message_unref(msg);
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
136
19643
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
137 return TRUE;
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
138 }
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
139
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
140 static GList *
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
141 msn_attention_types(PurpleAccount *account)
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
142 {
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
143 static GList *list = NULL;
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
144
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
145 if (!list) {
22225
6cd802a8c5ad This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22164
diff changeset
146 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
147 _("%s has nudged you!"), _("Nudging %s...")));
19643
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
148 }
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
149
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
150 return list;
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
151 }
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
152
23277
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
153 static GHashTable *
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
154 msn_get_account_text_table(PurpleAccount *unused)
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
155 {
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
156 GHashTable *table;
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
157
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
158 table = g_hash_table_new(g_str_hash, g_str_equal);
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
159
23325
a374a26fe217 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@pidgin.im>
parents: 23295
diff changeset
160 g_hash_table_insert(table, "login_label", (gpointer)_("Email Address..."));
23277
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
161
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
162 return table;
ea315a8d5bad Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23276
diff changeset
163 }
19643
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
164
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
165 static PurpleCmdRet
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
166 msn_cmd_nudge(PurpleConversation *conv, const gchar *cmd, gchar **args, gchar **error, void *data)
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
167 {
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
168 PurpleAccount *account = purple_conversation_get_account(conv);
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
169 PurpleConnection *gc = purple_account_get_connection(account);
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
170 const gchar *username;
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
171
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
172 username = purple_conversation_get_name(conv);
1794c23309d3 In MSN prpl, use attention API. Can be disabled by undefining
Jeff Connelly <jeff2@soc.pidgin.im>
parents: 18122
diff changeset
173
24032
d5c04a8cc62a Change the other prpls to use new purple_prpl_{send,got}_attention API.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24013
diff changeset
174 purple_prpl_send_attention(gc, username, MSN_NUDGE);
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
175
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
176 return PURPLE_CMD_RET_OK;
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
177 }
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
178
30196
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
179 struct public_alias_closure
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
180 {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
181 PurpleAccount *account;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
182 gpointer success_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
183 gpointer failure_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
184 };
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
185
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
186 static gboolean
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
187 set_public_alias_length_error(gpointer data)
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
188 {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
189 struct public_alias_closure *closure = data;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
190 PurpleSetPublicAliasFailureCallback failure_cb = closure->failure_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
191
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
192 failure_cb(closure->account, _("Your new MSN friendly name is too long."));
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
193 g_free(closure);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
194
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
195 return FALSE;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
196 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
197
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
198 static void
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
199 prp_success_cb(MsnCmdProc *cmdproc, MsnCommand *cmd)
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
200 {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
201 const char *type, *friendlyname;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
202 struct public_alias_closure *closure;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
203
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
204 g_return_if_fail(cmd->param_count >= 3);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
205 type = cmd->params[1];
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
206 g_return_if_fail(!strcmp(type, "MFN"));
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
207
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
208 closure = cmd->trans->data;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
209 friendlyname = purple_url_decode(cmd->params[2]);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
210
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
211 msn_update_contact(cmdproc->session, "Me", MSN_UPDATE_DISPLAY, friendlyname);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
212
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
213 purple_connection_set_display_name(
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
214 purple_account_get_connection(closure->account),
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
215 friendlyname);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
216 purple_account_set_string(closure->account, "display-name", friendlyname);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
217
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
218 if (closure->success_cb) {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
219 PurpleSetPublicAliasSuccessCallback success_cb = closure->success_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
220 success_cb(closure->account, friendlyname);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
221 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
222 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
223
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
224 static void
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
225 prp_error_cb(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
226 {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
227 struct public_alias_closure *closure = trans->data;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
228 PurpleSetPublicAliasFailureCallback failure_cb = closure->failure_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
229 gboolean debug;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
230 const char *error_text;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
231
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
232 error_text = msn_error_get_text(error, &debug);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
233 failure_cb(closure->account, error_text);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
234 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
235
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
236 static void
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
237 prp_timeout_cb(MsnCmdProc *cmdproc, MsnTransaction *trans)
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
238 {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
239 struct public_alias_closure *closure = trans->data;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
240 PurpleSetPublicAliasFailureCallback failure_cb = closure->failure_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
241 failure_cb(closure->account, _("Connection Timeout"));
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
242 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
243
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
244 void
30196
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
245 msn_set_public_alias(PurpleConnection *pc, const char *alias,
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
246 PurpleSetPublicAliasSuccessCallback success_cb,
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
247 PurpleSetPublicAliasFailureCallback failure_cb)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
248 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
249 MsnCmdProc *cmdproc;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
250 MsnSession *session;
30908
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
251 MsnTransaction *trans;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
252 PurpleAccount *account;
31186
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
253 char real_alias[BUDDY_ALIAS_MAXLEN+1];
30196
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
254 struct public_alias_closure *closure;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
255
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
256 session = purple_connection_get_protocol_data(pc);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
257 cmdproc = session->notification->cmdproc;
30196
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
258 account = purple_connection_get_account(pc);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
259
31186
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
260 if (alias && *alias) {
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
261 int i = 0;
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
262 while (isspace(*alias))
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
263 alias++;
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
264
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
265 for (; *alias && i < BUDDY_ALIAS_MAXLEN; alias++) {
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
266 if (*alias == '%') {
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
267 if (i > BUF_LEN - 4)
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
268 break;
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
269 real_alias[i++] = '%';
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
270 real_alias[i++] = '2';
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
271 real_alias[i++] = '5';
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
272 } else if (*alias == ' ') {
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
273 if (i > BUF_LEN - 4)
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
274 break;
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
275 real_alias[i++] = '%';
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
276 real_alias[i++] = '2';
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
277 real_alias[i++] = '0';
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
278 } else {
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
279 real_alias[i++] = *alias;
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
280 }
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
281 }
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
282
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
283 while (i && isspace(real_alias[i - 1]))
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
284 i--;
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
285
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
286 real_alias[i] = '\0';
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
287 } else
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
288 real_alias[0] = '\0';
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
289
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
290 if (*alias) {
30196
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
291 if (failure_cb) {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
292 struct public_alias_closure *closure =
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
293 g_new0(struct public_alias_closure, 1);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
294 closure->account = account;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
295 closure->failure_cb = failure_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
296 purple_timeout_add(0, set_public_alias_length_error, closure);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
297 } else {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
298 purple_notify_error(pc, NULL,
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
299 _("Your new MSN friendly name is too long."),
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
300 NULL);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
301 }
2738
bd5bcb1c8167 [gaim-migrate @ 2751]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2688
diff changeset
302 return;
bd5bcb1c8167 [gaim-migrate @ 2751]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2688
diff changeset
303 }
bd5bcb1c8167 [gaim-migrate @ 2751]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2688
diff changeset
304
31186
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
305 if (real_alias[0] == '\0') {
26c47566d14a Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31178
diff changeset
306 strcpy(real_alias, purple_account_get_username(account));
30196
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
307 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
308
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
309 closure = g_new0(struct public_alias_closure, 1);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
310 closure->account = account;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
311 closure->success_cb = success_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
312 closure->failure_cb = failure_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
313
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
314 trans = msn_transaction_new(cmdproc, "PRP", "MFN %s", real_alias);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
315 msn_transaction_set_data(trans, closure);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
316 msn_transaction_set_data_free(trans, g_free);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
317 msn_transaction_add_cb(trans, "PRP", prp_success_cb);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
318 if (failure_cb) {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
319 msn_transaction_set_error_cb(trans, prp_error_cb);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
320 msn_transaction_set_timeout_cb(trans, prp_timeout_cb);
20474
b0ef257ef8d4 The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung.
Ka-Hing Cheung <khc@pidgin.im>
parents: 20473
diff changeset
321 }
30196
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
322 msn_cmdproc_send_trans(cmdproc, trans);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
323 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
324
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
325 static gboolean
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
326 get_public_alias_cb(gpointer data)
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
327 {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
328 struct public_alias_closure *closure = data;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
329 PurpleGetPublicAliasSuccessCallback success_cb = closure->success_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
330 const char *alias;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
331
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
332 alias = purple_account_get_string(closure->account, "display-name",
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
333 purple_account_get_username(closure->account));
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
334 success_cb(closure->account, alias);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
335 g_free(closure);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
336
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
337 return FALSE;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
338 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
339
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
340 static void
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
341 msn_get_public_alias(PurpleConnection *pc,
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
342 PurpleGetPublicAliasSuccessCallback success_cb,
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
343 PurpleGetPublicAliasFailureCallback failure_cb)
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
344 {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
345 struct public_alias_closure *closure = g_new0(struct public_alias_closure, 1);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
346 PurpleAccount *account = purple_connection_get_account(pc);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
347
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
348 closure->account = account;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
349 closure->success_cb = success_cb;
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
350 purple_timeout_add(0, get_public_alias_cb, closure);
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
351 }
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
352
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
353 static void
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
354 msn_act_id(PurpleConnection *gc, const char *entry)
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
355 {
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
356 msn_set_public_alias(gc, entry, NULL, NULL);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
357 }
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
358
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
359 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
360 msn_set_prp(PurpleConnection *gc, const char *type, const char *entry)
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
361 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
362 MsnCmdProc *cmdproc;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
363 MsnSession *session;
30908
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
364 MsnTransaction *trans;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
365
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
366 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
367 cmdproc = session->notification->cmdproc;
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
368
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
369 if (entry == NULL || *entry == '\0')
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
370 {
30908
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
371 trans = msn_transaction_new(cmdproc, "PRP", "%s", type);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
372 }
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
373 else
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
374 {
30908
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
375 trans = msn_transaction_new(cmdproc, "PRP", "%s %s", type,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
376 purple_url_encode(entry));
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
377 }
30914
24c47e42518a Fix a few little things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30910
diff changeset
378 msn_cmdproc_send_trans(cmdproc, trans);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
379 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
380
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
381 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
382 msn_set_home_phone_cb(PurpleConnection *gc, const char *entry)
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
383 {
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
384 msn_set_prp(gc, "PHH", entry);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
385 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
386
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
387 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
388 msn_set_work_phone_cb(PurpleConnection *gc, const char *entry)
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
389 {
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
390 msn_set_prp(gc, "PHW", entry);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
391 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
392
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
393 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
394 msn_set_mobile_phone_cb(PurpleConnection *gc, const char *entry)
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
395 {
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
396 msn_set_prp(gc, "PHM", entry);
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
397 }
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
398
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
399 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
400 enable_msn_pages_cb(PurpleConnection *gc)
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
401 {
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
402 msn_set_prp(gc, "MOB", "Y");
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
403 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
404
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
405 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
406 disable_msn_pages_cb(PurpleConnection *gc)
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
407 {
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
408 msn_set_prp(gc, "MOB", "N");
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
409 }
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
410
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
411 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
412 send_to_mobile(PurpleConnection *gc, const char *who, const char *entry)
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
413 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
414 MsnTransaction *trans;
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8595
diff changeset
415 MsnSession *session;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
416 MsnCmdProc *cmdproc;
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
417 MsnPage *page;
28346
1250dd4e9448 Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27780
diff changeset
418 MsnMessage *msg;
22670
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
419 MsnUser *user;
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
420 char *payload = NULL;
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
421 const char *mobile_number = NULL;
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22670
diff changeset
422 gsize payload_len;
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
423
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
424 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
425 cmdproc = session->notification->cmdproc;
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
426
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
427 page = msn_page_new();
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
428 msn_page_set_body(page, entry);
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8595
diff changeset
429
9092
34b9e78827f6 [gaim-migrate @ 9869]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9091
diff changeset
430 payload = msn_page_gen_payload(page, &payload_len);
8646
74d0e7406e3b [gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8595
diff changeset
431
22670
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
432 if ((user = msn_userlist_find_user(session->userlist, who)) &&
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
433 (mobile_number = msn_user_get_mobile_phone(user)) &&
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
434 mobile_number[0] == '+') {
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
435 /* if msn_user_get_mobile_phone() has a + in front, it's a number
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
436 that from the buddy's contact card */
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22670
diff changeset
437 trans = msn_transaction_new(cmdproc, "PGD", "tel:%s 1 %" G_GSIZE_FORMAT,
22670
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
438 mobile_number, payload_len);
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
439 } else {
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
440 /* otherwise we send to whatever phone number the buddy registered
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
441 with msn */
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22670
diff changeset
442 trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %" G_GSIZE_FORMAT,
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22670
diff changeset
443 who, payload_len);
22670
2ad82dd45c56 Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@pidgin.im>
parents: 22581
diff changeset
444 }
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
445
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
446 msn_transaction_set_payload(trans, payload, payload_len);
21065
8bbf0f6700ed Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <datallah@pidgin.im>
parents: 21033
diff changeset
447 g_free(payload);
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
448
28346
1250dd4e9448 Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27780
diff changeset
449 msg = msn_message_new_plain(entry);
1250dd4e9448 Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27780
diff changeset
450 msn_transaction_set_data(trans, msg);
1250dd4e9448 Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27780
diff changeset
451
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
452 msn_page_destroy(page);
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
453
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
454 msn_cmdproc_send_trans(cmdproc, trans);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
455 }
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
456
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
457 static void
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
458 send_to_mobile_cb(MsnMobileData *data, const char *entry)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
459 {
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
460 send_to_mobile(data->gc, data->passport, entry);
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
461 g_free(data);
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
462 }
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
463
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
464 static void
5793
28d84d5e5663 [gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
465 close_mobile_page_cb(MsnMobileData *data, const char *entry)
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
466 {
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
467 g_free(data);
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
468 }
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
469
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
470 /* -- */
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
471
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
472 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
473 msn_show_set_friendly_name(PurplePluginAction *action)
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
474 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
475 PurpleConnection *gc;
29160
06bf248756a1 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
476 PurpleAccount *account;
06bf248756a1 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
477 char *tmp;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
478
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
479 gc = (PurpleConnection *) action->context;
29160
06bf248756a1 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
480 account = purple_connection_get_account(gc);
06bf248756a1 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
481
06bf248756a1 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
482 tmp = g_strdup_printf(_("Set friendly name for %s."),
06bf248756a1 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
483 purple_account_get_username(account));
30926
563077529cae Give the Set Friendly Name window a better title
Mark Doliner <markdoliner@pidgin.im>
parents: 30925
diff changeset
484 purple_request_input(gc, _("Set Friendly Name"), tmp,
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
485 _("This is the name that other MSN buddies will "
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
486 "see you as."),
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
487 purple_connection_get_display_name(gc), FALSE, FALSE, NULL,
5481
2f161d72e311 [gaim-migrate @ 5877]
Christian Hammond <chipx86@chipx86.com>
parents: 5436
diff changeset
488 _("OK"), G_CALLBACK(msn_act_id),
16490
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 15884
diff changeset
489 _("Cancel"), NULL,
29160
06bf248756a1 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
490 account, NULL, NULL,
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
491 gc);
29160
06bf248756a1 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
492 g_free(tmp);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
493 }
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
494
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
495 typedef struct MsnLocationData {
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
496 PurpleAccount *account;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
497 MsnSession *session;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
498 PurpleRequestFieldGroup *group;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
499 } MsnLocationData;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
500
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
501 static void
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
502 update_endpoint_cb(MsnLocationData *data, PurpleRequestFields *fields)
29448
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
503 {
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
504 PurpleAccount *account;
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
505 MsnSession *session;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
506 const char *old_name;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
507 const char *name;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
508 GList *others;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
509
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
510 session = data->session;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
511 account = data->account;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
512
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
513 /* Update the current location's name */
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
514 old_name = purple_account_get_string(account, "endpoint-name", NULL);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
515 name = purple_request_fields_get_string(fields, "endpoint-name");
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
516 if (!g_str_equal(old_name, name)) {
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
517 purple_account_set_string(account, "endpoint-name", name);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
518 msn_notification_send_uux_private_endpointdata(session);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
519 }
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
520
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
521 /* Sign out other locations */
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
522 for (others = purple_request_field_group_get_fields(data->group);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
523 others;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
524 others = g_list_next(others)) {
29452
bf81dc65bbd4 When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29451
diff changeset
525 PurpleRequestField *field = others->data;
bf81dc65bbd4 When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29451
diff changeset
526 if (purple_request_field_get_type(field) != PURPLE_REQUEST_FIELD_BOOLEAN)
bf81dc65bbd4 When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29451
diff changeset
527 continue;
29453
4f4a9646df32 Fix this inverted logic. Disconnect the selected endpoints as said in the field label.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 29452
diff changeset
528 if (purple_request_field_bool_get_value(field)) {
29452
bf81dc65bbd4 When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29451
diff changeset
529 const char *id = purple_request_field_get_id(field);
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
530 char *user;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
531 purple_debug_info("msn", "Disconnecting Endpoint %s\n", id);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
532
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
533 user = g_strdup_printf("%s;%s", purple_account_get_username(account), id);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
534 msn_notification_send_uun(session, user, MSN_UNIFIED_NOTIFICATION_MPOP, "goawyplzthxbye");
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
535 g_free(user);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
536 }
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
537 }
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
538
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
539 g_free(data);
29448
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
540 }
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
541
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
542 static void
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
543 msn_show_locations(PurplePluginAction *action)
29448
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
544 {
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
545 PurpleConnection *pc;
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
546 PurpleAccount *account;
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
547 MsnSession *session;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
548 PurpleRequestFields *fields;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
549 PurpleRequestFieldGroup *group;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
550 PurpleRequestField *field;
31161
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
551 gboolean have_other_endpoints;
30927
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
552 GSList *l;
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
553 MsnLocationData *data;
29448
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
554
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
555 pc = (PurpleConnection *)action->context;
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
556 account = purple_connection_get_account(pc);
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
557 session = purple_connection_get_protocol_data(pc);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
558
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
559 fields = purple_request_fields_new();
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
560
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
561 group = purple_request_field_group_new(_("This Location"));
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
562 purple_request_fields_add_group(fields, group);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
563 field = purple_request_field_label_new("endpoint-label", _("This is the name that identifies this location"));
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
564 purple_request_field_group_add_field(group, field);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
565 field = purple_request_field_string_new("endpoint-name",
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
566 _("Name"),
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
567 purple_account_get_string(account, "endpoint-name", NULL),
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
568 FALSE);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
569 purple_request_field_set_required(field, TRUE);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
570 purple_request_field_group_add_field(group, field);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
571
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
572 group = purple_request_field_group_new(_("Other Locations"));
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
573 purple_request_fields_add_group(fields, group);
31161
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
574
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
575 have_other_endpoints = FALSE;
30927
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
576 for (l = session->user->endpoints; l; l = l->next) {
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
577 MsnUserEndpoint *ep = l->data;
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
578
31161
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
579 if (ep->id[0] != '\0' && strncasecmp(ep->id + 1, session->guid, 36) == 0)
30927
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
580 /* Don't add myself to the list */
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
581 continue;
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
582
31161
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
583 if (!have_other_endpoints) {
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
584 /* We do in fact have an endpoint other than ourselves... let's
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
585 add a label */
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
586 field = purple_request_field_label_new("others-label",
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
587 _("You can sign out from other locations here"));
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
588 purple_request_field_group_add_field(group, field);
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
589 }
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
590
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
591 have_other_endpoints = TRUE;
30927
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
592 field = purple_request_field_bool_new(ep->id, ep->name, FALSE);
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
593 purple_request_field_group_add_field(group, field);
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
594 }
31161
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
595 if (!have_other_endpoints) {
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
596 /* TODO: Due to limitations in our current request field API, the
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
597 following string will show up with a trailing colon. This should
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
598 be fixed either by adding an "include_colon" boolean, or creating
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
599 a separate purple_request_field_label_new_without_colon function,
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
600 or by never automatically adding the colon and requiring that
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
601 callers add the colon themselves. */
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
602 field = purple_request_field_label_new("others-label", _("You are not signed in from any other locations."));
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
603 purple_request_field_group_add_field(group, field);
6a6358232969 * Don't include ourselves in the list of other endpoints that can be
Mark Doliner <markdoliner@pidgin.im>
parents: 31143
diff changeset
604 }
30927
ca3c59bdc5d3 Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <markdoliner@pidgin.im>
parents: 30926
diff changeset
605
29451
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
606 data = g_new0(MsnLocationData, 1);
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
607 data->account = account;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
608 data->session = session;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
609 data->group = group;
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
610
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
611 purple_request_fields(pc, NULL, NULL, NULL,
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
612 fields,
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
613 _("OK"), G_CALLBACK(update_endpoint_cb),
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
614 _("Cancel"), G_CALLBACK(g_free),
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
615 account, NULL, NULL,
a9f73732927b Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29448
diff changeset
616 data);
29448
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
617 }
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
618
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
619 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
620 msn_show_set_home_phone(PurplePluginAction *action)
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
621 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
622 PurpleConnection *gc;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
623 MsnSession *session;
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
624
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
625 gc = (PurpleConnection *) action->context;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
626 session = gc->proto_data;
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
627
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
628 purple_request_input(gc, NULL, _("Set your home phone number."), NULL,
8697
c5e51aef2026 [gaim-migrate @ 9450]
Jon Oberheide
parents: 8691
diff changeset
629 msn_user_get_home_phone(session->user), FALSE, FALSE, NULL,
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
630 _("OK"), G_CALLBACK(msn_set_home_phone_cb),
16490
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 15884
diff changeset
631 _("Cancel"), NULL,
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 15884
diff changeset
632 purple_connection_get_account(gc), NULL, NULL,
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
633 gc);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
634 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
635
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
636 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
637 msn_show_set_work_phone(PurplePluginAction *action)
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
638 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
639 PurpleConnection *gc;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
640 MsnSession *session;
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
641
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
642 gc = (PurpleConnection *) action->context;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
643 session = gc->proto_data;
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
644
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
645 purple_request_input(gc, NULL, _("Set your work phone number."), NULL,
8697
c5e51aef2026 [gaim-migrate @ 9450]
Jon Oberheide
parents: 8691
diff changeset
646 msn_user_get_work_phone(session->user), FALSE, FALSE, NULL,
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
647 _("OK"), G_CALLBACK(msn_set_work_phone_cb),
16490
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 15884
diff changeset
648 _("Cancel"), NULL,
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 15884
diff changeset
649 purple_connection_get_account(gc), NULL, NULL,
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
650 gc);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
651 }
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
652
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
653 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
654 msn_show_set_mobile_phone(PurplePluginAction *action)
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
655 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
656 PurpleConnection *gc;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
657 MsnSession *session;
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
658
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
659 gc = (PurpleConnection *) action->context;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
660 session = gc->proto_data;
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
661
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
662 purple_request_input(gc, NULL, _("Set your mobile phone number."), NULL,
8697
c5e51aef2026 [gaim-migrate @ 9450]
Jon Oberheide
parents: 8691
diff changeset
663 msn_user_get_mobile_phone(session->user), FALSE, FALSE, NULL,
5491
38c414014f4f [gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents: 5481
diff changeset
664 _("OK"), G_CALLBACK(msn_set_mobile_phone_cb),
16490
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 15884
diff changeset
665 _("Cancel"), NULL,
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 15884
diff changeset
666 purple_connection_get_account(gc), NULL, NULL,
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
667 gc);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
668 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
669
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
670 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
671 msn_show_set_mobile_pages(PurplePluginAction *action)
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
672 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
673 PurpleConnection *gc;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
674
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
675 gc = (PurpleConnection *) action->context;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
676
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
677 purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"),
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
678 _("Do you want to allow or disallow people on "
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
679 "your buddy list to send you MSN Mobile pages "
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
680 "to your cell phone or other mobile device?"),
22265
81cc9a21d463 Minor improvements to the default_action used in purple_action_request
Mark Doliner <markdoliner@pidgin.im>
parents: 22230
diff changeset
681 PURPLE_DEFAULT_ACTION_NONE,
16490
68c22924d66b Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents: 15884
diff changeset
682 purple_connection_get_account(gc), NULL, NULL,
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
683 gc, 3,
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
684 _("Allow"), G_CALLBACK(enable_msn_pages_cb),
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
685 _("Disallow"), G_CALLBACK(disable_msn_pages_cb),
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
686 _("Cancel"), NULL);
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
687 }
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
688
23839
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23830
diff changeset
689 /* QuLogic: Disabled until confirmed correct. */
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23830
diff changeset
690 #if 0
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
691 static void
23789
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
692 msn_show_blocked_text(PurplePluginAction *action)
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
693 {
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
694 PurpleConnection *pc = (PurpleConnection *) action->context;
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
695 MsnSession *session;
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
696 char *title;
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
697
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
698 session = pc->proto_data;
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
699
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
700 title = g_strdup_printf(_("Blocked Text for %s"), session->account->username);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
701 if (session->blocked_text == NULL) {
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
702 purple_notify_formatted(pc, title, title, NULL, _("No text is blocked for this account."), NULL, NULL);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
703 } else {
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
704 char *blocked_text;
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
705 blocked_text = g_strdup_printf(_("MSN servers are currently blocking the following regular expressions:<br/>%s"),
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
706 session->blocked_text);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
707
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
708 purple_notify_formatted(pc, title, title, NULL, blocked_text, NULL, NULL);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
709 g_free(blocked_text);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
710 }
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
711 g_free(title);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
712 }
23839
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23830
diff changeset
713 #endif
23789
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
714
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
715 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
716 msn_show_hotmail_inbox(PurplePluginAction *action)
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
717 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
718 PurpleConnection *gc;
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
719 MsnSession *session;
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
720
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
721 gc = (PurpleConnection *) action->context;
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
722 session = gc->proto_data;
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
723
23923
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23922
diff changeset
724 if (!session->passport_info.email_enabled) {
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23922
diff changeset
725 purple_notify_error(gc, NULL,
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23922
diff changeset
726 _("This account does not have email enabled."), NULL);
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23922
diff changeset
727 return;
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23922
diff changeset
728 }
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23922
diff changeset
729
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
730 /** apparently the correct value is 777, use 750 as a failsafe */
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
731 if ((session->passport_info.mail_url == NULL)
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
732 || (time (NULL) - session->passport_info.mail_timestamp >= 750)) {
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
733 MsnTransaction *trans;
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
734 MsnCmdProc *cmdproc;
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
735
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
736 cmdproc = session->notification->cmdproc;
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
737
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
738 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
23923
79bcb6763b5c Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23922
diff changeset
739 msn_transaction_set_data(trans, GUINT_TO_POINTER(TRUE));
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
740
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
741 msn_cmdproc_send_trans(cmdproc, trans);
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
742
23924
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
743 } else
1f8e75759bf3 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23923
diff changeset
744 purple_notify_uri(gc, session->passport_info.mail_url);
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
745 }
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
746
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
747 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
748 show_send_to_mobile_cb(PurpleBlistNode *node, gpointer ignored)
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
749 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
750 PurpleBuddy *buddy;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
751 PurpleConnection *gc;
9042
a44973ada5fe [gaim-migrate @ 9818]
Luke Schierer <lschiere@pidgin.im>
parents: 9041
diff changeset
752 MsnMobileData *data;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
753 PurpleAccount *account;
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
754 const char *name;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
755
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
756 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
757
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
758 buddy = (PurpleBuddy *) node;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
759 account = purple_buddy_get_account(buddy);
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
760 gc = purple_account_get_connection(account);
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
761 name = purple_buddy_get_name(buddy);
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
762
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
763 data = g_new0(MsnMobileData, 1);
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
764 data->gc = gc;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
765 data->passport = name;
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
766
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
767 purple_request_input(gc, NULL, _("Send a mobile message."), NULL,
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
768 NULL, TRUE, FALSE, NULL,
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
769 _("Page"), G_CALLBACK(send_to_mobile_cb),
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
770 _("Close"), G_CALLBACK(close_mobile_page_cb),
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
771 account, name, NULL,
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
772 data);
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
773 }
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
774
16890
3ea8e90bacd1 Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@pidgin.im>
parents: 16746
diff changeset
775 static gboolean
3ea8e90bacd1 Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@pidgin.im>
parents: 16746
diff changeset
776 msn_offline_message(const PurpleBuddy *buddy) {
24153
486c95be10e0 correctly say we support offline messages for all buddies, this was never
Ka-Hing Cheung <khc@pidgin.im>
parents: 24073
diff changeset
777 return TRUE;
16890
3ea8e90bacd1 Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@pidgin.im>
parents: 16746
diff changeset
778 }
3ea8e90bacd1 Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@pidgin.im>
parents: 16746
diff changeset
779
20542
e92b022fd611 In the initial ADL listing, send the commands in the correct sequence as required by the server: BLP, ADL and PRP. When the server acknowledges this initial ADL, send CHG with status information
Carlos Silva <typ0@pidgin.im>
parents: 20539
diff changeset
780 void
e92b022fd611 In the initial ADL listing, send the commands in the correct sequence as required by the server: BLP, ADL and PRP. When the server acknowledges this initial ADL, send CHG with status information
Carlos Silva <typ0@pidgin.im>
parents: 20539
diff changeset
781 msn_send_privacy(PurpleConnection *gc)
e92b022fd611 In the initial ADL listing, send the commands in the correct sequence as required by the server: BLP, ADL and PRP. When the server acknowledges this initial ADL, send CHG with status information
Carlos Silva <typ0@pidgin.im>
parents: 20539
diff changeset
782 {
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
783 PurpleAccount *account;
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
784 MsnSession *session;
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
785 MsnCmdProc *cmdproc;
30908
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
786 MsnTransaction *trans;
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
787
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
788 account = purple_connection_get_account(gc);
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
789 session = gc->proto_data;
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
790 cmdproc = session->notification->cmdproc;
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
791
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
792 if (account->perm_deny == PURPLE_PRIVACY_ALLOW_ALL ||
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
793 account->perm_deny == PURPLE_PRIVACY_DENY_USERS)
30908
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
794 trans = msn_transaction_new(cmdproc, "BLP", "%s", "AL");
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
795 else
30908
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
796 trans = msn_transaction_new(cmdproc, "BLP", "%s", "BL");
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
797
a56cb7eb6036 msn: Delete msn_cmdproc_send since it just have duplicated code from
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30902
diff changeset
798 msn_cmdproc_send_trans(cmdproc, trans);
20542
e92b022fd611 In the initial ADL listing, send the commands in the correct sequence as required by the server: BLP, ADL and PRP. When the server acknowledges this initial ADL, send CHG with status information
Carlos Silva <typ0@pidgin.im>
parents: 20539
diff changeset
799 }
e92b022fd611 In the initial ADL listing, send the commands in the correct sequence as required by the server: BLP, ADL and PRP. When the server acknowledges this initial ADL, send CHG with status information
Carlos Silva <typ0@pidgin.im>
parents: 20539
diff changeset
800
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
801 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
802 initiate_chat_cb(PurpleBlistNode *node, gpointer data)
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
803 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
804 PurpleBuddy *buddy;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
805 PurpleConnection *gc;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
806 PurpleAccount *account;
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
807
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
808 MsnSession *session;
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
809 MsnSwitchBoard *swboard;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
810
24006
acaac2aa49b7 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24000
diff changeset
811 const char *alias;
acaac2aa49b7 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24000
diff changeset
812
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
813 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
814
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
815 buddy = (PurpleBuddy *) node;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
816 account = purple_buddy_get_account(buddy);
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
817 gc = purple_account_get_connection(account);
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
818
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
819 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
820
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
821 swboard = msn_switchboard_new(session);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
822 msn_switchboard_request(swboard);
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
823 msn_switchboard_request_add_user(swboard, purple_buddy_get_name(buddy));
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
824
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
825 /* 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: 22133
diff changeset
826 swboard->chat_id = msn_switchboard_get_chat_id();
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
827 swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat");
10773
ef88ffed66eb [gaim-migrate @ 12382]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10738
diff changeset
828 swboard->flag = MSN_SB_FLAG_IM;
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
829
24006
acaac2aa49b7 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24000
diff changeset
830 /* Local alias > Display name > Username */
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
831 if ((alias = purple_account_get_alias(account)) == NULL)
24006
acaac2aa49b7 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24000
diff changeset
832 if ((alias = purple_connection_get_display_name(gc)) == NULL)
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
833 alias = purple_account_get_username(account);
24006
acaac2aa49b7 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24000
diff changeset
834
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
835 purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv),
24006
acaac2aa49b7 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24000
diff changeset
836 alias, NULL, PURPLE_CBFLAGS_NONE, TRUE);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
837 }
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
838
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
839 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
840 t_msn_xfer_init(PurpleXfer *xfer)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
841 {
31033
466924b5b42c Move file request up in the stack.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30960
diff changeset
842 msn_request_ft(xfer);
30046
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
843 }
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
844
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
845 static void
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
846 t_msn_xfer_cancel_send(PurpleXfer *xfer)
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
847 {
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
848 MsnSlpLink *slplink = xfer->data;
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
849 msn_slplink_unref(slplink);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
850 }
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
851
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
852 static PurpleXfer*
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
853 msn_new_xfer(PurpleConnection *gc, const char *who)
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
854 {
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
855 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
856 PurpleXfer *xfer;
12161
3c0edd63fe96 [gaim-migrate @ 14462]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12143
diff changeset
857
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
858 session = gc->proto_data;
12161
3c0edd63fe96 [gaim-migrate @ 14462]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12143
diff changeset
859
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
860 xfer = purple_xfer_new(gc->account, PURPLE_XFER_SEND, who);
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
861
24633
7ee2fe561fa7 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <markdoliner@pidgin.im>
parents: 24420
diff changeset
862 g_return_val_if_fail(xfer != NULL, NULL);
7ee2fe561fa7 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <markdoliner@pidgin.im>
parents: 24420
diff changeset
863
30046
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
864 xfer->data = msn_slplink_ref(msn_session_get_slplink(session, who));
24633
7ee2fe561fa7 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <markdoliner@pidgin.im>
parents: 24420
diff changeset
865
7ee2fe561fa7 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <markdoliner@pidgin.im>
parents: 24420
diff changeset
866 purple_xfer_set_init_fnc(xfer, t_msn_xfer_init);
30046
b1109ea8d963 Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29965
diff changeset
867 purple_xfer_set_cancel_send_fnc(xfer, t_msn_xfer_cancel_send);
12161
3c0edd63fe96 [gaim-migrate @ 14462]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12143
diff changeset
868
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11992
diff changeset
869 return xfer;
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11992
diff changeset
870 }
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
871
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11992
diff changeset
872 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
873 msn_send_file(PurpleConnection *gc, const char *who, const char *file)
12143
09f216663302 [gaim-migrate @ 14444]
Evan Schoenberg <evands@pidgin.im>
parents: 11992
diff changeset
874 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
875 PurpleXfer *xfer = msn_new_xfer(gc, who);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
876
9466
b6425eab60ca [gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents: 9363
diff changeset
877 if (file)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
878 purple_xfer_request_accepted(xfer, file);
9466
b6425eab60ca [gaim-migrate @ 10291]
Daniel Atallah <datallah@pidgin.im>
parents: 9363
diff changeset
879 else
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
880 purple_xfer_request(xfer);
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
881 }
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
882
10116
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
883 static gboolean
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
884 msn_can_receive_file(PurpleConnection *gc, const char *who)
10116
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
885 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
886 PurpleAccount *account;
23928
345ec6709d3b Fix a crash when the user isn't in your list.
Daniel Atallah <datallah@pidgin.im>
parents: 23924
diff changeset
887 gchar *normal;
10116
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
888 gboolean ret;
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
889
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
890 account = purple_connection_get_account(gc);
10116
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
891
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
892 normal = g_strdup(msn_normalize(account, purple_account_get_username(account)));
10116
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
893 ret = strcmp(normal, msn_normalize(account, who));
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
894 g_free(normal);
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
895
23921
48f0392f47e9 Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23872
diff changeset
896 if (ret) {
23928
345ec6709d3b Fix a crash when the user isn't in your list.
Daniel Atallah <datallah@pidgin.im>
parents: 23924
diff changeset
897 MsnSession *session = gc->proto_data;
23940
fc45c1d8ff30 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23928
diff changeset
898 if (session) {
fc45c1d8ff30 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23928
diff changeset
899 MsnUser *user = msn_userlist_find_user(session->userlist, who);
28787
26e9c95a91ae Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28731
diff changeset
900 if (user) {
23940
fc45c1d8ff30 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23928
diff changeset
901 /* Include these too: MSN_CLIENT_CAP_MSNMOBILE|MSN_CLIENT_CAP_MSNDIRECT ? */
28787
26e9c95a91ae Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28731
diff changeset
902 if ((user->clientid & MSN_CLIENT_CAP_WEBMSGR) ||
26e9c95a91ae Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28731
diff changeset
903 user->networkid == MSN_NETWORK_YAHOO)
26e9c95a91ae Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28731
diff changeset
904 ret = FALSE;
26e9c95a91ae Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28731
diff changeset
905 else
26e9c95a91ae Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28731
diff changeset
906 ret = TRUE;
26e9c95a91ae Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 28731
diff changeset
907 }
23940
fc45c1d8ff30 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23928
diff changeset
908 } else
fc45c1d8ff30 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23928
diff changeset
909 ret = FALSE;
23921
48f0392f47e9 Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23872
diff changeset
910 }
48f0392f47e9 Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23872
diff changeset
911
10116
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
912 return ret;
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
913 }
054b064145a1 [gaim-migrate @ 11153]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10102
diff changeset
914
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
915 /**************************************************************************
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
916 * Protocol Plugin ops
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
917 **************************************************************************/
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
918
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
919 static const char *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
920 msn_list_icon(PurpleAccount *a, PurpleBuddy *b)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
921 {
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
922 return "msn";
2993
0340d0a8b810 [gaim-migrate @ 3006]
Rob Flynn <gaim@robflynn.com>
parents: 2970
diff changeset
923 }
0340d0a8b810 [gaim-migrate @ 3006]
Rob Flynn <gaim@robflynn.com>
parents: 2970
diff changeset
924
23791
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
925 static const char *
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
926 msn_list_emblems(PurpleBuddy *b)
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
927 {
24946
390536329dc5 Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24571
diff changeset
928 MsnUser *user = purple_buddy_get_protocol_data(b);
23791
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
929
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
930 if (user != NULL) {
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
931 if (user->clientid & MSN_CLIENT_CAP_BOT)
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
932 return "bot";
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
933 if (user->clientid & MSN_CLIENT_CAP_WIN_MOBILE)
23922
979a9f52387d On MSN, use "external" and "mobile" for Web messenger and mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23921
diff changeset
934 return "mobile";
23791
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
935 #if 0
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
936 /* XXX: Since we don't support this, there's no point in showing it just yet */
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
937 if (user->clientid & MSN_CLIENT_CAP_SCHANNEL)
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
938 return "secure";
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
939 #endif
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
940 if (user->clientid & MSN_CLIENT_CAP_WEBMSGR)
23922
979a9f52387d On MSN, use "external" and "mobile" for Web messenger and mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23921
diff changeset
941 return "external";
23791
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
942 if (user->networkid == MSN_NETWORK_YAHOO)
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
943 return "yahoo";
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
944 }
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
945
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
946 return NULL;
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
947 }
a11ef8611747 Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23789
diff changeset
948
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
949 /*
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
950 * Set the User status text
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
951 */
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
952 static char *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
953 msn_status_text(PurpleBuddy *buddy)
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
954 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
955 PurplePresence *presence;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
956 PurpleStatus *status;
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
957 const char *msg;
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
958
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
959 presence = purple_buddy_get_presence(buddy);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
960 status = purple_presence_get_active_status(presence);
9951
19b949eca7f8 [gaim-migrate @ 10847]
Nathan Walp <nwalp@pidgin.im>
parents: 9943
diff changeset
961
25402
1ec1160f61f4 xmpp does this!
Ka-Hing Cheung <khc@pidgin.im>
parents: 25156
diff changeset
962 /* Official client says media takes precedence over message */
1ec1160f61f4 xmpp does this!
Ka-Hing Cheung <khc@pidgin.im>
parents: 25156
diff changeset
963 /* I say message take precedence over media! Plus prpl-jabber agrees
1ec1160f61f4 xmpp does this!
Ka-Hing Cheung <khc@pidgin.im>
parents: 25156
diff changeset
964 too */
1ec1160f61f4 xmpp does this!
Ka-Hing Cheung <khc@pidgin.im>
parents: 25156
diff changeset
965 msg = purple_status_get_attr_string(status, "message");
1ec1160f61f4 xmpp does this!
Ka-Hing Cheung <khc@pidgin.im>
parents: 25156
diff changeset
966 if (msg && *msg)
1ec1160f61f4 xmpp does this!
Ka-Hing Cheung <khc@pidgin.im>
parents: 25156
diff changeset
967 return g_markup_escape_text(msg, -1);
1ec1160f61f4 xmpp does this!
Ka-Hing Cheung <khc@pidgin.im>
parents: 25156
diff changeset
968
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
969 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
970 const char *title, *game, *office;
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
971 char *media, *esc;
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
972 status = purple_presence_get_status(presence, "tune");
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
973 title = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE);
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
974
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
975 game = purple_status_get_attr_string(status, "game");
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
976 office = purple_status_get_attr_string(status, "office");
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
977
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
978 if (title && *title) {
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
979 const char *artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
980 const char *album = purple_status_get_attr_string(status, PURPLE_TUNE_ALBUM);
27755
fdf193e013c4 Use purple_util_format_song_info in MSN/XMPP for the buddy list status text.
Paul Aurich <darkrain42@pidgin.im>
parents: 27654
diff changeset
981 media = purple_util_format_song_info(title, artist, album, NULL);
27780
e48b7c1b0f20 Don't double-escape media.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27779
diff changeset
982 return media;
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
983 }
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
984 else if (game && *game)
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
985 media = g_strdup_printf("Playing %s", game);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
986 else if (office && *office)
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
987 media = g_strdup_printf("Editing %s", office);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
988 else
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
989 return NULL;
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
990 esc = g_markup_escape_text(media, -1);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
991 g_free(media);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
992 return esc;
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
993 }
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
994
10057
f5670751740c [gaim-migrate @ 11022]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10049
diff changeset
995 return NULL;
f5670751740c [gaim-migrate @ 11022]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10049
diff changeset
996 }
f5670751740c [gaim-migrate @ 11022]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10049
diff changeset
997
12970
c2f3b4dcf711 [gaim-migrate @ 15323]
Richard Laager <rlaager@pidgin.im>
parents: 12948
diff changeset
998 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
999 msn_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full)
10057
f5670751740c [gaim-migrate @ 11022]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10049
diff changeset
1000 {
f5670751740c [gaim-migrate @ 11022]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10049
diff changeset
1001 MsnUser *user;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1002 PurplePresence *presence = purple_buddy_get_presence(buddy);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1003 PurpleStatus *status = purple_presence_get_active_status(presence);
10057
f5670751740c [gaim-migrate @ 11022]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10049
diff changeset
1004
24946
390536329dc5 Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24571
diff changeset
1005 user = purple_buddy_get_protocol_data(buddy);
10057
f5670751740c [gaim-migrate @ 11022]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10049
diff changeset
1006
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1007 if (purple_presence_is_online(presence))
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1008 {
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1009 const char *psm, *name;
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1010 const char *mediatype = NULL;
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1011 char *currentmedia = NULL;
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
1012 char *tmp;
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
1013
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
1014 psm = purple_status_get_attr_string(status, "message");
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1015 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1016 PurpleStatus *tune = purple_presence_get_status(presence, "tune");
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1017 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE);
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1018 const char *game = purple_status_get_attr_string(tune, "game");
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1019 const char *office = purple_status_get_attr_string(tune, "office");
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1020 if (title && *title) {
24772
c87747478d71 Only get the artist and album if we are setting a Music mediatype.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
1021 const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST);
c87747478d71 Only get the artist and album if we are setting a Music mediatype.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24771
diff changeset
1022 const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM);
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1023 mediatype = _("Now Listening");
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1024 currentmedia = purple_util_format_song_info(title, artist, album, NULL);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1025 } else if (game && *game) {
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1026 mediatype = _("Playing a game");
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1027 currentmedia = g_strdup(game);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1028 } else if (office && *office) {
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1029 mediatype = _("Working");
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1030 currentmedia = g_strdup(office);
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1031 }
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1032 }
13905
87ed03dbbe7e [gaim-migrate @ 17181]
Ma Yuan <mayuan2006@gmail.com>
parents: 13900
diff changeset
1033
21407
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1034 if (!purple_status_is_available(status)) {
20586
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1035 name = purple_status_get_name(status);
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1036 } else {
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1037 name = NULL;
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1038 }
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1039
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1040 if (name != NULL && *name) {
21407
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1041 char *tmp2;
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1042
24073
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1043 tmp2 = g_markup_escape_text(name, -1);
21407
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1044 if (purple_presence_is_idle(presence)) {
24073
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1045 char *idle;
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1046 char *tmp3;
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1047 /* Never know what those translations might end up like... */
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1048 idle = g_markup_escape_text(_("Idle"), -1);
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1049 tmp3 = g_strdup_printf("%s/%s", tmp2, idle);
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1050 g_free(idle);
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1051 g_free(tmp2);
9c569eb69980 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24072
diff changeset
1052 tmp2 = tmp3;
21407
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1053 }
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
1054
20586
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1055 if (psm != NULL && *psm) {
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1056 tmp = g_markup_escape_text(psm, -1);
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1057 purple_notify_user_info_add_pair(user_info, tmp2, tmp);
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1058 g_free(tmp);
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1059 } else {
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1060 purple_notify_user_info_add_pair(user_info, _("Status"), tmp2);
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1061 }
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1062
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1063 g_free(tmp2);
928a73117b1c Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@pidgin.im>
parents: 20571
diff changeset
1064 } else {
20639
e52bdb8edd5b don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@pidgin.im>
parents: 20626
diff changeset
1065 if (psm != NULL && *psm) {
e52bdb8edd5b don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@pidgin.im>
parents: 20626
diff changeset
1066 tmp = g_markup_escape_text(psm, -1);
21407
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1067 if (purple_presence_is_idle(presence)) {
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1068 purple_notify_user_info_add_pair(user_info, _("Idle"), tmp);
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1069 } else {
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1070 purple_notify_user_info_add_pair(user_info, _("Status"), tmp);
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1071 }
20639
e52bdb8edd5b don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@pidgin.im>
parents: 20626
diff changeset
1072 g_free(tmp);
21407
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1073 } else {
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1074 if (purple_presence_is_idle(presence)) {
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1075 purple_notify_user_info_add_pair(user_info, _("Status"),
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1076 _("Idle"));
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1077 } else {
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1078 purple_notify_user_info_add_pair(user_info, _("Status"),
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1079 purple_status_get_name(status));
0c6e5c795937 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@pidgin.im>
parents: 21381
diff changeset
1080 }
20639
e52bdb8edd5b don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@pidgin.im>
parents: 20626
diff changeset
1081 }
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
1082 }
20555
c0b556851de1 removed "PSM:" label and move the message to "Status:" to be consistent with
Ka-Hing Cheung <khc@pidgin.im>
parents: 20553
diff changeset
1083
16183
92409c474659 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@pidgin.im>
parents: 15884
diff changeset
1084 if (currentmedia) {
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1085 purple_notify_user_info_add_pair(user_info, mediatype, currentmedia);
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1086 g_free(currentmedia);
20473
91e1b3a49d10 msn.tgz from SF Patch #1621854 from Ka-Hing Cheung
Ka-Hing Cheung <khc@pidgin.im>
parents: 20472
diff changeset
1087 }
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
1088 }
12948
0867a553ed26 [gaim-migrate @ 15301]
Richard Laager <rlaager@pidgin.im>
parents: 12943
diff changeset
1089
0867a553ed26 [gaim-migrate @ 15301]
Richard Laager <rlaager@pidgin.im>
parents: 12943
diff changeset
1090 /* XXX: This is being shown in non-full tooltips because the
0867a553ed26 [gaim-migrate @ 15301]
Richard Laager <rlaager@pidgin.im>
parents: 12943
diff changeset
1091 * XXX: blocked icon overlay isn't always accurate for MSN.
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1092 * XXX: This can die as soon as purple_privacy_check() knows that
12948
0867a553ed26 [gaim-migrate @ 15301]
Richard Laager <rlaager@pidgin.im>
parents: 12943
diff changeset
1093 * XXX: this prpl always honors both the allow and deny lists. */
21101
1930e94a2028 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21076
diff changeset
1094 /* While the above comment may be strictly correct (the privacy API needs
1930e94a2028 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21076
diff changeset
1095 * rewriteing), purple_privacy_check() is going to be more accurate at
1930e94a2028 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21076
diff changeset
1096 * indicating whether a particular buddy is going to be able to message
1930e94a2028 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21076
diff changeset
1097 * you, which is the important information that this is trying to convey.
1930e94a2028 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21076
diff changeset
1098 */
1930e94a2028 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21076
diff changeset
1099 if (full && user)
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
1100 {
22387
47aab6e7eae8 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22265
diff changeset
1101 const char *phone;
47aab6e7eae8 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22265
diff changeset
1102
24245
c159dcb1f5de We can't have ./configure lying to you, can we?
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24153
diff changeset
1103 purple_notify_user_info_add_pair(user_info, _("Has you"),
c159dcb1f5de We can't have ./configure lying to you, can we?
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24153
diff changeset
1104 ((user->list_op & (1 << MSN_LIST_RL)) ? _("Yes") : _("No")));
c159dcb1f5de We can't have ./configure lying to you, can we?
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24153
diff changeset
1105
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1106 purple_notify_user_info_add_pair(user_info, _("Blocked"),
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
1107 ((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: 22265
diff changeset
1108
47aab6e7eae8 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22265
diff changeset
1109 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: 22265
diff changeset
1110 if (phone != NULL)
47aab6e7eae8 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22265
diff changeset
1111 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: 22265
diff changeset
1112
47aab6e7eae8 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22265
diff changeset
1113 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: 22265
diff changeset
1114 if (phone != NULL)
47aab6e7eae8 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22265
diff changeset
1115 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: 22265
diff changeset
1116
47aab6e7eae8 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22265
diff changeset
1117 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: 22265
diff changeset
1118 if (phone != NULL)
47aab6e7eae8 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22265
diff changeset
1119 purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), phone);
10093
e22f76d46b0b [gaim-migrate @ 11111]
Evan Schoenberg <evands@pidgin.im>
parents: 10069
diff changeset
1120 }
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1121 }
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1122
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1123 static GList *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1124 msn_status_types(PurpleAccount *account)
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1125 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1126 PurpleStatusType *status;
9951
19b949eca7f8 [gaim-migrate @ 10847]
Nathan Walp <nwalp@pidgin.im>
parents: 9943
diff changeset
1127 GList *types = NULL;
19b949eca7f8 [gaim-migrate @ 10847]
Nathan Walp <nwalp@pidgin.im>
parents: 9943
diff changeset
1128
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1129 status = purple_status_type_new_with_attrs(
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1130 PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE,
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1131 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
1132 NULL);
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1133 types = g_list_append(types, status);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1134
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1135 status = purple_status_type_new_with_attrs(
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1136 PURPLE_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE,
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1137 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
1138 NULL);
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1139 types = g_list_append(types, status);
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1140
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1141 status = purple_status_type_new_with_attrs(
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1142 PURPLE_STATUS_AWAY, "brb", _("Be Right Back"), TRUE, TRUE, FALSE,
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1143 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
1144 NULL);
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1145 types = g_list_append(types, status);
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1146
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1147 status = purple_status_type_new_with_attrs(
20520
49dd75a0c895 Patch from Pse to use the same status primitives as im.pidgin.pidgin for
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
1148 PURPLE_STATUS_UNAVAILABLE, "busy", _("Busy"), TRUE, TRUE, FALSE,
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1149 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
1150 NULL);
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1151 types = g_list_append(types, status);
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1152 status = purple_status_type_new_with_attrs(
20520
49dd75a0c895 Patch from Pse to use the same status primitives as im.pidgin.pidgin for
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20508
diff changeset
1153 PURPLE_STATUS_UNAVAILABLE, "phone", _("On the Phone"), TRUE, TRUE, FALSE,
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1154 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
1155 NULL);
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1156 types = g_list_append(types, status);
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1157 status = purple_status_type_new_with_attrs(
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1158 PURPLE_STATUS_AWAY, "lunch", _("Out to Lunch"), TRUE, TRUE, FALSE,
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
1159 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
13888
bda6f562e1e6 [gaim-migrate @ 17003]
Ma Yuan <mayuan2006@gmail.com>
parents: 13870
diff changeset
1160 NULL);
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1161 types = g_list_append(types, status);
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1162
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1163 status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE,
25552
ffd94785b2ad For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25415
diff changeset
1164 NULL, NULL, TRUE, TRUE, FALSE);
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1165 types = g_list_append(types, status);
9951
19b949eca7f8 [gaim-migrate @ 10847]
Nathan Walp <nwalp@pidgin.im>
parents: 9943
diff changeset
1166
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1167 status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE,
25552
ffd94785b2ad For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25415
diff changeset
1168 NULL, NULL, TRUE, TRUE, FALSE);
12658
4aa7a873628d [gaim-migrate @ 15001]
Mark Doliner <markdoliner@pidgin.im>
parents: 12645
diff changeset
1169 types = g_list_append(types, status);
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
1170
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1171 status = purple_status_type_new_full(PURPLE_STATUS_MOBILE,
15602
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1172 "mobile", NULL, FALSE, FALSE, TRUE);
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1173 types = g_list_append(types, status);
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
1174
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1175 status = purple_status_type_new_with_attrs(PURPLE_STATUS_TUNE,
24693
9ab5d932ab6c I don't know why we'd want the TUNE status to be saveable.
Richard Laager <rlaager@pidgin.im>
parents: 24652
diff changeset
1176 "tune", NULL, FALSE, TRUE, TRUE,
29965
d4d794093d2d Eliminate the name collisions on "Title". I have a few qualms:
Paul Aurich <darkrain42@pidgin.im>
parents: 29757
diff changeset
1177 PURPLE_TUNE_ARTIST, _("Tune Artist"), purple_value_new(PURPLE_TYPE_STRING),
d4d794093d2d Eliminate the name collisions on "Title". I have a few qualms:
Paul Aurich <darkrain42@pidgin.im>
parents: 29757
diff changeset
1178 PURPLE_TUNE_ALBUM, _("Tune Album"), purple_value_new(PURPLE_TYPE_STRING),
d4d794093d2d Eliminate the name collisions on "Title". I have a few qualms:
Paul Aurich <darkrain42@pidgin.im>
parents: 29757
diff changeset
1179 PURPLE_TUNE_TITLE, _("Tune Title"), purple_value_new(PURPLE_TYPE_STRING),
24771
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1180 "game", _("Game Title"), purple_value_new(PURPLE_TYPE_STRING),
7a17ecc0c85b Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24767
diff changeset
1181 "office", _("Office Title"), purple_value_new(PURPLE_TYPE_STRING),
21193
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1182 NULL);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1183 types = g_list_append(types, status);
e918a1846d03 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20639
diff changeset
1184
9951
19b949eca7f8 [gaim-migrate @ 10847]
Nathan Walp <nwalp@pidgin.im>
parents: 9943
diff changeset
1185 return types;
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1186 }
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1187
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1188 static GList *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1189 msn_actions(PurplePlugin *plugin, gpointer context)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1190 {
31189
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1191 PurpleConnection *gc;
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1192 MsnSession *session;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1193 GList *m = NULL;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1194 PurplePluginAction *act;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1195
31189
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1196 gc = (PurpleConnection *) context;
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1197 session = gc->proto_data;
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1198
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1199 act = purple_plugin_action_new(_("Set Friendly Name..."),
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1200 msn_show_set_friendly_name);
9015
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1201 m = g_list_append(m, act);
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
1202 m = g_list_append(m, NULL);
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
1203
31201
97dbb1e30ee1 Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31189
diff changeset
1204 if (purple_account_get_bool(session->account, "mpop", TRUE)
97dbb1e30ee1 Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31189
diff changeset
1205 && session->protocol_ver >= 16)
31189
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1206 {
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1207 act = purple_plugin_action_new(_("View Locations..."),
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1208 msn_show_locations);
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1209 m = g_list_append(m, act);
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1210 m = g_list_append(m, NULL);
82ef255d2c01 Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 31186
diff changeset
1211 }
29448
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
1212
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1213 act = purple_plugin_action_new(_("Set Home Phone Number..."),
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1214 msn_show_set_home_phone);
9015
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1215 m = g_list_append(m, act);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
1216
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1217 act = purple_plugin_action_new(_("Set Work Phone Number..."),
9015
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1218 msn_show_set_work_phone);
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1219 m = g_list_append(m, act);
5363
b6e28be0c9bd [gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents: 5361
diff changeset
1220
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1221 act = purple_plugin_action_new(_("Set Mobile Phone Number..."),
9015
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1222 msn_show_set_mobile_phone);
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1223 m = g_list_append(m, act);
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
1224 m = g_list_append(m, NULL);
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
1225
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
1226 #if 0
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1227 act = purple_plugin_action_new(_("Enable/Disable Mobile Devices..."),
9015
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1228 msn_show_set_mobile_support);
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1229 m = g_list_append(m, act);
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
1230 #endif
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
1231
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1232 act = purple_plugin_action_new(_("Allow/Disallow Mobile Pages..."),
9015
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1233 msn_show_set_mobile_pages);
3c27e9074fa2 [gaim-migrate @ 9791]
Christopher O'Brien <siege@pidgin.im>
parents: 8993
diff changeset
1234 m = g_list_append(m, act);
5364
d423753cfd63 [gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents: 5363
diff changeset
1235
23839
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23830
diff changeset
1236 /* QuLogic: Disabled until confirmed correct. */
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23830
diff changeset
1237 #if 0
23789
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
1238 m = g_list_append(m, NULL);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
1239 act = purple_plugin_action_new(_("View Blocked Text..."),
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
1240 msn_show_blocked_text);
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
1241 m = g_list_append(m, act);
23839
7351d841f0b5 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23830
diff changeset
1242 #endif
23789
3ef57c5a8d9c Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23784
diff changeset
1243
23866
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
1244 m = g_list_append(m, NULL);
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
1245 act = purple_plugin_action_new(_("Open Hotmail Inbox"),
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
1246 msn_show_hotmail_inbox);
6926fed80ff1 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23839
diff changeset
1247 m = g_list_append(m, act);
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
1248
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1249 return m;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1250 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1251
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1252 static GList *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1253 msn_buddy_menu(PurpleBuddy *buddy)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1254 {
5372
6fa63c80ea61 [gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents: 5369
diff changeset
1255 MsnUser *user;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1256
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1257 GList *m = NULL;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1258 PurpleMenuAction *act;
6858
a367cfd3e75f [gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents: 6842
diff changeset
1259
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1260 g_return_val_if_fail(buddy != NULL, NULL);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1261
24946
390536329dc5 Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24571
diff changeset
1262 user = purple_buddy_get_protocol_data(buddy);
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1263
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1264 if (user != NULL)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1265 {
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1266 if (user->mobile)
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1267 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1268 act = purple_menu_action_new(_("Send to Mobile"),
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1269 PURPLE_CALLBACK(show_send_to_mobile_cb),
12919
519199cca273 [gaim-migrate @ 15272]
Etan Reisner <deryni@pidgin.im>
parents: 12886
diff changeset
1270 NULL, NULL);
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1271 m = g_list_append(m, act);
5382
8580140115ea [gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents: 5379
diff changeset
1272 }
5369
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
1273 }
12dc1957e1b2 [gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents: 5364
diff changeset
1274
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
1275 if (g_ascii_strcasecmp(purple_buddy_get_name(buddy),
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
1276 purple_account_get_username(purple_buddy_get_account(buddy))))
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1277 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1278 act = purple_menu_action_new(_("Initiate _Chat"),
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1279 PURPLE_CALLBACK(initiate_chat_cb),
12919
519199cca273 [gaim-migrate @ 15272]
Etan Reisner <deryni@pidgin.im>
parents: 12886
diff changeset
1280 NULL, NULL);
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1281 m = g_list_append(m, act);
6148
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
1282 }
e3e81ed229c2 [gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents: 6059
diff changeset
1283
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1284 return m;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1285 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1286
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1287 static GList *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1288 msn_blist_node_menu(PurpleBlistNode *node)
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1289 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1290 if(PURPLE_BLIST_NODE_IS_BUDDY(node))
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1291 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1292 return msn_buddy_menu((PurpleBuddy *) node);
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1293 }
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1294 else
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1295 {
9030
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1296 return NULL;
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1297 }
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1298 }
7b574a641391 [gaim-migrate @ 9806]
Mark Doliner <markdoliner@pidgin.im>
parents: 9015
diff changeset
1299
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1300 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1301 msn_login(PurpleAccount *account)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1302 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1303 PurpleConnection *gc;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1304 MsnSession *session;
5564
1779a1bfbdb8 [gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
1305 const char *username;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1306 const char *host;
7288
486e8b44a14b [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7277
diff changeset
1307 gboolean http_method = FALSE;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1308 int port;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1309
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1310 gc = purple_account_get_connection(account);
7277
30f81cac2e3a [gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents: 7262
diff changeset
1311
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1312 if (!purple_ssl_is_supported())
7277
30f81cac2e3a [gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents: 7262
diff changeset
1313 {
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
1314 purple_connection_error_reason(gc,
21279
40685e1f50ca Rename:
Will Thompson <resiak@pidgin.im>
parents: 21211
diff changeset
1315 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
8499
bbe91550c012 [gaim-migrate @ 9235]
Robert Mibus <mibus@mibus.org>
parents: 8475
diff changeset
1316 _("SSL support is needed for MSN. Please install a supported "
21934
520eb16688da Stu says this was unnecessary, that it is already there.
Luke Schierer <lschiere@pidgin.im>
parents: 21931
diff changeset
1317 "SSL library."));
7277
30f81cac2e3a [gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents: 7262
diff changeset
1318 return;
30f81cac2e3a [gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents: 7262
diff changeset
1319 }
30f81cac2e3a [gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents: 7262
diff changeset
1320
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1321 http_method = purple_account_get_bool(account, "http_method", FALSE);
7288
486e8b44a14b [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7277
diff changeset
1322
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
1323 if (http_method)
20171
619991c900b7 Merged MSN_HTTPCONN_SERVER fix
Evan Schoenberg <evands@pidgin.im>
parents: 20077
diff changeset
1324 host = purple_account_get_string(account, "http_method_server", MSN_HTTPCONN_SERVER);
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
1325 else
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
1326 host = purple_account_get_string(account, "server", MSN_SERVER);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1327 port = purple_account_get_int(account, "port", MSN_PORT);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1328
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1329 session = msn_session_new(account);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1330
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1331 gc->proto_data = session;
23010
6230fac29cee Show the custom smileys only on accounts that support it. References
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23008
diff changeset
1332 gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO | PURPLE_CONNECTION_NO_BGCOLOR |
6230fac29cee Show the custom smileys only on accounts that support it. References
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23008
diff changeset
1333 PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1334
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1335 msn_session_set_login_step(session, MSN_LOGIN_STEP_START);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1336
5564
1779a1bfbdb8 [gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
1337 /* Hmm, I don't like this. */
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1338 /* XXX shx: Me neither */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1339 username = msn_normalize(account, purple_account_get_username(account));
5564
1779a1bfbdb8 [gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents: 5518
diff changeset
1340
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1341 if (strcmp(username, purple_account_get_username(account)))
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1342 purple_account_set_username(account, username);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1343
29001
9e0cff9fd757 Due to a server change, the friendly name on MSN was being changed to the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28981
diff changeset
1344 username = purple_account_get_string(account, "display-name", NULL);
9e0cff9fd757 Due to a server change, the friendly name on MSN was being changed to the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28981
diff changeset
1345 purple_connection_set_display_name(gc, username);
9e0cff9fd757 Due to a server change, the friendly name on MSN was being changed to the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28981
diff changeset
1346
29448
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
1347 if (purple_account_get_string(account, "endpoint-name", NULL) == NULL) {
30925
7263e633a236 Don't hardcode "Pidgin" as the name of this endpoint. Instead, grab the
Mark Doliner <markdoliner@pidgin.im>
parents: 30921
diff changeset
1348 GHashTable *ui_info = purple_core_get_ui_info();
7263e633a236 Don't hardcode "Pidgin" as the name of this endpoint. Instead, grab the
Mark Doliner <markdoliner@pidgin.im>
parents: 30921
diff changeset
1349 const gchar *ui_name = ui_info ? g_hash_table_lookup(ui_info, "name") : NULL;
7263e633a236 Don't hardcode "Pidgin" as the name of this endpoint. Instead, grab the
Mark Doliner <markdoliner@pidgin.im>
parents: 30921
diff changeset
1350 purple_account_set_string(account, "endpoint-name",
7263e633a236 Don't hardcode "Pidgin" as the name of this endpoint. Instead, grab the
Mark Doliner <markdoliner@pidgin.im>
parents: 30921
diff changeset
1351 ui_name && *ui_name ? ui_name : PACKAGE_NAME);
29448
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
1352 }
6796411135f1 Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29001
diff changeset
1353
10568
15f02c0e7fc1 [gaim-migrate @ 11954]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10533
diff changeset
1354 if (!msn_session_connect(session, host, port, http_method))
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
1355 purple_connection_error_reason(gc,
21279
40685e1f50ca Rename:
Will Thompson <resiak@pidgin.im>
parents: 21211
diff changeset
1356 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
27635
0cd19038c417 More uniformity among disconnect error messages
Mark Doliner <markdoliner@pidgin.im>
parents: 27361
diff changeset
1357 _("Unable to connect"));
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1358 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1359
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1360 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1361 msn_close(PurpleConnection *gc)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1362 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1363 MsnSession *session;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1364
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1365 session = gc->proto_data;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1366
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1367 g_return_if_fail(session != NULL);
8298
eb6f1096ffa6 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 8291
diff changeset
1368
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1369 msn_session_destroy(session);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1370
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1371 gc->proto_data = NULL;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1372 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1373
17103
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1374 static gboolean
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1375 msn_send_me_im(gpointer data)
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1376 {
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1377 MsnIMData *imdata = data;
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1378 serv_got_im(imdata->gc, imdata->who, imdata->msg, imdata->flags, imdata->when);
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1379 g_free(imdata->msg);
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1380 g_free(imdata);
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1381 return FALSE;
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1382 }
d7806e6686a7 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17089
diff changeset
1383
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1384 static GString*
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1385 msn_msg_emoticon_add(GString *current, MsnEmoticon *emoticon)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1386 {
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1387 MsnObject *obj;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1388 char *strobj;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1389
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1390 if (emoticon == NULL)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1391 return current;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1392
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1393 obj = emoticon->obj;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1394
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1395 if (!obj)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1396 return current;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1397
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1398 strobj = msn_object_to_string(obj);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1399
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1400 if (current)
28350
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
1401 g_string_append_printf(current, "\t%s\t%s", emoticon->smile, strobj);
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1402 else {
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1403 current = g_string_new("");
28350
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
1404 g_string_printf(current, "%s\t%s", emoticon->smile, strobj);
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1405 }
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1406
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1407 g_free(strobj);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1408
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1409 return current;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1410 }
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1411
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1412 static void
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1413 msn_send_emoticons(MsnSwitchBoard *swboard, GString *body)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1414 {
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1415 MsnMessage *msg;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1416
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1417 g_return_if_fail(body != NULL);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1418
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1419 msg = msn_message_new(MSN_MSG_SLP);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1420 msn_message_set_content_type(msg, "text/x-mms-emoticon");
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1421 msn_message_set_flag(msg, 'N');
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1422 msn_message_set_bin_data(msg, body->str, body->len);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1423
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1424 msn_switchboard_send_msg(swboard, msg, TRUE);
31162
2c596217766b msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <markdoliner@pidgin.im>
parents: 31161
diff changeset
1425 msn_message_unref(msg);
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1426 }
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1427
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1428 static void msn_emoticon_destroy(MsnEmoticon *emoticon)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1429 {
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1430 if (emoticon->obj)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1431 msn_object_destroy(emoticon->obj);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1432 g_free(emoticon->smile);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1433 g_free(emoticon);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1434 }
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1435
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1436 static GSList* msn_msg_grab_emoticons(const char *msg, const char *username)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1437 {
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1438 GSList *list;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1439 GList *smileys;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1440 PurpleSmiley *smiley;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1441 PurpleStoredImage *img;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1442 char *ptr;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1443 MsnEmoticon *emoticon;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1444 int length;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1445
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1446 list = NULL;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1447 smileys = purple_smileys_get_all();
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1448 length = strlen(msg);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1449
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1450 for (; smileys; smileys = g_list_delete_link(smileys, smileys)) {
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1451 smiley = smileys->data;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1452
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1453 ptr = g_strstr_len(msg, length, purple_smiley_get_shortcut(smiley));
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1454
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1455 if (!ptr)
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1456 continue;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1457
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1458 img = purple_smiley_get_stored_image(smiley);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1459
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1460 emoticon = g_new0(MsnEmoticon, 1);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1461 emoticon->smile = g_strdup(purple_smiley_get_shortcut(smiley));
28351
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
1462 emoticon->ps = smiley;
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1463 emoticon->obj = msn_object_new_from_image(img,
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1464 purple_imgstore_get_filename(img),
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1465 username, MSN_OBJECT_EMOTICON);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1466
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1467 purple_imgstore_unref(img);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1468 list = g_slist_prepend(list, emoticon);
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1469 }
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1470
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1471 return list;
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1472 }
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1473
24420
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1474 void
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1475 msn_send_im_message(MsnSession *session, MsnMessage *msg)
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1476 {
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1477 MsnEmoticon *smile;
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1478 GSList *smileys;
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1479 GString *emoticons = NULL;
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1480 const char *username = purple_account_get_username(session->account);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1481 MsnSwitchBoard *swboard = msn_session_get_swboard(session, msg->remote_user, MSN_SB_FLAG_IM);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1482
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1483 smileys = msn_msg_grab_emoticons(msg->body, username);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1484 while (smileys) {
28351
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
1485 smile = (MsnEmoticon *)smileys->data;
24420
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1486 emoticons = msn_msg_emoticon_add(emoticons, smile);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1487 msn_emoticon_destroy(smile);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1488 smileys = g_slist_delete_link(smileys, smileys);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1489 }
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1490
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1491 if (emoticons) {
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1492 msn_send_emoticons(swboard, emoticons);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1493 g_string_free(emoticons, TRUE);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1494 }
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1495
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1496 msn_switchboard_send_msg(swboard, msg, TRUE);
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1497 }
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1498
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1499 static int
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1500 msn_send_im(PurpleConnection *gc, const char *who, const char *message,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1501 PurpleMessageFlags flags)
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1502 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1503 PurpleAccount *account;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1504 PurpleBuddy *buddy = purple_find_buddy(gc->account, who);
23800
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1505 MsnSession *session;
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1506 MsnSwitchBoard *swboard;
10275
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1507 MsnMessage *msg;
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1508 char *msgformat;
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1509 char *msgtext;
25563
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1510 size_t msglen;
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1511 const char *username;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1512
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
1513 purple_debug_info("msn", "send IM {%s} to %s\n", message, who);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1514 account = purple_connection_get_account(gc);
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1515 username = purple_account_get_username(account);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1516
23800
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1517 session = gc->proto_data;
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1518 swboard = msn_session_find_swboard(session, who);
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1519
24409
ab6b342e807d Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24245
diff changeset
1520 if (!strncmp("tel:+", who, 5)) {
ab6b342e807d Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24245
diff changeset
1521 char *text = purple_markup_strip_html(message);
ab6b342e807d Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24245
diff changeset
1522 send_to_mobile(gc, who, text);
ab6b342e807d Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24245
diff changeset
1523 g_free(text);
ab6b342e807d Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24245
diff changeset
1524 return 1;
ab6b342e807d Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24245
diff changeset
1525 }
ab6b342e807d Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24245
diff changeset
1526
15602
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1527 if (buddy) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1528 PurplePresence *p = purple_buddy_get_presence(buddy);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1529 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) {
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1530 char *text = purple_markup_strip_html(message);
15602
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1531 send_to_mobile(gc, who, text);
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1532 g_free(text);
15654
fb4e6617313e Get rid of a minor compile warning
Mark Doliner <markdoliner@pidgin.im>
parents: 15602
diff changeset
1533 return 1;
15602
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1534 }
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1535 }
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1536
10275
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1537 msn_import_html(message, &msgformat, &msgtext);
25563
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1538 msglen = strlen(msgtext);
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1539 if (msglen == 0) {
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1540 /* Stuff like <hr> will be ignored. Don't send an empty message
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1541 if that's all there is. */
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1542 g_free(msgtext);
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1543 g_free(msgformat);
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1544
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1545 return 0;
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1546 }
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1547
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
1548 if (msn_user_is_online(account, who) ||
23800
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1549 msn_user_is_yahoo(account, who) ||
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
1550 swboard != NULL) {
23800
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1551 /*User online or have a swboard open because it's invisible
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1552 * and sent us a message,then send Online Instant Message*/
8028755bd342 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
1553
25563
545c69f0b96b After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25552
diff changeset
1554 if (msglen + strlen(msgformat) + strlen(VERSION) > 1564)
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1555 {
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1556 g_free(msgformat);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1557 g_free(msgtext);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1558
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1559 return -E2BIG;
15602
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1560 }
6d1d20a9e297 This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1561
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1562 msg = msn_message_new_plain(msgtext);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1563 msg->remote_user = g_strdup(who);
29457
15f977c9ac76 Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <markdoliner@pidgin.im>
parents: 29455
diff changeset
1564 msn_message_set_header(msg, "X-MMS-IM-Format", msgformat);
10275
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1565
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1566 g_free(msgformat);
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1567 g_free(msgtext);
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1568
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23817
diff changeset
1569 purple_debug_info("msn", "prepare to send online Message\n");
22653
bed3d8152a58 The patch to msn to allow sending custom smileys. Doesn't send all the custom smileys correctly at the moment. References #1187.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22387
diff changeset
1570 if (g_ascii_strcasecmp(who, username))
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1571 {
24767
5c8dc430f692 Don't request an acknowledgement on an auto-response message and don't set a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24693
diff changeset
1572 if (flags & PURPLE_MESSAGE_AUTO_RESP) {
5c8dc430f692 Don't request an acknowledgement on an auto-response message and don't set a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24693
diff changeset
1573 msn_message_set_flag(msg, 'U');
5c8dc430f692 Don't request an acknowledgement on an auto-response message and don't set a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24693
diff changeset
1574 }
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
1575 if (msn_user_is_yahoo(account, who)) {
13900
ce507a208510 [gaim-migrate @ 17056]
Ma Yuan <mayuan2006@gmail.com>
parents: 13898
diff changeset
1576 /*we send the online and offline Message to Yahoo User via UBM*/
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23817
diff changeset
1577 purple_debug_info("msn", "send to Yahoo User\n");
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
1578 uum_send_msg(session, msg);
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
1579 } else {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23817
diff changeset
1580 purple_debug_info("msn", "send via switchboard\n");
24420
e83317602b22 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@pidgin.im>
parents: 24409
diff changeset
1581 msn_send_im_message(session, msg);
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1582 }
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1583 }
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1584 else
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1585 {
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1586 char *body_str, *body_enc, *pre, *post;
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1587 const char *format;
20496
a99bc3146636 fix up broken merge
Ka-Hing Cheung <khc@pidgin.im>
parents: 20495
diff changeset
1588 MsnIMData *imdata = g_new0(MsnIMData, 1);
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1589 /*
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1590 * In MSN, you can't send messages to yourself, so
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1591 * we'll fake like we received it ;)
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1592 */
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1593 body_str = msn_message_to_string(msg);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1594 body_enc = g_markup_escape_text(body_str, -1);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1595 g_free(body_str);
10275
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1596
29457
15f977c9ac76 Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <markdoliner@pidgin.im>
parents: 29455
diff changeset
1597 format = msn_message_get_header_value(msg, "X-MMS-IM-Format");
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1598 msn_parse_format(format, &pre, &post);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1599 body_str = g_strdup_printf("%s%s%s", pre ? pre : "",
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1600 body_enc ? body_enc : "", post ? post : "");
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1601 g_free(body_enc);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1602 g_free(pre);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1603 g_free(post);
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1604
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1605 serv_got_typing_stopped(gc, who);
20496
a99bc3146636 fix up broken merge
Ka-Hing Cheung <khc@pidgin.im>
parents: 20495
diff changeset
1606 imdata->gc = gc;
a99bc3146636 fix up broken merge
Ka-Hing Cheung <khc@pidgin.im>
parents: 20495
diff changeset
1607 imdata->who = who;
a99bc3146636 fix up broken merge
Ka-Hing Cheung <khc@pidgin.im>
parents: 20495
diff changeset
1608 imdata->msg = body_str;
27235
2d1171609956 Turn off the send-flag for messages we send to ourselves in MSN.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 26482
diff changeset
1609 imdata->flags = flags & ~PURPLE_MESSAGE_SEND;
20496
a99bc3146636 fix up broken merge
Ka-Hing Cheung <khc@pidgin.im>
parents: 20495
diff changeset
1610 imdata->when = time(NULL);
20934
9254018407d0 Prevent null pointer deref to fix CID 349. I don't think this is possible, but I suppose it may happen with a different UI.
Daniel Atallah <datallah@pidgin.im>
parents: 20852
diff changeset
1611 purple_timeout_add(0, msn_send_me_im, imdata);
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1612 }
8595
c751f6b0260e [gaim-migrate @ 9346]
Christian Hammond <chipx86@chipx86.com>
parents: 8591
diff changeset
1613
31162
2c596217766b msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <markdoliner@pidgin.im>
parents: 31161
diff changeset
1614 msn_message_unref(msg);
23762
8bb3533742fd fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@pidgin.im>
parents: 21630
diff changeset
1615 } else {
13900
ce507a208510 [gaim-migrate @ 17056]
Ma Yuan <mayuan2006@gmail.com>
parents: 13898
diff changeset
1616 /*send Offline Instant Message,only to MSN Passport User*/
13893
228bc0341563 [gaim-migrate @ 17034]
Ma Yuan <mayuan2006@gmail.com>
parents: 13888
diff changeset
1617 char *friendname;
20508
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20505
diff changeset
1618
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23817
diff changeset
1619 purple_debug_info("msn", "prepare to send offline Message\n");
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1620
13898
9bc455f616cb [gaim-migrate @ 17045]
Ma Yuan <mayuan2006@gmail.com>
parents: 13897
diff changeset
1621 friendname = msn_encode_mime(account->username);
21361
f890366c8ec6 oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@pidgin.im>
parents: 20607
diff changeset
1622 msn_oim_prep_send_msg_info(session->oim,
f890366c8ec6 oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@pidgin.im>
parents: 20607
diff changeset
1623 purple_account_get_username(account),
23763
bbd719418998 oops, sending the format data probably isn't very useful. Unless you try
Ka-Hing Cheung <khc@pidgin.im>
parents: 23762
diff changeset
1624 friendname, who, msgtext);
21361
f890366c8ec6 oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@pidgin.im>
parents: 20607
diff changeset
1625 msn_oim_send_msg(session->oim);
23762
8bb3533742fd fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@pidgin.im>
parents: 21630
diff changeset
1626
8bb3533742fd fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@pidgin.im>
parents: 21630
diff changeset
1627 g_free(msgformat);
8bb3533742fd fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@pidgin.im>
parents: 21630
diff changeset
1628 g_free(msgtext);
21361
f890366c8ec6 oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@pidgin.im>
parents: 20607
diff changeset
1629 g_free(friendname);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1630 }
10275
186d84a66cc3 [gaim-migrate @ 11428]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10274
diff changeset
1631
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1632 return 1;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1633 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1634
13844
835b8f7b3d1d [gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents: 13713
diff changeset
1635 static unsigned int
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1636 msn_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1637 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1638 PurpleAccount *account;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1639 MsnSession *session;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1640 MsnSwitchBoard *swboard;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1641 MsnMessage *msg;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1642
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1643 account = purple_connection_get_account(gc);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1644 session = gc->proto_data;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1645
13844
835b8f7b3d1d [gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents: 13713
diff changeset
1646 /*
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1647 * TODO: I feel like this should be "if (state != PURPLE_TYPING)"
13844
835b8f7b3d1d [gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents: 13713
diff changeset
1648 * but this is how it was before, and I don't want to break
835b8f7b3d1d [gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents: 13713
diff changeset
1649 * anything. --KingAnt
835b8f7b3d1d [gaim-migrate @ 16295]
Mark Doliner <markdoliner@pidgin.im>
parents: 13713
diff changeset
1650 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1651 if (state == PURPLE_NOT_TYPING)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1652 return 0;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1653
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1654 if (!g_ascii_strcasecmp(who, purple_account_get_username(account)))
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1655 {
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1656 /* We'll just fake it, since we're sending to ourself. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1657 serv_got_typing(gc, who, MSN_TYPING_RECV_TIMEOUT, PURPLE_TYPING);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1658
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1659 return MSN_TYPING_SEND_TIMEOUT;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1660 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1661
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
1662 swboard = msn_session_find_swboard(session, who);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1663
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1664 if (swboard == NULL || !msn_switchboard_can_send(swboard))
10346
9c65a007b4a5 [gaim-migrate @ 11560]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10345
diff changeset
1665 return 0;
9c65a007b4a5 [gaim-migrate @ 11560]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10345
diff changeset
1666
10773
ef88ffed66eb [gaim-migrate @ 12382]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10738
diff changeset
1667 swboard->flag |= MSN_SB_FLAG_IM;
ef88ffed66eb [gaim-migrate @ 12382]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10738
diff changeset
1668
10225
0dfea1bc8695 [gaim-migrate @ 11357]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10116
diff changeset
1669 msg = msn_message_new(MSN_MSG_TYPING);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1670 msn_message_set_content_type(msg, "text/x-msmsgscontrol");
5505
176c91a635b7 [gaim-migrate @ 5904]
Christian Hammond <chipx86@chipx86.com>
parents: 5498
diff changeset
1671 msn_message_set_flag(msg, 'U');
29457
15f977c9ac76 Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <markdoliner@pidgin.im>
parents: 29455
diff changeset
1672 msn_message_set_header(msg, "TypingUser",
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1673 purple_account_get_username(account));
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1674 msn_message_set_bin_data(msg, "\r\n", 2);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1675
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
1676 msn_switchboard_send_msg(swboard, msg, FALSE);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1677
31162
2c596217766b msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <markdoliner@pidgin.im>
parents: 31161
diff changeset
1678 msn_message_unref(msg);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1679
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1680 return MSN_TYPING_SEND_TIMEOUT;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1681 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1682
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1683 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1684 msn_set_status(PurpleAccount *account, PurpleStatus *status)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1685 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1686 PurpleConnection *gc;
11992
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11920
diff changeset
1687 MsnSession *session;
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1688
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1689 gc = purple_account_get_connection(account);
9967
7400b348ff62 [gaim-migrate @ 10877]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9953
diff changeset
1690
11028
b3568dd036a9 [gaim-migrate @ 12906]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10914
diff changeset
1691 if (gc != NULL)
11992
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11920
diff changeset
1692 {
10646
e5930d962239 [gaim-migrate @ 12162]
Sean Egan <seanegan@pidgin.im>
parents: 10621
diff changeset
1693 session = gc->proto_data;
11992
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11920
diff changeset
1694 msn_change_status(session);
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11920
diff changeset
1695 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1696 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1697
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1698 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1699 msn_set_idle(PurpleConnection *gc, int idle)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1700 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1701 MsnSession *session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1702
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1703 session = gc->proto_data;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1704
11992
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11920
diff changeset
1705 msn_change_status(session);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1706 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1707
25773
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1708 /*
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1709 * Actually adds a buddy once we have the response from FQY
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1710 */
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1711 static void
25773
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1712 add_pending_buddy(MsnSession *session,
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1713 const char *who,
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1714 MsnNetwork network,
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1715 MsnUser *user)
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1716 {
25773
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1717 char *group;
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1718
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1719 g_return_if_fail(user != NULL);
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1720
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1721 group = msn_user_remove_pending_group(user);
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1722
27654
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1723 if (network != MSN_NETWORK_UNKNOWN) {
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1724 MsnUserList *userlist = session->userlist;
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1725 MsnUser *user2 = msn_userlist_find_user(userlist, who);
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1726 if (user2 != NULL) {
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1727 /* User already in userlist, so just update it. */
30944
4f1fc7c401fd Remove msn_user_destroy in favor of msn_user_unref.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30930
diff changeset
1728 msn_user_unref(user);
27654
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1729 user = user2;
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1730 } else {
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1731 msn_userlist_add_user(userlist, user);
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1732 }
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1733
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1734 msn_user_set_network(user, network);
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1735 msn_userlist_add_buddy(userlist, who, group);
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1736 }
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1737 else
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1738 {
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1739 PurpleBuddy * buddy = purple_find_buddy(session->account, who);
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1740 gchar *buf;
28560
19fd171d2877 Concordance between "Usernames" and "addresses"
Paul Aurich <darkrain42@pidgin.im>
parents: 28351
diff changeset
1741 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be valid email addresses."), who);
27654
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1742 if (!purple_conv_present_error(who, session->account, buf))
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1743 purple_notify_error(purple_account_get_connection(session->account), NULL, _("Unable to Add"), buf);
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1744 g_free(buf);
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1745
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1746 /* Remove from local list */
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1747 purple_blist_remove_buddy(buddy);
30944
4f1fc7c401fd Remove msn_user_destroy in favor of msn_user_unref.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30930
diff changeset
1748 msn_user_unref(user);
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1749 }
25773
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1750 g_free(group);
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1751 }
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1752
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1753 static void
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1754 finish_auth_request(MsnAddReqData *data, char *msg)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1755 {
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1756 PurpleConnection *pc;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1757 PurpleBuddy *buddy;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1758 PurpleGroup *group;
27654
697bea551516 Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27635
diff changeset
1759 PurpleAccount *account;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1760 MsnSession *session;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1761 MsnUserList *userlist;
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1762 const char *who, *gname;
25156
af3e232e2463 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25098
diff changeset
1763 MsnUser *user;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1764
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1765 pc = data->pc;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1766 buddy = data->buddy;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1767 group = data->group;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1768 g_free(data);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1769
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1770 account = purple_connection_get_account(pc);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1771 session = pc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1772 userlist = session->userlist;
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1773
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1774 who = msn_normalize(account, purple_buddy_get_name(buddy));
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
1775 gname = group ? purple_group_get_name(group) : NULL;
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
1776 purple_debug_info("msn", "Add user:%s to group:%s\n", who, gname ? gname : "(null)");
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1777 if (!session->logged_in)
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1778 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1779 purple_debug_error("msn", "msn_add_buddy called before connected\n");
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1780
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1781 return;
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1782 }
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1783
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1784 /* XXX - Would group ever be NULL here? I don't think so...
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1785 * shx: Yes it should; MSN handles non-grouped buddies, and this is only
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
1786 * internal. */
25156
af3e232e2463 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25098
diff changeset
1787 user = msn_userlist_find_user(userlist, who);
af3e232e2463 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25098
diff changeset
1788 if ((user != NULL) && (user->networkid != MSN_NETWORK_UNKNOWN)) {
af3e232e2463 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25098
diff changeset
1789 /* We already know this buddy and their network. This function knows
af3e232e2463 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25098
diff changeset
1790 what to do with users already in the list and stuff... */
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1791 msn_user_set_invite_message(user, msg);
25140
7c494d2bc5e4 propagate from branch 'im.pidgin.pidgin' (head 009f3ea551248605298fbf1b88d7a873b2a6c7a3)
Richard Laager <rlaager@pidgin.im>
parents: 25098 25132
diff changeset
1792 msn_userlist_add_buddy(userlist, who, gname);
24779
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24772
diff changeset
1793 } else {
25680
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1794 char **tokens;
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1795 char *fqy;
24779
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24772
diff changeset
1796 /* We need to check the network for this buddy first */
25773
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1797 user = msn_user_new(userlist, who, NULL);
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1798 msn_user_set_invite_message(user, msg);
27299
aee35fe64295 Add a data parameter for FQY callbacks and remove the pending users list
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27298
diff changeset
1799 msn_user_set_pending_group(user, gname);
25773
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1800 msn_user_set_network(user, MSN_NETWORK_UNKNOWN);
25680
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1801 tokens = g_strsplit(who, "@", 2);
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1802 fqy = g_strdup_printf("<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>",
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1803 tokens[1],
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1804 tokens[0]);
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1805 msn_notification_send_fqy(session, fqy, strlen(fqy),
25773
81ed6eacab59 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@pidgin.im>
parents: 25680
diff changeset
1806 (MsnFqyCb)add_pending_buddy, user);
25680
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1807 g_free(fqy);
a193b015a9da Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25563
diff changeset
1808 g_strfreev(tokens);
24779
b348af6b49a9 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24772
diff changeset
1809 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1810 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1811
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1812 static void
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1813 cancel_auth_request(MsnAddReqData *data, char *msg)
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1814 {
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1815 /* Remove from local list */
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1816 purple_blist_remove_buddy(data->buddy);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1817
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1818 g_free(data);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1819 }
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1820
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1821 static void
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1822 msn_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1823 {
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1824 const char *bname;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1825 MsnAddReqData *data;
29178
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1826 MsnSession *session;
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1827 MsnUser *user;
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1828
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1829 bname = purple_buddy_get_name(buddy);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1830
28731
46a9f7c534b1 The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28560
diff changeset
1831 if (!msn_email_is_valid(bname)) {
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1832 gchar *buf;
28560
19fd171d2877 Concordance between "Usernames" and "addresses"
Paul Aurich <darkrain42@pidgin.im>
parents: 28351
diff changeset
1833 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be valid email addresses."), bname);
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1834 if (!purple_conv_present_error(bname, purple_connection_get_account(gc), buf))
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1835 purple_notify_error(gc, NULL, _("Unable to Add"), buf);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1836 g_free(buf);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1837
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1838 /* Remove from local list */
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1839 purple_blist_remove_buddy(buddy);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1840
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1841 return;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1842 }
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1843
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1844 data = g_new0(MsnAddReqData, 1);
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1845 data->pc = gc;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1846 data->buddy = buddy;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1847 data->group = group;
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1848
29178
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1849 session = purple_connection_get_protocol_data(gc);
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1850 user = msn_userlist_find_user(session->userlist, bname);
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1851 if (user && user->authorized) {
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1852 finish_auth_request(data, NULL);
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1853 } else {
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1854 purple_request_input(gc, NULL, _("Authorization Request Message:"),
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1855 NULL, _("Please authorize me!"), TRUE, FALSE, NULL,
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1856 _("_OK"), G_CALLBACK(finish_auth_request),
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1857 _("_Cancel"), G_CALLBACK(cancel_auth_request),
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1858 purple_connection_get_account(gc), bname, NULL,
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1859 data);
9db8b14e66ec Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29160
diff changeset
1860 }
27776
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1861 }
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1862
60d79d68cde1 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27769
diff changeset
1863 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1864 msn_rem_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1865 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1866 MsnSession *session;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1867 MsnUserList *userlist;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1868
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1869 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1870 userlist = session->userlist;
9091
8c3907d0f436 [gaim-migrate @ 9868]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9086
diff changeset
1871
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1872 if (!session->logged_in)
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1873 return;
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1874
9285
9cedf5d26577 [gaim-migrate @ 10088]
Mark Doliner <markdoliner@pidgin.im>
parents: 9246
diff changeset
1875 /* XXX - Does buddy->name need to be msn_normalize'd here? --KingAnt */
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
1876 msn_userlist_rem_buddy(userlist, purple_buddy_get_name(buddy));
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1877 }
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1878
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1879 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1880 msn_add_permit(PurpleConnection *gc, const char *who)
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1881 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1882 MsnSession *session;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1883 MsnUserList *userlist;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1884 MsnUser *user;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1885
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1886 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1887 userlist = session->userlist;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1888 user = msn_userlist_find_user(userlist, who);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1889
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1890 if (!session->logged_in)
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1891 return;
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1892
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1893 if (user != NULL && user->list_op & MSN_LIST_BL_OP) {
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1894 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL);
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1895
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1896 /* delete contact from Block list and add it to Allow in the callback */
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23768
diff changeset
1897 msn_del_contact_from_list(session, NULL, who, MSN_LIST_BL);
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1898 } else {
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1899 /* just add the contact to Allow list */
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23768
diff changeset
1900 msn_add_contact_to_list(session, NULL, who, MSN_LIST_AL);
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1901 }
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1902
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1903
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1904 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1905 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1906
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1907 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1908 msn_add_deny(PurpleConnection *gc, const char *who)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1909 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1910 MsnSession *session;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1911 MsnUserList *userlist;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1912 MsnUser *user;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1913
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1914 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1915 userlist = session->userlist;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1916 user = msn_userlist_find_user(userlist, who);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1917
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1918 if (!session->logged_in)
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1919 return;
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1920
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1921 if (user != NULL && user->list_op & MSN_LIST_AL_OP) {
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1922 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1923
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1924 /* delete contact from Allow list and add it to Block in the callback */
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23768
diff changeset
1925 msn_del_contact_from_list(session, NULL, who, MSN_LIST_AL);
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1926 } else {
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1927 /* just add the contact to Block list */
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23768
diff changeset
1928 msn_add_contact_to_list(session, NULL, who, MSN_LIST_BL);
20569
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1929 }
66628c75dada Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20567
diff changeset
1930
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1931 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1932 }
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1933
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1934 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1935 msn_rem_permit(PurpleConnection *gc, const char *who)
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1936 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1937 MsnSession *session;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1938 MsnUserList *userlist;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1939 MsnUser *user;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1940
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1941 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1942 userlist = session->userlist;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1943
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1944 if (!session->logged_in)
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1945 return;
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1946
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1947 user = msn_userlist_find_user(userlist, who);
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1948
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1949 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1950
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23768
diff changeset
1951 msn_del_contact_from_list(session, NULL, who, MSN_LIST_AL);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1952
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1953 if (user != NULL && user->list_op & MSN_LIST_RL_OP)
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1954 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1955 }
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1956
12323
f52908fb23b0 [gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents: 12318
diff changeset
1957 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1958 msn_rem_deny(PurpleConnection *gc, const char *who)
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1959 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1960 MsnSession *session;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1961 MsnUserList *userlist;
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1962 MsnUser *user;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
1963
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1964 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1965 userlist = session->userlist;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1966
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1967 if (!session->logged_in)
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1968 return;
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1969
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
1970 user = msn_userlist_find_user(userlist, who);
2213
3a176de28de1 [gaim-migrate @ 2223]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2210
diff changeset
1971
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1972 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL);
7563
b921749e2976 [gaim-migrate @ 8179]
Robert Mibus <mibus@mibus.org>
parents: 7469
diff changeset
1973
23771
c98f7e879218 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@pidgin.im>
parents: 23768
diff changeset
1974 msn_del_contact_from_list(session, NULL, who, MSN_LIST_BL);
7563
b921749e2976 [gaim-migrate @ 8179]
Robert Mibus <mibus@mibus.org>
parents: 7469
diff changeset
1975
9363
605961038476 [gaim-migrate @ 10171]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9318
diff changeset
1976 if (user != NULL && user->list_op & MSN_LIST_RL_OP)
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
1977 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL);
2597
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
1978 }
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
1979
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1980 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1981 msn_set_permit_deny(PurpleConnection *gc)
2597
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
1982 {
20542
e92b022fd611 In the initial ADL listing, send the commands in the correct sequence as required by the server: BLP, ADL and PRP. When the server acknowledges this initial ADL, send CHG with status information
Carlos Silva <typ0@pidgin.im>
parents: 20539
diff changeset
1983 msn_send_privacy(gc);
2597
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
1984 }
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
1985
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1986 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1987 msn_chat_invite(PurpleConnection *gc, int id, const char *msg,
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1988 const char *who)
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1989 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1990 MsnSession *session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1991 MsnSwitchBoard *swboard;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1992
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
1993 session = gc->proto_data;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
1994
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
1995 swboard = msn_session_find_swboard_with_id(session, id);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
1996
10533
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
1997 if (swboard == NULL)
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
1998 {
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
1999 /* if we have no switchboard, everyone else left the chat already */
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2000 swboard = msn_switchboard_new(session);
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2001 msn_switchboard_request(swboard);
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2002 swboard->chat_id = id;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2003 swboard->conv = purple_find_chat(gc, id);
10533
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2004 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2005
10773
ef88ffed66eb [gaim-migrate @ 12382]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10738
diff changeset
2006 swboard->flag |= MSN_SB_FLAG_IM;
ef88ffed66eb [gaim-migrate @ 12382]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10738
diff changeset
2007
10533
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2008 msn_switchboard_request_add_user(swboard, who);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2009 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2010
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2011 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2012 msn_chat_leave(PurpleConnection *gc, int id)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2013 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2014 MsnSession *session;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2015 MsnSwitchBoard *swboard;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2016 PurpleConversation *conv;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2017
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2018 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2019
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2020 swboard = msn_session_find_swboard_with_id(session, id);
10533
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2021
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2022 /* if swboard is NULL we were the only person left anyway */
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2023 if (swboard == NULL)
4c2ad22fad20 [gaim-migrate @ 11862]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10504
diff changeset
2024 return;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2025
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2026 conv = swboard->conv;
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2027
10773
ef88ffed66eb [gaim-migrate @ 12382]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10738
diff changeset
2028 msn_switchboard_release(swboard, MSN_SB_FLAG_IM);
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2029
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2030 /* If other switchboards managed to associate themselves with this
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2031 * conv, make sure they know it's gone! */
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2032 if (conv != NULL)
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2033 {
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2034 while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL)
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2035 swboard->conv = NULL;
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2036 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2037 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2038
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2039 static int
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2040 msn_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags)
2597
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
2041 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2042 PurpleAccount *account;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2043 MsnSession *session;
28350
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2044 const char *username;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2045 MsnSwitchBoard *swboard;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2046 MsnMessage *msg;
8922
6928d9a0338b [gaim-migrate @ 9692]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8808
diff changeset
2047 char *msgformat;
6928d9a0338b [gaim-migrate @ 9692]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8808
diff changeset
2048 char *msgtext;
28349
f7833e8cfd90 Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28346
diff changeset
2049 size_t msglen;
28350
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2050 MsnEmoticon *smile;
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2051 GSList *smileys;
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2052 GString *emoticons = NULL;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2053
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2054 account = purple_connection_get_account(gc);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2055 session = gc->proto_data;
28350
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2056 username = purple_account_get_username(account);
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2057 swboard = msn_session_find_swboard_with_id(session, id);
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2058
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2059 if (swboard == NULL)
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2060 return -EINVAL;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2061
10345
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2062 if (!swboard->ready)
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2063 return 0;
10274
f329b1d7fd43 [gaim-migrate @ 11424]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10225
diff changeset
2064
10773
ef88ffed66eb [gaim-migrate @ 12382]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10738
diff changeset
2065 swboard->flag |= MSN_SB_FLAG_IM;
ef88ffed66eb [gaim-migrate @ 12382]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10738
diff changeset
2066
10345
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2067 msn_import_html(message, &msgformat, &msgtext);
28349
f7833e8cfd90 Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28346
diff changeset
2068 msglen = strlen(msgtext);
f7833e8cfd90 Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28346
diff changeset
2069
f7833e8cfd90 Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28346
diff changeset
2070 if ((msglen == 0) || (msglen + strlen(msgformat) + strlen(VERSION) > 1564))
10345
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2071 {
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2072 g_free(msgformat);
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2073 g_free(msgtext);
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2074
10345
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2075 return -E2BIG;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2076 }
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2077
10345
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2078 msg = msn_message_new_plain(msgtext);
29457
15f977c9ac76 Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <markdoliner@pidgin.im>
parents: 29455
diff changeset
2079 msn_message_set_header(msg, "X-MMS-IM-Format", msgformat);
28350
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2080
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2081 smileys = msn_msg_grab_emoticons(msg->body, username);
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2082 while (smileys) {
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2083 smile = (MsnEmoticon *)smileys->data;
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2084 emoticons = msn_msg_emoticon_add(emoticons, smile);
28351
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2085 if (purple_conv_custom_smiley_add(swboard->conv, smile->smile,
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2086 "sha1", purple_smiley_get_checksum(smile->ps),
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2087 FALSE)) {
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2088 gconstpointer data;
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2089 size_t len;
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2090 data = purple_smiley_get_data(smile->ps, &len);
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2091 purple_conv_custom_smiley_write(swboard->conv, smile->smile, data, len);
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2092 purple_conv_custom_smiley_close(swboard->conv, smile->smile);
54c4e81b6e28 It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28350
diff changeset
2093 }
28350
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2094 msn_emoticon_destroy(smile);
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2095 smileys = g_slist_delete_link(smileys, smileys);
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2096 }
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2097
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2098 if (emoticons) {
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2099 msn_send_emoticons(swboard, emoticons);
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2100 g_string_free(emoticons, TRUE);
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2101 }
d21e3805aa16 Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28349
diff changeset
2102
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
2103 msn_switchboard_send_msg(swboard, msg, FALSE);
31162
2c596217766b msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <markdoliner@pidgin.im>
parents: 31161
diff changeset
2104 msn_message_unref(msg);
10345
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2105
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2106 g_free(msgformat);
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2107 g_free(msgtext);
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2108
23295
5d3a2fd59439 When calling serv_got_chat_in() after sending a group chat message (to let
Evan Schoenberg <evands@pidgin.im>
parents: 23289
diff changeset
2109 serv_got_chat_in(gc, id, purple_account_get_username(account), flags,
10345
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2110 message, time(NULL));
7d7f8cfa2b4f [gaim-migrate @ 11556]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10306
diff changeset
2111
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2112 return 0;
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2113 }
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2114
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2115 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2116 msn_keepalive(PurpleConnection *gc)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2117 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2118 MsnSession *session;
30909
db4b1876a304 msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30908
diff changeset
2119 MsnTransaction *trans;
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2120
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2121 session = gc->proto_data;
10481
a5d6b8e1717d [gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10463
diff changeset
2122
10602
111ed237f509 [gaim-migrate @ 12032]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10589
diff changeset
2123 if (!session->http_method)
111ed237f509 [gaim-migrate @ 12032]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10589
diff changeset
2124 {
111ed237f509 [gaim-migrate @ 12032]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10589
diff changeset
2125 MsnCmdProc *cmdproc;
2597
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
2126
10602
111ed237f509 [gaim-migrate @ 12032]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10589
diff changeset
2127 cmdproc = session->notification->cmdproc;
111ed237f509 [gaim-migrate @ 12032]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10589
diff changeset
2128
30910
374c457d65b5 We need a way to send commands without transaction ID
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30909
diff changeset
2129 trans = msn_transaction_new(cmdproc, "PNG", NULL);
30915
56295f0a8ade I don't really like this name.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30914
diff changeset
2130 msn_transaction_set_saveable(trans, FALSE);
30909
db4b1876a304 msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 30908
diff changeset
2131 msn_cmdproc_send_trans(cmdproc, trans);
10602
111ed237f509 [gaim-migrate @ 12032]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10589
diff changeset
2132 }
2597
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
2133 }
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
2134
23784
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2135 static void msn_alias_buddy(PurpleConnection *pc, const char *name, const char *alias)
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2136 {
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2137 MsnSession *session;
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2138
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2139 session = pc->proto_data;
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2140
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2141 msn_update_contact(session, name, MSN_UPDATE_ALIAS, alias);
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2142 }
f09ed4e732df Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23776
diff changeset
2143
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2144 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2145 msn_group_buddy(PurpleConnection *gc, const char *who,
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5507
diff changeset
2146 const char *old_group_name, const char *new_group_name)
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2147 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2148 MsnSession *session;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2149 MsnUserList *userlist;
9198
e8eb6d5eb9eb [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9193
diff changeset
2150
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2151 session = gc->proto_data;
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2152 userlist = session->userlist;
5518
436fb9490b62 [gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents: 5507
diff changeset
2153
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2154 msn_userlist_move_buddy(userlist, who, old_group_name, new_group_name);
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2155 }
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2156
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2157 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2158 msn_rename_group(PurpleConnection *gc, const char *old_name,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2159 PurpleGroup *group, GList *moved_buddies)
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2160 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2161 MsnSession *session;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2162 const char *gname;
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2163
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2164 session = gc->proto_data;
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23325
diff changeset
2165
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
2166 g_return_if_fail(session != NULL);
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
2167 g_return_if_fail(session->userlist != NULL);
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23325
diff changeset
2168
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2169 gname = purple_group_get_name(group);
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
2170 if (msn_userlist_find_group_with_name(session->userlist, old_name) != NULL)
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2171 {
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2172 msn_contact_rename_group(session, old_name, gname);
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2173 }
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2174 else
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2175 {
20564
35675dd4a44d Make buddy and group management actually work, add some SOAP templates, redesign some parts of code and separate some bigger functions into its smaller tasks which are completely unrelated to each other
Carlos Silva <typ0@pidgin.im>
parents: 20560
diff changeset
2176 /* not found */
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2177 msn_add_group(session, NULL, gname);
5318
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2178 }
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2179 }
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2180
2073a19f4217 [gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2181 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2182 msn_convo_closed(PurpleConnection *gc, const char *who)
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2183 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2184 MsnSession *session;
5309
3178acad1449 [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents: 5221
diff changeset
2185 MsnSwitchBoard *swboard;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2186 PurpleConversation *conv;
6026
b11d9f2fd725 [gaim-migrate @ 6476]
Christian Hammond <chipx86@chipx86.com>
parents: 6024
diff changeset
2187
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2188 session = gc->proto_data;
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
2189
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2190 swboard = msn_session_find_swboard(session, who);
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2191
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2192 /*
10602
111ed237f509 [gaim-migrate @ 12032]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 10589
diff changeset
2193 * Don't perform an assertion here. If swboard is NULL, then the
9193
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2194 * switchboard was either closed by the other party, or the person
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2195 * is talking to himself.
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2196 */
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2197 if (swboard == NULL)
6e76f1367896 [gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9158
diff changeset
2198 return;
4349
a65175463a31 [gaim-migrate @ 4614]
Nathan Walp <nwalp@pidgin.im>
parents: 4333
diff changeset
2199
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2200 conv = swboard->conv;
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2201
17290
8807cc2337f4 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17259
diff changeset
2202 /* If we release the switchboard here, it may still have messages
8807cc2337f4 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17259
diff changeset
2203 pending ACK which would result in incorrect unsent message errors.
8807cc2337f4 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17259
diff changeset
2204 Just let it timeout... This is *so* going to screw with people who
8807cc2337f4 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17259
diff changeset
2205 use dumb clients that report "User has closed the conversation window" */
8807cc2337f4 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17259
diff changeset
2206 /* msn_switchboard_release(swboard, MSN_SB_FLAG_IM); */
8807cc2337f4 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17259
diff changeset
2207 swboard->conv = NULL;
10621
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2208
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2209 /* If other switchboards managed to associate themselves with this
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2210 * conv, make sure they know it's gone! */
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2211 if (conv != NULL)
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2212 {
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2213 while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL)
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2214 swboard->conv = NULL;
2b214ffb112b [gaim-migrate @ 12090]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10602
diff changeset
2215 }
2597
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
2216 }
51ca3fb939c9 [gaim-migrate @ 2610]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents: 2591
diff changeset
2217
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2218 static void
16538
c7e61e2917c9 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents: 16437
diff changeset
2219 msn_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img)
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 7563
diff changeset
2220 {
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
2221 MsnSession *session;
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
2222 MsnUser *user;
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
2223
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
2224 session = gc->proto_data;
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
2225 user = session->user;
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 7563
diff changeset
2226
16538
c7e61e2917c9 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents: 16437
diff changeset
2227 msn_user_set_buddy_icon(user, img);
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 7563
diff changeset
2228
11992
906176cc9b22 [gaim-migrate @ 14285]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11920
diff changeset
2229 msn_change_status(session);
7590
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 7563
diff changeset
2230 }
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 7563
diff changeset
2231
54b26062c7e0 [gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents: 7563
diff changeset
2232 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2233 msn_remove_group(PurpleConnection *gc, PurpleGroup *group)
6885
65132ebfc662 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6859
diff changeset
2234 {
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2235 MsnSession *session;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2236 const char *gname;
6885
65132ebfc662 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6859
diff changeset
2237
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2238 session = gc->proto_data;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2239 gname = purple_group_get_name(group);
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2240
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2241 purple_debug_info("msn", "Remove group %s\n", gname);
13897
9636e5364590 [gaim-migrate @ 17043]
Ma Yuan <mayuan2006@gmail.com>
parents: 13894
diff changeset
2242 /*we can't delete the default group*/
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2243 if(!strcmp(gname, MSN_INDIVIDUALS_GROUP_NAME)||
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2244 !strcmp(gname, MSN_NON_IM_GROUP_NAME))
6885
65132ebfc662 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6859
diff changeset
2245 {
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23817
diff changeset
2246 purple_debug_info("msn", "This group can't be removed, returning.\n");
13897
9636e5364590 [gaim-migrate @ 17043]
Ma Yuan <mayuan2006@gmail.com>
parents: 13894
diff changeset
2247 return ;
6885
65132ebfc662 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6859
diff changeset
2248 }
23441
fd45c23a3eb2 Delete trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents: 23325
diff changeset
2249
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2250 msn_del_group(session, gname);
6885
65132ebfc662 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6859
diff changeset
2251 }
65132ebfc662 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6859
diff changeset
2252
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2253 /**
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2254 * Extract info text from info_data and add it to user_info
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2255 */
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2256 static gboolean
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2257 msn_tooltip_extract_info_text(PurpleNotifyUserInfo *user_info, MsnGetInfoData *info_data)
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2258 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2259 PurpleBuddy *b;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2260
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2261 b = purple_find_buddy(purple_connection_get_account(info_data->gc),
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2262 info_data->name);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2263
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2264 if (b)
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2265 {
12970
c2f3b4dcf711 [gaim-migrate @ 15323]
Richard Laager <rlaager@pidgin.im>
parents: 12948
diff changeset
2266 char *tmp;
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2267 const char *alias;
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2268
24950
143f594f0cd0 Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24946
diff changeset
2269 alias = purple_buddy_get_local_buddy_alias(b);
143f594f0cd0 Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24946
diff changeset
2270 if (alias && alias[0])
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2271 {
24950
143f594f0cd0 Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24946
diff changeset
2272 char *aliastext = g_markup_escape_text(alias, -1);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2273 purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2274 g_free(aliastext);
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2275 }
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2276
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2277 if ((alias = purple_buddy_get_server_alias(b)) != NULL)
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2278 {
24398
4865c2ee6ea8 Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 24245
diff changeset
2279 char *nicktext = g_markup_escape_text(alias, -1);
25089
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2280 tmp = g_strdup_printf("<font sml=\"msn\">%s</font>", nicktext);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2281 purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp);
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2282 g_free(tmp);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2283 g_free(nicktext);
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2284 }
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2285
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2286 /* Add the tooltip information */
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2287 msn_tooltip_text(b, user_info, TRUE);
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2288
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2289 return TRUE;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2290 }
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2291
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2292 return FALSE;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2293 }
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2294
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2295 #if PHOTO_SUPPORT
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2296
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2297 static char *
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2298 msn_get_photo_url(const char *url_text)
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2299 {
13391
22e0ab3fb068 [gaim-migrate @ 15763]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13390
diff changeset
2300 char *p, *q;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2301
20508
a8855578906a Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20505
diff changeset
2302 if ((p = strstr(url_text, PHOTO_URL)) != NULL)
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2303 {
13862
9d790ad9fc7a [gaim-migrate @ 16654]
Ma Yuan <mayuan2006@gmail.com>
parents: 13861
diff changeset
2304 p += strlen(PHOTO_URL);
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2305 }
24000
0885f72ade83 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23940
diff changeset
2306 if (p && (strncmp(p, "http://", strlen("http://")) == 0) && ((q = strchr(p, '"')) != NULL))
13391
22e0ab3fb068 [gaim-migrate @ 15763]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13390
diff changeset
2307 return g_strndup(p, q - p);
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2308
13391
22e0ab3fb068 [gaim-migrate @ 15763]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13390
diff changeset
2309 return NULL;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2310 }
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2311
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2312 static void msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer data,
23796
026ffb2e4fb3 Fix up a typo between the declaration and definition of msn_got_photo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23791
diff changeset
2313 const gchar *url_text, gsize len, const gchar *error_message);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2314
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2315 #endif
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2316
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2317 #if 0
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2318 static char *msn_info_date_reformat(const char *field, size_t len)
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2319 {
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2320 char *tmp = g_strndup(field, len);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2321 time_t t = purple_str_to_time(tmp, FALSE, NULL, NULL, NULL);
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2322
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2323 g_free(tmp);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2324 return g_strdup(purple_date_format_short(localtime(&t)));
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2325 }
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2326 #endif
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2327
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2328 #define MSN_GOT_INFO_GET_FIELD(a, b) \
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2329 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \
14430
de574ba08dd9 [gaim-migrate @ 17074]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14416
diff changeset
2330 "\n" a ":", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2331 if (found) \
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2332 sect_info = TRUE;
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2333
17533
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2334 #define MSN_GOT_INFO_GET_FIELD_NO_SEARCH(a, b) \
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2335 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2336 "\n" a ":", 0, "\n", 0, "Undisclosed", b, 0, NULL, msn_info_strip_search_link); \
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2337 if (found) \
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2338 sect_info = TRUE;
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2339
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2340 static char *
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2341 msn_info_strip_search_link(const char *field, size_t len)
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2342 {
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2343 const char *c;
20626
dffaa4f562f5 Compile\!
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 20613
diff changeset
2344 if ((c = strstr(field, " (http://")) == NULL)
17533
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2345 return g_strndup(field, len);
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2346 return g_strndup(field, c - field);
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2347 }
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2348
6885
65132ebfc662 [gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents: 6859
diff changeset
2349 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2350 msn_got_info(PurpleUtilFetchUrlData *url_data, gpointer data,
14416
c95ffd983a39 [gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
2351 const gchar *url_text, size_t len, const gchar *error_message)
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2352 {
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2353 MsnGetInfoData *info_data = (MsnGetInfoData *)data;
30579
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2354 MsnSession *session;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2355 PurpleNotifyUserInfo *user_info;
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2356 char *stripped, *p, *q, *tmp;
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2357 char *user_url = NULL;
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2358 gboolean found;
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2359 gboolean has_tooltip_text = FALSE;
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2360 gboolean has_info = FALSE;
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2361 gboolean sect_info = FALSE;
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2362 gboolean has_contact_info = FALSE;
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2363 char *url_buffer;
7675
8058cedec7a2 [gaim-migrate @ 8319]
Tim Ringenbach <marv@pidgin.im>
parents: 7590
diff changeset
2364 int stripped_len;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2365 #if PHOTO_SUPPORT
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2366 char *photo_url_text = NULL;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2367 MsnGetInfoStepTwoData *info2_data = NULL;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2368 #endif
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2369
20478
46933dc62880 propagate from branch 'im.pidgin.pidgin' (head 88b7040408c88e4516c008f4eac579f98ef53e85)
Richard Laager <rlaager@pidgin.im>
parents: 20476 15884
diff changeset
2370 purple_debug_info("msn", "In msn_got_info,url_text:{%s}\n",url_text);
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2371
30579
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2372 session = purple_connection_get_protocol_data(info_data->gc);
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2373 session->url_datas = g_slist_remove(session->url_datas, url_data);
13480
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2374
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2375 user_info = purple_notify_user_info_new();
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2376 has_tooltip_text = msn_tooltip_extract_info_text(user_info, info_data);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2377
14416
c95ffd983a39 [gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
2378 if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0)
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2379 {
25089
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2380 purple_notify_user_info_add_pair(user_info,
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2381 _("Error retrieving profile"), NULL);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2382
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2383 purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2384 purple_notify_user_info_destroy(user_info);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2385
14430
de574ba08dd9 [gaim-migrate @ 17074]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14416
diff changeset
2386 g_free(info_data->name);
de574ba08dd9 [gaim-migrate @ 17074]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14416
diff changeset
2387 g_free(info_data);
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2388 return;
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2389 }
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2390
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2391 url_buffer = g_strdup(url_text);
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2392
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2393 /* If they have a homepage link, MSN masks it such that we need to
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2394 * fetch the url out before purple_markup_strip_html() nukes it */
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2395 /* I don't think this works with the new spaces profiles - Stu 3/2/06 */
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2396 if ((p = strstr(url_text,
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2397 "Take a look at my </font><A class=viewDesc title=\"")) != NULL)
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2398 {
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2399 p += 50;
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2400
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2401 if ((q = strchr(p, '"')) != NULL)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2402 user_url = g_strndup(p, q - p);
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2403 }
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2404
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2405 /*
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2406 * purple_markup_strip_html() doesn't strip out character entities like &nbsp;
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2407 * and &#183;
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2408 */
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2409 while ((p = strstr(url_buffer, "&nbsp;")) != NULL)
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2410 {
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2411 *p = ' '; /* Turn &nbsp;'s into ordinary blanks */
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2412 p += 1;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2413 memmove(p, p + 5, strlen(p + 5));
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2414 url_buffer[strlen(url_buffer) - 5] = '\0';
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2415 }
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2416
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2417 while ((p = strstr(url_buffer, "&#183;")) != NULL)
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2418 {
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2419 memmove(p, p + 6, strlen(p + 6));
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2420 url_buffer[strlen(url_buffer) - 6] = '\0';
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2421 }
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2422
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2423 /* Nuke the nasty \r's that just get in the way */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2424 purple_str_strip_char(url_buffer, '\r');
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2425
8735
01248ea222d3 [gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents: 8713
diff changeset
2426 /* MSN always puts in &#39; for apostrophes...replace them */
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2427 while ((p = strstr(url_buffer, "&#39;")) != NULL)
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2428 {
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2429 *p = '\'';
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2430 memmove(p + 1, p + 5, strlen(p + 5));
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2431 url_buffer[strlen(url_buffer) - 4] = '\0';
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2432 }
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2433
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2434 /* Nuke the html, it's easier than trying to parse the horrid stuff */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2435 stripped = purple_markup_strip_html(url_buffer);
7675
8058cedec7a2 [gaim-migrate @ 8319]
Tim Ringenbach <marv@pidgin.im>
parents: 7590
diff changeset
2436 stripped_len = strlen(stripped);
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2437
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2438 purple_debug_misc("msn", "stripped = %p\n", stripped);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2439 purple_debug_misc("msn", "url_buffer = %p\n", url_buffer);
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2440
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2441 /* General section header */
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2442 if (has_tooltip_text)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2443 purple_notify_user_info_add_section_break(user_info);
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2444
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2445 purple_notify_user_info_add_section_header(user_info, _("General"));
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2446
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2447 /* Extract their Name and put it in */
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2448 MSN_GOT_INFO_GET_FIELD("Name", _("Name"));
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2449
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2450 /* General */
13545
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2451 MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname"));
17533
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2452 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Age", _("Age"));
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2453 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Gender", _("Gender"));
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2454 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Occupation", _("Occupation"));
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2455 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Location", _("Location"));
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2456
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2457 /* Extract their Interests and put it in */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2458 found = purple_markup_extract_info_field(stripped, stripped_len, user_info,
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2459 "\nInterests\t", 0, " (/default.aspx?page=searchresults", 0,
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2460 "Undisclosed", _("Hobbies and Interests") /* _("Interests") */,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2461 0, NULL, NULL);
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2462
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2463 if (found)
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2464 sect_info = TRUE;
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2465
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2466 MSN_GOT_INFO_GET_FIELD("More about me", _("A Little About Me"));
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2467
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2468 if (sect_info)
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2469 {
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2470 has_info = TRUE;
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2471 sect_info = FALSE;
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2472 }
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2473 else
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2474 {
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2475 /* Remove the section header */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2476 purple_notify_user_info_remove_last_item(user_info);
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2477 if (has_tooltip_text)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2478 purple_notify_user_info_remove_last_item(user_info);
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2479 }
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2480
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2481 /* Social */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2482 purple_notify_user_info_add_section_break(user_info);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2483 purple_notify_user_info_add_section_header(user_info, _("Social"));
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2484
22581
bab4b3f8299a Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22387
diff changeset
2485 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
2486 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
2487 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
2488 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Hometown", _("Hometown"));
13545
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2489 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
2490 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
2491 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
2492 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
2493 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Favorite quote", _("Favorite Quote"));
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2494
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2495 if (sect_info)
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2496 {
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2497 has_info = TRUE;
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2498 sect_info = FALSE;
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2499 }
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2500 else
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2501 {
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2502 /* Remove the section header */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2503 purple_notify_user_info_remove_last_item(user_info);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2504 purple_notify_user_info_remove_last_item(user_info);
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2505 }
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2506
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2507 /* Contact Info */
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2508 /* Personal */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2509 purple_notify_user_info_add_section_break(user_info);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2510 purple_notify_user_info_add_section_header(user_info, _("Contact Info"));
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2511 purple_notify_user_info_add_section_header(user_info, _("Personal"));
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2512
13545
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2513 MSN_GOT_INFO_GET_FIELD("Name", _("Name"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2514 MSN_GOT_INFO_GET_FIELD("Significant other", _("Significant Other"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2515 MSN_GOT_INFO_GET_FIELD("Home phone", _("Home Phone"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2516 MSN_GOT_INFO_GET_FIELD("Home phone 2", _("Home Phone 2"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2517 MSN_GOT_INFO_GET_FIELD("Home address", _("Home Address"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2518 MSN_GOT_INFO_GET_FIELD("Personal Mobile", _("Personal Mobile"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2519 MSN_GOT_INFO_GET_FIELD("Home fax", _("Home Fax"));
23325
a374a26fe217 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@pidgin.im>
parents: 23295
diff changeset
2520 MSN_GOT_INFO_GET_FIELD("Personal email", _("Personal Email"));
13545
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2521 MSN_GOT_INFO_GET_FIELD("Personal IM", _("Personal IM"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2522 MSN_GOT_INFO_GET_FIELD("Birthday", _("Birthday"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2523 MSN_GOT_INFO_GET_FIELD("Anniversary", _("Anniversary"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2524 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes"));
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2525
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2526 if (sect_info)
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2527 {
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2528 has_info = TRUE;
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2529 sect_info = FALSE;
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2530 has_contact_info = TRUE;
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2531 }
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2532 else
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2533 {
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2534 /* Remove the section header */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2535 purple_notify_user_info_remove_last_item(user_info);
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2536 }
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2537
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2538 /* Business */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2539 purple_notify_user_info_add_section_header(user_info, _("Work"));
13545
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2540 MSN_GOT_INFO_GET_FIELD("Name", _("Name"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2541 MSN_GOT_INFO_GET_FIELD("Job title", _("Job Title"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2542 MSN_GOT_INFO_GET_FIELD("Company", _("Company"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2543 MSN_GOT_INFO_GET_FIELD("Department", _("Department"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2544 MSN_GOT_INFO_GET_FIELD("Profession", _("Profession"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2545 MSN_GOT_INFO_GET_FIELD("Work phone 1", _("Work Phone"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2546 MSN_GOT_INFO_GET_FIELD("Work phone 2", _("Work Phone 2"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2547 MSN_GOT_INFO_GET_FIELD("Work address", _("Work Address"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2548 MSN_GOT_INFO_GET_FIELD("Work mobile", _("Work Mobile"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2549 MSN_GOT_INFO_GET_FIELD("Work pager", _("Work Pager"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2550 MSN_GOT_INFO_GET_FIELD("Work fax", _("Work Fax"));
23325
a374a26fe217 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@pidgin.im>
parents: 23295
diff changeset
2551 MSN_GOT_INFO_GET_FIELD("Work email", _("Work Email"));
13545
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2552 MSN_GOT_INFO_GET_FIELD("Work IM", _("Work IM"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2553 MSN_GOT_INFO_GET_FIELD("Start date", _("Start Date"));
4647ec0d8a83 [gaim-migrate @ 15921]
Richard Laager <rlaager@pidgin.im>
parents: 13482
diff changeset
2554 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes"));
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2555
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2556 if (sect_info)
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2557 {
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2558 has_info = TRUE;
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2559 sect_info = FALSE;
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2560 has_contact_info = TRUE;
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2561 }
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2562 else
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2563 {
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2564 /* Remove the section header */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2565 purple_notify_user_info_remove_last_item(user_info);
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2566 }
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2567
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2568 if (!has_contact_info)
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2569 {
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2570 /* Remove the Contact Info section header */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2571 purple_notify_user_info_remove_last_item(user_info);
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2572 }
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2573
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2574 #if 0 /* these probably don't show up any more */
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2575 /*
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2576 * The fields, 'A Little About Me', 'Favorite Things', 'Hobbies
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2577 * and Interests', 'Favorite Quote', and 'My Homepage' may or may
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2578 * not appear, in any combination. However, they do appear in
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2579 * certain order, so we can successively search to pin down the
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2580 * distinct values.
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2581 */
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2582
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2583 /* Check if they have A Little About Me */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2584 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2585 " A Little About Me \n\n", 0, "Favorite Things", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2586 _("A Little About Me"), 0, NULL, NULL);
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2587
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2588 if (!found)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2589 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2590 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2591 " A Little About Me \n\n", 0, "Hobbies and Interests", '\n',
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2592 NULL, _("A Little About Me"), 0, NULL, NULL);
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2593 }
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2594
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2595 if (!found)
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2596 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2597 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2598 " A Little About Me \n\n", 0, "Favorite Quote", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2599 _("A Little About Me"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2600 }
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2601
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2602 if (!found)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2603 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2604 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2605 " A Little About Me \n\n", 0, "My Homepage \n\nTake a look",
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2606 '\n',
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2607 NULL, _("A Little About Me"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2608 }
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2609
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2610 if (!found)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2611 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2612 purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2613 " A Little About Me \n\n", 0, "last updated", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2614 _("A Little About Me"), 0, NULL, NULL);
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2615 }
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2616
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2617 if (found)
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2618 has_info = TRUE;
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2619
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2620 /* Check if they have Favorite Things */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2621 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2622 " Favorite Things \n\n", 0, "Hobbies and Interests", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2623 _("Favorite Things"), 0, NULL, NULL);
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2624
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2625 if (!found)
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
2626 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2627 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2628 " Favorite Things \n\n", 0, "Favorite Quote", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2629 _("Favorite Things"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2630 }
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2631
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2632 if (!found)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2633 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2634 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2635 " Favorite Things \n\n", 0, "My Homepage \n\nTake a look", '\n',
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2636 NULL, _("Favorite Things"), 0, NULL, NULL);
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2637 }
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2638
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2639 if (!found)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2640 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2641 purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2642 " Favorite Things \n\n", 0, "last updated", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2643 _("Favorite Things"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2644 }
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2645
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2646 if (found)
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2647 has_info = TRUE;
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2648
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2649 /* Check if they have Hobbies and Interests */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2650 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2651 " Hobbies and Interests \n\n", 0, "Favorite Quote", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2652 _("Hobbies and Interests"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2653
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2654 if (!found)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2655 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2656 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2657 " Hobbies and Interests \n\n", 0, "My Homepage \n\nTake a look",
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2658 '\n', NULL, _("Hobbies and Interests"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2659 }
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2660
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2661 if (!found)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2662 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2663 purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2664 " Hobbies and Interests \n\n", 0, "last updated", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2665 _("Hobbies and Interests"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2666 }
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2667
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2668 if (found)
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2669 has_info = TRUE;
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2670
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2671 /* Check if they have Favorite Quote */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2672 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2673 "Favorite Quote \n\n", 0, "My Homepage \n\nTake a look", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2674 _("Favorite Quote"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2675
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2676 if (!found)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2677 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2678 purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2679 "Favorite Quote \n\n", 0, "last updated", '\n', NULL,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2680 _("Favorite Quote"), 0, NULL, NULL);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2681 }
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2682
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2683 if (found)
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2684 has_info = TRUE;
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2685
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2686 /* Extract the last updated date and put it in */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2687 found = purple_markup_extract_info_field(stripped, stripped_len, s,
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2688 " last updated:", 1, "\n", 0, NULL, _("Last Updated"), 0,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13020
diff changeset
2689 NULL, msn_info_date_reformat);
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2690
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2691 if (found)
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2692 has_info = TRUE;
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2693 #endif
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2694
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2695 /* If we were able to fetch a homepage url earlier, stick it in there */
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2696 if (user_url != NULL)
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2697 {
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2698 tmp = g_strdup_printf("<a href=\"%s\">%s</a>", user_url, user_url);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2699 purple_notify_user_info_add_pair(user_info, _("Homepage"), tmp);
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2700 g_free(tmp);
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2701 g_free(user_url);
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2702
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2703 has_info = TRUE;
6859
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2704 }
070c664d7c14 [gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents: 6858
diff changeset
2705
9510
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2706 if (!has_info)
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2707 {
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2708 /* MSN doesn't actually distinguish between "unknown member" and
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2709 * a known member with an empty profile. Try to explain this fact.
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2710 * Note that if we have a nonempty tooltip_text, we know the user
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2711 * exists.
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2712 */
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2713 /* This doesn't work with the new spaces profiles - Stu 3/2/06
9510
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2714 char *p = strstr(url_buffer, "Unknown Member </TITLE>");
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2715 * This might not work for long either ... */
17533
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2716 /* Nope, it failed some time before 5/2/07 :(
13390
1d9b81d3a9b0 [gaim-migrate @ 15762]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 13297
diff changeset
2717 char *p = strstr(url_buffer, "form id=\"SpacesSearch\" name=\"SpacesSearch\"");
17533
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2718 * Let's see how long this one holds out for ... */
1968afe33448 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 17290
diff changeset
2719 char *p = strstr(url_buffer, "<form id=\"profile_form\" name=\"profile_form\" action=\"http&#58;&#47;&#47;spaces.live.com&#47;profile.aspx&#63;cid&#61;0\"");
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2720 PurpleBuddy *b = purple_find_buddy
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2721 (purple_connection_get_account(info_data->gc), info_data->name);
25089
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2722 purple_notify_user_info_add_pair(user_info,
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2723 _("Error retrieving profile"), NULL);
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2724 purple_notify_user_info_add_pair(user_info, NULL,
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2725 ((p && b) ? _("The user has not created a public profile.") :
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2726 (p ? _("MSN reported not being able to find the user's profile. "
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2727 "This either means that the user does not exist, "
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2728 "or that the user exists "
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2729 "but has not created a public profile.") :
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2730 _("Could not find " /* This should never happen */
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2731 "any information in the user's profile. "
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2732 "The user most likely does not exist."))));
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2733 }
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2734
9510
09843093610c [gaim-migrate @ 10337]
Tim Ringenbach <marv@pidgin.im>
parents: 9475
diff changeset
2735 /* put a link to the actual profile URL */
25089
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2736 purple_notify_user_info_add_section_break(user_info);
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2737 tmp = g_strdup_printf("<a href=\"%s%s\">%s</a>",
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2738 PROFILE_URL, info_data->name, _("View web profile"));
b381e7e2a1cf Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <markdoliner@pidgin.im>
parents: 24767
diff changeset
2739 purple_notify_user_info_add_pair(user_info, NULL, tmp);
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
2740 g_free(tmp);
7062
26abb8b189ce [gaim-migrate @ 7626]
Christian Hammond <chipx86@chipx86.com>
parents: 7015
diff changeset
2741
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2742 #if PHOTO_SUPPORT
9569
63364b43cb0b [gaim-migrate @ 10412]
Tim Ringenbach <marv@pidgin.im>
parents: 9558
diff changeset
2743 /* Find the URL to the photo; must be before the marshalling [Bug 994207] */
63364b43cb0b [gaim-migrate @ 10412]
Tim Ringenbach <marv@pidgin.im>
parents: 9558
diff changeset
2744 photo_url_text = msn_get_photo_url(url_text);
23830
1436e3de5d6c The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23817
diff changeset
2745 purple_debug_info("msn", "photo url:{%s}\n", photo_url_text ? photo_url_text : "(null)");
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2746
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2747 /* Marshall the existing state */
21065
8bbf0f6700ed Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <datallah@pidgin.im>
parents: 21033
diff changeset
2748 info2_data = g_new0(MsnGetInfoStepTwoData, 1);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2749 info2_data->info_data = info_data;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2750 info2_data->stripped = stripped;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2751 info2_data->url_buffer = url_buffer;
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15192
diff changeset
2752 info2_data->user_info = user_info;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2753 info2_data->photo_url_text = photo_url_text;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2754
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2755 /* Try to put the photo in there too, if there's one */
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2756 if (photo_url_text)
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2757 {
30579
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2758 url_data = purple_util_fetch_url_len(photo_url_text, FALSE, NULL, FALSE,
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2759 MAX_HTTP_BUDDYICON_BYTES,
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2760 msn_got_photo, info2_data);
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2761 session->url_datas = g_slist_prepend(session->url_datas, url_data);
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2762 }
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2763 else
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2764 {
30579
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2765 /* Finish the Get Info and show the user something */
14416
c95ffd983a39 [gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
2766 msn_got_photo(NULL, info2_data, NULL, 0, NULL);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2767 }
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2768 }
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2769
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2770 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2771 msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer user_data,
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22670
diff changeset
2772 const gchar *url_text, gsize len, const gchar *error_message)
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2773 {
14416
c95ffd983a39 [gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
2774 MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)user_data;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2775 int id = -1;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2776
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2777 /* Unmarshall the saved state */
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2778 MsnGetInfoData *info_data = info2_data->info_data;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2779 char *stripped = info2_data->stripped;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2780 char *url_buffer = info2_data->url_buffer;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2781 PurpleNotifyUserInfo *user_info = info2_data->user_info;
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2782 char *photo_url_text = info2_data->photo_url_text;
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2783
30579
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2784 if (url_data) {
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2785 MsnSession *session = purple_connection_get_protocol_data(info_data->gc);
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2786 session->url_datas = g_slist_remove(session->url_datas, url_data);
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2787 }
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2788
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2789 if (url_text && error_message)
13480
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2790 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2791 purple_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n");
13480
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2792 g_free(stripped);
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2793 g_free(url_buffer);
21026
c30d218090bb Fix some (rather large) leakage.
Daniel Atallah <datallah@pidgin.im>
parents: 20934
diff changeset
2794 purple_notify_user_info_destroy(user_info);
13480
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2795 g_free(info_data->name);
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2796 g_free(info_data);
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2797 g_free(photo_url_text);
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2798 g_free(info2_data);
13482
8b1b470cc1ef [gaim-migrate @ 15857]
Evan Schoenberg <evands@pidgin.im>
parents: 13480
diff changeset
2799
13480
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2800 return;
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2801 }
fa44dafa1a02 [gaim-migrate @ 15855]
Evan Schoenberg <evands@pidgin.im>
parents: 13391
diff changeset
2802
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2803 /* Try to put the photo in there too, if there's one and is readable */
14416
c95ffd983a39 [gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents: 14254
diff changeset
2804 if (user_data && url_text && len != 0)
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2805 {
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2806 if (strstr(url_text, "400 Bad Request")
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2807 || strstr(url_text, "403 Forbidden")
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2808 || strstr(url_text, "404 Not Found"))
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2809 {
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2810
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2811 purple_debug_info("msn", "Error getting %s: %s\n",
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2812 photo_url_text, url_text);
10044
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2813 }
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2814 else
884c09b189e6 [gaim-migrate @ 11003]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9967
diff changeset
2815 {
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2816 char buf[1024];
22969
51f5e7777915 This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22670
diff changeset
2817 purple_debug_info("msn", "%s is %" G_GSIZE_FORMAT " bytes\n", photo_url_text, len);
16539
75a20ae3a527 Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents: 16538
diff changeset
2818 id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2819 g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2820 purple_notify_user_info_prepend_pair(user_info, NULL, buf);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2821 }
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2822 }
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2823
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2824 /* We continue here from msn_got_info, as if nothing has happened */
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2825 #endif
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2826 purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL);
7062
26abb8b189ce [gaim-migrate @ 7626]
Christian Hammond <chipx86@chipx86.com>
parents: 7015
diff changeset
2827
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2828 g_free(stripped);
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 7062
diff changeset
2829 g_free(url_buffer);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2830 purple_notify_user_info_destroy(user_info);
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2831 g_free(info_data->name);
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2832 g_free(info_data);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2833 #if PHOTO_SUPPORT
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2834 g_free(photo_url_text);
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2835 g_free(info2_data);
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2836 if (id != -1)
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 15884
diff changeset
2837 purple_imgstore_unref_by_id(id);
9243
c22d815cb7ba [gaim-migrate @ 10042]
Tim Ringenbach <marv@pidgin.im>
parents: 9198
diff changeset
2838 #endif
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2839 }
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2840
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2841 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2842 msn_get_info(PurpleConnection *gc, const char *name)
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2843 {
30579
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2844 MsnSession *session = purple_connection_get_protocol_data(gc);
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2845 MsnGetInfoData *data;
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2846 char *url;
30579
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2847 PurpleUtilFetchUrlData *url_data;
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2848
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2849 data = g_new0(MsnGetInfoData, 1);
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2850 data->gc = gc;
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2851 data->name = g_strdup(name);
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2852
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2853 url = g_strdup_printf("%s%s", PROFILE_URL, name);
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2854
30579
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2855 url_data = purple_util_fetch_url(url, FALSE,
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2856 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2857 TRUE, msn_got_info, data);
458621d24012 Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30303
diff changeset
2858 session->url_datas = g_slist_prepend(session->url_datas, url_data);
7104
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2859
d8415ef3d687 [gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents: 7095
diff changeset
2860 g_free(url);
6516
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2861 }
ea1e11634bf5 [gaim-migrate @ 7033]
Luke Schierer <lschiere@pidgin.im>
parents: 6378
diff changeset
2862
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2863 static gboolean msn_load(PurplePlugin *plugin)
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2864 {
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2865 msn_notification_init();
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2866 msn_switchboard_init();
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2867
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2868 return TRUE;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2869 }
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2870
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2871 static gboolean msn_unload(PurplePlugin *plugin)
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2872 {
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2873 msn_notification_end();
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2874 msn_switchboard_end();
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2875
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2876 return TRUE;
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2877 }
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
2878
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2879 static PurpleAccount *find_acct(const char *prpl, const char *acct_id)
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2880 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2881 PurpleAccount *acct = NULL;
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2882
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2883 /* If we have a specific acct, use it */
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2884 if (acct_id) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2885 acct = purple_accounts_find(acct_id, prpl);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2886 if (acct && !purple_account_is_connected(acct))
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2887 acct = NULL;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2888 } else { /* Otherwise find an active account for the protocol */
18122
9bf9970c1b6a disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents: 18121
diff changeset
2889 GList *l = purple_accounts_get_all();
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2890 while (l) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2891 if (!strcmp(prpl, purple_account_get_protocol_id(l->data))
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2892 && purple_account_is_connected(l->data)) {
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2893 acct = l->data;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2894 break;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2895 }
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2896 l = l->next;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2897 }
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2898 }
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2899
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2900 return acct;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2901 }
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2902
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2903 static gboolean msn_uri_handler(const char *proto, const char *cmd, GHashTable *params)
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2904 {
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2905 char *acct_id = g_hash_table_lookup(params, "account");
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2906 PurpleAccount *acct;
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2907
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2908 if (g_ascii_strcasecmp(proto, "msnim"))
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2909 return FALSE;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2910
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2911 acct = find_acct("prpl-msn", acct_id);
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2912
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2913 if (!acct)
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2914 return FALSE;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2915
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2916 /* msnim:chat?contact=user@domain.tld */
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2917 if (!g_ascii_strcasecmp(cmd, "Chat")) {
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2918 char *sname = g_hash_table_lookup(params, "contact");
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2919 if (sname) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2920 PurpleConversation *conv = purple_find_conversation_with_account(
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2921 PURPLE_CONV_TYPE_IM, sname, acct);
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2922 if (conv == NULL)
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2923 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, sname);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2924 purple_conversation_present(conv);
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2925 }
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2926 /*else
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2927 **If pidgindialogs_im() was in the core, we could use it here.
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2928 * It is all purple_request_* based, but I'm not sure it really belongs in the core
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2929 pidgindialogs_im();*/
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2930
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2931 return TRUE;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2932 }
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2933 /* msnim:add?contact=user@domain.tld */
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2934 else if (!g_ascii_strcasecmp(cmd, "Add")) {
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2935 char *name = g_hash_table_lookup(params, "contact");
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2936 purple_blist_request_add_buddy(acct, name, NULL, NULL);
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2937 return TRUE;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2938 }
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2939
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2940 return FALSE;
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2941 }
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2942
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
2943
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
2944 static PurplePluginProtocolInfo prpl_info =
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
2945 {
9308
4ea759d72d37 [gaim-migrate @ 10116]
Sean Egan <seanegan@pidgin.im>
parents: 9290
diff changeset
2946 OPT_PROTO_MAIL_CHECK,
30194
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2947 NULL, /* user_splits */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2948 NULL, /* protocol_options */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2949 {"png,gif", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_SEND}, /* icon_spec */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2950 msn_list_icon, /* list_icon */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2951 msn_list_emblems, /* list_emblems */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2952 msn_status_text, /* status_text */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2953 msn_tooltip_text, /* tooltip_text */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2954 msn_status_types, /* away_states */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2955 msn_blist_node_menu, /* blist_node_menu */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2956 NULL, /* chat_info */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2957 NULL, /* chat_info_defaults */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2958 msn_login, /* login */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2959 msn_close, /* close */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2960 msn_send_im, /* send_im */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2961 NULL, /* set_info */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2962 msn_send_typing, /* send_typing */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2963 msn_get_info, /* get_info */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2964 msn_set_status, /* set_away */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2965 msn_set_idle, /* set_idle */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2966 NULL, /* change_passwd */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2967 msn_add_buddy, /* add_buddy */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2968 NULL, /* add_buddies */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2969 msn_rem_buddy, /* remove_buddy */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2970 NULL, /* remove_buddies */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2971 msn_add_permit, /* add_permit */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2972 msn_add_deny, /* add_deny */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2973 msn_rem_permit, /* rem_permit */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2974 msn_rem_deny, /* rem_deny */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2975 msn_set_permit_deny, /* set_permit_deny */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2976 NULL, /* join_chat */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2977 NULL, /* reject chat invite */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2978 NULL, /* get_chat_name */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2979 msn_chat_invite, /* chat_invite */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2980 msn_chat_leave, /* chat_leave */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2981 NULL, /* chat_whisper */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2982 msn_chat_send, /* chat_send */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2983 msn_keepalive, /* keepalive */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2984 NULL, /* register_user */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2985 NULL, /* get_cb_info */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2986 NULL, /* get_cb_away */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2987 msn_alias_buddy, /* alias_buddy */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2988 msn_group_buddy, /* group_buddy */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2989 msn_rename_group, /* rename_group */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2990 NULL, /* buddy_free */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2991 msn_convo_closed, /* convo_closed */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2992 msn_normalize, /* normalize */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2993 msn_set_buddy_icon, /* set_buddy_icon */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2994 msn_remove_group, /* remove_group */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2995 NULL, /* get_cb_real_name */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2996 NULL, /* set_chat_topic */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2997 NULL, /* find_blist_chat */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2998 NULL, /* roomlist_get_list */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
2999 NULL, /* roomlist_cancel */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3000 NULL, /* roomlist_expand_category */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3001 msn_can_receive_file, /* can_receive_file */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3002 msn_send_file, /* send_file */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3003 msn_new_xfer, /* new_xfer */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3004 msn_offline_message, /* offline_message */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3005 NULL, /* whiteboard_prpl_ops */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3006 NULL, /* send_raw */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3007 NULL, /* roomlist_room_serialize */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3008 NULL, /* unregister_user */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3009 msn_send_attention, /* send_attention */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3010 msn_attention_types, /* attention_types */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3011 sizeof(PurplePluginProtocolInfo), /* struct_size */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3012 msn_get_account_text_table, /* get_account_text_table */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3013 NULL, /* initiate_media */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3014 NULL, /* get_media_caps */
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30138
diff changeset
3015 NULL, /* get_moods */
30196
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
3016 msn_set_public_alias, /* set_public_alias */
6a2c93988900 Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30194
diff changeset
3017 msn_get_public_alias /* get_public_alias */
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3018 };
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3019
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3020 static PurplePluginInfo info =
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3021 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3022 PURPLE_PLUGIN_MAGIC,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3023 PURPLE_MAJOR_VERSION,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3024 PURPLE_MINOR_VERSION,
24651
1f40dd552d77 Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <markdoliner@pidgin.im>
parents: 24649
diff changeset
3025 PURPLE_PLUGIN_PROTOCOL, /**< type */
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3026 NULL, /**< ui_requirement */
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3027 0, /**< flags */
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3028 NULL, /**< dependencies */
24651
1f40dd552d77 Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <markdoliner@pidgin.im>
parents: 24649
diff changeset
3029 PURPLE_PRIORITY_DEFAULT, /**< priority */
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3030
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3031 "prpl-msn", /**< id */
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3032 "MSN", /**< name */
21106
b85fbef13eed Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 21101
diff changeset
3033 DISPLAY_VERSION, /**< version */
24652
7cdb83d14427 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <markdoliner@pidgin.im>
parents: 24651
diff changeset
3034 N_("Windows Live Messenger Protocol Plugin"), /**< summary */
7cdb83d14427 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <markdoliner@pidgin.im>
parents: 24651
diff changeset
3035 N_("Windows Live Messenger Protocol Plugin"), /**< description */
24651
1f40dd552d77 Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <markdoliner@pidgin.im>
parents: 24649
diff changeset
3036 NULL, /**< author */
1f40dd552d77 Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <markdoliner@pidgin.im>
parents: 24649
diff changeset
3037 PURPLE_WEBSITE, /**< homepage */
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3038
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
3039 msn_load, /**< load */
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
3040 msn_unload, /**< unload */
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3041 NULL, /**< destroy */
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3042
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3043 NULL, /**< ui_info */
8808
1cb5ddf6b625 [gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 8749
diff changeset
3044 &prpl_info, /**< extra_info */
10487
4a37cce04215 [gaim-migrate @ 11777]
Sean Egan <seanegan@pidgin.im>
parents: 10481
diff changeset
3045 NULL, /**< prefs_info */
16746
72faf41c3c4f And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16545
diff changeset
3046 msn_actions,
72faf41c3c4f And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16545
diff changeset
3047
72faf41c3c4f And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16545
diff changeset
3048 /* padding */
72faf41c3c4f And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16545
diff changeset
3049 NULL,
72faf41c3c4f And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16545
diff changeset
3050 NULL,
72faf41c3c4f And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16545
diff changeset
3051 NULL,
72faf41c3c4f And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16545
diff changeset
3052 NULL
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3053 };
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3054
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5191
diff changeset
3055 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3056 init_plugin(PurplePlugin *plugin)
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
3057 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3058 PurpleAccountOption *option;
3572
d07e14aa6f26 [gaim-migrate @ 3670]
Sean Egan <seanegan@pidgin.im>
parents: 3538
diff changeset
3059
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3060 option = purple_account_option_string_new(_("Server"), "server",
23817
aff31c9b1fad Clean up some #define's in msn.h and various supporting changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23800
diff changeset
3061 MSN_SERVER);
5638
53e752c88ea1 [gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents: 5626
diff changeset
3062 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
53e752c88ea1 [gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents: 5626
diff changeset
3063 option);
3572
d07e14aa6f26 [gaim-migrate @ 3670]
Sean Egan <seanegan@pidgin.im>
parents: 3538
diff changeset
3064
23817
aff31c9b1fad Clean up some #define's in msn.h and various supporting changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23800
diff changeset
3065 option = purple_account_option_int_new(_("Port"), "port", MSN_PORT);
5638
53e752c88ea1 [gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents: 5626
diff changeset
3066 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
53e752c88ea1 [gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents: 5626
diff changeset
3067 option);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
3068
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3069 option = purple_account_option_bool_new(_("Use HTTP Method"),
9158
f8dab42adeaf [gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 9092
diff changeset
3070 "http_method", FALSE);
7288
486e8b44a14b [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7277
diff changeset
3071 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
486e8b44a14b [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7277
diff changeset
3072 option);
486e8b44a14b [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents: 7277
diff changeset
3073
20077
dad85816359f applied changes from e3d8fe145881335e4c42f96480b7c2681ff85fe9
Richard Laager <rlaager@pidgin.im>
parents: 19989
diff changeset
3074 option = purple_account_option_string_new(_("HTTP Method Server"),
19989
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
3075 "http_method_server", MSN_HTTPCONN_SERVER);
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
3076 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
3077 option);
1f1bb361a75a A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <datallah@pidgin.im>
parents: 19918
diff changeset
3078
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3079 option = purple_account_option_bool_new(_("Show custom smileys"),
12886
050f70062d54 [gaim-migrate @ 15238]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12658
diff changeset
3080 "custom_smileys", TRUE);
050f70062d54 [gaim-migrate @ 15238]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12658
diff changeset
3081 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
050f70062d54 [gaim-migrate @ 15238]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12658
diff changeset
3082 option);
050f70062d54 [gaim-migrate @ 15238]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12658
diff changeset
3083
30303
3dd06cd2f208 Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30196
diff changeset
3084 option = purple_account_option_bool_new(_("Allow direct connections"),
3dd06cd2f208 Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30196
diff changeset
3085 "direct_connect", TRUE);
3dd06cd2f208 Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30196
diff changeset
3086 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
3dd06cd2f208 Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30196
diff changeset
3087 option);
3dd06cd2f208 Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30196
diff changeset
3088
31201
97dbb1e30ee1 Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31189
diff changeset
3089 option = purple_account_option_bool_new(_("Allow connecting from multiple locations"),
97dbb1e30ee1 Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31189
diff changeset
3090 "mpop", TRUE);
97dbb1e30ee1 Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31189
diff changeset
3091 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
97dbb1e30ee1 Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31189
diff changeset
3092 option);
97dbb1e30ee1 Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31189
diff changeset
3093
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3094 purple_cmd_register("nudge", "", PURPLE_CMD_P_PRPL,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3095 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PRPL_ONLY,
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
3096 "prpl-msn", msn_cmd_nudge,
12318
942b7c089acb [gaim-migrate @ 14622]
Richard Laager <rlaager@pidgin.im>
parents: 12243
diff changeset
3097 _("nudge: nudge a user to get their attention"), NULL);
11321
a93121c0ea16 [gaim-migrate @ 13525]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 11257
diff changeset
3098
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3099 purple_prefs_remove("/plugins/prpl/msn");
15685
483b223d0b60 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <datallah@pidgin.im>
parents: 15654
diff changeset
3100
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3101 purple_signal_connect(purple_get_core(), "uri-handler", plugin,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3102 PURPLE_CALLBACK(msn_uri_handler), NULL);
2086
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
3103 }
007508451e2c [gaim-migrate @ 2096]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
3104
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3105 PURPLE_INIT_PLUGIN(msn, init_plugin, info);

mercurial