annotate libpurple/protocols/msn/msn.c @ 31154:c316749944c1

I don't really like this name.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 13 Mar 2010 08:18:25 +0000
parents 59cf1be8eaa7
children b5793b417705
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file msn.c The MSN protocol plugin
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
4 * purple
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
6 * Purple is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19465
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24 #define PHOTO_SUPPORT 1
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 #include "msn.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include "accountopt.h"
23504
69af5301e1a7 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents: 23501
diff changeset
28 #include "contact.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "msg.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "page.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "pluginpref.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include "prefs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "session.h"
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
34 #include "smiley.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 #include "state.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 #include "util.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 #include "cmds.h"
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
38 #include "core.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 #include "prpl.h"
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
40 #include "msnutils.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 #include "version.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42
24142
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
43 #include "msg.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 #include "switchboard.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 #include "notification.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 #include "sync.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 #include "slplink.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 #if PHOTO_SUPPORT
23745
80ddf59e1585 A similar size limit for MSN buddy icon retrieval from arbitrary urls.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23736
diff changeset
50 #define MAX_HTTP_BUDDYICON_BYTES (200 * 1024)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 #include "imgstore.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 typedef struct
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
56 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 const char *passport;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 } MsnMobileData;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 typedef struct
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
63 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 char *name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 } MsnGetInfoData;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 typedef struct
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 MsnGetInfoData *info_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 char *stripped;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 char *url_buffer;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
73 PurpleNotifyUserInfo *user_info;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 char *photo_url_text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 } MsnGetInfoStepTwoData;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77
17072
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
78 typedef struct
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
79 {
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
80 PurpleConnection *gc;
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
81 const char *who;
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
82 char *msg;
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
83 PurpleMessageFlags flags;
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
84 time_t when;
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
85 } MsnIMData;
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
86
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
87 typedef struct
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
88 {
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
89 char *smile;
28419
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
90 PurpleSmiley *ps;
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
91 MsnObject *obj;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
92 } MsnEmoticon;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
93
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
94 typedef struct
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
95 {
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
96 PurpleConnection *pc;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
97 PurpleBuddy *buddy;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
98 PurpleGroup *group;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
99 } MsnAddReqData;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
100
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 static const char *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
102 msn_normalize(const PurpleAccount *account, const char *str)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104 static char buf[BUF_LEN];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105 char *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 g_return_val_if_fail(str != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109 g_snprintf(buf, sizeof(buf), "%s%s", str,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 (strchr(str, '@') ? "" : "@hotmail.com"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 tmp = g_utf8_strdown(buf, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113 strncpy(buf, tmp, sizeof(buf));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
114 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
116 return buf;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118
28790
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
119 gboolean
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
120 msn_email_is_valid(const char *passport)
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
121 {
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
122 if (purple_email_is_valid(passport)) {
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
123 /* Special characters aren't allowed in domains, so only go to '@' */
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
124 while (*passport != '@') {
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
125 if (*passport == '/')
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
126 return FALSE;
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
127 else if (*passport == '?')
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
128 return FALSE;
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
129 else if (*passport == '=')
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
130 return FALSE;
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
131 /* MSN also doesn't like colons, but that's checked already */
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
132
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
133 passport++;
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
134 }
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
135
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
136 return TRUE;
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
137 }
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
138
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
139 return FALSE;
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
140 }
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
141
19465
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
142 static gboolean
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
143 msn_send_attention(PurpleConnection *gc, const char *username, guint type)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145 MsnMessage *msg;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 MsnSwitchBoard *swboard;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 msg = msn_message_new_nudge();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 session = gc->proto_data;
19465
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
151 swboard = msn_session_get_swboard(session, username, MSN_SB_FLAG_IM);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 msn_switchboard_send_msg(swboard, msg, TRUE);
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
154 msn_message_destroy(msg);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155
19465
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
156 return TRUE;
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
157 }
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
158
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
159 static GList *
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
160 msn_attention_types(PurpleAccount *account)
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
161 {
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
162 static GList *list = NULL;
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
163
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
164 if (!list) {
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22043
diff changeset
165 list = g_list_append(list, purple_attention_type_new("Nudge", _("Nudge"),
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22043
diff changeset
166 _("%s has nudged you!"), _("Nudging %s...")));
19465
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
167 }
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
168
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
169 return list;
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
170 }
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
171
23112
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
172 static GHashTable *
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
173 msn_get_account_text_table(PurpleAccount *unused)
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
174 {
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
175 GHashTable *table;
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
176
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
177 table = g_hash_table_new(g_str_hash, g_str_equal);
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
178
23182
e0bcb8cfda74 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents: 23154
diff changeset
179 g_hash_table_insert(table, "login_label", (gpointer)_("Email Address..."));
23112
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
180
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
181 return table;
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
182 }
19465
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
183
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
184 static PurpleCmdRet
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
185 msn_cmd_nudge(PurpleConversation *conv, const gchar *cmd, gchar **args, gchar **error, void *data)
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
186 {
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
187 PurpleAccount *account = purple_conversation_get_account(conv);
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
188 PurpleConnection *gc = purple_account_get_connection(account);
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
189 const gchar *username;
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
190
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
191 username = purple_conversation_get_name(conv);
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
192
23751
797377cbd5bf Change the other prpls to use new purple_prpl_{send,got}_attention API.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23745
diff changeset
193 purple_prpl_send_attention(gc, username, MSN_NUDGE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
195 return PURPLE_CMD_RET_OK;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197
19797
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
198 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
199 msn_act_id(PurpleConnection *gc, const char *entry)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201 MsnCmdProc *cmdproc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 MsnSession *session;
31147
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
203 MsnTransaction *trans;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
204 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 const char *alias;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 cmdproc = session->notification->cmdproc;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
209 account = purple_connection_get_account(gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
210
27558
8accf7a2264c The MSN client and server strips leading and trailing whitespace, so do the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27477
diff changeset
211 if (entry && *entry)
8accf7a2264c The MSN client and server strips leading and trailing whitespace, so do the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27477
diff changeset
212 {
8accf7a2264c The MSN client and server strips leading and trailing whitespace, so do the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27477
diff changeset
213 char *tmp = g_strdup(entry);
8accf7a2264c The MSN client and server strips leading and trailing whitespace, so do the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27477
diff changeset
214 alias = purple_url_encode(g_strstrip(tmp));
8accf7a2264c The MSN client and server strips leading and trailing whitespace, so do the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27477
diff changeset
215 g_free(tmp);
8accf7a2264c The MSN client and server strips leading and trailing whitespace, so do the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27477
diff changeset
216 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 alias = "";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 if (strlen(alias) > BUDDY_ALIAS_MAXLEN)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
222 purple_notify_error(gc, NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 _("Your new MSN friendly name is too long."), NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
227 if (*alias == '\0') {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
228 alias = purple_url_encode(purple_account_get_username(account));
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
229 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
230
31147
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
231 trans = msn_transaction_new(cmdproc, "PRP", "MFN %s", alias);
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
232
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
233 msn_cmdproc_send_trans(cmdproc, trans);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
237 msn_set_prp(PurpleConnection *gc, const char *type, const char *entry)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 MsnCmdProc *cmdproc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240 MsnSession *session;
31147
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
241 MsnTransaction *trans;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244 cmdproc = session->notification->cmdproc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
245
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246 if (entry == NULL || *entry == '\0')
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 {
31147
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
248 trans = msn_transaction_new(cmdproc, "PRP", "%s", type);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 {
31147
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
252 trans = msn_transaction_new(cmdproc, "PRP", "%s %s", type,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
253 purple_url_encode(entry));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254 }
31153
59cf1be8eaa7 Fix a few little things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31149
diff changeset
255 msn_cmdproc_send_trans(cmdproc, trans);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
259 msn_set_home_phone_cb(PurpleConnection *gc, const char *entry)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 msn_set_prp(gc, "PHH", entry);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
265 msn_set_work_phone_cb(PurpleConnection *gc, const char *entry)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 msn_set_prp(gc, "PHW", entry);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
271 msn_set_mobile_phone_cb(PurpleConnection *gc, const char *entry)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 msn_set_prp(gc, "PHM", entry);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
277 enable_msn_pages_cb(PurpleConnection *gc)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279 msn_set_prp(gc, "MOB", "Y");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
283 disable_msn_pages_cb(PurpleConnection *gc)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 msn_set_prp(gc, "MOB", "N");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
286 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
287
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
289 send_to_mobile(PurpleConnection *gc, const char *who, const char *entry)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291 MsnTransaction *trans;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
293 MsnCmdProc *cmdproc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294 MsnPage *page;
28414
e7a2e2208f88 Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27604
diff changeset
295 MsnMessage *msg;
22518
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
296 MsnUser *user;
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
297 char *payload = NULL;
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
298 const char *mobile_number = NULL;
22798
05cb3f04c01e This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22518
diff changeset
299 gsize payload_len;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302 cmdproc = session->notification->cmdproc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304 page = msn_page_new();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305 msn_page_set_body(page, entry);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
307 payload = msn_page_gen_payload(page, &payload_len);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
308
22518
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
309 if ((user = msn_userlist_find_user(session->userlist, who)) &&
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
310 (mobile_number = msn_user_get_mobile_phone(user)) &&
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
311 mobile_number[0] == '+') {
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
312 /* if msn_user_get_mobile_phone() has a + in front, it's a number
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
313 that from the buddy's contact card */
22798
05cb3f04c01e This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22518
diff changeset
314 trans = msn_transaction_new(cmdproc, "PGD", "tel:%s 1 %" G_GSIZE_FORMAT,
22518
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
315 mobile_number, payload_len);
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
316 } else {
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
317 /* otherwise we send to whatever phone number the buddy registered
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
318 with msn */
22798
05cb3f04c01e This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22518
diff changeset
319 trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %" G_GSIZE_FORMAT,
05cb3f04c01e This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22518
diff changeset
320 who, payload_len);
22518
6aa076a2ea6f Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents: 22433
diff changeset
321 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323 msn_transaction_set_payload(trans, payload, payload_len);
20989
2097b1664fa3 Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20957
diff changeset
324 g_free(payload);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
325
28414
e7a2e2208f88 Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27604
diff changeset
326 msg = msn_message_new_plain(entry);
e7a2e2208f88 Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27604
diff changeset
327 msn_transaction_set_data(trans, msg);
e7a2e2208f88 Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27604
diff changeset
328
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329 msn_page_destroy(page);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
330
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
331 msn_cmdproc_send_trans(cmdproc, trans);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
332 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
333
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
334 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
335 send_to_mobile_cb(MsnMobileData *data, const char *entry)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
336 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
337 send_to_mobile(data->gc, data->passport, entry);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
338 g_free(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
339 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
340
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341 static void
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 close_mobile_page_cb(MsnMobileData *data, const char *entry)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
343 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
344 g_free(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
347 /* -- */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
348
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
349 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
350 msn_show_set_friendly_name(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
351 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
352 PurpleConnection *gc;
29207
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
353 PurpleAccount *account;
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
354 char *tmp;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
355
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
356 gc = (PurpleConnection *) action->context;
29207
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
357 account = purple_connection_get_account(gc);
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
358
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
359 tmp = g_strdup_printf(_("Set friendly name for %s."),
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
360 purple_account_get_username(account));
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
361 purple_request_input(gc, _("Set your friendly name."), tmp,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
362 _("This is the name that other MSN buddies will "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
363 "see you as."),
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
364 purple_connection_get_display_name(gc), FALSE, FALSE, NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
365 _("OK"), G_CALLBACK(msn_act_id),
16442
08db93bbd798 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 <evan.s@dreskin.net>
parents: 15823
diff changeset
366 _("Cancel"), NULL,
29207
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
367 account, NULL, NULL,
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
368 gc);
29207
5259ca10b641 Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
369 g_free(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
372 typedef struct MsnLocationData {
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
373 PurpleAccount *account;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
374 MsnSession *session;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
375 PurpleRequestFieldGroup *group;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
376 } MsnLocationData;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
377
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378 static void
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
379 update_endpoint_cb(MsnLocationData *data, PurpleRequestFields *fields)
31123
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
380 {
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
381 PurpleAccount *account;
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
382 MsnSession *session;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
383 const char *old_name;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
384 const char *name;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
385 GList *others;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
386
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
387 session = data->session;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
388 account = data->account;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
389
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
390 /* Update the current location's name */
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
391 old_name = purple_account_get_string(account, "endpoint-name", NULL);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
392 name = purple_request_fields_get_string(fields, "endpoint-name");
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
393 if (!g_str_equal(old_name, name)) {
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
394 purple_account_set_string(account, "endpoint-name", name);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
395 msn_notification_send_uux_private_endpointdata(session);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
396 }
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
397
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
398 /* Sign out other locations */
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
399 for (others = purple_request_field_group_get_fields(data->group);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
400 others;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
401 others = g_list_next(others)) {
31127
fe607234b0d8 When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31126
diff changeset
402 PurpleRequestField *field = others->data;
fe607234b0d8 When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31126
diff changeset
403 if (purple_request_field_get_type(field) != PURPLE_REQUEST_FIELD_BOOLEAN)
fe607234b0d8 When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31126
diff changeset
404 continue;
31128
d80d32644492 Fix this inverted logic. Disconnect the selected endpoints as said in the field label.
masca@cpw.pidgin.im
parents: 31127
diff changeset
405 if (purple_request_field_bool_get_value(field)) {
31127
fe607234b0d8 When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31126
diff changeset
406 const char *id = purple_request_field_get_id(field);
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
407 char *user;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
408 purple_debug_info("msn", "Disconnecting Endpoint %s\n", id);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
409
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
410 user = g_strdup_printf("%s;%s", purple_account_get_username(account), id);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
411 msn_notification_send_uun(session, user, MSN_UNIFIED_NOTIFICATION_MPOP, "goawyplzthxbye");
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
412 g_free(user);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
413 }
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
414 }
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
415
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
416 g_free(data);
31123
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
417 }
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
418
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
419 static void
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
420 create_endpoint_fields(gpointer key, gpointer value, gpointer user_data)
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
421 {
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
422 const char *id = key;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
423 MsnUserEndpoint *ep = value;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
424 MsnLocationData *data = user_data;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
425 PurpleRequestField *field;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
426
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
427 if (g_str_equal(id, data->session->guid))
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
428 return;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
429
31129
b27d2e8f137e Default to FALSE the endpoints you want to sing out from this menu. It makes sense because you may want to just change the endpoint name.
masca@cpw.pidgin.im
parents: 31128
diff changeset
430 field = purple_request_field_bool_new(id, ep->name, FALSE);
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
431 purple_request_field_group_add_field(data->group, field);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
432 }
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
433
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
434 static void
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
435 msn_show_locations(PurplePluginAction *action)
31123
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
436 {
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
437 PurpleConnection *pc;
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
438 PurpleAccount *account;
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
439 MsnSession *session;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
440 PurpleRequestFields *fields;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
441 PurpleRequestFieldGroup *group;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
442 PurpleRequestField *field;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
443 MsnLocationData *data;
31123
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
444
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
445 pc = (PurpleConnection *)action->context;
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
446 account = purple_connection_get_account(pc);
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
447 session = purple_connection_get_protocol_data(pc);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
448
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
449 fields = purple_request_fields_new();
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
450
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
451 group = purple_request_field_group_new(_("This Location"));
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
452 purple_request_fields_add_group(fields, group);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
453 field = purple_request_field_label_new("endpoint-label", _("This is the name that identifies this location"));
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
454 purple_request_field_group_add_field(group, field);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
455 field = purple_request_field_string_new("endpoint-name",
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
456 _("Name"),
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
457 purple_account_get_string(account, "endpoint-name", NULL),
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
458 FALSE);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
459 purple_request_field_set_required(field, TRUE);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
460 purple_request_field_group_add_field(group, field);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
461
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
462 group = purple_request_field_group_new(_("Other Locations"));
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
463 purple_request_fields_add_group(fields, group);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
464 field = purple_request_field_label_new("others-label", _("You can sign out from other locations here"));
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
465 purple_request_field_group_add_field(group, field);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
466
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
467 data = g_new0(MsnLocationData, 1);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
468 data->account = account;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
469 data->session = session;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
470 data->group = group;
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
471 g_hash_table_foreach(session->user->endpoints, create_endpoint_fields, data);
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
472
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
473 purple_request_fields(pc, NULL, NULL, NULL,
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
474 fields,
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
475 _("OK"), G_CALLBACK(update_endpoint_cb),
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
476 _("Cancel"), G_CALLBACK(g_free),
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
477 account, NULL, NULL,
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
478 data);
31123
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
479 }
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
480
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
482 msn_show_set_home_phone(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
483 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
484 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
487 gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
488 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
489
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
490 purple_request_input(gc, NULL, _("Set your home phone number."), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 msn_user_get_home_phone(session->user), FALSE, FALSE, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 _("OK"), G_CALLBACK(msn_set_home_phone_cb),
16442
08db93bbd798 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 <evan.s@dreskin.net>
parents: 15823
diff changeset
493 _("Cancel"), NULL,
08db93bbd798 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 <evan.s@dreskin.net>
parents: 15823
diff changeset
494 purple_connection_get_account(gc), NULL, NULL,
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
495 gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
497
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
499 msn_show_set_work_phone(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
501 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
502 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
504 gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
505 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
507 purple_request_input(gc, NULL, _("Set your work phone number."), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
508 msn_user_get_work_phone(session->user), FALSE, FALSE, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509 _("OK"), G_CALLBACK(msn_set_work_phone_cb),
16442
08db93bbd798 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 <evan.s@dreskin.net>
parents: 15823
diff changeset
510 _("Cancel"), NULL,
08db93bbd798 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 <evan.s@dreskin.net>
parents: 15823
diff changeset
511 purple_connection_get_account(gc), NULL, NULL,
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
512 gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
513 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
514
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
516 msn_show_set_mobile_phone(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
518 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
521 gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
522 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
524 purple_request_input(gc, NULL, _("Set your mobile phone number."), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
525 msn_user_get_mobile_phone(session->user), FALSE, FALSE, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 _("OK"), G_CALLBACK(msn_set_mobile_phone_cb),
16442
08db93bbd798 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 <evan.s@dreskin.net>
parents: 15823
diff changeset
527 _("Cancel"), NULL,
08db93bbd798 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 <evan.s@dreskin.net>
parents: 15823
diff changeset
528 purple_connection_get_account(gc), NULL, NULL,
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
529 gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
530 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
531
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
532 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
533 msn_show_set_mobile_pages(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
534 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
535 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
536
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
537 gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
539 purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
540 _("Do you want to allow or disallow people on "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
541 "your buddy list to send you MSN Mobile pages "
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
542 "to your cell phone or other mobile device?"),
22138
8515997d66e9 Minor improvements to the default_action used in purple_action_request
Mark Doliner <mark@kingant.net>
parents: 22103
diff changeset
543 PURPLE_DEFAULT_ACTION_NONE,
16442
08db93bbd798 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 <evan.s@dreskin.net>
parents: 15823
diff changeset
544 purple_connection_get_account(gc), NULL, NULL,
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
545 gc, 3,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
546 _("Allow"), G_CALLBACK(enable_msn_pages_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 _("Disallow"), G_CALLBACK(disable_msn_pages_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548 _("Cancel"), NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
550
23572
25aec47d9671 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23564
diff changeset
551 /* QuLogic: Disabled until confirmed correct. */
25aec47d9671 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23564
diff changeset
552 #if 0
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
553 static void
23522
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
554 msn_show_blocked_text(PurplePluginAction *action)
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
555 {
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
556 PurpleConnection *pc = (PurpleConnection *) action->context;
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
557 MsnSession *session;
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
558 char *title;
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
559
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
560 session = pc->proto_data;
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
561
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
562 title = g_strdup_printf(_("Blocked Text for %s"), session->account->username);
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
563 if (session->blocked_text == NULL) {
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
564 purple_notify_formatted(pc, title, title, NULL, _("No text is blocked for this account."), NULL, NULL);
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
565 } else {
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
566 char *blocked_text;
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
567 blocked_text = g_strdup_printf(_("MSN servers are currently blocking the following regular expressions:<br/>%s"),
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
568 session->blocked_text);
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
569
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
570 purple_notify_formatted(pc, title, title, NULL, blocked_text, NULL, NULL);
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
571 g_free(blocked_text);
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
572 }
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
573 g_free(title);
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
574 }
23572
25aec47d9671 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23564
diff changeset
575 #endif
23522
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
576
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
577 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
578 msn_show_hotmail_inbox(PurplePluginAction *action)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
579 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
580 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
581 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
582
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
583 gc = (PurpleConnection *) action->context;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
584 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
585
23656
b2609fca4943 Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23655
diff changeset
586 if (!session->passport_info.email_enabled) {
b2609fca4943 Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23655
diff changeset
587 purple_notify_error(gc, NULL,
b2609fca4943 Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23655
diff changeset
588 _("This account does not have email enabled."), NULL);
b2609fca4943 Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23655
diff changeset
589 return;
b2609fca4943 Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23655
diff changeset
590 }
b2609fca4943 Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23655
diff changeset
591
23599
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
592 /** apparently the correct value is 777, use 750 as a failsafe */
23657
7f4b697c6947 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23656
diff changeset
593 if ((session->passport_info.mail_url == NULL)
7f4b697c6947 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23656
diff changeset
594 || (time (NULL) - session->passport_info.mail_timestamp >= 750)) {
23599
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
595 MsnTransaction *trans;
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
596 MsnCmdProc *cmdproc;
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
597
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
598 cmdproc = session->notification->cmdproc;
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
599
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
600 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX");
23656
b2609fca4943 Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23655
diff changeset
601 msn_transaction_set_data(trans, GUINT_TO_POINTER(TRUE));
23599
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
602
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
603 msn_cmdproc_send_trans(cmdproc, trans);
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
604
23657
7f4b697c6947 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23656
diff changeset
605 } else
7f4b697c6947 Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23656
diff changeset
606 purple_notify_uri(gc, session->passport_info.mail_url);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
607 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
608
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
609 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
610 show_send_to_mobile_cb(PurpleBlistNode *node, gpointer ignored)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
611 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
612 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
613 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
614 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
615 MsnMobileData *data;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
616 PurpleAccount *account;
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
617 const char *name;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
618
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
619 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
620
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
621 buddy = (PurpleBuddy *) node;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
622 account = purple_buddy_get_account(buddy);
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
623 gc = purple_account_get_connection(account);
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
624 name = purple_buddy_get_name(buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
625
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
626 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
627
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
628 data = g_new0(MsnMobileData, 1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
629 data->gc = gc;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
630 data->passport = name;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
631
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
632 purple_request_input(gc, NULL, _("Send a mobile message."), NULL,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633 NULL, TRUE, FALSE, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
634 _("Page"), G_CALLBACK(send_to_mobile_cb),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
635 _("Close"), G_CALLBACK(close_mobile_page_cb),
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
636 account, name, NULL,
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
637 data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
638 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
639
16848
133932a97faa Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents: 16675
diff changeset
640 static gboolean
133932a97faa Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents: 16675
diff changeset
641 msn_offline_message(const PurpleBuddy *buddy) {
23887
b664b3924a52 correctly say we support offline messages for all buddies, this was never
Ka-Hing Cheung <khc@hxbc.us>
parents: 23797
diff changeset
642 return TRUE;
16848
133932a97faa Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents: 16675
diff changeset
643 }
133932a97faa Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents: 16675
diff changeset
644
20459
46437bdf316b 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: 20456
diff changeset
645 void
46437bdf316b 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: 20456
diff changeset
646 msn_send_privacy(PurpleConnection *gc)
46437bdf316b 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: 20456
diff changeset
647 {
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
648 PurpleAccount *account;
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
649 MsnSession *session;
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
650 MsnCmdProc *cmdproc;
31147
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
651 MsnTransaction *trans;
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
652
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
653 account = purple_connection_get_account(gc);
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
654 session = gc->proto_data;
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
655 cmdproc = session->notification->cmdproc;
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
656
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
657 if (account->perm_deny == PURPLE_PRIVACY_ALLOW_ALL ||
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
658 account->perm_deny == PURPLE_PRIVACY_DENY_USERS)
31147
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
659 trans = msn_transaction_new(cmdproc, "BLP", "%s", "AL");
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
660 else
31147
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
661 trans = msn_transaction_new(cmdproc, "BLP", "%s", "BL");
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
662
4d7dfeae29c6 msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents: 31143
diff changeset
663 msn_cmdproc_send_trans(cmdproc, trans);
20459
46437bdf316b 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: 20456
diff changeset
664 }
46437bdf316b 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: 20456
diff changeset
665
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
666 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
667 initiate_chat_cb(PurpleBlistNode *node, gpointer data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
668 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
669 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
670 PurpleConnection *gc;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
671 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
672
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
673 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
674 MsnSwitchBoard *swboard;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
675
23736
8ba3d6905252 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23730
diff changeset
676 const char *alias;
8ba3d6905252 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23730
diff changeset
677
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
678 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
679
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
680 buddy = (PurpleBuddy *) node;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
681 account = purple_buddy_get_account(buddy);
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
682 gc = purple_account_get_connection(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
683
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
684 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
685
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
686 swboard = msn_switchboard_new(session);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
687 msn_switchboard_request(swboard);
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
688 msn_switchboard_request_add_user(swboard, purple_buddy_get_name(buddy));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
689
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
690 /* TODO: This might move somewhere else, after USR might be */
22043
23fef20a0ef2 Use a unique chat id across all sessions for multi-user chats, probably
Stu Tomlinson <stu@nosnilmot.com>
parents: 22000
diff changeset
691 swboard->chat_id = msn_switchboard_get_chat_id();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
692 swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
693 swboard->flag = MSN_SB_FLAG_IM;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
694
23736
8ba3d6905252 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23730
diff changeset
695 /* Local alias > Display name > Username */
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
696 if ((alias = purple_account_get_alias(account)) == NULL)
23736
8ba3d6905252 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23730
diff changeset
697 if ((alias = purple_connection_get_display_name(gc)) == NULL)
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
698 alias = purple_account_get_username(account);
23736
8ba3d6905252 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23730
diff changeset
699
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
700 purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv),
23736
8ba3d6905252 When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23730
diff changeset
701 alias, NULL, PURPLE_CBFLAGS_NONE, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
702 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
703
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
704 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
705 t_msn_xfer_init(PurpleXfer *xfer)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
706 {
17065
21830d70709b Patch from sourceforge tracker 1652005 from wabz to fix displaying file
Stu Tomlinson <stu@nosnilmot.com>
parents: 16878
diff changeset
707 MsnSlpLink *slplink = xfer->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
708 msn_slplink_request_ft(slplink, xfer);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
709 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
710
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
711 static PurpleXfer*
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
712 msn_new_xfer(PurpleConnection *gc, const char *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
713 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
714 MsnSession *session;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
715 PurpleXfer *xfer;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
716
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
717 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
718
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
719 xfer = purple_xfer_new(gc->account, PURPLE_XFER_SEND, who);
19797
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
720
24355
63558ea6fac6 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <mark@kingant.net>
parents: 24142
diff changeset
721 g_return_val_if_fail(xfer != NULL, NULL);
63558ea6fac6 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <mark@kingant.net>
parents: 24142
diff changeset
722
63558ea6fac6 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <mark@kingant.net>
parents: 24142
diff changeset
723 xfer->data = msn_session_get_slplink(session, who);
63558ea6fac6 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <mark@kingant.net>
parents: 24142
diff changeset
724
63558ea6fac6 It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <mark@kingant.net>
parents: 24142
diff changeset
725 purple_xfer_set_init_fnc(xfer, t_msn_xfer_init);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
726
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727 return xfer;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
728 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
729
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
731 msn_send_file(PurpleConnection *gc, const char *who, const char *file)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
732 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
733 PurpleXfer *xfer = msn_new_xfer(gc, who);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
734
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
735 if (file)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
736 purple_xfer_request_accepted(xfer, file);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
737 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
738 purple_xfer_request(xfer);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
739 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
740
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
741 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
742 msn_can_receive_file(PurpleConnection *gc, const char *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
743 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
744 PurpleAccount *account;
23661
6659ba7b3941 Fix a crash when the user isn't in your list.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23657
diff changeset
745 gchar *normal;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
746 gboolean ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
747
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
748 account = purple_connection_get_account(gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
749
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
750 normal = g_strdup(msn_normalize(account, purple_account_get_username(account)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
751 ret = strcmp(normal, msn_normalize(account, who));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
752 g_free(normal);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753
23654
46da06b6b4ce Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23605
diff changeset
754 if (ret) {
23661
6659ba7b3941 Fix a crash when the user isn't in your list.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23657
diff changeset
755 MsnSession *session = gc->proto_data;
23673
7a71457cdd32 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23661
diff changeset
756 if (session) {
7a71457cdd32 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23661
diff changeset
757 MsnUser *user = msn_userlist_find_user(session->userlist, who);
28837
019c8be6b52d Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 28790
diff changeset
758 if (user) {
23673
7a71457cdd32 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23661
diff changeset
759 /* Include these too: MSN_CLIENT_CAP_MSNMOBILE|MSN_CLIENT_CAP_MSNDIRECT ? */
28837
019c8be6b52d Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 28790
diff changeset
760 if ((user->clientid & MSN_CLIENT_CAP_WEBMSGR) ||
019c8be6b52d Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 28790
diff changeset
761 user->networkid == MSN_NETWORK_YAHOO)
019c8be6b52d Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 28790
diff changeset
762 ret = FALSE;
019c8be6b52d Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 28790
diff changeset
763 else
019c8be6b52d Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 28790
diff changeset
764 ret = TRUE;
019c8be6b52d Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 28790
diff changeset
765 }
23673
7a71457cdd32 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23661
diff changeset
766 } else
7a71457cdd32 Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23661
diff changeset
767 ret = FALSE;
23654
46da06b6b4ce Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23605
diff changeset
768 }
46da06b6b4ce Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23605
diff changeset
769
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770 return ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
772
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
773 /**************************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
774 * Protocol Plugin ops
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
775 **************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
776
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
777 static const char *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
778 msn_list_icon(PurpleAccount *a, PurpleBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
779 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
780 return "msn";
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
781 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
782
23524
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
783 static const char *
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
784 msn_list_emblems(PurpleBuddy *b)
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
785 {
25290
8d562557ed6f Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 24294
diff changeset
786 MsnUser *user = purple_buddy_get_protocol_data(b);
23524
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
787
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
788 if (user != NULL) {
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
789 if (user->clientid & MSN_CLIENT_CAP_BOT)
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
790 return "bot";
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
791 if (user->clientid & MSN_CLIENT_CAP_WIN_MOBILE)
23655
8218a2c209f1 On MSN, use "external" and "mobile" for Web messenger and mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23654
diff changeset
792 return "mobile";
23524
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
793 #if 0
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
794 /* XXX: Since we don't support this, there's no point in showing it just yet */
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
795 if (user->clientid & MSN_CLIENT_CAP_SCHANNEL)
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
796 return "secure";
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
797 #endif
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
798 if (user->clientid & MSN_CLIENT_CAP_WEBMSGR)
23655
8218a2c209f1 On MSN, use "external" and "mobile" for Web messenger and mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23654
diff changeset
799 return "external";
23524
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
800 if (user->networkid == MSN_NETWORK_YAHOO)
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
801 return "yahoo";
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
802 }
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
803
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
804 return NULL;
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
805 }
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
806
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
807 /*
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
808 * Set the User status text
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
809 */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
810 static char *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
811 msn_status_text(PurpleBuddy *buddy)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
812 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
813 PurplePresence *presence;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
814 PurpleStatus *status;
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
815 const char *msg;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
816
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
817 presence = purple_buddy_get_presence(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
818 status = purple_presence_get_active_status(presence);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
819
24931
3e39e4652c36 xmpp does this!
Ka-Hing Cheung <khc@hxbc.us>
parents: 24674
diff changeset
820 /* Official client says media takes precedence over message */
3e39e4652c36 xmpp does this!
Ka-Hing Cheung <khc@hxbc.us>
parents: 24674
diff changeset
821 /* I say message take precedence over media! Plus prpl-jabber agrees
3e39e4652c36 xmpp does this!
Ka-Hing Cheung <khc@hxbc.us>
parents: 24674
diff changeset
822 too */
3e39e4652c36 xmpp does this!
Ka-Hing Cheung <khc@hxbc.us>
parents: 24674
diff changeset
823 msg = purple_status_get_attr_string(status, "message");
3e39e4652c36 xmpp does this!
Ka-Hing Cheung <khc@hxbc.us>
parents: 24674
diff changeset
824 if (msg && *msg)
3e39e4652c36 xmpp does this!
Ka-Hing Cheung <khc@hxbc.us>
parents: 24674
diff changeset
825 return g_markup_escape_text(msg, -1);
3e39e4652c36 xmpp does this!
Ka-Hing Cheung <khc@hxbc.us>
parents: 24674
diff changeset
826
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
827 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
828 const char *title, *game, *office;
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
829 char *media, *esc;
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
830 status = purple_presence_get_status(presence, "tune");
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
831 title = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE);
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
832
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
833 game = purple_status_get_attr_string(status, "game");
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
834 office = purple_status_get_attr_string(status, "office");
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
835
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
836 if (title && *title) {
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
837 const char *artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST);
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
838 const char *album = purple_status_get_attr_string(status, PURPLE_TUNE_ALBUM);
27592
4cddfd2d06be Use purple_util_format_song_info in MSN/XMPP for the buddy list status text.
Paul Aurich <paul@darkrain42.org>
parents: 27477
diff changeset
839 media = purple_util_format_song_info(title, artist, album, NULL);
27604
8cfc45425ac7 Don't double-escape media.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27603
diff changeset
840 return media;
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
841 }
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
842 else if (game && *game)
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
843 media = g_strdup_printf("Playing %s", game);
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
844 else if (office && *office)
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
845 media = g_strdup_printf("Editing %s", office);
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
846 else
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
847 return NULL;
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
848 esc = g_markup_escape_text(media, -1);
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
849 g_free(media);
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
850 return esc;
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
851 }
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
852
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
853 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
854 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
855
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
856 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
857 msn_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
858 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
859 MsnUser *user;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
860 PurplePresence *presence = purple_buddy_get_presence(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
861 PurpleStatus *status = purple_presence_get_active_status(presence);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
862
25290
8d562557ed6f Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 24294
diff changeset
863 user = purple_buddy_get_protocol_data(buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
864
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
865 if (purple_presence_is_online(presence))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
866 {
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
867 const char *psm, *name;
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
868 const char *mediatype = NULL;
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
869 char *currentmedia = NULL;
19797
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
870 char *tmp;
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
871
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
872 psm = purple_status_get_attr_string(status, "message");
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
873 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
874 PurpleStatus *tune = purple_presence_get_status(presence, "tune");
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
875 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE);
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
876 const char *game = purple_status_get_attr_string(tune, "game");
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
877 const char *office = purple_status_get_attr_string(tune, "office");
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
878 if (title && *title) {
24456
7a5f6ddd11b1 Only get the artist and album if we are setting a Music mediatype.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
879 const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST);
7a5f6ddd11b1 Only get the artist and album if we are setting a Music mediatype.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24455
diff changeset
880 const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM);
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
881 mediatype = _("Now Listening");
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
882 currentmedia = purple_util_format_song_info(title, artist, album, NULL);
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
883 } else if (game && *game) {
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
884 mediatype = _("Playing a game");
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
885 currentmedia = g_strdup(game);
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
886 } else if (office && *office) {
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
887 mediatype = _("Working");
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
888 currentmedia = g_strdup(office);
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
889 }
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
890 }
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
891
21139
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
892 if (!purple_status_is_available(status)) {
20502
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
893 name = purple_status_get_name(status);
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
894 } else {
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
895 name = NULL;
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
896 }
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
897
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
898 if (name != NULL && *name) {
21139
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
899 char *tmp2;
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
900
23797
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
901 tmp2 = g_markup_escape_text(name, -1);
21139
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
902 if (purple_presence_is_idle(presence)) {
23797
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
903 char *idle;
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
904 char *tmp3;
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
905 /* Never know what those translations might end up like... */
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
906 idle = g_markup_escape_text(_("Idle"), -1);
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
907 tmp3 = g_strdup_printf("%s/%s", tmp2, idle);
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
908 g_free(idle);
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
909 g_free(tmp2);
35f7b7c62995 Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23796
diff changeset
910 tmp2 = tmp3;
21139
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
911 }
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
912
20502
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
913 if (psm != NULL && *psm) {
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
914 tmp = g_markup_escape_text(psm, -1);
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
915 purple_notify_user_info_add_pair(user_info, tmp2, tmp);
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
916 g_free(tmp);
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
917 } else {
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
918 purple_notify_user_info_add_pair(user_info, _("Status"), tmp2);
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
919 }
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
920
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
921 g_free(tmp2);
b5a2938b4549 Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents: 20488
diff changeset
922 } else {
20567
b4a141f9294a don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@hxbc.us>
parents: 20554
diff changeset
923 if (psm != NULL && *psm) {
b4a141f9294a don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@hxbc.us>
parents: 20554
diff changeset
924 tmp = g_markup_escape_text(psm, -1);
21139
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
925 if (purple_presence_is_idle(presence)) {
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
926 purple_notify_user_info_add_pair(user_info, _("Idle"), tmp);
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
927 } else {
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
928 purple_notify_user_info_add_pair(user_info, _("Status"), tmp);
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
929 }
20567
b4a141f9294a don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@hxbc.us>
parents: 20554
diff changeset
930 g_free(tmp);
21139
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
931 } else {
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
932 if (purple_presence_is_idle(presence)) {
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
933 purple_notify_user_info_add_pair(user_info, _("Status"),
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
934 _("Idle"));
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
935 } else {
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
936 purple_notify_user_info_add_pair(user_info, _("Status"),
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
937 purple_status_get_name(status));
0df8263c21b8 show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents: 21113
diff changeset
938 }
20567
b4a141f9294a don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@hxbc.us>
parents: 20554
diff changeset
939 }
19797
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
940 }
20463
0b04a7d90470 removed "PSM:" label and move the message to "Status:" to be consistent with
Ka-Hing Cheung <khc@hxbc.us>
parents: 20462
diff changeset
941
19797
60bc06498746 Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents: 15823
diff changeset
942 if (currentmedia) {
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
943 purple_notify_user_info_add_pair(user_info, mediatype, currentmedia);
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
944 g_free(currentmedia);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
945 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
946 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
947
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
948 /* XXX: This is being shown in non-full tooltips because the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
949 * XXX: blocked icon overlay isn't always accurate for MSN.
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
950 * XXX: This can die as soon as purple_privacy_check() knows that
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
951 * XXX: this prpl always honors both the allow and deny lists. */
21026
27c72bd82a81 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <stu@nosnilmot.com>
parents: 21000
diff changeset
952 /* While the above comment may be strictly correct (the privacy API needs
27c72bd82a81 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <stu@nosnilmot.com>
parents: 21000
diff changeset
953 * rewriteing), purple_privacy_check() is going to be more accurate at
27c72bd82a81 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <stu@nosnilmot.com>
parents: 21000
diff changeset
954 * indicating whether a particular buddy is going to be able to message
27c72bd82a81 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <stu@nosnilmot.com>
parents: 21000
diff changeset
955 * you, which is the important information that this is trying to convey.
27c72bd82a81 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <stu@nosnilmot.com>
parents: 21000
diff changeset
956 */
27c72bd82a81 We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <stu@nosnilmot.com>
parents: 21000
diff changeset
957 if (full && user)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
958 {
22259
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
959 const char *phone;
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
960
23978
0a4aa7df352b We can't have ./configure lying to you, can we?
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23887
diff changeset
961 purple_notify_user_info_add_pair(user_info, _("Has you"),
0a4aa7df352b We can't have ./configure lying to you, can we?
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23887
diff changeset
962 ((user->list_op & (1 << MSN_LIST_RL)) ? _("Yes") : _("No")));
0a4aa7df352b We can't have ./configure lying to you, can we?
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23887
diff changeset
963
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
964 purple_notify_user_info_add_pair(user_info, _("Blocked"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
965 ((user->list_op & (1 << MSN_LIST_BL)) ? _("Yes") : _("No")));
22259
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
966
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
967 phone = msn_user_get_home_phone(user);
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
968 if (phone != NULL)
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
969 purple_notify_user_info_add_pair(user_info, _("Home Phone Number"), phone);
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
970
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
971 phone = msn_user_get_work_phone(user);
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
972 if (phone != NULL)
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
973 purple_notify_user_info_add_pair(user_info, _("Work Phone Number"), phone);
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
974
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
975 phone = msn_user_get_mobile_phone(user);
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
976 if (phone != NULL)
6e5d37105189 Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents: 22138
diff changeset
977 purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), phone);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
978 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
979 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
980
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
981 static GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
982 msn_status_types(PurpleAccount *account)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
983 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
984 PurpleStatusType *status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
985 GList *types = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
986
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
987 status = purple_status_type_new_with_attrs(
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
988 PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
989 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
990 NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
991 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
992
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
993 status = purple_status_type_new_with_attrs(
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
994 PURPLE_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
995 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
996 NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
997 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
998
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
999 status = purple_status_type_new_with_attrs(
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1000 PURPLE_STATUS_AWAY, "brb", _("Be Right Back"), TRUE, TRUE, FALSE,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1001 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1002 NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1003 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1004
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1005 status = purple_status_type_new_with_attrs(
20437
8e722e947e00 Patch from Pse to use the same status primitives as im.pidgin.pidgin for
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
1006 PURPLE_STATUS_UNAVAILABLE, "busy", _("Busy"), TRUE, TRUE, FALSE,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1007 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1008 NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1009 types = g_list_append(types, status);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1010 status = purple_status_type_new_with_attrs(
20437
8e722e947e00 Patch from Pse to use the same status primitives as im.pidgin.pidgin for
Stu Tomlinson <stu@nosnilmot.com>
parents: 20425
diff changeset
1011 PURPLE_STATUS_UNAVAILABLE, "phone", _("On the Phone"), TRUE, TRUE, FALSE,
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1012 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1013 NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1014 types = g_list_append(types, status);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1015 status = purple_status_type_new_with_attrs(
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1016 PURPLE_STATUS_AWAY, "lunch", _("Out to Lunch"), TRUE, TRUE, FALSE,
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1017 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1018 NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1019 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1020
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1021 status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE,
25050
b5c82724598c For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24943
diff changeset
1022 NULL, NULL, TRUE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1023 types = g_list_append(types, status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1024
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1025 status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE,
25050
b5c82724598c For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24943
diff changeset
1026 NULL, NULL, TRUE, TRUE, FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1027 types = g_list_append(types, status);
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
1028
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1029 status = purple_status_type_new_full(PURPLE_STATUS_MOBILE,
15541
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1030 "mobile", NULL, FALSE, FALSE, TRUE);
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1031 types = g_list_append(types, status);
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
1032
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
1033 status = purple_status_type_new_with_attrs(PURPLE_STATUS_TUNE,
24409
3a3d36791a47 I don't know why we'd want the TUNE status to be saveable.
Richard Laager <rlaager@wiktel.com>
parents: 24374
diff changeset
1034 "tune", NULL, FALSE, TRUE, TRUE,
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
1035 PURPLE_TUNE_ARTIST, _("Artist"), purple_value_new(PURPLE_TYPE_STRING),
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
1036 PURPLE_TUNE_ALBUM, _("Album"), purple_value_new(PURPLE_TYPE_STRING),
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
1037 PURPLE_TUNE_TITLE, _("Title"), purple_value_new(PURPLE_TYPE_STRING),
24455
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
1038 "game", _("Game Title"), purple_value_new(PURPLE_TYPE_STRING),
e344426d7c28 Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24451
diff changeset
1039 "office", _("Office Title"), purple_value_new(PURPLE_TYPE_STRING),
20570
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
1040 NULL);
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
1041 types = g_list_append(types, status);
5913725cbcd6 Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20567
diff changeset
1042
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1043 return types;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1044 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1045
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1046 static GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1047 msn_actions(PurplePlugin *plugin, gpointer context)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1048 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1049 GList *m = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1050 PurplePluginAction *act;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1051
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1052 act = purple_plugin_action_new(_("Set Friendly Name..."),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1053 msn_show_set_friendly_name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1054 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1055 m = g_list_append(m, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1056
31126
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
1057 act = purple_plugin_action_new(_("View Locations..."),
3d34a0870920 Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31123
diff changeset
1058 msn_show_locations);
31123
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
1059 m = g_list_append(m, act);
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
1060 m = g_list_append(m, NULL);
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
1061
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1062 act = purple_plugin_action_new(_("Set Home Phone Number..."),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1063 msn_show_set_home_phone);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1064 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1065
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1066 act = purple_plugin_action_new(_("Set Work Phone Number..."),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1067 msn_show_set_work_phone);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1068 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1069
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1070 act = purple_plugin_action_new(_("Set Mobile Phone Number..."),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1071 msn_show_set_mobile_phone);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1072 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1073 m = g_list_append(m, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1074
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1075 #if 0
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1076 act = purple_plugin_action_new(_("Enable/Disable Mobile Devices..."),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1077 msn_show_set_mobile_support);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1078 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1079 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1080
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1081 act = purple_plugin_action_new(_("Allow/Disallow Mobile Pages..."),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1082 msn_show_set_mobile_pages);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1083 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1084
23572
25aec47d9671 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23564
diff changeset
1085 /* QuLogic: Disabled until confirmed correct. */
25aec47d9671 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23564
diff changeset
1086 #if 0
23522
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
1087 m = g_list_append(m, NULL);
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
1088 act = purple_plugin_action_new(_("View Blocked Text..."),
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
1089 msn_show_blocked_text);
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
1090 m = g_list_append(m, act);
23572
25aec47d9671 Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23564
diff changeset
1091 #endif
23522
fd124c21ebb7 Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23517
diff changeset
1092
23599
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
1093 m = g_list_append(m, NULL);
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
1094 act = purple_plugin_action_new(_("Open Hotmail Inbox"),
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
1095 msn_show_hotmail_inbox);
ab70eae012f5 Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23572
diff changeset
1096 m = g_list_append(m, act);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1097
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1098 return m;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1099 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1100
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1101 static GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1102 msn_buddy_menu(PurpleBuddy *buddy)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1103 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1104 MsnUser *user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1105
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1106 GList *m = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1107 PurpleMenuAction *act;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1108
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1109 g_return_val_if_fail(buddy != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1110
25290
8d562557ed6f Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 24294
diff changeset
1111 user = purple_buddy_get_protocol_data(buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1112
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1113 if (user != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1114 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1115 if (user->mobile)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1116 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1117 act = purple_menu_action_new(_("Send to Mobile"),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1118 PURPLE_CALLBACK(show_send_to_mobile_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1119 NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1120 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1121 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1122 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1123
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
1124 if (g_ascii_strcasecmp(purple_buddy_get_name(buddy),
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
1125 purple_account_get_username(purple_buddy_get_account(buddy))))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1126 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1127 act = purple_menu_action_new(_("Initiate _Chat"),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1128 PURPLE_CALLBACK(initiate_chat_cb),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1129 NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1130 m = g_list_append(m, act);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1131 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1132
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1133 return m;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1134 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1135
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1136 static GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1137 msn_blist_node_menu(PurpleBlistNode *node)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1138 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1139 if(PURPLE_BLIST_NODE_IS_BUDDY(node))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1140 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1141 return msn_buddy_menu((PurpleBuddy *) node);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1142 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1143 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1144 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1145 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1146 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1147 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1148
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1149 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1150 msn_login(PurpleAccount *account)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1151 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1152 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1153 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1154 const char *username;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1155 const char *host;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1156 gboolean http_method = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1157 int port;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1158
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1159 gc = purple_account_get_connection(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1160
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1161 if (!purple_ssl_is_supported())
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1162 {
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
1163 purple_connection_error_reason(gc,
21358
ba41f2a60253 Rename:
Will Thompson <will.thompson@collabora.co.uk>
parents: 21355
diff changeset
1164 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1165 _("SSL support is needed for MSN. Please install a supported "
21819
1162bf342def Stu says this was unnecessary, that it is already there.
Luke Schierer <lschiere@pidgin.im>
parents: 21815
diff changeset
1166 "SSL library."));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1167 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1168 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1169
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1170 http_method = purple_account_get_bool(account, "http_method", FALSE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1171
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
1172 if (http_method)
20277
c37128d87d5a Merged MSN_HTTPCONN_SERVER fix
Evan Schoenberg <evan.s@dreskin.net>
parents: 20044
diff changeset
1173 host = purple_account_get_string(account, "http_method_server", MSN_HTTPCONN_SERVER);
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
1174 else
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
1175 host = purple_account_get_string(account, "server", MSN_SERVER);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1176 port = purple_account_get_int(account, "port", MSN_PORT);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1177
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1178 session = msn_session_new(account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1179
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1180 gc->proto_data = session;
23133
9aa105267f46 Show the custom smileys only on accounts that support it. References
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23131
diff changeset
1181 gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO | PURPLE_CONNECTION_NO_BGCOLOR |
9aa105267f46 Show the custom smileys only on accounts that support it. References
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23131
diff changeset
1182 PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1183
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1184 msn_session_set_login_step(session, MSN_LOGIN_STEP_START);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1185
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1186 /* Hmm, I don't like this. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1187 /* XXX shx: Me neither */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1188 username = msn_normalize(account, purple_account_get_username(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1189
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1190 if (strcmp(username, purple_account_get_username(account)))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1191 purple_account_set_username(account, username);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1192
29049
23f6f80f45ed Due to a server change, the friendly name on MSN was being changed to the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29028
diff changeset
1193 username = purple_account_get_string(account, "display-name", NULL);
23f6f80f45ed Due to a server change, the friendly name on MSN was being changed to the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29028
diff changeset
1194 purple_connection_set_display_name(gc, username);
23f6f80f45ed Due to a server change, the friendly name on MSN was being changed to the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29028
diff changeset
1195
31123
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
1196 if (purple_account_get_string(account, "endpoint-name", NULL) == NULL) {
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
1197 purple_account_set_string(account, "endpoint-name", "Pidgin");
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
1198 }
dd430f788bdc Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29049
diff changeset
1199
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1200 if (!msn_session_connect(session, host, port, http_method))
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
1201 purple_connection_error_reason(gc,
21358
ba41f2a60253 Rename:
Will Thompson <will.thompson@collabora.co.uk>
parents: 21355
diff changeset
1202 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
27463
f541583e31bd More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents: 27219
diff changeset
1203 _("Unable to connect"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1204 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1205
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1206 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1207 msn_close(PurpleConnection *gc)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1208 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1209 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1210
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1211 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1212
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1213 g_return_if_fail(session != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1214
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1215 msn_session_destroy(session);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1216
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1217 gc->proto_data = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1218 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1219
17072
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1220 static gboolean
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1221 msn_send_me_im(gpointer data)
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1222 {
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1223 MsnIMData *imdata = data;
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1224 serv_got_im(imdata->gc, imdata->who, imdata->msg, imdata->flags, imdata->when);
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1225 g_free(imdata->msg);
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1226 g_free(imdata);
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1227 return FALSE;
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1228 }
cb4380df3005 In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents: 17065
diff changeset
1229
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1230 static GString*
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1231 msn_msg_emoticon_add(GString *current, MsnEmoticon *emoticon)
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1232 {
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1233 MsnObject *obj;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1234 char *strobj;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1235
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1236 if (emoticon == NULL)
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1237 return current;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1238
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1239 obj = emoticon->obj;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1240
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1241 if (!obj)
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1242 return current;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1243
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1244 strobj = msn_object_to_string(obj);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1245
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1246 if (current)
28418
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1247 g_string_append_printf(current, "\t%s\t%s", emoticon->smile, strobj);
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1248 else {
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1249 current = g_string_new("");
28418
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1250 g_string_printf(current, "%s\t%s", emoticon->smile, strobj);
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1251 }
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1252
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1253 g_free(strobj);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1254
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1255 return current;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1256 }
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1257
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1258 static void
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1259 msn_send_emoticons(MsnSwitchBoard *swboard, GString *body)
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1260 {
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1261 MsnMessage *msg;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1262
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1263 g_return_if_fail(body != NULL);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1264
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1265 msg = msn_message_new(MSN_MSG_SLP);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1266 msn_message_set_content_type(msg, "text/x-mms-emoticon");
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1267 msn_message_set_flag(msg, 'N');
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1268 msn_message_set_bin_data(msg, body->str, body->len);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1269
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1270 msn_switchboard_send_msg(swboard, msg, TRUE);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1271 msn_message_destroy(msg);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1272 }
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1273
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1274 static void msn_emoticon_destroy(MsnEmoticon *emoticon)
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1275 {
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1276 if (emoticon->obj)
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1277 msn_object_destroy(emoticon->obj);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1278 g_free(emoticon->smile);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1279 g_free(emoticon);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1280 }
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1281
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1282 static GSList* msn_msg_grab_emoticons(const char *msg, const char *username)
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1283 {
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1284 GSList *list;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1285 GList *smileys;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1286 PurpleSmiley *smiley;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1287 PurpleStoredImage *img;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1288 char *ptr;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1289 MsnEmoticon *emoticon;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1290 int length;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1291
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1292 list = NULL;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1293 smileys = purple_smileys_get_all();
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1294 length = strlen(msg);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1295
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1296 for (; smileys; smileys = g_list_delete_link(smileys, smileys)) {
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1297 smiley = smileys->data;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1298
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1299 ptr = g_strstr_len(msg, length, purple_smiley_get_shortcut(smiley));
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1300
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1301 if (!ptr)
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1302 continue;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1303
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1304 img = purple_smiley_get_stored_image(smiley);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1305
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1306 emoticon = g_new0(MsnEmoticon, 1);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1307 emoticon->smile = g_strdup(purple_smiley_get_shortcut(smiley));
28419
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1308 emoticon->ps = smiley;
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1309 emoticon->obj = msn_object_new_from_image(img,
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1310 purple_imgstore_get_filename(img),
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1311 username, MSN_OBJECT_EMOTICON);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1312
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1313 purple_imgstore_unref(img);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1314 list = g_slist_prepend(list, emoticon);
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1315 }
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1316
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1317 return list;
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1318 }
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1319
24142
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1320 void
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1321 msn_send_im_message(MsnSession *session, MsnMessage *msg)
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1322 {
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1323 MsnEmoticon *smile;
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1324 GSList *smileys;
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1325 GString *emoticons = NULL;
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1326 const char *username = purple_account_get_username(session->account);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1327 MsnSwitchBoard *swboard = msn_session_get_swboard(session, msg->remote_user, MSN_SB_FLAG_IM);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1328
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1329 smileys = msn_msg_grab_emoticons(msg->body, username);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1330 while (smileys) {
28419
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1331 smile = (MsnEmoticon *)smileys->data;
24142
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1332 emoticons = msn_msg_emoticon_add(emoticons, smile);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1333 msn_emoticon_destroy(smile);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1334 smileys = g_slist_delete_link(smileys, smileys);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1335 }
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1336
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1337 if (emoticons) {
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1338 msn_send_emoticons(swboard, emoticons);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1339 g_string_free(emoticons, TRUE);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1340 }
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1341
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1342 msn_switchboard_send_msg(swboard, msg, TRUE);
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1343 }
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1344
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1345 static int
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1346 msn_send_im(PurpleConnection *gc, const char *who, const char *message,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1347 PurpleMessageFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1348 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1349 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1350 PurpleBuddy *buddy = purple_find_buddy(gc->account, who);
23533
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1351 MsnSession *session;
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1352 MsnSwitchBoard *swboard;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1353 MsnMessage *msg;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1354 char *msgformat;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1355 char *msgtext;
25056
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1356 size_t msglen;
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1357 const char *username;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1358
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
1359 purple_debug_info("msn", "send IM {%s} to %s\n", message, who);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1360 account = purple_connection_get_account(gc);
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1361 username = purple_account_get_username(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1362
23533
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1363 session = gc->proto_data;
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1364 swboard = msn_session_find_swboard(session, who);
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1365
24132
eeccedae4de5 Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23978
diff changeset
1366 if (!strncmp("tel:+", who, 5)) {
eeccedae4de5 Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23978
diff changeset
1367 char *text = purple_markup_strip_html(message);
eeccedae4de5 Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23978
diff changeset
1368 send_to_mobile(gc, who, text);
eeccedae4de5 Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23978
diff changeset
1369 g_free(text);
eeccedae4de5 Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23978
diff changeset
1370 return 1;
eeccedae4de5 Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23978
diff changeset
1371 }
eeccedae4de5 Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23978
diff changeset
1372
15541
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1373 if (buddy) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1374 PurplePresence *p = purple_buddy_get_presence(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1375 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1376 char *text = purple_markup_strip_html(message);
15541
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1377 send_to_mobile(gc, who, text);
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1378 g_free(text);
15591
1d0d25848c5d Get rid of a minor compile warning
Mark Doliner <mark@kingant.net>
parents: 15541
diff changeset
1379 return 1;
15541
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1380 }
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1381 }
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1382
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1383 msn_import_html(message, &msgformat, &msgtext);
25056
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1384 msglen = strlen(msgtext);
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1385 if (msglen == 0) {
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1386 /* Stuff like <hr> will be ignored. Don't send an empty message
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1387 if that's all there is. */
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1388 g_free(msgtext);
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1389 g_free(msgformat);
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1390
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1391 return 0;
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1392 }
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1393
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
1394 if (msn_user_is_online(account, who) ||
23533
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1395 msn_user_is_yahoo(account, who) ||
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
1396 swboard != NULL) {
23533
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1397 /*User online or have a swboard open because it's invisible
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1398 * and sent us a message,then send Online Instant Message*/
8aa7e01bc4d5 An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23529
diff changeset
1399
25056
b0c75121cf66 After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25050
diff changeset
1400 if (msglen + strlen(msgformat) + strlen(VERSION) > 1564)
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1401 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1402 g_free(msgformat);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1403 g_free(msgtext);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1404
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1405 return -E2BIG;
15541
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1406 }
d74985add99f 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@gmail.com>
parents: 15463
diff changeset
1407
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1408 msg = msn_message_new_plain(msgtext);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1409 msg->remote_user = g_strdup(who);
31132
33b4ae796648 Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents: 31130
diff changeset
1410 msn_message_set_header(msg, "X-MMS-IM-Format", msgformat);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1411
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1412 g_free(msgformat);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1413 g_free(msgtext);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1414
23564
7bceac816e19 The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23550
diff changeset
1415 purple_debug_info("msn", "prepare to send online Message\n");
22887
b65997110933 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 <imadil@gmail.com>
parents: 22259
diff changeset
1416 if (g_ascii_strcasecmp(who, username))
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1417 {
24451
82452077f0db Don't request an acknowledgement on an auto-response message and don't set a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24409
diff changeset
1418 if (flags & PURPLE_MESSAGE_AUTO_RESP) {
82452077f0db Don't request an acknowledgement on an auto-response message and don't set a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24409
diff changeset
1419 msn_message_set_flag(msg, 'U');
82452077f0db Don't request an acknowledgement on an auto-response message and don't set a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24409
diff changeset
1420 }
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
1421 if (msn_user_is_yahoo(account, who)) {
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1422 /*we send the online and offline Message to Yahoo User via UBM*/
23564
7bceac816e19 The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23550
diff changeset
1423 purple_debug_info("msn", "send to Yahoo User\n");
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
1424 uum_send_msg(session, msg);
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
1425 } else {
23564
7bceac816e19 The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23550
diff changeset
1426 purple_debug_info("msn", "send via switchboard\n");
24142
fb722b8b4c74 attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents: 24132
diff changeset
1427 msn_send_im_message(session, msg);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1428 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1429 }
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1430 else
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1431 {
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1432 char *body_str, *body_enc, *pre, *post;
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1433 const char *format;
20413
fd7b501cc9c8 fix up broken merge
Ka-Hing Cheung <khc@hxbc.us>
parents: 20412
diff changeset
1434 MsnIMData *imdata = g_new0(MsnIMData, 1);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1435 /*
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1436 * In MSN, you can't send messages to yourself, so
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1437 * we'll fake like we received it ;)
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1438 */
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1439 body_str = msn_message_to_string(msg);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1440 body_enc = g_markup_escape_text(body_str, -1);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1441 g_free(body_str);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1442
31132
33b4ae796648 Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents: 31130
diff changeset
1443 format = msn_message_get_header_value(msg, "X-MMS-IM-Format");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1444 msn_parse_format(format, &pre, &post);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1445 body_str = g_strdup_printf("%s%s%s", pre ? pre : "",
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1446 body_enc ? body_enc : "", post ? post : "");
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1447 g_free(body_enc);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1448 g_free(pre);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1449 g_free(post);
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1450
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1451 serv_got_typing_stopped(gc, who);
20413
fd7b501cc9c8 fix up broken merge
Ka-Hing Cheung <khc@hxbc.us>
parents: 20412
diff changeset
1452 imdata->gc = gc;
fd7b501cc9c8 fix up broken merge
Ka-Hing Cheung <khc@hxbc.us>
parents: 20412
diff changeset
1453 imdata->who = who;
fd7b501cc9c8 fix up broken merge
Ka-Hing Cheung <khc@hxbc.us>
parents: 20412
diff changeset
1454 imdata->msg = body_str;
27095
1b47eb4abf96 Turn off the send-flag for messages we send to ourselves in MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26434
diff changeset
1455 imdata->flags = flags & ~PURPLE_MESSAGE_SEND;
20413
fd7b501cc9c8 fix up broken merge
Ka-Hing Cheung <khc@hxbc.us>
parents: 20412
diff changeset
1456 imdata->when = time(NULL);
20856
306f3c0bccd4 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 <daniel.atallah@gmail.com>
parents: 20775
diff changeset
1457 purple_timeout_add(0, msn_send_me_im, imdata);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1458 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1459
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1460 msn_message_destroy(msg);
23495
b82a17934604 fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@hxbc.us>
parents: 21560
diff changeset
1461 } else {
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1462 /*send Offline Instant Message,only to MSN Passport User*/
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1463 char *friendname;
20425
5048651671e1 Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents: 20422
diff changeset
1464
23564
7bceac816e19 The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23550
diff changeset
1465 purple_debug_info("msn", "prepare to send offline Message\n");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1466
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1467 friendname = msn_encode_mime(account->username);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20524
diff changeset
1468 msn_oim_prep_send_msg_info(session->oim,
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20524
diff changeset
1469 purple_account_get_username(account),
23496
aa25bb450139 oops, sending the format data probably isn't very useful. Unless you try
Ka-Hing Cheung <khc@hxbc.us>
parents: 23495
diff changeset
1470 friendname, who, msgtext);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20524
diff changeset
1471 msn_oim_send_msg(session->oim);
23495
b82a17934604 fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@hxbc.us>
parents: 21560
diff changeset
1472
b82a17934604 fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@hxbc.us>
parents: 21560
diff changeset
1473 g_free(msgformat);
b82a17934604 fixed a memleak or 3, or maybe 4, or 5. Some of these applies to the p14
Ka-Hing Cheung <khc@hxbc.us>
parents: 21560
diff changeset
1474 g_free(msgtext);
20534
7e69275a4eef oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents: 20524
diff changeset
1475 g_free(friendname);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1476 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1477
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1478 return 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1479 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1480
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1481 static unsigned int
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1482 msn_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1483 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1484 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1485 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1486 MsnSwitchBoard *swboard;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1487 MsnMessage *msg;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1488
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1489 account = purple_connection_get_account(gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1490 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1491
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1492 /*
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1493 * TODO: I feel like this should be "if (state != PURPLE_TYPING)"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1494 * but this is how it was before, and I don't want to break
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1495 * anything. --KingAnt
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1496 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1497 if (state == PURPLE_NOT_TYPING)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1498 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1499
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1500 if (!g_ascii_strcasecmp(who, purple_account_get_username(account)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1501 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1502 /* We'll just fake it, since we're sending to ourself. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1503 serv_got_typing(gc, who, MSN_TYPING_RECV_TIMEOUT, PURPLE_TYPING);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1504
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1505 return MSN_TYPING_SEND_TIMEOUT;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1506 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1507
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1508 swboard = msn_session_find_swboard(session, who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1509
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1510 if (swboard == NULL || !msn_switchboard_can_send(swboard))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1511 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1512
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1513 swboard->flag |= MSN_SB_FLAG_IM;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1514
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1515 msg = msn_message_new(MSN_MSG_TYPING);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1516 msn_message_set_content_type(msg, "text/x-msmsgscontrol");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1517 msn_message_set_flag(msg, 'U');
31132
33b4ae796648 Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents: 31130
diff changeset
1518 msn_message_set_header(msg, "TypingUser",
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1519 purple_account_get_username(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1520 msn_message_set_bin_data(msg, "\r\n", 2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1521
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1522 msn_switchboard_send_msg(swboard, msg, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1523
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1524 msn_message_destroy(msg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1525
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1526 return MSN_TYPING_SEND_TIMEOUT;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1527 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1528
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1529 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1530 msn_set_status(PurpleAccount *account, PurpleStatus *status)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1531 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1532 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1533 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1534
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1535 gc = purple_account_get_connection(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1536
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1537 if (gc != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1538 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1539 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1540 msn_change_status(session);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1541 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1542 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1543
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1544 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1545 msn_set_idle(PurpleConnection *gc, int idle)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1546 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1547 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1548
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1549 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1550
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1551 msn_change_status(session);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1552 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1553
25918
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1554 /*
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1555 * Actually adds a buddy once we have the response from FQY
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1556 */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1557 static void
25918
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1558 add_pending_buddy(MsnSession *session,
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1559 const char *who,
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1560 MsnNetwork network,
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1561 MsnUser *user)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1562 {
25918
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1563 char *group;
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1564
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1565 g_return_if_fail(user != NULL);
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1566
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1567 group = msn_user_remove_pending_group(user);
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1568
27477
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1569 if (network != MSN_NETWORK_UNKNOWN) {
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1570 MsnUserList *userlist = session->userlist;
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1571 MsnUser *user2 = msn_userlist_find_user(userlist, who);
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1572 if (user2 != NULL) {
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1573 /* User already in userlist, so just update it. */
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1574 msn_user_destroy(user);
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1575 user = user2;
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1576 } else {
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1577 msn_userlist_add_user(userlist, user);
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1578 }
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1579
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1580 msn_user_set_network(user, network);
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1581 msn_userlist_add_buddy(userlist, who, group);
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1582 }
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1583 else
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1584 {
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1585 PurpleBuddy * buddy = purple_find_buddy(session->account, who);
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1586 gchar *buf;
28645
77a007e0de1f Concordance between "Usernames" and "addresses"
Paul Aurich <paul@darkrain42.org>
parents: 28419
diff changeset
1587 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be valid email addresses."), who);
27477
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1588 if (!purple_conv_present_error(who, session->account, buf))
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1589 purple_notify_error(purple_account_get_connection(session->account), NULL, _("Unable to Add"), buf);
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1590 g_free(buf);
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1591
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1592 /* Remove from local list */
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1593 purple_blist_remove_buddy(buddy);
25918
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1594 msn_user_destroy(user);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1595 }
25918
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1596 g_free(group);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1597 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1598
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1599 static void
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1600 finish_auth_request(MsnAddReqData *data, char *msg)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1601 {
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1602 PurpleConnection *pc;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1603 PurpleBuddy *buddy;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1604 PurpleGroup *group;
27477
d375ef85519f Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27463
diff changeset
1605 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1606 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1607 MsnUserList *userlist;
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1608 const char *who, *gname;
24674
f3950234b164 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24625
diff changeset
1609 MsnUser *user;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1610
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1611 pc = data->pc;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1612 buddy = data->buddy;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1613 group = data->group;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1614 g_free(data);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1615
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1616 account = purple_connection_get_account(pc);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1617 session = pc->proto_data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1618 userlist = session->userlist;
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1619
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1620 who = msn_normalize(account, purple_buddy_get_name(buddy));
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
1621 gname = group ? purple_group_get_name(group) : NULL;
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
1622 purple_debug_info("msn", "Add user:%s to group:%s\n", who, gname ? gname : "(null)");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1623 if (!session->logged_in)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1624 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1625 purple_debug_error("msn", "msn_add_buddy called before connected\n");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1626
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1627 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1628 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1629
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1630 /* XXX - Would group ever be NULL here? I don't think so...
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1631 * shx: Yes it should; MSN handles non-grouped buddies, and this is only
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1632 * internal. */
24674
f3950234b164 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24625
diff changeset
1633 user = msn_userlist_find_user(userlist, who);
f3950234b164 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24625
diff changeset
1634 if ((user != NULL) && (user->networkid != MSN_NETWORK_UNKNOWN)) {
f3950234b164 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24625
diff changeset
1635 /* We already know this buddy and their network. This function knows
f3950234b164 If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24625
diff changeset
1636 what to do with users already in the list and stuff... */
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1637 msn_user_set_invite_message(user, msg);
25368
1260a3fb60f4 propagate from branch 'im.pidgin.pidgin' (head b8d6086aef6b2e65d86e8ce60220ab7f460d5079)
Richard Laager <rlaager@wiktel.com>
parents: 24625 25365
diff changeset
1638 msn_userlist_add_buddy(userlist, who, gname);
24463
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24456
diff changeset
1639 } else {
25172
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1640 char **tokens;
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1641 char *fqy;
24463
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24456
diff changeset
1642 /* We need to check the network for this buddy first */
25918
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1643 user = msn_user_new(userlist, who, NULL);
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1644 msn_user_set_invite_message(user, msg);
27145
4c651771840d Add a data parameter for FQY callbacks and remove the pending users list
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27144
diff changeset
1645 msn_user_set_pending_group(user, gname);
25918
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1646 msn_user_set_network(user, MSN_NETWORK_UNKNOWN);
25172
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1647 tokens = g_strsplit(who, "@", 2);
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1648 fqy = g_strdup_printf("<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>",
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1649 tokens[1],
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1650 tokens[0]);
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1651 msn_notification_send_fqy(session, fqy, strlen(fqy),
25918
c384d62009c0 *** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents: 25172
diff changeset
1652 (MsnFqyCb)add_pending_buddy, user);
25172
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1653 g_free(fqy);
fd5eedf131b4 Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 25056
diff changeset
1654 g_strfreev(tokens);
24463
4fd22591e3f0 Send FQY as the first thing when adding a buddy so that we know what network
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 24456
diff changeset
1655 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1656 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1657
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1658 static void
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1659 cancel_auth_request(MsnAddReqData *data, char *msg)
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1660 {
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1661 /* Remove from local list */
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1662 purple_blist_remove_buddy(data->buddy);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1663
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1664 g_free(data);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1665 }
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1666
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1667 static void
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1668 msn_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1669 {
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1670 const char *bname;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1671 MsnAddReqData *data;
29225
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1672 MsnSession *session;
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1673 MsnUser *user;
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1674
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1675 bname = purple_buddy_get_name(buddy);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1676
28790
c3f79073c9be The MSN servers are a bit more strict about what's allowed in emails than
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28645
diff changeset
1677 if (!msn_email_is_valid(bname)) {
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1678 gchar *buf;
28645
77a007e0de1f Concordance between "Usernames" and "addresses"
Paul Aurich <paul@darkrain42.org>
parents: 28419
diff changeset
1679 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be valid email addresses."), bname);
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1680 if (!purple_conv_present_error(bname, purple_connection_get_account(gc), buf))
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1681 purple_notify_error(gc, NULL, _("Unable to Add"), buf);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1682 g_free(buf);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1683
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1684 /* Remove from local list */
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1685 purple_blist_remove_buddy(buddy);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1686
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1687 return;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1688 }
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1689
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1690 data = g_new0(MsnAddReqData, 1);
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1691 data->pc = gc;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1692 data->buddy = buddy;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1693 data->group = group;
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1694
29225
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1695 session = purple_connection_get_protocol_data(gc);
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1696 user = msn_userlist_find_user(session->userlist, bname);
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1697 if (user && user->authorized) {
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1698 finish_auth_request(data, NULL);
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1699 } else {
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1700 purple_request_input(gc, NULL, _("Authorization Request Message:"),
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1701 NULL, _("Please authorize me!"), TRUE, FALSE, NULL,
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1702 _("_OK"), G_CALLBACK(finish_auth_request),
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1703 _("_Cancel"), G_CALLBACK(cancel_auth_request),
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1704 purple_connection_get_account(gc), bname, NULL,
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1705 data);
42b47f88f6e1 Don't bother asking for an authorization message for users that added us to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29207
diff changeset
1706 }
27564
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1707 }
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1708
3698c7f4d803 On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 27558
diff changeset
1709 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1710 msn_rem_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1711 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1712 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1713 MsnUserList *userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1714
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1715 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1716 userlist = session->userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1717
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1718 if (!session->logged_in)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1719 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1720
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1721 /* XXX - Does buddy->name need to be msn_normalize'd here? --KingAnt */
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
1722 msn_userlist_rem_buddy(userlist, purple_buddy_get_name(buddy));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1723 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1724
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1725 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1726 msn_add_permit(PurpleConnection *gc, const char *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1727 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1728 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1729 MsnUserList *userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1730 MsnUser *user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1731
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1732 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1733 userlist = session->userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1734 user = msn_userlist_find_user(userlist, who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1735
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1736 if (!session->logged_in)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1737 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1738
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1739 if (user != NULL && user->list_op & MSN_LIST_BL_OP) {
20481
eb93710aec4d 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: 20477
diff changeset
1740 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1741
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1742 /* delete contact from Block list and add it to Allow in the callback */
23504
69af5301e1a7 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents: 23501
diff changeset
1743 msn_del_contact_from_list(session, NULL, who, MSN_LIST_BL);
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1744 } else {
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1745 /* just add the contact to Allow list */
23504
69af5301e1a7 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents: 23501
diff changeset
1746 msn_add_contact_to_list(session, NULL, who, MSN_LIST_AL);
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1747 }
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1748
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1749
20481
eb93710aec4d 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: 20477
diff changeset
1750 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1751 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1752
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1753 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1754 msn_add_deny(PurpleConnection *gc, const char *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1755 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1756 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1757 MsnUserList *userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1758 MsnUser *user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1759
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1760 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1761 userlist = session->userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1762 user = msn_userlist_find_user(userlist, who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1763
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1764 if (!session->logged_in)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1765 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1766
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1767 if (user != NULL && user->list_op & MSN_LIST_AL_OP) {
20481
eb93710aec4d 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: 20477
diff changeset
1768 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1769
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1770 /* delete contact from Allow list and add it to Block in the callback */
23504
69af5301e1a7 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents: 23501
diff changeset
1771 msn_del_contact_from_list(session, NULL, who, MSN_LIST_AL);
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1772 } else {
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1773 /* just add the contact to Block list */
23504
69af5301e1a7 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents: 23501
diff changeset
1774 msn_add_contact_to_list(session, NULL, who, MSN_LIST_BL);
20486
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1775 }
ff4ae9dde291 Make block/unblock work right, as well as being add by a buddy. Finally fixes #723
Carlos Silva <typ0@pidgin.im>
parents: 20484
diff changeset
1776
20481
eb93710aec4d 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: 20477
diff changeset
1777 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1778 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1779
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1780 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1781 msn_rem_permit(PurpleConnection *gc, const char *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1782 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1783 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1784 MsnUserList *userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1785 MsnUser *user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1786
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1787 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1788 userlist = session->userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1789
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1790 if (!session->logged_in)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1791 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1792
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1793 user = msn_userlist_find_user(userlist, who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1794
20481
eb93710aec4d 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: 20477
diff changeset
1795 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1796
23504
69af5301e1a7 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents: 23501
diff changeset
1797 msn_del_contact_from_list(session, NULL, who, MSN_LIST_AL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1798
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1799 if (user != NULL && user->list_op & MSN_LIST_RL_OP)
20481
eb93710aec4d 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: 20477
diff changeset
1800 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1801 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1802
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1803 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1804 msn_rem_deny(PurpleConnection *gc, const char *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1805 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1806 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1807 MsnUserList *userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1808 MsnUser *user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1809
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1810 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1811 userlist = session->userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1812
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1813 if (!session->logged_in)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1814 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1815
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1816 user = msn_userlist_find_user(userlist, who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1817
20481
eb93710aec4d 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: 20477
diff changeset
1818 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1819
23504
69af5301e1a7 killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents: 23501
diff changeset
1820 msn_del_contact_from_list(session, NULL, who, MSN_LIST_BL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1821
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1822 if (user != NULL && user->list_op & MSN_LIST_RL_OP)
20481
eb93710aec4d 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: 20477
diff changeset
1823 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1824 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1825
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1826 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1827 msn_set_permit_deny(PurpleConnection *gc)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1828 {
20459
46437bdf316b 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: 20456
diff changeset
1829 msn_send_privacy(gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1830 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1831
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1832 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1833 msn_chat_invite(PurpleConnection *gc, int id, const char *msg,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1834 const char *who)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1835 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1836 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1837 MsnSwitchBoard *swboard;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1838
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1839 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1840
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1841 swboard = msn_session_find_swboard_with_id(session, id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1842
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1843 if (swboard == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1844 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1845 /* if we have no switchboard, everyone else left the chat already */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1846 swboard = msn_switchboard_new(session);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1847 msn_switchboard_request(swboard);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1848 swboard->chat_id = id;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1849 swboard->conv = purple_find_chat(gc, id);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1850 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1851
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1852 swboard->flag |= MSN_SB_FLAG_IM;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1853
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1854 msn_switchboard_request_add_user(swboard, who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1855 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1856
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1857 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1858 msn_chat_leave(PurpleConnection *gc, int id)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1859 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1860 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1861 MsnSwitchBoard *swboard;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1862 PurpleConversation *conv;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1863
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1864 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1865
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1866 swboard = msn_session_find_swboard_with_id(session, id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1867
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1868 /* if swboard is NULL we were the only person left anyway */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1869 if (swboard == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1870 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1871
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1872 conv = swboard->conv;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1873
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1874 msn_switchboard_release(swboard, MSN_SB_FLAG_IM);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1875
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1876 /* If other switchboards managed to associate themselves with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1877 * conv, make sure they know it's gone! */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1878 if (conv != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1879 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1880 while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1881 swboard->conv = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1882 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1883 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1884
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1885 static int
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1886 msn_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1887 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1888 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1889 MsnSession *session;
28418
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1890 const char *username;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1891 MsnSwitchBoard *swboard;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1892 MsnMessage *msg;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1893 char *msgformat;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1894 char *msgtext;
28417
ea7e54c4d7fd Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28414
diff changeset
1895 size_t msglen;
28418
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1896 MsnEmoticon *smile;
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1897 GSList *smileys;
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1898 GString *emoticons = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1899
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1900 account = purple_connection_get_account(gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1901 session = gc->proto_data;
28418
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1902 username = purple_account_get_username(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1903 swboard = msn_session_find_swboard_with_id(session, id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1904
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1905 if (swboard == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1906 return -EINVAL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1907
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1908 if (!swboard->ready)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1909 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1910
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1911 swboard->flag |= MSN_SB_FLAG_IM;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1912
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1913 msn_import_html(message, &msgformat, &msgtext);
28417
ea7e54c4d7fd Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28414
diff changeset
1914 msglen = strlen(msgtext);
ea7e54c4d7fd Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28414
diff changeset
1915
ea7e54c4d7fd Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28414
diff changeset
1916 if ((msglen == 0) || (msglen + strlen(msgformat) + strlen(VERSION) > 1564))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1917 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1918 g_free(msgformat);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1919 g_free(msgtext);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1920
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1921 return -E2BIG;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1922 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1923
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1924 msg = msn_message_new_plain(msgtext);
31132
33b4ae796648 Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents: 31130
diff changeset
1925 msn_message_set_header(msg, "X-MMS-IM-Format", msgformat);
28418
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1926
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1927 smileys = msn_msg_grab_emoticons(msg->body, username);
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1928 while (smileys) {
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1929 smile = (MsnEmoticon *)smileys->data;
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1930 emoticons = msn_msg_emoticon_add(emoticons, smile);
28419
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1931 if (purple_conv_custom_smiley_add(swboard->conv, smile->smile,
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1932 "sha1", purple_smiley_get_checksum(smile->ps),
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1933 FALSE)) {
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1934 gconstpointer data;
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1935 size_t len;
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1936 data = purple_smiley_get_data(smile->ps, &len);
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1937 purple_conv_custom_smiley_write(swboard->conv, smile->smile, data, len);
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1938 purple_conv_custom_smiley_close(swboard->conv, smile->smile);
36c6601d650a It seems I need to write the smiley to the conversation for it to show up
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28418
diff changeset
1939 }
28418
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1940 msn_emoticon_destroy(smile);
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1941 smileys = g_slist_delete_link(smileys, smileys);
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1942 }
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1943
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1944 if (emoticons) {
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1945 msn_send_emoticons(swboard, emoticons);
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1946 g_string_free(emoticons, TRUE);
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1947 }
afe6ce7cc64f Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 28417
diff changeset
1948
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1949 msn_switchboard_send_msg(swboard, msg, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1950 msn_message_destroy(msg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1951
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1952 g_free(msgformat);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1953 g_free(msgtext);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1954
23154
caa533b62902 When calling serv_got_chat_in() after sending a group chat message (to let
Evan Schoenberg <evan.s@dreskin.net>
parents: 23144
diff changeset
1955 serv_got_chat_in(gc, id, purple_account_get_username(account), flags,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1956 message, time(NULL));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1957
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1958 return 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1959 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1960
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1961 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1962 msn_keepalive(PurpleConnection *gc)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1963 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1964 MsnSession *session;
31148
f7ee91763c6b msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
masca@cpw.pidgin.im
parents: 31147
diff changeset
1965 MsnTransaction *trans;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1966
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1967 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1968
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1969 if (!session->http_method)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1970 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1971 MsnCmdProc *cmdproc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1972
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1973 cmdproc = session->notification->cmdproc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1974
31149
54c8aeecab4c We need a way to send commands without transaction ID
masca@cpw.pidgin.im
parents: 31148
diff changeset
1975 trans = msn_transaction_new(cmdproc, "PNG", NULL);
31154
c316749944c1 I don't really like this name.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31153
diff changeset
1976 msn_transaction_set_saveable(trans, FALSE);
31148
f7ee91763c6b msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
masca@cpw.pidgin.im
parents: 31147
diff changeset
1977 msn_cmdproc_send_trans(cmdproc, trans);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1978 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1979 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1980
23517
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1981 static void msn_alias_buddy(PurpleConnection *pc, const char *name, const char *alias)
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1982 {
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1983 MsnSession *session;
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1984
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1985 session = pc->proto_data;
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1986
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1987 msn_update_contact(session, name, MSN_UPDATE_ALIAS, alias);
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1988 }
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
1989
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1990 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
1991 msn_group_buddy(PurpleConnection *gc, const char *who,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1992 const char *old_group_name, const char *new_group_name)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1993 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1994 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1995 MsnUserList *userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1996
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1997 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1998 userlist = session->userlist;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1999
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2000 msn_userlist_move_buddy(userlist, who, old_group_name, new_group_name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2001 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2002
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2003 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2004 msn_rename_group(PurpleConnection *gc, const char *old_name,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2005 PurpleGroup *group, GList *moved_buddies)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2006 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2007 MsnSession *session;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2008 const char *gname;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2009
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2010 session = gc->proto_data;
23300
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 23182
diff changeset
2011
20481
eb93710aec4d 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: 20477
diff changeset
2012 g_return_if_fail(session != NULL);
eb93710aec4d 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: 20477
diff changeset
2013 g_return_if_fail(session->userlist != NULL);
23300
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 23182
diff changeset
2014
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2015 gname = purple_group_get_name(group);
20481
eb93710aec4d 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: 20477
diff changeset
2016 if (msn_userlist_find_group_with_name(session->userlist, old_name) != NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2017 {
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2018 msn_contact_rename_group(session, old_name, gname);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2019 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2020 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2021 {
20481
eb93710aec4d 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: 20477
diff changeset
2022 /* not found */
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2023 msn_add_group(session, NULL, gname);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2024 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2025 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2026
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2027 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2028 msn_convo_closed(PurpleConnection *gc, const char *who)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2029 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2030 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2031 MsnSwitchBoard *swboard;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2032 PurpleConversation *conv;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2033
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2034 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2035
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2036 swboard = msn_session_find_swboard(session, who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2037
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2038 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2039 * Don't perform an assertion here. If swboard is NULL, then the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2040 * switchboard was either closed by the other party, or the person
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2041 * is talking to himself.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2042 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2043 if (swboard == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2044 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2045
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2046 conv = swboard->conv;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2047
17247
d63075ed73c9 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents: 17197
diff changeset
2048 /* If we release the switchboard here, it may still have messages
d63075ed73c9 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents: 17197
diff changeset
2049 pending ACK which would result in incorrect unsent message errors.
d63075ed73c9 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents: 17197
diff changeset
2050 Just let it timeout... This is *so* going to screw with people who
d63075ed73c9 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents: 17197
diff changeset
2051 use dumb clients that report "User has closed the conversation window" */
d63075ed73c9 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents: 17197
diff changeset
2052 /* msn_switchboard_release(swboard, MSN_SB_FLAG_IM); */
d63075ed73c9 When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents: 17197
diff changeset
2053 swboard->conv = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2054
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2055 /* If other switchboards managed to associate themselves with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2056 * conv, make sure they know it's gone! */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2057 if (conv != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2058 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2059 while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2060 swboard->conv = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2061 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2062 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2063
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2064 static void
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16375
diff changeset
2065 msn_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2066 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2067 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2068 MsnUser *user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2069
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2070 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2071 user = session->user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2072
16390
4fc51a87ce42 Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents: 16375
diff changeset
2073 msn_user_set_buddy_icon(user, img);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2074
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2075 msn_change_status(session);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2076 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2077
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2078 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2079 msn_remove_group(PurpleConnection *gc, PurpleGroup *group)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2080 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2081 MsnSession *session;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2082 MsnCmdProc *cmdproc;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2083 const char *gname;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2084
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2085 session = gc->proto_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2086 cmdproc = session->notification->cmdproc;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2087 gname = purple_group_get_name(group);
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2088
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2089 purple_debug_info("msn", "Remove group %s\n", gname);
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
2090 /*we can't delete the default group*/
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2091 if(!strcmp(gname, MSN_INDIVIDUALS_GROUP_NAME)||
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2092 !strcmp(gname, MSN_NON_IM_GROUP_NAME))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2093 {
23564
7bceac816e19 The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23550
diff changeset
2094 purple_debug_info("msn", "This group can't be removed, returning.\n");
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
2095 return ;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2096 }
23300
5cdd93dac7a2 Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 23182
diff changeset
2097
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2098 msn_del_group(session, gname);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2099 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2100
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2101 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2102 * Extract info text from info_data and add it to user_info
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2103 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2104 static gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2105 msn_tooltip_extract_info_text(PurpleNotifyUserInfo *user_info, MsnGetInfoData *info_data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2106 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2107 PurpleBuddy *b;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2108
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2109 b = purple_find_buddy(purple_connection_get_account(info_data->gc),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2110 info_data->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2111
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2112 if (b)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2113 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2114 char *tmp;
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2115 const char *alias;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2116
25294
8aa7d8bcbc7d Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25290
diff changeset
2117 alias = purple_buddy_get_local_buddy_alias(b);
8aa7d8bcbc7d Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25290
diff changeset
2118 if (alias && alias[0])
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2119 {
25294
8aa7d8bcbc7d Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25290
diff changeset
2120 char *aliastext = g_markup_escape_text(alias, -1);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2121 purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2122 g_free(aliastext);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2123 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2124
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2125 if ((alias = purple_buddy_get_server_alias(b)) != NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2126 {
24120
16734635febf Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23978
diff changeset
2127 char *nicktext = g_markup_escape_text(alias, -1);
24615
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2128 tmp = g_strdup_printf("<font sml=\"msn\">%s</font>", nicktext);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2129 purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2130 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2131 g_free(nicktext);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2132 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2133
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2134 /* Add the tooltip information */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2135 msn_tooltip_text(b, user_info, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2136
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2137 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2138 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2139
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2140 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2141 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2142
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2143 #if PHOTO_SUPPORT
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2144
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2145 static char *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2146 msn_get_photo_url(const char *url_text)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2147 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2148 char *p, *q;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2149
20425
5048651671e1 Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents: 20422
diff changeset
2150 if ((p = strstr(url_text, PHOTO_URL)) != NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2151 {
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
2152 p += strlen(PHOTO_URL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2153 }
23730
5aba1f0f36b0 Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23673
diff changeset
2154 if (p && (strncmp(p, "http://", strlen("http://")) == 0) && ((q = strchr(p, '"')) != NULL))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2155 return g_strndup(p, q - p);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2156
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2157 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2158 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2159
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2160 static void msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer data,
23529
46d8edad1647 Fix up a typo between the declaration and definition of msn_got_photo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23524
diff changeset
2161 const gchar *url_text, gsize len, const gchar *error_message);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2162
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2163 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2164
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2165 #if 0
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2166 static char *msn_info_date_reformat(const char *field, size_t len)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2167 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2168 char *tmp = g_strndup(field, len);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2169 time_t t = purple_str_to_time(tmp, FALSE, NULL, NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2170
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2171 g_free(tmp);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2172 return g_strdup(purple_date_format_short(localtime(&t)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2173 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2174 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2175
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2176 #define MSN_GOT_INFO_GET_FIELD(a, b) \
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2177 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2178 "\n" a ":", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2179 if (found) \
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2180 sect_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2181
17665
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2182 #define MSN_GOT_INFO_GET_FIELD_NO_SEARCH(a, b) \
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2183 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2184 "\n" a ":", 0, "\n", 0, "Undisclosed", b, 0, NULL, msn_info_strip_search_link); \
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2185 if (found) \
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2186 sect_info = TRUE;
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2187
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2188 static char *
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2189 msn_info_strip_search_link(const char *field, size_t len)
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2190 {
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2191 const char *c;
20554
11d09a5f7b46 Compile\!
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20544
diff changeset
2192 if ((c = strstr(field, " (http://")) == NULL)
17665
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2193 return g_strndup(field, len);
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2194 return g_strndup(field, c - field);
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2195 }
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2196
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2197 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2198 msn_got_info(PurpleUtilFetchUrlData *url_data, gpointer data,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2199 const gchar *url_text, size_t len, const gchar *error_message)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2200 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2201 MsnGetInfoData *info_data = (MsnGetInfoData *)data;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2202 PurpleNotifyUserInfo *user_info;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2203 char *stripped, *p, *q, *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2204 char *user_url = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2205 gboolean found;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2206 gboolean has_tooltip_text = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2207 gboolean has_info = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2208 gboolean sect_info = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2209 gboolean has_contact_info = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2210 char *url_buffer;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2211 int stripped_len;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2212 #if PHOTO_SUPPORT
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2213 char *photo_url_text = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2214 MsnGetInfoStepTwoData *info2_data = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2215 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2216
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
2217 purple_debug_info("msn", "In msn_got_info,url_text:{%s}\n",url_text);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2218
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2219 /* Make sure the connection is still valid */
23745
80ddf59e1585 A similar size limit for MSN buddy icon retrieval from arbitrary urls.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23736
diff changeset
2220 /* TODO: Instead of this, we should be canceling this when we disconnect */
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
2221 if (g_list_find(purple_connections_get_all(), info_data->gc) == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2222 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2223 purple_debug_warning("msn", "invalid connection. ignoring buddy info.\n");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2224 g_free(info_data->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2225 g_free(info_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2226 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2227 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2228
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2229 user_info = purple_notify_user_info_new();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2230 has_tooltip_text = msn_tooltip_extract_info_text(user_info, info_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2231
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2232 if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2233 {
24615
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2234 purple_notify_user_info_add_pair(user_info,
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2235 _("Error retrieving profile"), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2236
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2237 purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2238 purple_notify_user_info_destroy(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2239
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2240 g_free(info_data->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2241 g_free(info_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2242 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2243 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2244
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2245 url_buffer = g_strdup(url_text);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2246
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2247 /* If they have a homepage link, MSN masks it such that we need to
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2248 * fetch the url out before purple_markup_strip_html() nukes it */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2249 /* I don't think this works with the new spaces profiles - Stu 3/2/06 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2250 if ((p = strstr(url_text,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2251 "Take a look at my </font><A class=viewDesc title=\"")) != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2252 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2253 p += 50;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2254
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2255 if ((q = strchr(p, '"')) != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2256 user_url = g_strndup(p, q - p);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2257 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2258
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2259 /*
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2260 * purple_markup_strip_html() doesn't strip out character entities like &nbsp;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2261 * and &#183;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2262 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2263 while ((p = strstr(url_buffer, "&nbsp;")) != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2264 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2265 *p = ' '; /* Turn &nbsp;'s into ordinary blanks */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2266 p += 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2267 memmove(p, p + 5, strlen(p + 5));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2268 url_buffer[strlen(url_buffer) - 5] = '\0';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2269 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2270
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2271 while ((p = strstr(url_buffer, "&#183;")) != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2272 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2273 memmove(p, p + 6, strlen(p + 6));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2274 url_buffer[strlen(url_buffer) - 6] = '\0';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2275 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2276
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2277 /* Nuke the nasty \r's that just get in the way */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2278 purple_str_strip_char(url_buffer, '\r');
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2279
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2280 /* MSN always puts in &#39; for apostrophes...replace them */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2281 while ((p = strstr(url_buffer, "&#39;")) != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2282 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2283 *p = '\'';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2284 memmove(p + 1, p + 5, strlen(p + 5));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2285 url_buffer[strlen(url_buffer) - 4] = '\0';
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2286 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2287
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2288 /* Nuke the html, it's easier than trying to parse the horrid stuff */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2289 stripped = purple_markup_strip_html(url_buffer);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2290 stripped_len = strlen(stripped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2291
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2292 purple_debug_misc("msn", "stripped = %p\n", stripped);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2293 purple_debug_misc("msn", "url_buffer = %p\n", url_buffer);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2294
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2295 /* General section header */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2296 if (has_tooltip_text)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2297 purple_notify_user_info_add_section_break(user_info);
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2298
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2299 purple_notify_user_info_add_section_header(user_info, _("General"));
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2300
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2301 /* Extract their Name and put it in */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2302 MSN_GOT_INFO_GET_FIELD("Name", _("Name"));
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2303
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2304 /* General */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2305 MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname"));
17665
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2306 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Age", _("Age"));
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2307 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Gender", _("Gender"));
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2308 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Occupation", _("Occupation"));
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2309 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Location", _("Location"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2310
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2311 /* Extract their Interests and put it in */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2312 found = purple_markup_extract_info_field(stripped, stripped_len, user_info,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2313 "\nInterests\t", 0, " (/default.aspx?page=searchresults", 0,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2314 "Undisclosed", _("Hobbies and Interests") /* _("Interests") */,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2315 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2316
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2317 if (found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2318 sect_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2319
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2320 MSN_GOT_INFO_GET_FIELD("More about me", _("A Little About Me"));
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2321
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2322 if (sect_info)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2323 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2324 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2325 sect_info = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2326 }
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2327 else
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2328 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2329 /* Remove the section header */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2330 purple_notify_user_info_remove_last_item(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2331 if (has_tooltip_text)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2332 purple_notify_user_info_remove_last_item(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2333 }
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2334
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2335 /* Social */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2336 purple_notify_user_info_add_section_break(user_info);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2337 purple_notify_user_info_add_section_header(user_info, _("Social"));
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2338
22433
616a76954a97 Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents: 22259
diff changeset
2339 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Marital status", _("Marital Status"));
616a76954a97 Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents: 22259
diff changeset
2340 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Interested in", _("Interests"));
616a76954a97 Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents: 22259
diff changeset
2341 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Pets", _("Pets"));
616a76954a97 Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents: 22259
diff changeset
2342 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Hometown", _("Hometown"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2343 MSN_GOT_INFO_GET_FIELD("Places lived", _("Places Lived"));
22433
616a76954a97 Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents: 22259
diff changeset
2344 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Fashion", _("Fashion"));
616a76954a97 Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents: 22259
diff changeset
2345 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Humor", _("Humor"));
616a76954a97 Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents: 22259
diff changeset
2346 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Music", _("Music"));
616a76954a97 Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents: 22259
diff changeset
2347 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Favorite quote", _("Favorite Quote"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2348
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2349 if (sect_info)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2350 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2351 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2352 sect_info = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2353 }
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2354 else
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2355 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2356 /* Remove the section header */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2357 purple_notify_user_info_remove_last_item(user_info);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2358 purple_notify_user_info_remove_last_item(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2359 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2360
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2361 /* Contact Info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2362 /* Personal */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2363 purple_notify_user_info_add_section_break(user_info);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2364 purple_notify_user_info_add_section_header(user_info, _("Contact Info"));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2365 purple_notify_user_info_add_section_header(user_info, _("Personal"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2366
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2367 MSN_GOT_INFO_GET_FIELD("Name", _("Name"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2368 MSN_GOT_INFO_GET_FIELD("Significant other", _("Significant Other"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2369 MSN_GOT_INFO_GET_FIELD("Home phone", _("Home Phone"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2370 MSN_GOT_INFO_GET_FIELD("Home phone 2", _("Home Phone 2"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2371 MSN_GOT_INFO_GET_FIELD("Home address", _("Home Address"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2372 MSN_GOT_INFO_GET_FIELD("Personal Mobile", _("Personal Mobile"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2373 MSN_GOT_INFO_GET_FIELD("Home fax", _("Home Fax"));
23182
e0bcb8cfda74 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents: 23154
diff changeset
2374 MSN_GOT_INFO_GET_FIELD("Personal email", _("Personal Email"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2375 MSN_GOT_INFO_GET_FIELD("Personal IM", _("Personal IM"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2376 MSN_GOT_INFO_GET_FIELD("Birthday", _("Birthday"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2377 MSN_GOT_INFO_GET_FIELD("Anniversary", _("Anniversary"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2378 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2379
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2380 if (sect_info)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2381 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2382 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2383 sect_info = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2384 has_contact_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2385 }
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2386 else
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2387 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2388 /* Remove the section header */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2389 purple_notify_user_info_remove_last_item(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2390 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2391
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2392 /* Business */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2393 purple_notify_user_info_add_section_header(user_info, _("Work"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2394 MSN_GOT_INFO_GET_FIELD("Name", _("Name"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2395 MSN_GOT_INFO_GET_FIELD("Job title", _("Job Title"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2396 MSN_GOT_INFO_GET_FIELD("Company", _("Company"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2397 MSN_GOT_INFO_GET_FIELD("Department", _("Department"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2398 MSN_GOT_INFO_GET_FIELD("Profession", _("Profession"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2399 MSN_GOT_INFO_GET_FIELD("Work phone 1", _("Work Phone"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2400 MSN_GOT_INFO_GET_FIELD("Work phone 2", _("Work Phone 2"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2401 MSN_GOT_INFO_GET_FIELD("Work address", _("Work Address"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2402 MSN_GOT_INFO_GET_FIELD("Work mobile", _("Work Mobile"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2403 MSN_GOT_INFO_GET_FIELD("Work pager", _("Work Pager"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2404 MSN_GOT_INFO_GET_FIELD("Work fax", _("Work Fax"));
23182
e0bcb8cfda74 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents: 23154
diff changeset
2405 MSN_GOT_INFO_GET_FIELD("Work email", _("Work Email"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2406 MSN_GOT_INFO_GET_FIELD("Work IM", _("Work IM"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2407 MSN_GOT_INFO_GET_FIELD("Start date", _("Start Date"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2408 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2409
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2410 if (sect_info)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2411 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2412 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2413 sect_info = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2414 has_contact_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2415 }
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2416 else
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2417 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2418 /* Remove the section header */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2419 purple_notify_user_info_remove_last_item(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2420 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2421
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2422 if (!has_contact_info)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2423 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2424 /* Remove the Contact Info section header */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2425 purple_notify_user_info_remove_last_item(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2426 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2427
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2428 #if 0 /* these probably don't show up any more */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2429 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2430 * The fields, 'A Little About Me', 'Favorite Things', 'Hobbies
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2431 * and Interests', 'Favorite Quote', and 'My Homepage' may or may
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2432 * not appear, in any combination. However, they do appear in
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2433 * certain order, so we can successively search to pin down the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2434 * distinct values.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2435 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2436
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2437 /* Check if they have A Little About Me */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2438 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2439 " A Little About Me \n\n", 0, "Favorite Things", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2440 _("A Little About Me"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2441
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2442 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2443 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2444 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2445 " A Little About Me \n\n", 0, "Hobbies and Interests", '\n',
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2446 NULL, _("A Little About Me"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2447 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2448
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2449 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2450 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2451 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2452 " A Little About Me \n\n", 0, "Favorite Quote", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2453 _("A Little About Me"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2454 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2455
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2456 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2457 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2458 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2459 " A Little About Me \n\n", 0, "My Homepage \n\nTake a look",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2460 '\n',
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2461 NULL, _("A Little About Me"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2462 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2463
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2464 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2465 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2466 purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2467 " A Little About Me \n\n", 0, "last updated", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2468 _("A Little About Me"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2469 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2470
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2471 if (found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2472 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2473
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2474 /* Check if they have Favorite Things */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2475 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2476 " Favorite Things \n\n", 0, "Hobbies and Interests", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2477 _("Favorite Things"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2478
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2479 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2480 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2481 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2482 " Favorite Things \n\n", 0, "Favorite Quote", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2483 _("Favorite Things"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2484 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2485
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2486 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2487 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2488 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2489 " Favorite Things \n\n", 0, "My Homepage \n\nTake a look", '\n',
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2490 NULL, _("Favorite Things"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2491 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2492
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2493 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2494 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2495 purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2496 " Favorite Things \n\n", 0, "last updated", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2497 _("Favorite Things"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2498 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2499
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2500 if (found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2501 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2502
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2503 /* Check if they have Hobbies and Interests */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2504 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2505 " Hobbies and Interests \n\n", 0, "Favorite Quote", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2506 _("Hobbies and Interests"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2507
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2508 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2509 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2510 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2511 " Hobbies and Interests \n\n", 0, "My Homepage \n\nTake a look",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2512 '\n', NULL, _("Hobbies and Interests"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2513 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2514
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2515 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2516 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2517 purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2518 " Hobbies and Interests \n\n", 0, "last updated", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2519 _("Hobbies and Interests"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2520 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2521
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2522 if (found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2523 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2524
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2525 /* Check if they have Favorite Quote */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2526 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2527 "Favorite Quote \n\n", 0, "My Homepage \n\nTake a look", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2528 _("Favorite Quote"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2529
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2530 if (!found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2531 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2532 purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2533 "Favorite Quote \n\n", 0, "last updated", '\n', NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2534 _("Favorite Quote"), 0, NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2535 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2536
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2537 if (found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2538 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2539
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2540 /* Extract the last updated date and put it in */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2541 found = purple_markup_extract_info_field(stripped, stripped_len, s,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2542 " last updated:", 1, "\n", 0, NULL, _("Last Updated"), 0,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2543 NULL, msn_info_date_reformat);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2544
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2545 if (found)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2546 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2547 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2548
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2549 /* If we were able to fetch a homepage url earlier, stick it in there */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2550 if (user_url != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2551 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2552 tmp = g_strdup_printf("<a href=\"%s\">%s</a>", user_url, user_url);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2553 purple_notify_user_info_add_pair(user_info, _("Homepage"), tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2554 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2555 g_free(user_url);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2556
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2557 has_info = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2558 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2559
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2560 if (!has_info)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2561 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2562 /* MSN doesn't actually distinguish between "unknown member" and
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2563 * a known member with an empty profile. Try to explain this fact.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2564 * Note that if we have a nonempty tooltip_text, we know the user
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2565 * exists.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2566 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2567 /* This doesn't work with the new spaces profiles - Stu 3/2/06
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2568 char *p = strstr(url_buffer, "Unknown Member </TITLE>");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2569 * This might not work for long either ... */
17665
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2570 /* Nope, it failed some time before 5/2/07 :(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2571 char *p = strstr(url_buffer, "form id=\"SpacesSearch\" name=\"SpacesSearch\"");
17665
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2572 * Let's see how long this one holds out for ... */
02abb6713cf2 Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents: 17247
diff changeset
2573 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\"");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2574 PurpleBuddy *b = purple_find_buddy
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2575 (purple_connection_get_account(info_data->gc), info_data->name);
24615
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2576 purple_notify_user_info_add_pair(user_info,
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2577 _("Error retrieving profile"), NULL);
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2578 purple_notify_user_info_add_pair(user_info, NULL,
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2579 ((p && b) ? _("The user has not created a public profile.") :
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2580 (p ? _("MSN reported not being able to find the user's profile. "
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2581 "This either means that the user does not exist, "
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2582 "or that the user exists "
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2583 "but has not created a public profile.") :
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2584 _("Could not find " /* This should never happen */
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2585 "any information in the user's profile. "
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2586 "The user most likely does not exist."))));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2587 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2588
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2589 /* put a link to the actual profile URL */
24615
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2590 purple_notify_user_info_add_section_break(user_info);
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2591 tmp = g_strdup_printf("<a href=\"%s%s\">%s</a>",
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2592 PROFILE_URL, info_data->name, _("View web profile"));
9fc3f5bf4455 Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents: 24451
diff changeset
2593 purple_notify_user_info_add_pair(user_info, NULL, tmp);
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2594 g_free(tmp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2595
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2596 #if PHOTO_SUPPORT
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2597 /* Find the URL to the photo; must be before the marshalling [Bug 994207] */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2598 photo_url_text = msn_get_photo_url(url_text);
23564
7bceac816e19 The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23550
diff changeset
2599 purple_debug_info("msn", "photo url:{%s}\n", photo_url_text ? photo_url_text : "(null)");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2600
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2601 /* Marshall the existing state */
20989
2097b1664fa3 Fix some leaks and prevent some unnecessary allocations and frees.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20957
diff changeset
2602 info2_data = g_new0(MsnGetInfoStepTwoData, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2603 info2_data->info_data = info_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2604 info2_data->stripped = stripped;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2605 info2_data->url_buffer = url_buffer;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2606 info2_data->user_info = user_info;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2607 info2_data->photo_url_text = photo_url_text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2608
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2609 /* Try to put the photo in there too, if there's one */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2610 if (photo_url_text)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2611 {
23745
80ddf59e1585 A similar size limit for MSN buddy icon retrieval from arbitrary urls.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23736
diff changeset
2612 purple_util_fetch_url_len(photo_url_text, FALSE, NULL, FALSE, MAX_HTTP_BUDDYICON_BYTES, msn_got_photo,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2613 info2_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2614 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2615 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2616 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2617 /* Emulate a callback */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2618 /* TODO: Huh? */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2619 msn_got_photo(NULL, info2_data, NULL, 0, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2620 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2621 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2622
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2623 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2624 msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer user_data,
22798
05cb3f04c01e This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22518
diff changeset
2625 const gchar *url_text, gsize len, const gchar *error_message)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2626 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2627 MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)user_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2628 int id = -1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2629
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2630 /* Unmarshall the saved state */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2631 MsnGetInfoData *info_data = info2_data->info_data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2632 char *stripped = info2_data->stripped;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2633 char *url_buffer = info2_data->url_buffer;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2634 PurpleNotifyUserInfo *user_info = info2_data->user_info;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2635 char *photo_url_text = info2_data->photo_url_text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2636
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2637 /* Make sure the connection is still valid if we got here by fetching a photo url */
23745
80ddf59e1585 A similar size limit for MSN buddy icon retrieval from arbitrary urls.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 23736
diff changeset
2638 /* TODO: Instead of this, we should be canceling this when we disconnect */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2639 if (url_text && (error_message != NULL ||
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
2640 g_list_find(purple_connections_get_all(), info_data->gc) == NULL))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2641 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2642 purple_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2643 g_free(stripped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2644 g_free(url_buffer);
20950
52deb2160496 Fix some (rather large) leakage.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 20856
diff changeset
2645 purple_notify_user_info_destroy(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2646 g_free(info_data->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2647 g_free(info_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2648 g_free(photo_url_text);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2649 g_free(info2_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2650
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2651 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2652 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2653
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2654 /* Try to put the photo in there too, if there's one and is readable */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2655 if (user_data && url_text && len != 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2656 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2657 if (strstr(url_text, "400 Bad Request")
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2658 || strstr(url_text, "403 Forbidden")
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2659 || strstr(url_text, "404 Not Found"))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2660 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2661
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2662 purple_debug_info("msn", "Error getting %s: %s\n",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2663 photo_url_text, url_text);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2664 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2665 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2666 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2667 char buf[1024];
22798
05cb3f04c01e This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22518
diff changeset
2668 purple_debug_info("msn", "%s is %" G_GSIZE_FORMAT " bytes\n", photo_url_text, len);
16391
24bbd7e46bfe Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@wiktel.com>
parents: 16390
diff changeset
2669 id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2670 g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2671 purple_notify_user_info_prepend_pair(user_info, NULL, buf);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2672 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2673 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2674
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2675 /* We continue here from msn_got_info, as if nothing has happened */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2676 #endif
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2677 purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2678
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2679 g_free(stripped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2680 g_free(url_buffer);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2681 purple_notify_user_info_destroy(user_info);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2682 g_free(info_data->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2683 g_free(info_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2684 #if PHOTO_SUPPORT
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2685 g_free(photo_url_text);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2686 g_free(info2_data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2687 if (id != -1)
16375
391a79778f89 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
2688 purple_imgstore_unref_by_id(id);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2689 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2690 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2691
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2692 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2693 msn_get_info(PurpleConnection *gc, const char *name)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2694 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2695 MsnGetInfoData *data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2696 char *url;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2697
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2698 data = g_new0(MsnGetInfoData, 1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2699 data->gc = gc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2700 data->name = g_strdup(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2701
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2702 url = g_strdup_printf("%s%s", PROFILE_URL, name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2703
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2704 purple_util_fetch_url(url, FALSE,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2705 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2706 TRUE, msn_got_info, data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2707
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2708 g_free(url);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2709 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2710
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2711 static gboolean msn_load(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2712 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2713 msn_notification_init();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2714 msn_switchboard_init();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2715 msn_sync_init();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2716
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2717 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2718 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2719
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2720 static gboolean msn_unload(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2721 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2722 msn_notification_end();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2723 msn_switchboard_end();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2724 msn_sync_end();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2725
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2726 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2727 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2728
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2729 static PurpleAccount *find_acct(const char *prpl, const char *acct_id)
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2730 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2731 PurpleAccount *acct = NULL;
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2732
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2733 /* If we have a specific acct, use it */
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2734 if (acct_id) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2735 acct = purple_accounts_find(acct_id, prpl);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2736 if (acct && !purple_account_is_connected(acct))
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2737 acct = NULL;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2738 } else { /* Otherwise find an active account for the protocol */
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
2739 GList *l = purple_accounts_get_all();
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2740 while (l) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2741 if (!strcmp(prpl, purple_account_get_protocol_id(l->data))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2742 && purple_account_is_connected(l->data)) {
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2743 acct = l->data;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2744 break;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2745 }
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2746 l = l->next;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2747 }
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2748 }
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2749
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2750 return acct;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2751 }
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2752
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2753 static gboolean msn_uri_handler(const char *proto, const char *cmd, GHashTable *params)
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2754 {
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2755 char *acct_id = g_hash_table_lookup(params, "account");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2756 PurpleAccount *acct;
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2757
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2758 if (g_ascii_strcasecmp(proto, "msnim"))
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2759 return FALSE;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2760
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2761 acct = find_acct("prpl-msn", acct_id);
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2762
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2763 if (!acct)
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2764 return FALSE;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2765
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2766 /* msnim:chat?contact=user@domain.tld */
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2767 if (!g_ascii_strcasecmp(cmd, "Chat")) {
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2768 char *sname = g_hash_table_lookup(params, "contact");
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2769 if (sname) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2770 PurpleConversation *conv = purple_find_conversation_with_account(
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2771 PURPLE_CONV_TYPE_IM, sname, acct);
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2772 if (conv == NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2773 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, sname);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2774 purple_conversation_present(conv);
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2775 }
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2776 /*else
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2777 **If pidgindialogs_im() was in the core, we could use it here.
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2778 * It is all purple_request_* based, but I'm not sure it really belongs in the core
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2779 pidgindialogs_im();*/
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2780
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2781 return TRUE;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2782 }
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2783 /* msnim:add?contact=user@domain.tld */
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2784 else if (!g_ascii_strcasecmp(cmd, "Add")) {
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2785 char *name = g_hash_table_lookup(params, "contact");
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2786 purple_blist_request_add_buddy(acct, name, NULL, NULL);
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2787 return TRUE;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2788 }
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2789
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2790 return FALSE;
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2791 }
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2792
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2793
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2794 static PurplePluginProtocolInfo prpl_info =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2795 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2796 OPT_PROTO_MAIL_CHECK,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2797 NULL, /* user_splits */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2798 NULL, /* protocol_options */
29227
c706d830cd32 The official MSN client supports setting (animated) GIFs as a buddy icon,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29225
diff changeset
2799 {"png,gif", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_SEND}, /* icon_spec */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2800 msn_list_icon, /* list_icon */
23524
ad565744246e Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23522
diff changeset
2801 msn_list_emblems, /* list_emblems */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2802 msn_status_text, /* status_text */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2803 msn_tooltip_text, /* tooltip_text */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2804 msn_status_types, /* away_states */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2805 msn_blist_node_menu, /* blist_node_menu */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2806 NULL, /* chat_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2807 NULL, /* chat_info_defaults */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2808 msn_login, /* login */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2809 msn_close, /* close */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2810 msn_send_im, /* send_im */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2811 NULL, /* set_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2812 msn_send_typing, /* send_typing */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2813 msn_get_info, /* get_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2814 msn_set_status, /* set_away */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2815 msn_set_idle, /* set_idle */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2816 NULL, /* change_passwd */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2817 msn_add_buddy, /* add_buddy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2818 NULL, /* add_buddies */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2819 msn_rem_buddy, /* remove_buddy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2820 NULL, /* remove_buddies */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2821 msn_add_permit, /* add_permit */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2822 msn_add_deny, /* add_deny */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2823 msn_rem_permit, /* rem_permit */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2824 msn_rem_deny, /* rem_deny */
20394
4a099e4d0d09 propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
2825 msn_set_permit_deny, /* set_permit_deny */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2826 NULL, /* join_chat */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2827 NULL, /* reject chat invite */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2828 NULL, /* get_chat_name */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2829 msn_chat_invite, /* chat_invite */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2830 msn_chat_leave, /* chat_leave */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2831 NULL, /* chat_whisper */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2832 msn_chat_send, /* chat_send */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2833 msn_keepalive, /* keepalive */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2834 NULL, /* register_user */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2835 NULL, /* get_cb_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2836 NULL, /* get_cb_away */
23517
70de4e2246ec Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23509
diff changeset
2837 msn_alias_buddy, /* alias_buddy */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2838 msn_group_buddy, /* group_buddy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2839 msn_rename_group, /* rename_group */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2840 NULL, /* buddy_free */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2841 msn_convo_closed, /* convo_closed */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2842 msn_normalize, /* normalize */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2843 msn_set_buddy_icon, /* set_buddy_icon */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2844 msn_remove_group, /* remove_group */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2845 NULL, /* get_cb_real_name */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2846 NULL, /* set_chat_topic */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2847 NULL, /* find_blist_chat */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2848 NULL, /* roomlist_get_list */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2849 NULL, /* roomlist_cancel */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2850 NULL, /* roomlist_expand_category */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2851 msn_can_receive_file, /* can_receive_file */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2852 msn_send_file, /* send_file */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2853 msn_new_xfer, /* new_xfer */
16848
133932a97faa Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents: 16675
diff changeset
2854 msn_offline_message, /* offline_message */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2855 NULL, /* whiteboard_prpl_ops */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2856 NULL, /* send_raw */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2857 NULL, /* roomlist_room_serialize */
19488
ebe2d2e71223 Fixed merge errors stemming from the fact that the main branch and my branch both added something to the prpl struct
Andreas Monitzer <pidgin@monitzer.com>
parents: 19465
diff changeset
2858 NULL, /* unregister_user */
19465
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
2859 msn_send_attention, /* send_attention */
d9d9283680a4 In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents: 18063
diff changeset
2860 msn_attention_types, /* attention_types */
23111
718a9c287839 Use up the last padding for PurplePluginProtocolInfo in a way that allows
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23107
diff changeset
2861 sizeof(PurplePluginProtocolInfo), /* struct_size */
23112
bb41bdce8981 Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23111
diff changeset
2862 msn_get_account_text_table, /* get_account_text_table */
25657
ff29208e03ef propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5)
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23182 25640
diff changeset
2863 NULL, /* initiate_media */
29874
2cb6ea4420a0 Add a NULL for PurplePluginProtocolInfo::get_moods to all the plugins I build
Paul Aurich <paul@darkrain42.org>
parents: 29227
diff changeset
2864 NULL, /* get_media_caps */
2cb6ea4420a0 Add a NULL for PurplePluginProtocolInfo::get_moods to all the plugins I build
Paul Aurich <paul@darkrain42.org>
parents: 29227
diff changeset
2865 NULL /* get_moods */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2866 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2867
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2868 static PurplePluginInfo info =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2869 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2870 PURPLE_PLUGIN_MAGIC,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2871 PURPLE_MAJOR_VERSION,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2872 PURPLE_MINOR_VERSION,
24373
ad685dadbaca Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents: 24371
diff changeset
2873 PURPLE_PLUGIN_PROTOCOL, /**< type */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2874 NULL, /**< ui_requirement */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2875 0, /**< flags */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2876 NULL, /**< dependencies */
24373
ad685dadbaca Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents: 24371
diff changeset
2877 PURPLE_PRIORITY_DEFAULT, /**< priority */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2878
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2879 "prpl-msn", /**< id */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2880 "MSN", /**< name */
21030
3cc856ca2338 Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents: 21026
diff changeset
2881 DISPLAY_VERSION, /**< version */
24374
75545fdf8944 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents: 24373
diff changeset
2882 N_("Windows Live Messenger Protocol Plugin"), /**< summary */
75545fdf8944 String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents: 24373
diff changeset
2883 N_("Windows Live Messenger Protocol Plugin"), /**< description */
24373
ad685dadbaca Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents: 24371
diff changeset
2884 NULL, /**< author */
ad685dadbaca Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents: 24371
diff changeset
2885 PURPLE_WEBSITE, /**< homepage */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2886
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2887 msn_load, /**< load */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2888 msn_unload, /**< unload */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2889 NULL, /**< destroy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2890
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2891 NULL, /**< ui_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2892 &prpl_info, /**< extra_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2893 NULL, /**< prefs_info */
16675
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
2894 msn_actions,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
2895
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
2896 /* padding */
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
2897 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
2898 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
2899 NULL,
a338acd14365 And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents: 16483
diff changeset
2900 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2901 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2902
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2903 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2904 init_plugin(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2905 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2906 PurpleAccountOption *option;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2907
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2908 option = purple_account_option_string_new(_("Server"), "server",
23550
efa4534fd23a Clean up some #define's in msn.h and various supporting changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23533
diff changeset
2909 MSN_SERVER);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2910 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2911 option);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2912
23550
efa4534fd23a Clean up some #define's in msn.h and various supporting changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 23533
diff changeset
2913 option = purple_account_option_int_new(_("Port"), "port", MSN_PORT);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2914 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2915 option);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2916
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2917 option = purple_account_option_bool_new(_("Use HTTP Method"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2918 "http_method", FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2919 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2920 option);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2921
20044
4fdf9c1212e2 Mark new MSN string translatable now that we're no longer string frozen.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 19993
diff changeset
2922 option = purple_account_option_string_new(_("HTTP Method Server"),
19993
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2923 "http_method_server", MSN_HTTPCONN_SERVER);
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2924 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2925 option);
e73e510d56ec 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 <daniel.atallah@gmail.com>
parents: 19718
diff changeset
2926
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2927 option = purple_account_option_bool_new(_("Show custom smileys"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2928 "custom_smileys", TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2929 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2930 option);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2931
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2932 purple_cmd_register("nudge", "", PURPLE_CMD_P_PRPL,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2933 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PRPL_ONLY,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2934 "prpl-msn", msn_cmd_nudge,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2935 _("nudge: nudge a user to get their attention"), NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2936
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2937 purple_prefs_remove("/plugins/prpl/msn");
15624
71af5b6209d5 uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents: 15591
diff changeset
2938
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2939 purple_signal_connect(purple_get_core(), "uri-handler", plugin,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2940 PURPLE_CALLBACK(msn_uri_handler), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2941 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2942
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15624
diff changeset
2943 PURPLE_INIT_PLUGIN(msn, init_plugin, info);