Mercurial > pidgin
annotate libpurple/protocols/msn/msn.c @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 02 Jun 2012 02:30:49 +0000 |
parents | e10e419e6067 |
children |
rev | line source |
---|---|
15373
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 * |
15822 | 4 * purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * |
15822 | 6 * Purple is the legal property of its developers, whose names are too numerous |
15373
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 |
19681
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 |
15373
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 |
30757
575d1af924af
Add internal here so it brings config.h that make it possible to load the plugin. Fixes a regresion introduced in 7ab10ac51ae5537fc0c3eeca18c24dcadf63728f.
masca@cpw.pidgin.im
parents:
30753
diff
changeset
|
26 #include "internal.h" |
575d1af924af
Add internal here so it brings config.h that make it possible to load the plugin. Fixes a regresion introduced in 7ab10ac51ae5537fc0c3eeca18c24dcadf63728f.
masca@cpw.pidgin.im
parents:
30753
diff
changeset
|
27 |
30742
a99b6dcdb60d
Remove unnecesary includes from msn.h.
masca@cpw.pidgin.im
parents:
30741
diff
changeset
|
28 #include "debug.h" |
a99b6dcdb60d
Remove unnecesary includes from msn.h.
masca@cpw.pidgin.im
parents:
30741
diff
changeset
|
29 #include "request.h" |
a99b6dcdb60d
Remove unnecesary includes from msn.h.
masca@cpw.pidgin.im
parents:
30741
diff
changeset
|
30 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #include "accountopt.h" |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23456
diff
changeset
|
32 #include "contact.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "msg.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "page.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "pluginpref.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "prefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "session.h" |
22512
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
|
38 #include "smiley.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "state.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "cmds.h" |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
42 #include "core.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "prpl.h" |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
44 #include "msnutils.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "version.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 |
30753 | 47 #include "error.h" |
24207
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
48 #include "msg.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 #include "switchboard.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 #include "notification.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 #include "slplink.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 #if PHOTO_SUPPORT |
23687
80ddf59e1585
A similar size limit for MSN buddy icon retrieval from arbitrary urls.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23678
diff
changeset
|
54 #define MAX_HTTP_BUDDYICON_BYTES (200 * 1024) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 #include "imgstore.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 { |
15822 | 60 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 const char *passport; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 } MsnMobileData; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 { |
15822 | 67 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 char *name; |
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; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 MsnGetInfoData *info_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 char *stripped; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 char *url_buffer; |
15822 | 77 PurpleNotifyUserInfo *user_info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 char *photo_url_text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 } MsnGetInfoStepTwoData; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 |
17061
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
82 typedef struct |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
83 { |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
84 PurpleConnection *gc; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
85 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:
17054
diff
changeset
|
86 char *msg; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
87 PurpleMessageFlags flags; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
88 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:
17054
diff
changeset
|
89 } MsnIMData; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
90 |
22512
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 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
|
92 { |
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 char *smile; |
28069
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:
28068
diff
changeset
|
94 PurpleSmiley *ps; |
22512
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
|
95 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
|
96 } 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
|
97 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 static const char * |
15822 | 99 msn_normalize(const PurpleAccount *account, const char *str) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 static char buf[BUF_LEN]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 char *tmp; |
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 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
|
105 |
31270
ccda2eba140b
Strip spaces when normalizing MSN usernames. Spaces in the account
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
106 tmp = g_strchomp(g_utf8_strdown(str, -1)); |
ccda2eba140b
Strip spaces when normalizing MSN usernames. Spaces in the account
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
107 g_snprintf(buf, sizeof(buf), "%s%s", tmp, |
ccda2eba140b
Strip spaces when normalizing MSN usernames. Spaces in the account
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31208
diff
changeset
|
108 (strchr(tmp, '@') ? "" : "@hotmail.com")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 return buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
114 static gboolean |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
115 msn_send_attention(PurpleConnection *gc, const char *username, guint type) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 msg = msn_message_new_nudge(); |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
122 session = purple_connection_get_protocol_data(gc); |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
123 swboard = msn_session_get_swboard(session, username, MSN_SB_FLAG_IM); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
125 msn_switchboard_send_msg(swboard, msg, TRUE); |
30952
b4285ea42b6e
msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <mark@kingant.net>
parents:
30951
diff
changeset
|
126 msn_message_unref(msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
128 return TRUE; |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
129 } |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
130 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
131 static GList * |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
132 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
|
133 { |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
134 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
|
135 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
136 if (!list) { |
22097
eab7d03edfcb
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22043
diff
changeset
|
137 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
|
138 _("%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
|
139 } |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
140 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
141 return list; |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
142 } |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
143 |
23110
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23109
diff
changeset
|
144 static GHashTable * |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23109
diff
changeset
|
145 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:
23109
diff
changeset
|
146 { |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23109
diff
changeset
|
147 GHashTable *table; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23109
diff
changeset
|
148 |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23109
diff
changeset
|
149 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:
23109
diff
changeset
|
150 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23152
diff
changeset
|
151 g_hash_table_insert(table, "login_label", (gpointer)_("Email Address...")); |
23110
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23109
diff
changeset
|
152 |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23109
diff
changeset
|
153 return table; |
bb41bdce8981
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23109
diff
changeset
|
154 } |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
155 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
156 static PurpleCmdRet |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
157 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
|
158 { |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
159 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
|
160 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
|
161 const gchar *username; |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
162 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
163 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
|
164 |
23693
797377cbd5bf
Change the other prpls to use new purple_prpl_{send,got}_attention API.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23687
diff
changeset
|
165 purple_prpl_send_attention(gc, username, MSN_NUDGE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 |
15822 | 167 return PURPLE_CMD_RET_OK; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
170 struct public_alias_closure |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
171 { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
172 PurpleAccount *account; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
173 gpointer success_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
174 gpointer failure_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
175 }; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
176 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
177 static gboolean |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
178 set_public_alias_length_error(gpointer data) |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
179 { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
180 struct public_alias_closure *closure = data; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
181 PurpleSetPublicAliasFailureCallback failure_cb = closure->failure_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
182 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
183 failure_cb(closure->account, _("Your new MSN friendly name is too long.")); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
184 g_free(closure); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
185 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
186 return FALSE; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
187 } |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
188 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
189 static void |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
190 prp_success_cb(MsnCmdProc *cmdproc, MsnCommand *cmd) |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
191 { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
192 const char *type, *friendlyname; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
193 struct public_alias_closure *closure; |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31009
diff
changeset
|
194 |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
195 g_return_if_fail(cmd->param_count >= 3); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
196 type = cmd->params[1]; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
197 g_return_if_fail(!strcmp(type, "MFN")); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
198 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
199 closure = cmd->trans->data; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
200 friendlyname = purple_url_decode(cmd->params[2]); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
201 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
202 msn_update_contact(cmdproc->session, "Me", MSN_UPDATE_DISPLAY, friendlyname); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
203 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
204 purple_connection_set_display_name( |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
205 purple_account_get_connection(closure->account), |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
206 friendlyname); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
207 purple_account_set_string(closure->account, "display-name", friendlyname); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
208 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
209 if (closure->success_cb) { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
210 PurpleSetPublicAliasSuccessCallback success_cb = closure->success_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
211 success_cb(closure->account, friendlyname); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
212 } |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
213 } |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
214 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
215 static void |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
216 prp_error_cb(MsnCmdProc *cmdproc, MsnTransaction *trans, int error) |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
217 { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
218 struct public_alias_closure *closure = trans->data; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
219 PurpleSetPublicAliasFailureCallback failure_cb = closure->failure_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
220 gboolean debug; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
221 const char *error_text; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
222 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
223 error_text = msn_error_get_text(error, &debug); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
224 failure_cb(closure->account, error_text); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
225 } |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
226 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
227 static void |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
228 prp_timeout_cb(MsnCmdProc *cmdproc, MsnTransaction *trans) |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
229 { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
230 struct public_alias_closure *closure = trans->data; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
231 PurpleSetPublicAliasFailureCallback failure_cb = closure->failure_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
232 failure_cb(closure->account, _("Connection Timeout")); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
233 } |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
234 |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15822
diff
changeset
|
235 void |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
236 msn_set_public_alias(PurpleConnection *pc, const char *alias, |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
237 PurpleSetPublicAliasSuccessCallback success_cb, |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
238 PurpleSetPublicAliasFailureCallback failure_cb) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 MsnSession *session; |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30705
diff
changeset
|
242 MsnTransaction *trans; |
15822 | 243 PurpleAccount *account; |
30993
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
244 char real_alias[BUDDY_ALIAS_MAXLEN + 1]; |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
245 struct public_alias_closure *closure; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
246 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
247 session = purple_connection_get_protocol_data(pc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 cmdproc = session->notification->cmdproc; |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
249 account = purple_connection_get_account(pc); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
250 |
30975
2812bbd3fc18
Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
251 if (alias && *alias) { |
30993
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
252 if (!msn_encode_spaces(alias, real_alias, BUDDY_ALIAS_MAXLEN + 1)) { |
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
253 if (failure_cb) { |
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
254 struct public_alias_closure *closure = |
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
255 g_new0(struct public_alias_closure, 1); |
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
256 closure->account = account; |
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
257 closure->failure_cb = failure_cb; |
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
258 purple_timeout_add(0, set_public_alias_length_error, closure); |
30975
2812bbd3fc18
Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
259 } else { |
30993
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
260 purple_notify_error(pc, NULL, |
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
261 _("Your new MSN friendly name is too long."), |
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
262 NULL); |
30975
2812bbd3fc18
Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
263 } |
30993
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
264 return; |
30975
2812bbd3fc18
Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
265 } |
2812bbd3fc18
Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
266 |
30993
dc996aa83f49
Combine the encode_spaces function and the stuff for the display name
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30992
diff
changeset
|
267 if (real_alias[0] == '\0') |
31778
5f6bbe89d873
Use g_strlcpy instead of strcpy in MSN alias string creation.
Ethan Blanton <elb@pidgin.im>
parents:
31400
diff
changeset
|
268 g_strlcpy(real_alias, purple_account_get_username(account), sizeof(real_alias)); |
30975
2812bbd3fc18
Stop escaping all characters in the display name. It's only necessary
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30967
diff
changeset
|
269 } else |
31778
5f6bbe89d873
Use g_strlcpy instead of strcpy in MSN alias string creation.
Ethan Blanton <elb@pidgin.im>
parents:
31400
diff
changeset
|
270 g_strlcpy(real_alias, purple_account_get_username(account), sizeof(real_alias)); |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
271 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
272 closure = g_new0(struct public_alias_closure, 1); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
273 closure->account = account; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
274 closure->success_cb = success_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
275 closure->failure_cb = failure_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
276 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
277 trans = msn_transaction_new(cmdproc, "PRP", "MFN %s", real_alias); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
278 msn_transaction_set_data(trans, closure); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
279 msn_transaction_set_data_free(trans, g_free); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
280 msn_transaction_add_cb(trans, "PRP", prp_success_cb); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
281 if (failure_cb) { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
282 msn_transaction_set_error_cb(trans, prp_error_cb); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
283 msn_transaction_set_timeout_cb(trans, prp_timeout_cb); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
284 } |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
285 msn_cmdproc_send_trans(cmdproc, trans); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
286 } |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
287 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
288 static gboolean |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
289 get_public_alias_cb(gpointer data) |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
290 { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
291 struct public_alias_closure *closure = data; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
292 PurpleGetPublicAliasSuccessCallback success_cb = closure->success_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
293 const char *alias; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
294 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
295 alias = purple_account_get_string(closure->account, "display-name", |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
296 purple_account_get_username(closure->account)); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
297 success_cb(closure->account, alias); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
298 g_free(closure); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
299 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
300 return FALSE; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
301 } |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
302 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
303 static void |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
304 msn_get_public_alias(PurpleConnection *pc, |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
305 PurpleGetPublicAliasSuccessCallback success_cb, |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
306 PurpleGetPublicAliasFailureCallback failure_cb) |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
307 { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
308 struct public_alias_closure *closure = g_new0(struct public_alias_closure, 1); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
309 PurpleAccount *account = purple_connection_get_account(pc); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
310 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
311 closure->account = account; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
312 closure->success_cb = success_cb; |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
313 purple_timeout_add(0, get_public_alias_cb, closure); |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
314 } |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
315 |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
316 static void |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
317 msn_act_id(PurpleConnection *gc, const char *entry) |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
318 { |
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
319 msn_set_public_alias(gc, entry, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 static void |
15822 | 323 msn_set_prp(PurpleConnection *gc, const char *type, const char *entry) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 MsnSession *session; |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30705
diff
changeset
|
327 MsnTransaction *trans; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
329 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 if (entry == NULL || *entry == '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 { |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30705
diff
changeset
|
334 trans = msn_transaction_new(cmdproc, "PRP", "%s", type); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 { |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30705
diff
changeset
|
338 trans = msn_transaction_new(cmdproc, "PRP", "%s %s", type, |
15822 | 339 purple_url_encode(entry)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 } |
30715
59cf1be8eaa7
Fix a few little things.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30711
diff
changeset
|
341 msn_cmdproc_send_trans(cmdproc, trans); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 } |
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 static void |
15822 | 345 msn_set_home_phone_cb(PurpleConnection *gc, const char *entry) |
15373
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 msn_set_prp(gc, "PHH", entry); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
350 static void |
15822 | 351 msn_set_work_phone_cb(PurpleConnection *gc, const char *entry) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 msn_set_prp(gc, "PHW", entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 static void |
15822 | 357 msn_set_mobile_phone_cb(PurpleConnection *gc, const char *entry) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 msn_set_prp(gc, "PHM", entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 static void |
15822 | 363 enable_msn_pages_cb(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
364 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 msn_set_prp(gc, "MOB", "Y"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 static void |
15822 | 369 disable_msn_pages_cb(PurpleConnection *gc) |
15373
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 msn_set_prp(gc, "MOB", "N"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
373 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
374 static void |
15822 | 375 send_to_mobile(PurpleConnection *gc, const char *who, const char *entry) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
377 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
378 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
380 MsnPage *page; |
28064
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27528
diff
changeset
|
381 MsnMessage *msg; |
22535
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22444
diff
changeset
|
382 MsnUser *user; |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22444
diff
changeset
|
383 char *payload = NULL; |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22444
diff
changeset
|
384 const char *mobile_number = NULL; |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22535
diff
changeset
|
385 gsize payload_len; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
387 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
388 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
389 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
390 page = msn_page_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 msn_page_set_body(page, entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
392 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
393 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
|
394 |
22535
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22444
diff
changeset
|
395 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:
22444
diff
changeset
|
396 (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:
22444
diff
changeset
|
397 mobile_number[0] == '+') { |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22444
diff
changeset
|
398 /* 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:
22444
diff
changeset
|
399 that from the buddy's contact card */ |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22535
diff
changeset
|
400 trans = msn_transaction_new(cmdproc, "PGD", "tel:%s 1 %" G_GSIZE_FORMAT, |
22535
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22444
diff
changeset
|
401 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:
22444
diff
changeset
|
402 } else { |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22444
diff
changeset
|
403 /* 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:
22444
diff
changeset
|
404 with msn */ |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22535
diff
changeset
|
405 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:
22535
diff
changeset
|
406 who, payload_len); |
22535
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22444
diff
changeset
|
407 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 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
|
410 g_free(payload); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 |
28064
e7a2e2208f88
Display the full message when there are errors sending a MSN Mobile message
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27528
diff
changeset
|
412 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:
27528
diff
changeset
|
413 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:
27528
diff
changeset
|
414 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 msn_page_destroy(page); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
416 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 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
|
422 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 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
|
424 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
426 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
427 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
428 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
|
429 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
430 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
431 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
432 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
433 /* -- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
434 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
435 static void |
15822 | 436 msn_show_set_friendly_name(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
437 { |
15822 | 438 PurpleConnection *gc; |
28824
5259ca10b641
Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
439 PurpleAccount *account; |
5259ca10b641
Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
440 char *tmp; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
441 |
15822 | 442 gc = (PurpleConnection *) action->context; |
28824
5259ca10b641
Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
443 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:
28668
diff
changeset
|
444 |
5259ca10b641
Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
445 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:
28668
diff
changeset
|
446 purple_account_get_username(account)); |
30727
e167de25e795
Give the Set Friendly Name window a better title
Mark Doliner <mark@kingant.net>
parents:
30726
diff
changeset
|
447 purple_request_input(gc, _("Set Friendly Name"), tmp, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
448 _("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
|
449 "see you as."), |
15822 | 450 purple_connection_get_display_name(gc), FALSE, FALSE, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
451 _("OK"), G_CALLBACK(msn_act_id), |
16439
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:
15822
diff
changeset
|
452 _("Cancel"), NULL, |
28824
5259ca10b641
Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
453 account, NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
454 gc); |
28824
5259ca10b641
Show the name of the account in the "Set Friendly Name" dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
455 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
458 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:
30685
diff
changeset
|
459 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:
30685
diff
changeset
|
460 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:
30685
diff
changeset
|
461 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:
30685
diff
changeset
|
462 } MsnLocationData; |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
463 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
464 static void |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
465 update_endpoint_cb(MsnLocationData *data, PurpleRequestFields *fields) |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
466 { |
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
467 PurpleAccount *account; |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
468 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:
30685
diff
changeset
|
469 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:
30685
diff
changeset
|
470 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:
30685
diff
changeset
|
471 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:
30685
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:
30685
diff
changeset
|
473 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:
30685
diff
changeset
|
474 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:
30685
diff
changeset
|
475 |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
476 /* 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:
30685
diff
changeset
|
477 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:
30685
diff
changeset
|
478 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:
30685
diff
changeset
|
479 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:
30685
diff
changeset
|
480 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:
30685
diff
changeset
|
481 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:
30685
diff
changeset
|
482 } |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
483 |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
484 /* 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:
30685
diff
changeset
|
485 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:
30685
diff
changeset
|
486 others; |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
487 others = g_list_next(others)) { |
30689
fe607234b0d8
When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30688
diff
changeset
|
488 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:
30688
diff
changeset
|
489 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:
30688
diff
changeset
|
490 continue; |
30690
d80d32644492
Fix this inverted logic. Disconnect the selected endpoints as said in the field label.
masca@cpw.pidgin.im
parents:
30689
diff
changeset
|
491 if (purple_request_field_bool_get_value(field)) { |
30689
fe607234b0d8
When looping through the request fields, don't try to disconnect a field if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30688
diff
changeset
|
492 const char *id = purple_request_field_get_id(field); |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
493 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:
30685
diff
changeset
|
494 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:
30685
diff
changeset
|
495 |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
496 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:
30685
diff
changeset
|
497 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:
30685
diff
changeset
|
498 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:
30685
diff
changeset
|
499 } |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
500 } |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
501 |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
502 g_free(data); |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
503 } |
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
504 |
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
505 static void |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
506 msn_show_locations(PurplePluginAction *action) |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
507 { |
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
508 PurpleConnection *pc; |
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
509 PurpleAccount *account; |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
510 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:
30685
diff
changeset
|
511 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:
30685
diff
changeset
|
512 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:
30685
diff
changeset
|
513 PurpleRequestField *field; |
30951
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
514 gboolean have_other_endpoints; |
30728
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
515 GSList *l; |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
516 MsnLocationData *data; |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
517 |
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
518 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:
28668
diff
changeset
|
519 account = purple_connection_get_account(pc); |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
520 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:
30685
diff
changeset
|
521 |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
522 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:
30685
diff
changeset
|
523 |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
524 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:
30685
diff
changeset
|
525 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:
30685
diff
changeset
|
526 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:
30685
diff
changeset
|
527 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:
30685
diff
changeset
|
528 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:
30685
diff
changeset
|
529 _("Name"), |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
530 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:
30685
diff
changeset
|
531 FALSE); |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
532 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:
30685
diff
changeset
|
533 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:
30685
diff
changeset
|
534 |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
535 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:
30685
diff
changeset
|
536 purple_request_fields_add_group(fields, group); |
30951
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
537 |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
538 have_other_endpoints = FALSE; |
30728
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
539 for (l = session->user->endpoints; l; l = l->next) { |
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
540 MsnUserEndpoint *ep = l->data; |
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
541 |
30951
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
542 if (ep->id[0] != '\0' && strncasecmp(ep->id + 1, session->guid, 36) == 0) |
30728
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
543 /* Don't add myself to the list */ |
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
544 continue; |
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
545 |
30951
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
546 if (!have_other_endpoints) { |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
547 /* We do in fact have an endpoint other than ourselves... let's |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
548 add a label */ |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
549 field = purple_request_field_label_new("others-label", |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
550 _("You can sign out from other locations here")); |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
551 purple_request_field_group_add_field(group, field); |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
552 } |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
553 |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
554 have_other_endpoints = TRUE; |
30728
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
555 field = purple_request_field_bool_new(ep->id, ep->name, FALSE); |
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
556 purple_request_field_group_add_field(group, field); |
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
557 } |
30951
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
558 if (!have_other_endpoints) { |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
559 /* TODO: Due to limitations in our current request field API, the |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
560 following string will show up with a trailing colon. This should |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
561 be fixed either by adding an "include_colon" boolean, or creating |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
562 a separate purple_request_field_label_new_without_colon function, |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
563 or by never automatically adding the colon and requiring that |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
564 callers add the colon themselves. */ |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
565 field = purple_request_field_label_new("others-label", _("You are not signed in from any other locations.")); |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
566 purple_request_field_group_add_field(group, field); |
a328691c761a
* Don't include ourselves in the list of other endpoints that can be
Mark Doliner <mark@kingant.net>
parents:
30944
diff
changeset
|
567 } |
30728
2a5dbea6ab6b
Use a linked list to store MsnUserEndpoints instead of a hash table.
Mark Doliner <mark@kingant.net>
parents:
30727
diff
changeset
|
568 |
30688
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
569 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:
30685
diff
changeset
|
570 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:
30685
diff
changeset
|
571 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:
30685
diff
changeset
|
572 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:
30685
diff
changeset
|
573 |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
574 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:
30685
diff
changeset
|
575 fields, |
3d34a0870920
Add a dialog listing the other endpoints from which users can sign them out
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30685
diff
changeset
|
576 _("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:
30685
diff
changeset
|
577 _("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:
30685
diff
changeset
|
578 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:
30685
diff
changeset
|
579 data); |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
580 } |
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
581 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
582 static void |
31009
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
583 enable_mpop_cb(PurpleConnection *pc) |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
584 { |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
585 MsnSession *session = purple_connection_get_protocol_data(pc); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
586 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
587 purple_debug_info("msn", "Enabling MPOP\n"); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
588 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
589 session->enable_mpop = TRUE; |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
590 msn_annotate_contact(session, "Me", "MSN.IM.MPOP", "1", NULL); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
591 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
592 purple_prpl_got_account_actions(purple_connection_get_account(pc)); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
593 } |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
594 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
595 static void |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
596 disable_mpop_cb(PurpleConnection *pc) |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
597 { |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
598 PurpleAccount *account = purple_connection_get_account(pc); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
599 MsnSession *session = purple_connection_get_protocol_data(pc); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
600 GSList *l; |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
601 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
602 purple_debug_info("msn", "Disabling MPOP\n"); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
603 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
604 session->enable_mpop = FALSE; |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
605 msn_annotate_contact(session, "Me", "MSN.IM.MPOP", "0", NULL); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
606 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
607 for (l = session->user->endpoints; l; l = l->next) { |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
608 MsnUserEndpoint *ep = l->data; |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
609 char *user; |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
610 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
611 if (ep->id[0] != '\0' && strncasecmp(ep->id + 1, session->guid, 36) == 0) |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
612 /* Don't kick myself */ |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
613 continue; |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
614 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
615 purple_debug_info("msn", "Disconnecting Endpoint %s\n", ep->id); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
616 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
617 user = g_strdup_printf("%s;%s", purple_account_get_username(account), ep->id); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
618 msn_notification_send_uun(session, user, MSN_UNIFIED_NOTIFICATION_MPOP, "goawyplzthxbye"); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
619 g_free(user); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
620 } |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
621 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
622 purple_prpl_got_account_actions(account); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
623 } |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
624 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
625 static void |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
626 msn_show_set_mpop(PurplePluginAction *action) |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
627 { |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
628 PurpleConnection *pc; |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
629 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
630 pc = (PurpleConnection *)action->context; |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
631 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
632 purple_request_action(pc, NULL, _("Allow multiple logins?"), |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
633 _("Do you want to allow or disallow connecting from " |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
634 "multiple locations simultaneously?"), |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
635 PURPLE_DEFAULT_ACTION_NONE, |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
636 purple_connection_get_account(pc), NULL, NULL, |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
637 pc, 3, |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
638 _("Allow"), G_CALLBACK(enable_mpop_cb), |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
639 _("Disallow"), G_CALLBACK(disable_mpop_cb), |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
640 _("Cancel"), NULL); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
641 } |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
642 |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
643 static void |
15822 | 644 msn_show_set_home_phone(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 { |
15822 | 646 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 |
15822 | 649 gc = (PurpleConnection *) action->context; |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
650 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
652 purple_request_input(gc, NULL, _("Set your home phone number."), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 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
|
654 _("OK"), G_CALLBACK(msn_set_home_phone_cb), |
16439
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:
15822
diff
changeset
|
655 _("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:
15822
diff
changeset
|
656 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
657 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
660 static void |
15822 | 661 msn_show_set_work_phone(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 { |
15822 | 663 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
664 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 |
15822 | 666 gc = (PurpleConnection *) action->context; |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
667 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
669 purple_request_input(gc, NULL, _("Set your work phone number."), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 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
|
671 _("OK"), G_CALLBACK(msn_set_work_phone_cb), |
16439
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:
15822
diff
changeset
|
672 _("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:
15822
diff
changeset
|
673 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
674 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
676 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 static void |
15822 | 678 msn_show_set_mobile_phone(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 { |
15822 | 680 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 |
15822 | 683 gc = (PurpleConnection *) action->context; |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
684 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
685 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
686 purple_request_input(gc, NULL, _("Set your mobile phone number."), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
687 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
|
688 _("OK"), G_CALLBACK(msn_set_mobile_phone_cb), |
16439
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:
15822
diff
changeset
|
689 _("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:
15822
diff
changeset
|
690 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
691 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
692 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
693 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
694 static void |
15822 | 695 msn_show_set_mobile_pages(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 { |
15822 | 697 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 |
15822 | 699 gc = (PurpleConnection *) action->context; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
701 purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 _("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
|
703 "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
|
704 "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
|
705 PURPLE_DEFAULT_ACTION_NONE, |
16439
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:
15822
diff
changeset
|
706 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
707 gc, 3, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 _("Allow"), G_CALLBACK(enable_msn_pages_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
709 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 _("Cancel"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 |
23527
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23519
diff
changeset
|
713 /* 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:
23519
diff
changeset
|
714 #if 0 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 static void |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
716 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:
23472
diff
changeset
|
717 { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
718 PurpleConnection *pc = (PurpleConnection *) action->context; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
719 MsnSession *session; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
720 char *title; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
721 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
722 session = purple_connection_get_protocol_data(pc); |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
723 |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
724 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:
23472
diff
changeset
|
725 if (session->blocked_text == NULL) { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
726 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:
23472
diff
changeset
|
727 } else { |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
728 char *blocked_text; |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
729 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:
23472
diff
changeset
|
730 session->blocked_text); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31009
diff
changeset
|
731 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
732 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:
23472
diff
changeset
|
733 g_free(blocked_text); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
734 } |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
735 g_free(title); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
736 } |
23527
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23519
diff
changeset
|
737 #endif |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
738 |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
739 static void |
15822 | 740 msn_show_hotmail_inbox(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 { |
15822 | 742 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
744 |
15822 | 745 gc = (PurpleConnection *) action->context; |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
746 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 |
23611
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23610
diff
changeset
|
748 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:
23610
diff
changeset
|
749 purple_notify_error(gc, NULL, |
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23610
diff
changeset
|
750 _("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:
23610
diff
changeset
|
751 return; |
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23610
diff
changeset
|
752 } |
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23610
diff
changeset
|
753 |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31009
diff
changeset
|
754 /** apparently the correct value is 777, use 750 as a failsafe */ |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
755 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:
23611
diff
changeset
|
756 || (time (NULL) - session->passport_info.mail_timestamp >= 750)) { |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23527
diff
changeset
|
757 MsnTransaction *trans; |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23527
diff
changeset
|
758 MsnCmdProc *cmdproc; |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23527
diff
changeset
|
759 |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23527
diff
changeset
|
760 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:
23527
diff
changeset
|
761 |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23527
diff
changeset
|
762 trans = msn_transaction_new(cmdproc, "URL", "%s", "INBOX"); |
23611
b2609fca4943
Use "EmailEnabled" from the MSN profile message to determine whether
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23610
diff
changeset
|
763 msn_transaction_set_data(trans, GUINT_TO_POINTER(TRUE)); |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23527
diff
changeset
|
764 |
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23527
diff
changeset
|
765 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:
23527
diff
changeset
|
766 |
23612
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
767 } else |
7f4b697c6947
Use a URL to open MSN Hotmail inbox instead of a temporary file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23611
diff
changeset
|
768 purple_notify_uri(gc, session->passport_info.mail_url); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
770 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
771 static void |
15822 | 772 show_send_to_mobile_cb(PurpleBlistNode *node, gpointer ignored) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
773 { |
15822 | 774 PurpleBuddy *buddy; |
775 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
776 MsnMobileData *data; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
777 PurpleAccount *account; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
778 const char *name; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
779 |
15822 | 780 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 |
15822 | 782 buddy = (PurpleBuddy *) node; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
783 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
784 gc = purple_account_get_connection(account); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
785 name = purple_buddy_get_name(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
786 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 data = g_new0(MsnMobileData, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
788 data->gc = gc; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
789 data->passport = name; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
791 purple_request_input(gc, NULL, _("Send a mobile message."), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
792 NULL, TRUE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
793 _("Page"), G_CALLBACK(send_to_mobile_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
794 _("Close"), G_CALLBACK(close_mobile_page_cb), |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
795 account, name, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
796 data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
797 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
798 |
16837
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16667
diff
changeset
|
799 static gboolean |
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16667
diff
changeset
|
800 msn_offline_message(const PurpleBuddy *buddy) { |
23957
b664b3924a52
correctly say we support offline messages for all buddies, this was never
Ka-Hing Cheung <khc@hxbc.us>
parents:
23735
diff
changeset
|
801 return TRUE; |
16837
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16667
diff
changeset
|
802 } |
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16667
diff
changeset
|
803 |
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
|
804 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
|
805 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
|
806 { |
23672
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
807 PurpleAccount *account; |
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
808 MsnSession *session; |
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
809 MsnCmdProc *cmdproc; |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30705
diff
changeset
|
810 MsnTransaction *trans; |
23672
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
811 |
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
812 account = purple_connection_get_account(gc); |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
813 session = purple_connection_get_protocol_data(gc); |
23672
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
814 cmdproc = session->notification->cmdproc; |
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
815 |
32245
f75041cb3fec
Convert libpurple and protocol prpl's to use the purple_account_* accessor functions.
andrew.victor@mxit.com
parents:
32218
diff
changeset
|
816 if (purple_account_get_privacy_type(account) == PURPLE_PRIVACY_ALLOW_ALL || |
f75041cb3fec
Convert libpurple and protocol prpl's to use the purple_account_* accessor functions.
andrew.victor@mxit.com
parents:
32218
diff
changeset
|
817 purple_account_get_privacy_type(account) == PURPLE_PRIVACY_DENY_USERS) |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30705
diff
changeset
|
818 trans = msn_transaction_new(cmdproc, "BLP", "%s", "AL"); |
23672
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
819 else |
30709
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30705
diff
changeset
|
820 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:
30705
diff
changeset
|
821 |
4d7dfeae29c6
msn: Delete msn_cmdproc_send since it just have duplicated code from
masca@cpw.pidgin.im
parents:
30705
diff
changeset
|
822 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
|
823 } |
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
|
824 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 static void |
15822 | 826 initiate_chat_cb(PurpleBlistNode *node, gpointer data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
827 { |
15822 | 828 PurpleBuddy *buddy; |
829 PurpleConnection *gc; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
830 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
831 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
832 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 |
23678
8ba3d6905252
When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23672
diff
changeset
|
835 const char *alias; |
8ba3d6905252
When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23672
diff
changeset
|
836 |
15822 | 837 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 |
15822 | 839 buddy = (PurpleBuddy *) node; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
840 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
841 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
842 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
843 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 swboard = msn_switchboard_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 msn_switchboard_request(swboard); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
847 msn_switchboard_request_add_user(swboard, purple_buddy_get_name(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 /* 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
|
850 swboard->chat_id = msn_switchboard_get_chat_id(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 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
|
852 swboard->flag = MSN_SB_FLAG_IM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 |
23678
8ba3d6905252
When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23672
diff
changeset
|
854 /* Local alias > Display name > Username */ |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
855 if ((alias = purple_account_get_alias(account)) == NULL) |
23678
8ba3d6905252
When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23672
diff
changeset
|
856 if ((alias = purple_connection_get_display_name(gc)) == NULL) |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
857 alias = purple_account_get_username(account); |
23678
8ba3d6905252
When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23672
diff
changeset
|
858 |
15822 | 859 purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv), |
23678
8ba3d6905252
When opening MSN chats, use "Local alias" in preference to "Display
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23672
diff
changeset
|
860 alias, NULL, PURPLE_CBFLAGS_NONE, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 static void |
15822 | 864 t_msn_xfer_init(PurpleXfer *xfer) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
865 { |
30831 | 866 msn_request_ft(xfer); |
29762
b0bc67f42027
Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29682
diff
changeset
|
867 } |
b0bc67f42027
Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29682
diff
changeset
|
868 |
b0bc67f42027
Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29682
diff
changeset
|
869 static void |
b0bc67f42027
Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29682
diff
changeset
|
870 t_msn_xfer_cancel_send(PurpleXfer *xfer) |
b0bc67f42027
Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29682
diff
changeset
|
871 { |
31963
92711688c245
Convert the msn prpl to use the new API.
andrew.victor@mxit.com
parents:
31942
diff
changeset
|
872 MsnSlpLink *slplink = purple_xfer_get_protocol_data(xfer); |
29762
b0bc67f42027
Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29682
diff
changeset
|
873 msn_slplink_unref(slplink); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 |
15822 | 876 static PurpleXfer* |
877 msn_new_xfer(PurpleConnection *gc, const char *who) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 MsnSession *session; |
15822 | 880 PurpleXfer *xfer; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
881 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
882 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
883 |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32245
diff
changeset
|
884 xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_SEND, who); |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15822
diff
changeset
|
885 |
24412
63558ea6fac6
It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <mark@kingant.net>
parents:
24207
diff
changeset
|
886 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:
24207
diff
changeset
|
887 |
31963
92711688c245
Convert the msn prpl to use the new API.
andrew.victor@mxit.com
parents:
31942
diff
changeset
|
888 purple_xfer_set_protocol_data(xfer, msn_slplink_ref(msn_session_get_slplink(session, who))); |
24412
63558ea6fac6
It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <mark@kingant.net>
parents:
24207
diff
changeset
|
889 |
63558ea6fac6
It's an error if purple_xfer_new fails, so use a g_return_val_if_fail
Mark Doliner <mark@kingant.net>
parents:
24207
diff
changeset
|
890 purple_xfer_set_init_fnc(xfer, t_msn_xfer_init); |
29762
b0bc67f42027
Fix a possible use-after-free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29682
diff
changeset
|
891 purple_xfer_set_cancel_send_fnc(xfer, t_msn_xfer_cancel_send); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 return xfer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 static void |
15822 | 897 msn_send_file(PurpleConnection *gc, const char *who, const char *file) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 { |
15822 | 899 PurpleXfer *xfer = msn_new_xfer(gc, who); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
901 if (file) |
15822 | 902 purple_xfer_request_accepted(xfer, file); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 else |
15822 | 904 purple_xfer_request(xfer); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
905 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 static gboolean |
15822 | 908 msn_can_receive_file(PurpleConnection *gc, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 { |
15822 | 910 PurpleAccount *account; |
23616
6659ba7b3941
Fix a crash when the user isn't in your list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23612
diff
changeset
|
911 gchar *normal; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 gboolean ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 |
15822 | 914 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 |
15822 | 916 normal = g_strdup(msn_normalize(account, purple_account_get_username(account))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 ret = strcmp(normal, msn_normalize(account, who)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 g_free(normal); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 |
23609
46da06b6b4ce
Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23560
diff
changeset
|
920 if (ret) { |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
921 MsnSession *session = purple_connection_get_protocol_data(gc); |
23628
7a71457cdd32
Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23616
diff
changeset
|
922 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:
23616
diff
changeset
|
923 MsnUser *user = msn_userlist_find_user(session->userlist, who); |
28464
019c8be6b52d
Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28418
diff
changeset
|
924 if (user) { |
31208
d235da74af79
Updated client capabilities and networks from msnpsharp.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
925 /* Include these too: MSN_CAP_MOBILE_ON|MSN_CAP_WEB_WATCH ? */ |
d235da74af79
Updated client capabilities and networks from msnpsharp.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
926 if ((user->clientid & MSN_CAP_VIA_WEBIM) || |
28464
019c8be6b52d
Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28418
diff
changeset
|
927 user->networkid == MSN_NETWORK_YAHOO) |
019c8be6b52d
Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28418
diff
changeset
|
928 ret = FALSE; |
019c8be6b52d
Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28418
diff
changeset
|
929 else |
019c8be6b52d
Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28418
diff
changeset
|
930 ret = TRUE; |
019c8be6b52d
Cannot send a file to a Yahoo! user on MSN.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
28418
diff
changeset
|
931 } |
23628
7a71457cdd32
Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23616
diff
changeset
|
932 } else |
7a71457cdd32
Don't crash if MsnSession is NULL when checking for ability to send a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23616
diff
changeset
|
933 ret = FALSE; |
23609
46da06b6b4ce
Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23560
diff
changeset
|
934 } |
46da06b6b4ce
Disable sending files to MSN contacts using the web messenger. Not sure
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23560
diff
changeset
|
935 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 * Protocol Plugin ops |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 static const char * |
15822 | 944 msn_list_icon(PurpleAccount *a, PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 return "msn"; |
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 |
23479
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
949 static const char * |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
950 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:
23477
diff
changeset
|
951 { |
25799
8d562557ed6f
Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25141
diff
changeset
|
952 MsnUser *user = purple_buddy_get_protocol_data(b); |
23479
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
953 |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
954 if (user != NULL) { |
31208
d235da74af79
Updated client capabilities and networks from msnpsharp.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
955 if (user->clientid & MSN_CAP_BOT) |
23479
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
956 return "bot"; |
31208
d235da74af79
Updated client capabilities and networks from msnpsharp.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
957 if (user->clientid & MSN_CAP_VIA_MOBILE) |
23610
8218a2c209f1
On MSN, use "external" and "mobile" for Web messenger and mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23609
diff
changeset
|
958 return "mobile"; |
23479
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
959 #if 0 |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
960 /* XXX: Since we don't support this, there's no point in showing it just yet */ |
31208
d235da74af79
Updated client capabilities and networks from msnpsharp.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
961 if (user->clientid & MSN_CAP_SCHANNEL) |
23479
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
962 return "secure"; |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
963 #endif |
31208
d235da74af79
Updated client capabilities and networks from msnpsharp.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31086
diff
changeset
|
964 if (user->clientid & MSN_CAP_VIA_WEBIM) |
23610
8218a2c209f1
On MSN, use "external" and "mobile" for Web messenger and mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23609
diff
changeset
|
965 return "external"; |
23479
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
966 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:
23477
diff
changeset
|
967 return "yahoo"; |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
968 } |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
969 |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
970 return NULL; |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
971 } |
ad565744246e
Add support for emblems in MSN protocol. Emblems include bots, mobile
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23477
diff
changeset
|
972 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
973 /* |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
974 * Set the User status text |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
975 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
976 static char * |
15822 | 977 msn_status_text(PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 { |
15822 | 979 PurplePresence *presence; |
980 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
|
981 const char *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
982 |
15822 | 983 presence = purple_buddy_get_presence(buddy); |
984 status = purple_presence_get_active_status(presence); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 |
25295 | 986 /* Official client says media takes precedence over message */ |
987 /* I say message take precedence over media! Plus prpl-jabber agrees | |
988 too */ | |
989 msg = purple_status_get_attr_string(status, "message"); | |
990 if (msg && *msg) | |
991 return g_markup_escape_text(msg, -1); | |
992 | |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
993 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
994 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
|
995 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
|
996 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
|
997 title = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE); |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
998 |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
999 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:
24506
diff
changeset
|
1000 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:
24506
diff
changeset
|
1001 |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
1002 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:
24506
diff
changeset
|
1003 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:
24506
diff
changeset
|
1004 const char *album = purple_status_get_attr_string(status, PURPLE_TUNE_ALBUM); |
27516
4cddfd2d06be
Use purple_util_format_song_info in MSN/XMPP for the buddy list status text.
Paul Aurich <paul@darkrain42.org>
parents:
27395
diff
changeset
|
1005 media = purple_util_format_song_info(title, artist, album, NULL); |
27528
8cfc45425ac7
Don't double-escape media.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27527
diff
changeset
|
1006 return media; |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
1007 } |
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
1008 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:
24506
diff
changeset
|
1009 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:
24506
diff
changeset
|
1010 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:
24506
diff
changeset
|
1011 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:
24506
diff
changeset
|
1012 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:
24506
diff
changeset
|
1013 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
|
1014 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
|
1015 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
|
1016 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
|
1017 } |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
1018 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1022 static void |
15822 | 1023 msn_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1024 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1025 MsnUser *user; |
15822 | 1026 PurplePresence *presence = purple_buddy_get_presence(buddy); |
1027 PurpleStatus *status = purple_presence_get_active_status(presence); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 |
25799
8d562557ed6f
Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25141
diff
changeset
|
1029 user = purple_buddy_get_protocol_data(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 |
15822 | 1031 if (purple_presence_is_online(presence)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
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 const char *psm, *name; |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
1034 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
|
1035 char *currentmedia = NULL; |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15822
diff
changeset
|
1036 |
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15822
diff
changeset
|
1037 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
|
1038 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
|
1039 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
|
1040 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
1041 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:
24506
diff
changeset
|
1042 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:
24506
diff
changeset
|
1043 if (title && *title) { |
24511
7a5f6ddd11b1
Only get the artist and album if we are setting a Music mediatype.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24510
diff
changeset
|
1044 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:
24510
diff
changeset
|
1045 const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM); |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
1046 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:
24506
diff
changeset
|
1047 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:
24506
diff
changeset
|
1048 } 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:
24506
diff
changeset
|
1049 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:
24506
diff
changeset
|
1050 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:
24506
diff
changeset
|
1051 } 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:
24506
diff
changeset
|
1052 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:
24506
diff
changeset
|
1053 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:
24506
diff
changeset
|
1054 } |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
1055 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1056 |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1057 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
|
1058 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
|
1059 } 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
|
1060 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
|
1061 } |
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
|
1062 |
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
|
1063 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
|
1064 char *tmp2; |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1065 |
23735
35f7b7c62995
Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23734
diff
changeset
|
1066 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
|
1067 if (purple_presence_is_idle(presence)) { |
23735
35f7b7c62995
Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23734
diff
changeset
|
1068 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:
23734
diff
changeset
|
1069 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:
23734
diff
changeset
|
1070 /* 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:
23734
diff
changeset
|
1071 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:
23734
diff
changeset
|
1072 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:
23734
diff
changeset
|
1073 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:
23734
diff
changeset
|
1074 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:
23734
diff
changeset
|
1075 tmp2 = tmp3; |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1076 } |
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:
19719
diff
changeset
|
1077 |
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
|
1078 if (psm != NULL && *psm) { |
31361
0123c69ec0e5
Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents:
30005
diff
changeset
|
1079 purple_notify_user_info_add_pair_plaintext(user_info, tmp2, psm); |
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
|
1080 } else { |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
1081 purple_notify_user_info_add_pair_html(user_info, _("Status"), tmp2); |
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
|
1082 } |
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
|
1083 |
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
|
1084 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
|
1085 } 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
|
1086 if (psm != NULL && *psm) { |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1087 if (purple_presence_is_idle(presence)) { |
31361
0123c69ec0e5
Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents:
30005
diff
changeset
|
1088 purple_notify_user_info_add_pair_plaintext(user_info, _("Idle"), psm); |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1089 } else { |
31361
0123c69ec0e5
Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents:
30005
diff
changeset
|
1090 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), psm); |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1091 } |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1092 } else { |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1093 if (purple_presence_is_idle(presence)) { |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1094 purple_notify_user_info_add_pair_plaintext(user_info, |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1095 _("Status"), _("Idle")); |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1096 } else { |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1097 purple_notify_user_info_add_pair_plaintext(user_info, |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1098 _("Status"), purple_status_get_name(status)); |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
1099 } |
20567
b4a141f9294a
don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@hxbc.us>
parents:
20554
diff
changeset
|
1100 } |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15822
diff
changeset
|
1101 } |
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
|
1102 |
19843
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15822
diff
changeset
|
1103 if (currentmedia) { |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
1104 purple_notify_user_info_add_pair_html(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
|
1105 g_free(currentmedia); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1106 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1107 } |
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 /* 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
|
1110 * XXX: blocked icon overlay isn't always accurate for MSN. |
15822 | 1111 * XXX: This can die as soon as purple_privacy_check() knows that |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1112 * 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
|
1113 /* 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
|
1114 * 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
|
1115 * 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
|
1116 * 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
|
1117 */ |
27c72bd82a81
We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <stu@nosnilmot.com>
parents:
21000
diff
changeset
|
1118 if (full && user) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1119 { |
22259
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
1120 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
|
1121 |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1122 purple_notify_user_info_add_pair_plaintext(user_info, _("Has you"), |
24048
0a4aa7df352b
We can't have ./configure lying to you, can we?
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23957
diff
changeset
|
1123 ((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:
23957
diff
changeset
|
1124 |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1125 purple_notify_user_info_add_pair_plaintext(user_info, _("Blocked"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1126 ((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
|
1127 |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
1128 phone = msn_user_get_home_phone(user); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1129 if (phone != NULL) { |
31942
56ef2369f330
Fix the _add_pair_html/plaintext calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31920
diff
changeset
|
1130 purple_notify_user_info_add_pair_plaintext(user_info, _("Home Phone Number"), phone); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1131 } |
22259
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
1132 |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
1133 phone = msn_user_get_work_phone(user); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1134 if (phone != NULL) { |
31942
56ef2369f330
Fix the _add_pair_html/plaintext calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31920
diff
changeset
|
1135 purple_notify_user_info_add_pair_plaintext(user_info, _("Work Phone Number"), phone); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1136 } |
22259
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
1137 |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
1138 phone = msn_user_get_mobile_phone(user); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1139 if (phone != NULL) { |
31942
56ef2369f330
Fix the _add_pair_html/plaintext calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31920
diff
changeset
|
1140 purple_notify_user_info_add_pair_plaintext(user_info, _("Mobile Phone Number"), phone); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
1141 } |
15373
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 } |
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 static GList * |
15822 | 1146 msn_status_types(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1147 { |
15822 | 1148 PurpleStatusType *status; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1149 GList *types = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1151 status = purple_status_type_new_with_attrs( |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1152 PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1153 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1154 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1155 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1157 status = purple_status_type_new_with_attrs( |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1158 PURPLE_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1159 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1160 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1161 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1162 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1163 status = purple_status_type_new_with_attrs( |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1164 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:
15822
diff
changeset
|
1165 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1166 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1167 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1168 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1169 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
|
1170 PURPLE_STATUS_UNAVAILABLE, "busy", _("Busy"), TRUE, TRUE, FALSE, |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1171 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1172 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1173 types = g_list_append(types, status); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1174 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
|
1175 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:
15822
diff
changeset
|
1176 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1177 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1178 types = g_list_append(types, status); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1179 status = purple_status_type_new_with_attrs( |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1180 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:
15822
diff
changeset
|
1181 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1182 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1183 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1184 |
15822 | 1185 status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE, |
25412
b5c82724598c
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25307
diff
changeset
|
1186 NULL, NULL, TRUE, TRUE, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 |
15822 | 1189 status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, |
25412
b5c82724598c
For some reason, all these statuses were set to saveable=FALSE. With the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25307
diff
changeset
|
1190 NULL, NULL, TRUE, TRUE, FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1191 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:
19719
diff
changeset
|
1192 |
15822 | 1193 status = purple_status_type_new_full(PURPLE_STATUS_MOBILE, |
15540
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:
15462
diff
changeset
|
1194 "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:
15462
diff
changeset
|
1195 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:
19719
diff
changeset
|
1196 |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
1197 status = purple_status_type_new_with_attrs(PURPLE_STATUS_TUNE, |
24464
3a3d36791a47
I don't know why we'd want the TUNE status to be saveable.
Richard Laager <rlaager@wiktel.com>
parents:
24431
diff
changeset
|
1198 "tune", NULL, FALSE, TRUE, TRUE, |
29682
29df7408df03
Eliminate the name collisions on "Title". I have a few qualms:
Paul Aurich <paul@darkrain42.org>
parents:
29478
diff
changeset
|
1199 PURPLE_TUNE_ARTIST, _("Tune Artist"), purple_value_new(PURPLE_TYPE_STRING), |
29df7408df03
Eliminate the name collisions on "Title". I have a few qualms:
Paul Aurich <paul@darkrain42.org>
parents:
29478
diff
changeset
|
1200 PURPLE_TUNE_ALBUM, _("Tune Album"), purple_value_new(PURPLE_TYPE_STRING), |
29df7408df03
Eliminate the name collisions on "Title". I have a few qualms:
Paul Aurich <paul@darkrain42.org>
parents:
29478
diff
changeset
|
1201 PURPLE_TUNE_TITLE, _("Tune Title"), purple_value_new(PURPLE_TYPE_STRING), |
24510
e344426d7c28
Add the Games and Office media to MSN as attributes tacked on to the tune
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24506
diff
changeset
|
1202 "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:
24506
diff
changeset
|
1203 "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
|
1204 NULL); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
1205 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
|
1206 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1207 return types; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1210 static GList * |
15822 | 1211 msn_actions(PurplePlugin *plugin, gpointer context) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1212 { |
30978
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1213 PurpleConnection *gc; |
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1214 MsnSession *session; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1215 GList *m = NULL; |
15822 | 1216 PurplePluginAction *act; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1217 |
30978
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1218 gc = (PurpleConnection *) context; |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1219 session = purple_connection_get_protocol_data(gc); |
30978
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1220 |
15822 | 1221 act = purple_plugin_action_new(_("Set Friendly Name..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1222 msn_show_set_friendly_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1223 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1224 m = g_list_append(m, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1225 |
32533
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1226 if (session->enable_mpop) |
30978
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1227 { |
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1228 act = purple_plugin_action_new(_("View Locations..."), |
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1229 msn_show_locations); |
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1230 m = g_list_append(m, act); |
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1231 m = g_list_append(m, NULL); |
2a9327053398
Suppress the "View Locations..." protocol action on MSN if we are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
30975
diff
changeset
|
1232 } |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1233 |
15822 | 1234 act = purple_plugin_action_new(_("Set Home Phone Number..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 msn_show_set_home_phone); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1236 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 |
15822 | 1238 act = purple_plugin_action_new(_("Set Work Phone Number..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1239 msn_show_set_work_phone); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 |
15822 | 1242 act = purple_plugin_action_new(_("Set Mobile Phone Number..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1243 msn_show_set_mobile_phone); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 m = g_list_append(m, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1246 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1247 #if 0 |
15822 | 1248 act = purple_plugin_action_new(_("Enable/Disable Mobile Devices..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 msn_show_set_mobile_support); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 |
31009
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
1253 act = purple_plugin_action_new(_("Allow/Disallow Multiple Logins..."), |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
1254 msn_show_set_mpop); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
1255 m = g_list_append(m, act); |
b78991ee326c
Add account action to enable/disable connecting from multiple
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31007
diff
changeset
|
1256 |
15822 | 1257 act = purple_plugin_action_new(_("Allow/Disallow Mobile Pages..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1258 msn_show_set_mobile_pages); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 |
23527
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23519
diff
changeset
|
1261 /* 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:
23519
diff
changeset
|
1262 #if 0 |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
1263 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:
23472
diff
changeset
|
1264 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:
23472
diff
changeset
|
1265 msn_show_blocked_text); |
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
1266 m = g_list_append(m, act); |
23527
25aec47d9671
Disable the MSN blocked text dialog for now because it doesn't always
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23519
diff
changeset
|
1267 #endif |
23477
fd124c21ebb7
Properly parse (most of) the MSN GCF command. Provides a
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23472
diff
changeset
|
1268 |
23554
ab70eae012f5
Fixup MSN mailbox handling based on a patch from Felipe, plus various
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23527
diff
changeset
|
1269 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:
23527
diff
changeset
|
1270 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:
23527
diff
changeset
|
1271 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:
23527
diff
changeset
|
1272 m = g_list_append(m, act); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1275 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 static GList * |
15822 | 1278 msn_buddy_menu(PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 GList *m = NULL; |
15822 | 1283 PurpleMenuAction *act; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 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
|
1286 |
25799
8d562557ed6f
Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25141
diff
changeset
|
1287 user = purple_buddy_get_protocol_data(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 if (user != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 if (user->mobile) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1292 { |
15822 | 1293 act = purple_menu_action_new(_("Send to Mobile"), |
1294 PURPLE_CALLBACK(show_send_to_mobile_cb), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1298 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1299 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
1300 if (g_ascii_strcasecmp(purple_buddy_get_name(buddy), |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
1301 purple_account_get_username(purple_buddy_get_account(buddy)))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 { |
15822 | 1303 act = purple_menu_action_new(_("Initiate _Chat"), |
1304 PURPLE_CALLBACK(initiate_chat_cb), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 static GList * |
15822 | 1313 msn_blist_node_menu(PurpleBlistNode *node) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1314 { |
15822 | 1315 if(PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 { |
15822 | 1317 return msn_buddy_menu((PurpleBuddy *) node); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 static void |
15822 | 1326 msn_login(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 { |
15822 | 1328 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 const char *username; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1331 const char *host; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 gboolean http_method = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 |
15822 | 1335 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 |
15822 | 1337 if (!purple_ssl_is_supported()) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 { |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31778
diff
changeset
|
1339 purple_connection_error(gc, |
21358 | 1340 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 _("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
|
1342 "SSL library.")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 |
15822 | 1346 http_method = purple_account_get_bool(account, "http_method", FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 |
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:
19719
diff
changeset
|
1348 if (http_method) |
20277
c37128d87d5a
Merged MSN_HTTPCONN_SERVER fix
Evan Schoenberg <evan.s@dreskin.net>
parents:
20044
diff
changeset
|
1349 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:
19719
diff
changeset
|
1350 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:
19719
diff
changeset
|
1351 host = purple_account_get_string(account, "server", MSN_SERVER); |
15822 | 1352 port = purple_account_get_int(account, "port", MSN_PORT); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1353 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 session = msn_session_new(account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1356 purple_connection_set_protocol_data(gc, session); |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32245
diff
changeset
|
1357 purple_connection_set_flags(gc, |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32245
diff
changeset
|
1358 PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO | PURPLE_CONNECTION_NO_BGCOLOR | |
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32245
diff
changeset
|
1359 PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 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
|
1362 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 /* Hmm, I don't like this. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 /* XXX shx: Me neither */ |
15822 | 1365 username = msn_normalize(account, purple_account_get_username(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 |
15822 | 1367 if (strcmp(username, purple_account_get_username(account))) |
1368 purple_account_set_username(account, username); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 |
28668
23f6f80f45ed
Due to a server change, the friendly name on MSN was being changed to the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28647
diff
changeset
|
1370 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:
28647
diff
changeset
|
1371 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:
28647
diff
changeset
|
1372 |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1373 if (purple_account_get_string(account, "endpoint-name", NULL) == NULL) { |
30726
8e765543dc8b
Don't hardcode "Pidgin" as the name of this endpoint. Instead, grab the
Mark Doliner <mark@kingant.net>
parents:
30722
diff
changeset
|
1374 GHashTable *ui_info = purple_core_get_ui_info(); |
8e765543dc8b
Don't hardcode "Pidgin" as the name of this endpoint. Instead, grab the
Mark Doliner <mark@kingant.net>
parents:
30722
diff
changeset
|
1375 const gchar *ui_name = ui_info ? g_hash_table_lookup(ui_info, "name") : NULL; |
8e765543dc8b
Don't hardcode "Pidgin" as the name of this endpoint. Instead, grab the
Mark Doliner <mark@kingant.net>
parents:
30722
diff
changeset
|
1376 purple_account_set_string(account, "endpoint-name", |
8e765543dc8b
Don't hardcode "Pidgin" as the name of this endpoint. Instead, grab the
Mark Doliner <mark@kingant.net>
parents:
30722
diff
changeset
|
1377 ui_name && *ui_name ? ui_name : PACKAGE_NAME); |
30685
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1378 } |
dd430f788bdc
Allow setting the name of the current location. The default is still Pidgin
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28668
diff
changeset
|
1379 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1380 if (!msn_session_connect(session, host, port, http_method)) |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31778
diff
changeset
|
1381 purple_connection_error(gc, |
21358 | 1382 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27137
diff
changeset
|
1383 _("Unable to connect")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1384 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1385 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1386 static void |
15822 | 1387 msn_close(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1388 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1389 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1390 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1391 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1392 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1393 g_return_if_fail(session != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1394 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1395 msn_session_destroy(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1396 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1397 purple_connection_set_protocol_data(gc, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1398 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1399 |
17061
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
1400 static gboolean |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
1401 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:
17054
diff
changeset
|
1402 { |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
1403 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:
17054
diff
changeset
|
1404 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:
17054
diff
changeset
|
1405 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:
17054
diff
changeset
|
1406 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:
17054
diff
changeset
|
1407 return FALSE; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
1408 } |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17054
diff
changeset
|
1409 |
22512
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
|
1410 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
|
1411 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
|
1412 { |
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
|
1413 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
|
1414 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
|
1415 |
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 (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
|
1417 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
|
1418 |
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
|
1419 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
|
1420 |
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
|
1421 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
|
1422 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
|
1423 |
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
|
1424 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
|
1425 |
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
|
1426 if (current) |
28068
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
1427 g_string_append_printf(current, "\t%s\t%s", emoticon->smile, strobj); |
22512
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
|
1428 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
|
1429 current = g_string_new(""); |
28068
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
1430 g_string_printf(current, "%s\t%s", emoticon->smile, strobj); |
22512
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
|
1431 } |
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
|
1432 |
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
|
1433 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
|
1434 |
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
|
1435 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
|
1436 } |
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
|
1437 |
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
|
1438 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
|
1439 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
|
1440 { |
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
|
1441 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
|
1442 |
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
|
1443 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
|
1444 |
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
|
1445 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
|
1446 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
|
1447 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
|
1448 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
|
1449 |
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
|
1450 msn_switchboard_send_msg(swboard, msg, TRUE); |
30952
b4285ea42b6e
msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <mark@kingant.net>
parents:
30951
diff
changeset
|
1451 msn_message_unref(msg); |
22512
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
|
1452 } |
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
|
1453 |
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
|
1454 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
|
1455 { |
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
|
1456 if (emoticon->obj) |
32028
60d879806964
Be a bit more specific about removing non-local MSN objects, which
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31996
diff
changeset
|
1457 msn_object_destroy(emoticon->obj, FALSE); |
22512
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
|
1458 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
|
1459 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
|
1460 } |
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
|
1461 |
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
|
1462 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
|
1463 { |
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
|
1464 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
|
1465 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
|
1466 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
|
1467 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
|
1468 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
|
1469 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
|
1470 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
|
1471 |
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
|
1472 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
|
1473 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
|
1474 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
|
1475 |
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
|
1476 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
|
1477 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
|
1478 |
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
|
1479 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
|
1480 |
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
|
1481 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
|
1482 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
|
1483 |
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
|
1484 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
|
1485 |
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
|
1486 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
|
1487 emoticon->smile = g_strdup(purple_smiley_get_shortcut(smiley)); |
28069
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:
28068
diff
changeset
|
1488 emoticon->ps = smiley; |
22512
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
|
1489 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
|
1490 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
|
1491 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
|
1492 |
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
|
1493 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
|
1494 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
|
1495 } |
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
|
1496 |
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
|
1497 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
|
1498 } |
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
|
1499 |
24207
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1500 void |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1501 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:
24197
diff
changeset
|
1502 { |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1503 MsnEmoticon *smile; |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1504 GSList *smileys; |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1505 GString *emoticons = NULL; |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1506 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:
24197
diff
changeset
|
1507 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:
24197
diff
changeset
|
1508 |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1509 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:
24197
diff
changeset
|
1510 while (smileys) { |
28069
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:
28068
diff
changeset
|
1511 smile = (MsnEmoticon *)smileys->data; |
24207
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1512 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:
24197
diff
changeset
|
1513 msn_emoticon_destroy(smile); |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1514 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:
24197
diff
changeset
|
1515 } |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1516 |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1517 if (emoticons) { |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1518 msn_send_emoticons(swboard, emoticons); |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1519 g_string_free(emoticons, TRUE); |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1520 } |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1521 |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1522 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:
24197
diff
changeset
|
1523 } |
fb722b8b4c74
attempts to resend message on switchboard error once, tested by maually
Ka-Hing Cheung <khc@hxbc.us>
parents:
24197
diff
changeset
|
1524 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1525 static int |
15822 | 1526 msn_send_im(PurpleConnection *gc, const char *who, const char *message, |
1527 PurpleMessageFlags flags) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1528 { |
15822 | 1529 PurpleAccount *account; |
32305
2ec94166be43
On the way to hiding the PurpleConnection struct.
andrew.victor@mxit.com
parents:
32245
diff
changeset
|
1530 PurpleBuddy *buddy = purple_find_buddy(purple_connection_get_account(gc), who); |
23488
8aa7e01bc4d5
An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23484
diff
changeset
|
1531 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:
23484
diff
changeset
|
1532 MsnSwitchBoard *swboard; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1533 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1534 char *msgformat; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1535 char *msgtext; |
25418
b0c75121cf66
After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25412
diff
changeset
|
1536 size_t msglen; |
22512
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
|
1537 const char *username; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1538 |
23672
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
1539 purple_debug_info("msn", "send IM {%s} to %s\n", message, who); |
15822 | 1540 account = purple_connection_get_account(gc); |
22512
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
|
1541 username = purple_account_get_username(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1542 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1543 session = purple_connection_get_protocol_data(gc); |
23488
8aa7e01bc4d5
An MSN patch from Masca to check if there's a SB available before
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23484
diff
changeset
|
1544 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:
23484
diff
changeset
|
1545 |
24197
eeccedae4de5
Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24048
diff
changeset
|
1546 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:
24048
diff
changeset
|
1547 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:
24048
diff
changeset
|
1548 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:
24048
diff
changeset
|
1549 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:
24048
diff
changeset
|
1550 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:
24048
diff
changeset
|
1551 } |
eeccedae4de5
Patch from Maiku to allow replying to a mobile contact that isn't on
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24048
diff
changeset
|
1552 |
15540
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:
15462
diff
changeset
|
1553 if (buddy) { |
15822 | 1554 PurplePresence *p = purple_buddy_get_presence(buddy); |
1555 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { | |
1556 char *text = purple_markup_strip_html(message); | |
15540
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:
15462
diff
changeset
|
1557 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:
15462
diff
changeset
|
1558 g_free(text); |
15590
1d0d25848c5d
Get rid of a minor compile warning
Mark Doliner <mark@kingant.net>
parents:
15540
diff
changeset
|
1559 return 1; |
15540
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:
15462
diff
changeset
|
1560 } |
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:
15462
diff
changeset
|
1561 } |
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:
15462
diff
changeset
|
1562 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1563 msn_import_html(message, &msgformat, &msgtext); |
25418
b0c75121cf66
After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25412
diff
changeset
|
1564 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:
25412
diff
changeset
|
1565 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:
25412
diff
changeset
|
1566 /* 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:
25412
diff
changeset
|
1567 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:
25412
diff
changeset
|
1568 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:
25412
diff
changeset
|
1569 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:
25412
diff
changeset
|
1570 |
b0c75121cf66
After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25412
diff
changeset
|
1571 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:
25412
diff
changeset
|
1572 } |
b0c75121cf66
After parsing the message text for HTML formatting, don't try to send it if
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25412
diff
changeset
|
1573 |
32533
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1574 if (msglen + strlen(msgformat) + strlen(VERSION) > 1564) |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1575 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1576 g_free(msgformat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1577 g_free(msgtext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1578 |
32533
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1579 return -E2BIG; |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1580 } |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1581 |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1582 msg = msn_message_new_plain(msgtext); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1583 msg->remote_user = g_strdup(who); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1584 msn_message_set_header(msg, "X-MMS-IM-Format", msgformat); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1585 |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1586 g_free(msgformat); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1587 g_free(msgtext); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1588 |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1589 purple_debug_info("msn", "prepare to send online Message\n"); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1590 if (g_ascii_strcasecmp(who, username)) |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1591 { |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1592 if (flags & PURPLE_MESSAGE_AUTO_RESP) { |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1593 msn_message_set_flag(msg, 'U'); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1594 } |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1595 |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1596 if (msn_user_is_yahoo(account, who) || !(msn_user_is_online(account, who) || swboard != NULL)) { |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1597 /*we send the online and offline Message to Yahoo User via UBM*/ |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1598 purple_debug_info("msn", "send to Yahoo User\n"); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1599 msn_notification_send_uum(session, msg); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1600 } else { |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1601 purple_debug_info("msn", "send via switchboard\n"); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1602 msn_send_im_message(session, msg); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
1603 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1604 } |
32533
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1605 else |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1606 { |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1607 char *body_str, *body_enc, *pre, *post; |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1608 const char *format; |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1609 MsnIMData *imdata = g_new0(MsnIMData, 1); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1610 /* |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1611 * In MSN, you can't send messages to yourself, so |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1612 * we'll fake like we received it ;) |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1613 */ |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1614 body_str = msn_message_to_string(msg); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1615 body_enc = g_markup_escape_text(body_str, -1); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1616 g_free(body_str); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1617 |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1618 format = msn_message_get_header_value(msg, "X-MMS-IM-Format"); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1619 msn_parse_format(format, &pre, &post); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1620 body_str = g_strdup_printf("%s%s%s", pre ? pre : "", |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1621 body_enc ? body_enc : "", post ? post : ""); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1622 g_free(body_enc); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1623 g_free(pre); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1624 g_free(post); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1625 |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1626 serv_got_typing_stopped(gc, who); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1627 imdata->gc = gc; |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1628 imdata->who = who; |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1629 imdata->msg = body_str; |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1630 imdata->flags = flags & ~PURPLE_MESSAGE_SEND; |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1631 imdata->when = time(NULL); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1632 purple_timeout_add(0, msn_send_me_im, imdata); |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1633 } |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1634 |
e091c8ea292e
Pluck all MSNP18 changes. This is pretty much to fix sending OIMs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31778
diff
changeset
|
1635 msn_message_unref(msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1636 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1637 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1638 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1639 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1640 static unsigned int |
15822 | 1641 msn_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1642 { |
15822 | 1643 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1645 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1646 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1647 |
15822 | 1648 account = purple_connection_get_account(gc); |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1649 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1650 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1651 /* |
15822 | 1652 * TODO: I feel like this should be "if (state != PURPLE_TYPING)" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1653 * 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
|
1654 * anything. --KingAnt |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1655 */ |
15822 | 1656 if (state == PURPLE_NOT_TYPING) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1657 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1658 |
15822 | 1659 if (!g_ascii_strcasecmp(who, purple_account_get_username(account))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1660 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1661 /* We'll just fake it, since we're sending to ourself. */ |
15822 | 1662 serv_got_typing(gc, who, MSN_TYPING_RECV_TIMEOUT, PURPLE_TYPING); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1663 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1664 return MSN_TYPING_SEND_TIMEOUT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1665 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1666 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1667 swboard = msn_session_find_swboard(session, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1668 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1669 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
|
1670 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1671 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1672 swboard->flag |= MSN_SB_FLAG_IM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1673 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1674 msg = msn_message_new(MSN_MSG_TYPING); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1675 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
|
1676 msn_message_set_flag(msg, 'U'); |
30694
33b4ae796648
Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents:
30692
diff
changeset
|
1677 msn_message_set_header(msg, "TypingUser", |
15822 | 1678 purple_account_get_username(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1679 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
|
1680 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1681 msn_switchboard_send_msg(swboard, msg, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1682 |
30952
b4285ea42b6e
msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <mark@kingant.net>
parents:
30951
diff
changeset
|
1683 msn_message_unref(msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1684 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1685 return MSN_TYPING_SEND_TIMEOUT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1686 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1687 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1688 static void |
15822 | 1689 msn_set_status(PurpleAccount *account, PurpleStatus *status) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1690 { |
15822 | 1691 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1692 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1693 |
15822 | 1694 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1695 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1696 if (gc != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1697 { |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1698 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1699 msn_change_status(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1700 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1701 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1702 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1703 static void |
15822 | 1704 msn_set_idle(PurpleConnection *gc, int idle) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1705 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1706 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1707 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1708 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1709 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1710 msn_change_status(session); |
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 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1713 /* |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1714 * 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:
25542
diff
changeset
|
1715 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1716 static void |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1717 add_pending_buddy(MsnSession *session, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1718 const char *who, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1719 MsnNetwork network, |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1720 MsnUser *user) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 { |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1722 char *group; |
31263
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1723 MsnUserList *userlist; |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1724 MsnUser *user2; |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1725 |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1726 g_return_if_fail(user != NULL); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1727 |
31263
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1728 if (network == MSN_NETWORK_UNKNOWN) { |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1729 purple_debug_error("msn", "Network in FQY response was unknown. " |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1730 "Assuming %s is a passport user and adding anyway.\n", who); |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1731 network = MSN_NETWORK_PASSPORT; |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1732 } |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1733 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1734 group = msn_user_remove_pending_group(user); |
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1735 |
31263
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1736 userlist = session->userlist; |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1737 user2 = msn_userlist_find_user(userlist, who); |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1738 if (user2 != NULL) { |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1739 /* User already in userlist, so just update it. */ |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1740 msn_user_unref(user); |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1741 user = user2; |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1742 } else { |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1743 msn_userlist_add_user(userlist, user); |
30741
417899347f8a
Remove msn_user_destroy in favor of msn_user_unref.
masca@cpw.pidgin.im
parents:
30735
diff
changeset
|
1744 msn_user_unref(user); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 } |
31263
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1746 |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1747 msn_user_set_network(user, network); |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1748 msn_userlist_add_buddy(userlist, who, group); |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1749 |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1750 g_free(group); |
15373
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 |
31400
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1754 msn_add_buddy(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group, const char *message) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1755 { |
27395
d375ef85519f
Add some checks before attempting to add a buddy on MSN. Also, if the FQY
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27381
diff
changeset
|
1756 PurpleAccount *account; |
31400
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1757 const char *bname, *gname; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1759 MsnUserList *userlist; |
24723
f3950234b164
If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24677
diff
changeset
|
1760 MsnUser *user; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1761 |
27488
3698c7f4d803
On MSN, pop up an "invite message" request similar to oscar, and send that
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27482
diff
changeset
|
1762 account = purple_connection_get_account(pc); |
31400
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1763 session = purple_connection_get_protocol_data(pc); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1764 bname = purple_buddy_get_name(buddy); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1765 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1766 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1767 { |
15822 | 1768 purple_debug_error("msn", "msn_add_buddy called before connected\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1769 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1770 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1771 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1772 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1773 /* 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
|
1774 * shx: Yes it should; MSN handles non-grouped buddies, and this is only |
31263
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1775 * internal. |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1776 * KingAnt: But PurpleBuddys must always exist inside PurpleGroups, so |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1777 * won't group always be non-NULL here? |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1778 */ |
31400
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1779 bname = msn_normalize(account, bname); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1780 gname = group ? purple_group_get_name(group) : NULL; |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1781 purple_debug_info("msn", "Add user:%s to group:%s\n", |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1782 bname, gname ? gname : "(null)"); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1783 |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1784 if (!msn_email_is_valid(bname)) { |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1785 gchar *buf; |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1786 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be valid email addresses."), bname); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1787 if (!purple_conv_present_error(bname, account, buf)) |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1788 purple_notify_error(pc, NULL, _("Unable to Add"), buf); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1789 g_free(buf); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1790 |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1791 /* Remove from local list */ |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1792 purple_blist_remove_buddy(buddy); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1793 |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1794 return; |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1795 } |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1796 |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1797 /* Make sure name is normalized */ |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1798 purple_blist_rename_buddy(buddy, bname); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1799 |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1800 userlist = session->userlist; |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1801 user = msn_userlist_find_user(userlist, bname); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1802 if (user && user->authorized) { |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1803 message = NULL; |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1804 } |
24723
f3950234b164
If the MSN user is in the userlist already, then check whether we know the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24677
diff
changeset
|
1805 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:
24677
diff
changeset
|
1806 /* 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:
24677
diff
changeset
|
1807 what to do with users already in the list and stuff... */ |
31400
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1808 msn_user_set_invite_message(user, message); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1809 msn_userlist_add_buddy(userlist, bname, gname); |
24518
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:
24511
diff
changeset
|
1810 } else { |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25418
diff
changeset
|
1811 char **tokens; |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25418
diff
changeset
|
1812 char *fqy; |
24518
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:
24511
diff
changeset
|
1813 /* We need to check the network for this buddy first */ |
31400
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1814 user = msn_user_new(userlist, bname, NULL); |
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1815 msn_user_set_invite_message(user, message); |
27063
4c651771840d
Add a data parameter for FQY callbacks and remove the pending users list
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27062
diff
changeset
|
1816 msn_user_set_pending_group(user, gname); |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1817 msn_user_set_network(user, MSN_NETWORK_UNKNOWN); |
31316
f3d11c84cc03
Add a little note about something that nobody cares about
Mark Doliner <mark@kingant.net>
parents:
31273
diff
changeset
|
1818 /* Should probably re-use the msn_add_contact_xml function here */ |
31400
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
1819 tokens = g_strsplit(bname, "@", 2); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25418
diff
changeset
|
1820 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:
25418
diff
changeset
|
1821 tokens[1], |
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25418
diff
changeset
|
1822 tokens[0]); |
31263
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1823 /* TODO: I think user will leak if we disconnect before receiving |
8fc25b77295a
Hopefully fixes #13298, the bug about not being able to add MSN buddies.
Mark Doliner <mark@kingant.net>
parents:
31262
diff
changeset
|
1824 a response to this FQY request */ |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25418
diff
changeset
|
1825 msn_notification_send_fqy(session, fqy, strlen(fqy), |
25633
c384d62009c0
*** Plucked rev b932d4f94f9c771877b6a8a6a1d7dd3ea9c08005 (qulogic@pidgin.im):
Ka-Hing Cheung <khc@hxbc.us>
parents:
25542
diff
changeset
|
1826 (MsnFqyCb)add_pending_buddy, user); |
25542
fd5eedf131b4
Generalize the FQY command so it can be used by different callbacks based
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25418
diff
changeset
|
1827 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:
25418
diff
changeset
|
1828 g_strfreev(tokens); |
24518
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:
24511
diff
changeset
|
1829 } |
15373
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 |
15822 | 1833 msn_rem_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1834 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1835 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1836 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1837 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1838 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1839 userlist = session->userlist; |
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 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1843 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1844 /* XXX - Does buddy->name need to be msn_normalize'd here? --KingAnt */ |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
1845 msn_userlist_rem_buddy(userlist, purple_buddy_get_name(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1847 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 static void |
15822 | 1849 msn_add_permit(PurpleConnection *gc, const char *who) |
15373
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 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1852 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1855 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1856 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1857 user = msn_userlist_find_user(userlist, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1858 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1859 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1861 |
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
|
1862 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
|
1863 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1864 |
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
|
1865 /* delete contact from Block list and add it to Allow in the callback */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23456
diff
changeset
|
1866 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
|
1867 } 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
|
1868 /* just add the contact to Allow list */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23456
diff
changeset
|
1869 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
|
1870 } |
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
|
1871 |
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
|
1872 |
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
|
1873 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1874 } |
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 static void |
15822 | 1877 msn_add_deny(PurpleConnection *gc, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1879 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1882 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1883 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1884 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1885 user = msn_userlist_find_user(userlist, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 |
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
|
1890 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
|
1891 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1892 |
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
|
1893 /* delete contact from Allow list and add it to Block in the callback */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23456
diff
changeset
|
1894 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
|
1895 } 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
|
1896 /* just add the contact to Block list */ |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23456
diff
changeset
|
1897 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
|
1898 } |
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
|
1899 |
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
|
1900 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1901 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1902 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1903 static void |
15822 | 1904 msn_rem_permit(PurpleConnection *gc, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1905 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1906 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1907 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1908 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1909 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1910 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1911 userlist = session->userlist; |
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 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1914 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1915 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1916 user = msn_userlist_find_user(userlist, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1917 |
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
|
1918 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23456
diff
changeset
|
1920 msn_del_contact_from_list(session, NULL, who, MSN_LIST_AL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1921 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1922 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
|
1923 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1924 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1925 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1926 static void |
15822 | 1927 msn_rem_deny(PurpleConnection *gc, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1928 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1929 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1930 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1931 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1932 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1933 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1934 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1935 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1936 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1937 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1938 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1939 user = msn_userlist_find_user(userlist, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1940 |
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
|
1941 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 |
23459
69af5301e1a7
killing MsnContact which just wraps MsnSession
Ka-Hing Cheung <khc@hxbc.us>
parents:
23456
diff
changeset
|
1943 msn_del_contact_from_list(session, NULL, who, MSN_LIST_BL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 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
|
1946 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1948 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1949 static void |
15822 | 1950 msn_set_permit_deny(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1951 { |
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
|
1952 msn_send_privacy(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1953 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1954 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1955 static void |
15822 | 1956 msn_chat_invite(PurpleConnection *gc, int id, const char *msg, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 const char *who) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1958 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1962 session = purple_connection_get_protocol_data(gc); |
15373
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 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
|
1965 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1966 if (swboard == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1967 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1968 /* 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
|
1969 swboard = msn_switchboard_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1970 msn_switchboard_request(swboard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1971 swboard->chat_id = id; |
15822 | 1972 swboard->conv = purple_find_chat(gc, id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1973 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1975 swboard->flag |= MSN_SB_FLAG_IM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1976 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 msn_switchboard_request_add_user(swboard, who); |
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 static void |
15822 | 1981 msn_chat_leave(PurpleConnection *gc, int id) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1982 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1983 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 MsnSwitchBoard *swboard; |
15822 | 1985 PurpleConversation *conv; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
1987 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1989 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
|
1990 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 /* 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
|
1992 if (swboard == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1993 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1994 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1995 conv = swboard->conv; |
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 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
|
1998 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1999 /* 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
|
2000 * 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
|
2001 if (conv != NULL) |
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 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
|
2004 swboard->conv = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2005 } |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2008 static int |
15822 | 2009 msn_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2010 { |
15822 | 2011 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2012 MsnSession *session; |
28068
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2013 const char *username; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2014 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2015 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2016 char *msgformat; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2017 char *msgtext; |
28067
ea7e54c4d7fd
Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
2018 size_t msglen; |
28068
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2019 MsnEmoticon *smile; |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2020 GSList *smileys; |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2021 GString *emoticons = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2022 |
15822 | 2023 account = purple_connection_get_account(gc); |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
2024 session = purple_connection_get_protocol_data(gc); |
28068
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2025 username = purple_account_get_username(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2026 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
|
2027 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2028 if (swboard == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2029 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2030 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2031 if (!swboard->ready) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2032 return 0; |
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 swboard->flag |= MSN_SB_FLAG_IM; |
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 msn_import_html(message, &msgformat, &msgtext); |
28067
ea7e54c4d7fd
Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
2037 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:
28064
diff
changeset
|
2038 |
ea7e54c4d7fd
Check for empty messages before sending them in chats. This is the same
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28064
diff
changeset
|
2039 if ((msglen == 0) || (msglen + strlen(msgformat) + strlen(VERSION) > 1564)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2041 g_free(msgformat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2042 g_free(msgtext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2043 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2044 return -E2BIG; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2047 msg = msn_message_new_plain(msgtext); |
30694
33b4ae796648
Rename "attribute" to "header" in a bunch of places. The SLP protocol
Mark Doliner <mark@kingant.net>
parents:
30692
diff
changeset
|
2048 msn_message_set_header(msg, "X-MMS-IM-Format", msgformat); |
28068
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2049 |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2050 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:
28067
diff
changeset
|
2051 while (smileys) { |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2052 smile = (MsnEmoticon *)smileys->data; |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2053 emoticons = msn_msg_emoticon_add(emoticons, smile); |
28069
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:
28068
diff
changeset
|
2054 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:
28068
diff
changeset
|
2055 "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:
28068
diff
changeset
|
2056 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:
28068
diff
changeset
|
2057 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:
28068
diff
changeset
|
2058 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:
28068
diff
changeset
|
2059 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:
28068
diff
changeset
|
2060 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:
28068
diff
changeset
|
2061 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:
28068
diff
changeset
|
2062 } |
28068
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2063 msn_emoticon_destroy(smile); |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2064 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:
28067
diff
changeset
|
2065 } |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2066 |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2067 if (emoticons) { |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2068 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:
28067
diff
changeset
|
2069 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:
28067
diff
changeset
|
2070 } |
afe6ce7cc64f
Send proper emoticon messages in MSN chats. Apparently, this never worked
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
28067
diff
changeset
|
2071 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2072 msn_switchboard_send_msg(swboard, msg, FALSE); |
30952
b4285ea42b6e
msn_message_destroy() calls msn_message_unref() if refcount>0. This is
Mark Doliner <mark@kingant.net>
parents:
30951
diff
changeset
|
2073 msn_message_unref(msg); |
15373
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 g_free(msgformat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2076 g_free(msgtext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2077 |
23152
caa533b62902
When calling serv_got_chat_in() after sending a group chat message (to let
Evan Schoenberg <evan.s@dreskin.net>
parents:
23142
diff
changeset
|
2078 serv_got_chat_in(gc, id, purple_account_get_username(account), flags, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2079 message, time(NULL)); |
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 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2082 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 static void |
15822 | 2085 msn_keepalive(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2086 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2087 MsnSession *session; |
30710
f7ee91763c6b
msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
masca@cpw.pidgin.im
parents:
30709
diff
changeset
|
2088 MsnTransaction *trans; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2089 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
2090 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2091 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2092 if (!session->http_method) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2093 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2094 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2096 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2097 |
30711
54c8aeecab4c
We need a way to send commands without transaction ID
masca@cpw.pidgin.im
parents:
30710
diff
changeset
|
2098 trans = msn_transaction_new(cmdproc, "PNG", NULL); |
30716
c316749944c1
I don't really like this name.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30715
diff
changeset
|
2099 msn_transaction_set_saveable(trans, FALSE); |
30710
f7ee91763c6b
msn: Remove msn_cmdproc_send_quick in favor of msn_cmdproc_send_trans
masca@cpw.pidgin.im
parents:
30709
diff
changeset
|
2100 msn_cmdproc_send_trans(cmdproc, trans); |
15373
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2103 |
23472
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23464
diff
changeset
|
2104 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:
23464
diff
changeset
|
2105 { |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23464
diff
changeset
|
2106 MsnSession *session; |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23464
diff
changeset
|
2107 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
2108 session = purple_connection_get_protocol_data(pc); |
23472
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23464
diff
changeset
|
2109 |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23464
diff
changeset
|
2110 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:
23464
diff
changeset
|
2111 } |
70de4e2246ec
Add real server-side aliasing to MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23464
diff
changeset
|
2112 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2113 static void |
15822 | 2114 msn_group_buddy(PurpleConnection *gc, const char *who, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2115 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
|
2116 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2117 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
2120 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2121 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2122 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 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
|
2124 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2125 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2126 static void |
15822 | 2127 msn_rename_group(PurpleConnection *gc, const char *old_name, |
2128 PurpleGroup *group, GList *moved_buddies) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2130 MsnSession *session; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2131 const char *gname; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2132 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
2133 session = purple_connection_get_protocol_data(gc); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
23180
diff
changeset
|
2134 |
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
|
2135 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
|
2136 g_return_if_fail(session->userlist != NULL); |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
23180
diff
changeset
|
2137 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2138 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
|
2139 if (msn_userlist_find_group_with_name(session->userlist, old_name) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2140 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2141 msn_contact_rename_group(session, old_name, gname); |
15373
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2144 { |
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
|
2145 /* not found */ |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2146 msn_add_group(session, NULL, gname); |
15373
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2149 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2150 static void |
15822 | 2151 msn_convo_closed(PurpleConnection *gc, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2152 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2154 MsnSwitchBoard *swboard; |
15822 | 2155 PurpleConversation *conv; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
2157 session = purple_connection_get_protocol_data(gc); |
15373
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 swboard = msn_session_find_swboard(session, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2161 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2162 * 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
|
2163 * 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
|
2164 * is talking to himself. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 if (swboard == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2167 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2168 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2169 conv = swboard->conv; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2170 |
17198
d63075ed73c9
When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
17164
diff
changeset
|
2171 /* 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:
17164
diff
changeset
|
2172 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:
17164
diff
changeset
|
2173 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:
17164
diff
changeset
|
2174 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:
17164
diff
changeset
|
2175 /* 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:
17164
diff
changeset
|
2176 swboard->conv = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2177 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 /* 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
|
2179 * 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
|
2180 if (conv != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2181 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2182 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
|
2183 swboard->conv = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2187 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
|
2188 msn_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2190 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2191 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
2193 session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2194 user = session->user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2195 |
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
|
2196 msn_user_set_buddy_icon(user, img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2198 msn_change_status(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2199 } |
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 static void |
15822 | 2202 msn_remove_group(PurpleConnection *gc, PurpleGroup *group) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2203 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2204 MsnSession *session; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2205 const char *gname; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2206 |
31996
b48dfbb514d3
Convert msn prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
andrew.victor@mxit.com
parents:
31963
diff
changeset
|
2207 session = purple_connection_get_protocol_data(gc); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2208 gname = purple_group_get_name(group); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2209 |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2210 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:
15822
diff
changeset
|
2211 /*we can't delete the default group*/ |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2212 if(!strcmp(gname, MSN_INDIVIDUALS_GROUP_NAME)|| |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2213 !strcmp(gname, MSN_NON_IM_GROUP_NAME)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2214 { |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23505
diff
changeset
|
2215 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:
15822
diff
changeset
|
2216 return ; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 } |
23298
5cdd93dac7a2
Delete trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
23180
diff
changeset
|
2218 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2219 msn_del_group(session, gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2220 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2221 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2222 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2223 * 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
|
2224 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2225 static gboolean |
15822 | 2226 msn_tooltip_extract_info_text(PurpleNotifyUserInfo *user_info, MsnGetInfoData *info_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2227 { |
15822 | 2228 PurpleBuddy *b; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2229 |
15822 | 2230 b = purple_find_buddy(purple_connection_get_account(info_data->gc), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2231 info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2232 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2233 if (b) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2234 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2235 char *tmp; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2236 const char *alias; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2237 |
25803
8aa7d8bcbc7d
Alias foo. I think blist.h structs are now completely hidden.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25799
diff
changeset
|
2238 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:
25799
diff
changeset
|
2239 if (alias && alias[0]) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2240 { |
31361
0123c69ec0e5
Add a purple_notify_user_info_add_pair_plaintext function that accepts a
Mark Doliner <mark@kingant.net>
parents:
30005
diff
changeset
|
2241 purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2242 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2243 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2244 if ((alias = purple_buddy_get_server_alias(b)) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2245 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24048
diff
changeset
|
2246 char *nicktext = g_markup_escape_text(alias, -1); |
24667
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24506
diff
changeset
|
2247 tmp = g_strdup_printf("<font sml=\"msn\">%s</font>", nicktext); |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2248 purple_notify_user_info_add_pair_html(user_info, _("Nickname"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2249 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2250 g_free(nicktext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2251 } |
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 /* Add the tooltip information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2254 msn_tooltip_text(b, user_info, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2256 return TRUE; |
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 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2260 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2261 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2262 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2263 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2264 static char * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2265 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
|
2266 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2267 char *p, *q; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2268 |
20425
5048651671e1
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents:
20422
diff
changeset
|
2269 if ((p = strstr(url_text, PHOTO_URL)) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2270 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
2271 p += strlen(PHOTO_URL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2272 } |
23672
5aba1f0f36b0
Fix up some whitespace problems.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23628
diff
changeset
|
2273 if (p && (strncmp(p, "http://", strlen("http://")) == 0) && ((q = strchr(p, '"')) != NULL)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2274 return g_strndup(p, q - p); |
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 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2277 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2278 |
15822 | 2279 static void msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer data, |
23484
46d8edad1647
Fix up a typo between the declaration and definition of msn_got_photo.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23479
diff
changeset
|
2280 const gchar *url_text, gsize len, const gchar *error_message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2282 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2283 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2284 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2285 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
|
2286 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2287 char *tmp = g_strndup(field, len); |
15822 | 2288 time_t t = purple_str_to_time(tmp, FALSE, NULL, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2289 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2290 g_free(tmp); |
15822 | 2291 return g_strdup(purple_date_format_short(localtime(&t))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2292 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2293 #endif |
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 #define MSN_GOT_INFO_GET_FIELD(a, b) \ |
15822 | 2296 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2297 "\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
|
2298 if (found) \ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2299 sect_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2300 |
17442
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2301 #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:
17198
diff
changeset
|
2302 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:
17198
diff
changeset
|
2303 "\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:
17198
diff
changeset
|
2304 if (found) \ |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2305 sect_info = TRUE; |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2306 |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2307 static char * |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2308 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:
17198
diff
changeset
|
2309 { |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2310 const char *c; |
20554 | 2311 if ((c = strstr(field, " (http://")) == NULL) |
17442
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2312 return g_strndup(field, len); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2313 return g_strndup(field, c - field); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2314 } |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2315 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2316 static void |
15822 | 2317 msn_got_info(PurpleUtilFetchUrlData *url_data, gpointer data, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2318 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
|
2319 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2320 MsnGetInfoData *info_data = (MsnGetInfoData *)data; |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2321 MsnSession *session; |
15822 | 2322 PurpleNotifyUserInfo *user_info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2323 char *stripped, *p, *q, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2324 char *user_url = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2325 gboolean found; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2326 gboolean has_tooltip_text = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2327 gboolean has_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2328 gboolean sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2329 gboolean has_contact_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2330 char *url_buffer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2331 int stripped_len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2332 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2333 char *photo_url_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2334 MsnGetInfoStepTwoData *info2_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2335 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2336 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
2337 purple_debug_info("msn", "In msn_got_info,url_text:{%s}\n",url_text); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2338 |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2339 session = purple_connection_get_protocol_data(info_data->gc); |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2340 session->url_datas = g_slist_remove(session->url_datas, url_data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2341 |
15822 | 2342 user_info = purple_notify_user_info_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2343 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
|
2344 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2345 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
|
2346 { |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2347 purple_notify_user_info_add_pair_html(user_info, |
24667
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24506
diff
changeset
|
2348 _("Error retrieving profile"), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2349 |
15822 | 2350 purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); |
2351 purple_notify_user_info_destroy(user_info); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2352 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2353 g_free(info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2354 g_free(info_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2355 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2356 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2357 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2358 url_buffer = g_strdup(url_text); |
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 /* If they have a homepage link, MSN masks it such that we need to |
15822 | 2361 * fetch the url out before purple_markup_strip_html() nukes it */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2362 /* 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
|
2363 if ((p = strstr(url_text, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2364 "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
|
2365 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2366 p += 50; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 if ((q = strchr(p, '"')) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 user_url = g_strndup(p, q - p); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2371 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2372 /* |
15822 | 2373 * purple_markup_strip_html() doesn't strip out character entities like |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 * and · |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2375 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2376 while ((p = strstr(url_buffer, " ")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2377 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2378 *p = ' '; /* Turn 's into ordinary blanks */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2379 p += 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2380 memmove(p, p + 5, strlen(p + 5)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2381 url_buffer[strlen(url_buffer) - 5] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2383 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 while ((p = strstr(url_buffer, "·")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2385 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 memmove(p, p + 6, strlen(p + 6)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 url_buffer[strlen(url_buffer) - 6] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2388 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2389 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2390 /* Nuke the nasty \r's that just get in the way */ |
15822 | 2391 purple_str_strip_char(url_buffer, '\r'); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2392 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2393 /* MSN always puts in ' for apostrophes...replace them */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2394 while ((p = strstr(url_buffer, "'")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2395 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 *p = '\''; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 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
|
2398 url_buffer[strlen(url_buffer) - 4] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2399 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2400 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 /* Nuke the html, it's easier than trying to parse the horrid stuff */ |
15822 | 2402 stripped = purple_markup_strip_html(url_buffer); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 stripped_len = strlen(stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2404 |
15822 | 2405 purple_debug_misc("msn", "stripped = %p\n", stripped); |
2406 purple_debug_misc("msn", "url_buffer = %p\n", url_buffer); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2408 /* General section header */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2409 if (has_tooltip_text) |
15822 | 2410 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:
19719
diff
changeset
|
2411 |
15822 | 2412 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:
19719
diff
changeset
|
2413 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2414 /* Extract their Name and put it in */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2415 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:
19719
diff
changeset
|
2416 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2417 /* General */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2418 MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname")); |
17442
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2419 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Age", _("Age")); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2420 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Gender", _("Gender")); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2421 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Occupation", _("Occupation")); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2422 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Location", _("Location")); |
15373
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 /* Extract their Interests and put it in */ |
15822 | 2425 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2426 "\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
|
2427 "Undisclosed", _("Hobbies and Interests") /* _("Interests") */, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2428 0, NULL, NULL); |
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 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2431 sect_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2432 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2433 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:
19719
diff
changeset
|
2434 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2435 if (sect_info) |
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 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2438 sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2439 } |
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:
19719
diff
changeset
|
2440 else |
15373
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 /* Remove the section header */ |
15822 | 2443 purple_notify_user_info_remove_last_item(user_info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2444 if (has_tooltip_text) |
15822 | 2445 purple_notify_user_info_remove_last_item(user_info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2446 } |
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:
19719
diff
changeset
|
2447 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2448 /* Social */ |
15822 | 2449 purple_notify_user_info_add_section_break(user_info); |
2450 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:
19719
diff
changeset
|
2451 |
22444
616a76954a97
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents:
22259
diff
changeset
|
2452 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
|
2453 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
|
2454 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
|
2455 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Hometown", _("Hometown")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2456 MSN_GOT_INFO_GET_FIELD("Places lived", _("Places Lived")); |
22444
616a76954a97
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents:
22259
diff
changeset
|
2457 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
|
2458 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
|
2459 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
|
2460 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Favorite quote", _("Favorite Quote")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2461 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2462 if (sect_info) |
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 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2465 sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2466 } |
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:
19719
diff
changeset
|
2467 else |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2468 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2469 /* Remove the section header */ |
15822 | 2470 purple_notify_user_info_remove_last_item(user_info); |
2471 purple_notify_user_info_remove_last_item(user_info); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2472 } |
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 /* Contact Info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2475 /* Personal */ |
15822 | 2476 purple_notify_user_info_add_section_break(user_info); |
2477 purple_notify_user_info_add_section_header(user_info, _("Contact Info")); | |
2478 purple_notify_user_info_add_section_header(user_info, _("Personal")); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2480 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2481 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
|
2482 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
|
2483 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
|
2484 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
|
2485 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
|
2486 MSN_GOT_INFO_GET_FIELD("Home fax", _("Home Fax")); |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23152
diff
changeset
|
2487 MSN_GOT_INFO_GET_FIELD("Personal email", _("Personal Email")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2488 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
|
2489 MSN_GOT_INFO_GET_FIELD("Birthday", _("Birthday")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2490 MSN_GOT_INFO_GET_FIELD("Anniversary", _("Anniversary")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2491 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes")); |
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 (sect_info) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2494 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2495 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2496 sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2497 has_contact_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2498 } |
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:
19719
diff
changeset
|
2499 else |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2500 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2501 /* Remove the section header */ |
15822 | 2502 purple_notify_user_info_remove_last_item(user_info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2503 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2504 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2505 /* Business */ |
15822 | 2506 purple_notify_user_info_add_section_header(user_info, _("Work")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2507 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2508 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
|
2509 MSN_GOT_INFO_GET_FIELD("Company", _("Company")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2510 MSN_GOT_INFO_GET_FIELD("Department", _("Department")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2511 MSN_GOT_INFO_GET_FIELD("Profession", _("Profession")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2512 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
|
2513 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
|
2514 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
|
2515 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
|
2516 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
|
2517 MSN_GOT_INFO_GET_FIELD("Work fax", _("Work Fax")); |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23152
diff
changeset
|
2518 MSN_GOT_INFO_GET_FIELD("Work email", _("Work Email")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2519 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
|
2520 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
|
2521 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2522 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2523 if (sect_info) |
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 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2526 sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2527 has_contact_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2528 } |
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:
19719
diff
changeset
|
2529 else |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2530 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2531 /* Remove the section header */ |
15822 | 2532 purple_notify_user_info_remove_last_item(user_info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2533 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2534 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2535 if (!has_contact_info) |
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 /* Remove the Contact Info section header */ |
15822 | 2538 purple_notify_user_info_remove_last_item(user_info); |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2541 #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
|
2542 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2543 * 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
|
2544 * 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
|
2545 * 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
|
2546 * 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
|
2547 * distinct values. |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2550 /* Check if they have A Little About Me */ |
15822 | 2551 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2552 " 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
|
2553 _("A Little About Me"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2554 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2555 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2556 { |
15822 | 2557 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2558 " 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
|
2559 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
|
2560 } |
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 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2563 { |
15822 | 2564 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2565 " 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
|
2566 _("A Little About Me"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2567 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2568 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2569 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2570 { |
15822 | 2571 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2572 " 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
|
2573 '\n', |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2574 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
|
2575 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2577 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2578 { |
15822 | 2579 purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2580 " 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
|
2581 _("A Little About Me"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2582 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2583 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2584 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2585 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2586 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2587 /* Check if they have Favorite Things */ |
15822 | 2588 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2589 " 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
|
2590 _("Favorite Things"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2591 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2592 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2593 { |
15822 | 2594 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2595 " 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
|
2596 _("Favorite Things"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2597 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2598 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2599 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2600 { |
15822 | 2601 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2602 " 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
|
2603 NULL, _("Favorite Things"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2604 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2605 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2606 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2607 { |
15822 | 2608 purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2609 " 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
|
2610 _("Favorite Things"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2611 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2612 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2613 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2614 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2615 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2616 /* Check if they have Hobbies and Interests */ |
15822 | 2617 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2618 " 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
|
2619 _("Hobbies and Interests"), 0, NULL, 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 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2622 { |
15822 | 2623 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2624 " 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
|
2625 '\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
|
2626 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2627 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2628 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2629 { |
15822 | 2630 purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2631 " 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
|
2632 _("Hobbies and Interests"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2633 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2634 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2635 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2636 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2637 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2638 /* Check if they have Favorite Quote */ |
15822 | 2639 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2640 "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
|
2641 _("Favorite Quote"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2642 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2643 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2644 { |
15822 | 2645 purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2646 "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
|
2647 _("Favorite Quote"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2648 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2649 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2650 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2651 has_info = TRUE; |
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 /* Extract the last updated date and put it in */ |
15822 | 2654 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2655 " 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
|
2656 NULL, msn_info_date_reformat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2657 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2658 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2659 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2660 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2661 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2662 /* 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
|
2663 if (user_url != NULL) |
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 tmp = g_strdup_printf("<a href=\"%s\">%s</a>", user_url, user_url); |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2666 purple_notify_user_info_add_pair_html(user_info, _("Homepage"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2667 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2668 g_free(user_url); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2669 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2670 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2671 } |
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 if (!has_info) |
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 /* 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
|
2676 * 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
|
2677 * 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
|
2678 * exists. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2679 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2680 /* 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
|
2681 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
|
2682 * This might not work for long either ... */ |
17442
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2683 /* Nope, it failed some time before 5/2/07 :( |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2684 char *p = strstr(url_buffer, "form id=\"SpacesSearch\" name=\"SpacesSearch\""); |
17442
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17198
diff
changeset
|
2685 * 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:
17198
diff
changeset
|
2686 char *p = strstr(url_buffer, "<form id=\"profile_form\" name=\"profile_form\" action=\"http://spaces.live.com/profile.aspx?cid=0\""); |
15822 | 2687 PurpleBuddy *b = purple_find_buddy |
2688 (purple_connection_get_account(info_data->gc), info_data->name); | |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2689 purple_notify_user_info_add_pair_html(user_info, |
24667
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24506
diff
changeset
|
2690 _("Error retrieving profile"), NULL); |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2691 purple_notify_user_info_add_pair_plaintext(user_info, NULL, |
24667
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24506
diff
changeset
|
2692 ((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:
24506
diff
changeset
|
2693 (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:
24506
diff
changeset
|
2694 "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:
24506
diff
changeset
|
2695 "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:
24506
diff
changeset
|
2696 "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:
24506
diff
changeset
|
2697 _("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:
24506
diff
changeset
|
2698 "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:
24506
diff
changeset
|
2699 "The user most likely does not exist.")))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2700 } |
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 /* put a link to the actual profile URL */ |
24667
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24506
diff
changeset
|
2703 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:
24506
diff
changeset
|
2704 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:
24506
diff
changeset
|
2705 PROFILE_URL, info_data->name, _("View web profile")); |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2706 purple_notify_user_info_add_pair_html(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:
19719
diff
changeset
|
2707 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2708 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2709 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2710 /* 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
|
2711 photo_url_text = msn_get_photo_url(url_text); |
23519
7bceac816e19
The great MSN debug message cleanup! Threw in a few whitespace fixes,
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23505
diff
changeset
|
2712 purple_debug_info("msn", "photo url:{%s}\n", photo_url_text ? photo_url_text : "(null)"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2713 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2714 /* 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
|
2715 info2_data = g_new0(MsnGetInfoStepTwoData, 1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2716 info2_data->info_data = info_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2717 info2_data->stripped = stripped; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2718 info2_data->url_buffer = url_buffer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2719 info2_data->user_info = user_info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2720 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
|
2721 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2722 /* 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
|
2723 if (photo_url_text) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2724 { |
32218
904686722499
* purple_util_fetch_url_request_len() renamed to purple_util_fetch_url_request().
andrew.victor@mxit.com
parents:
32053
diff
changeset
|
2725 url_data = purple_util_fetch_url(photo_url_text, FALSE, NULL, FALSE, |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2726 MAX_HTTP_BUDDYICON_BYTES, |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2727 msn_got_photo, info2_data); |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2728 session->url_datas = g_slist_prepend(session->url_datas, url_data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2729 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2730 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2731 { |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2732 /* Finish the Get Info and show the user something */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2733 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
|
2734 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2735 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2736 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2737 static void |
15822 | 2738 msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22535
diff
changeset
|
2739 const gchar *url_text, gsize len, const gchar *error_message) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2740 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2741 MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2742 int id = -1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2743 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2744 /* Unmarshall the saved state */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2745 MsnGetInfoData *info_data = info2_data->info_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2746 char *stripped = info2_data->stripped; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2747 char *url_buffer = info2_data->url_buffer; |
15822 | 2748 PurpleNotifyUserInfo *user_info = info2_data->user_info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2749 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
|
2750 |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2751 if (url_data) { |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2752 MsnSession *session = purple_connection_get_protocol_data(info_data->gc); |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2753 session->url_datas = g_slist_remove(session->url_datas, url_data); |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2754 } |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2755 |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2756 if (url_text && error_message) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2757 { |
15822 | 2758 purple_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2759 g_free(stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2760 g_free(url_buffer); |
20950
52deb2160496
Fix some (rather large) leakage.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20856
diff
changeset
|
2761 purple_notify_user_info_destroy(user_info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2762 g_free(info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2763 g_free(info_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2764 g_free(photo_url_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2765 g_free(info2_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2766 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2767 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2768 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2769 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2770 /* 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
|
2771 if (user_data && url_text && len != 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2772 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2773 if (strstr(url_text, "400 Bad Request") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2774 || strstr(url_text, "403 Forbidden") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2775 || strstr(url_text, "404 Not Found")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2776 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2777 |
15822 | 2778 purple_debug_info("msn", "Error getting %s: %s\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2779 photo_url_text, url_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2780 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2781 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2782 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2783 char buf[1024]; |
22822
05cb3f04c01e
This cleans up a bunch of warnings that stem from the fact that size_t and
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22535
diff
changeset
|
2784 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
|
2785 id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2786 g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id); |
31920
0cc718e10344
Actually commit the purple_notify_user_info_prepend_pair_plaintext
Mark Doliner <mark@kingant.net>
parents:
31907
diff
changeset
|
2787 purple_notify_user_info_prepend_pair_html(user_info, NULL, buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2788 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2789 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2790 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2791 /* 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
|
2792 #endif |
15822 | 2793 purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2794 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2795 g_free(stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2796 g_free(url_buffer); |
15822 | 2797 purple_notify_user_info_destroy(user_info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2798 g_free(info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2799 g_free(info_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2800 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2801 g_free(photo_url_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2802 g_free(info2_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2803 if (id != -1) |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
15822
diff
changeset
|
2804 purple_imgstore_unref_by_id(id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2805 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2806 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2807 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2808 static void |
15822 | 2809 msn_get_info(PurpleConnection *gc, const char *name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2810 { |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2811 MsnSession *session = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2812 MsnGetInfoData *data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2813 char *url; |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2814 PurpleUtilFetchUrlData *url_data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2815 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2816 data = g_new0(MsnGetInfoData, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2817 data->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2818 data->name = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2819 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2820 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
|
2821 |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2822 url_data = purple_util_fetch_url(url, FALSE, |
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2823 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)", |
32218
904686722499
* purple_util_fetch_url_request_len() renamed to purple_util_fetch_url_request().
andrew.victor@mxit.com
parents:
32053
diff
changeset
|
2824 TRUE, -1, msn_got_info, data); |
30317
ea96292336f0
Save and cancel-on-exit any URL requests, instead of checking the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30005
diff
changeset
|
2825 session->url_datas = g_slist_prepend(session->url_datas, url_data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2826 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2827 g_free(url); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2828 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2829 |
15822 | 2830 static gboolean msn_load(PurplePlugin *plugin) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2831 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2832 msn_notification_init(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2833 msn_switchboard_init(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2834 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2835 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2836 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2837 |
15822 | 2838 static gboolean msn_unload(PurplePlugin *plugin) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2839 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2840 msn_notification_end(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2841 msn_switchboard_end(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2842 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2843 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2844 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2845 |
15822 | 2846 static PurpleAccount *find_acct(const char *prpl, const char *acct_id) |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2847 { |
15822 | 2848 PurpleAccount *acct = NULL; |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2849 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2850 /* 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:
15590
diff
changeset
|
2851 if (acct_id) { |
15822 | 2852 acct = purple_accounts_find(acct_id, prpl); |
2853 if (acct && !purple_account_is_connected(acct)) | |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2854 acct = NULL; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2855 } else { /* Otherwise find an active account for the protocol */ |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
2856 GList *l = purple_accounts_get_all(); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2857 while (l) { |
15822 | 2858 if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) |
2859 && purple_account_is_connected(l->data)) { | |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2860 acct = l->data; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2861 break; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2862 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2863 l = l->next; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2864 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2865 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2866 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2867 return acct; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2868 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2869 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2870 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:
15590
diff
changeset
|
2871 { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2872 char *acct_id = g_hash_table_lookup(params, "account"); |
15822 | 2873 PurpleAccount *acct; |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2874 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2875 if (g_ascii_strcasecmp(proto, "msnim")) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2876 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2877 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2878 acct = find_acct("prpl-msn", acct_id); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2879 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2880 if (!acct) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2881 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2882 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2883 /* msnim:chat?contact=user@domain.tld */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2884 if (!g_ascii_strcasecmp(cmd, "Chat")) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2885 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:
15590
diff
changeset
|
2886 if (sname) { |
15822 | 2887 PurpleConversation *conv = purple_find_conversation_with_account( |
2888 PURPLE_CONV_TYPE_IM, sname, acct); | |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2889 if (conv == NULL) |
15822 | 2890 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, sname); |
2891 purple_conversation_present(conv); | |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2892 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2893 /*else |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2894 **If pidgindialogs_im() was in the core, we could use it here. |
15822 | 2895 * It is all purple_request_* based, but I'm not sure it really belongs in the core |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2896 pidgindialogs_im();*/ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2897 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2898 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2899 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2900 /* msnim:add?contact=user@domain.tld */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2901 else if (!g_ascii_strcasecmp(cmd, "Add")) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2902 char *name = g_hash_table_lookup(params, "contact"); |
15822 | 2903 purple_blist_request_add_buddy(acct, name, NULL, NULL); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2904 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2905 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2906 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2907 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2908 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2909 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
2910 |
15822 | 2911 static PurplePluginProtocolInfo prpl_info = |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2912 { |
32032
743bb6b1aa30
Move struct_size to the beginning of the struct. Even if we don't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32031
diff
changeset
|
2913 sizeof(PurplePluginProtocolInfo), /* struct_size */ |
31400
0c981f2c169a
Add the invite message support to MSN prpl.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31397
diff
changeset
|
2914 OPT_PROTO_MAIL_CHECK|OPT_PROTO_INVITE_MESSAGE, |
29892 | 2915 NULL, /* user_splits */ |
2916 NULL, /* protocol_options */ | |
2917 {"png,gif", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_SEND}, /* icon_spec */ | |
2918 msn_list_icon, /* list_icon */ | |
2919 msn_list_emblems, /* list_emblems */ | |
2920 msn_status_text, /* status_text */ | |
2921 msn_tooltip_text, /* tooltip_text */ | |
2922 msn_status_types, /* away_states */ | |
2923 msn_blist_node_menu, /* blist_node_menu */ | |
2924 NULL, /* chat_info */ | |
2925 NULL, /* chat_info_defaults */ | |
2926 msn_login, /* login */ | |
2927 msn_close, /* close */ | |
2928 msn_send_im, /* send_im */ | |
2929 NULL, /* set_info */ | |
2930 msn_send_typing, /* send_typing */ | |
2931 msn_get_info, /* get_info */ | |
2932 msn_set_status, /* set_away */ | |
2933 msn_set_idle, /* set_idle */ | |
2934 NULL, /* change_passwd */ | |
32031
cd1d9e04c587
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32028
diff
changeset
|
2935 msn_add_buddy, /* add_buddy */ |
29892 | 2936 NULL, /* add_buddies */ |
2937 msn_rem_buddy, /* remove_buddy */ | |
2938 NULL, /* remove_buddies */ | |
2939 msn_add_permit, /* add_permit */ | |
2940 msn_add_deny, /* add_deny */ | |
2941 msn_rem_permit, /* rem_permit */ | |
2942 msn_rem_deny, /* rem_deny */ | |
2943 msn_set_permit_deny, /* set_permit_deny */ | |
2944 NULL, /* join_chat */ | |
2945 NULL, /* reject chat invite */ | |
2946 NULL, /* get_chat_name */ | |
2947 msn_chat_invite, /* chat_invite */ | |
2948 msn_chat_leave, /* chat_leave */ | |
2949 NULL, /* chat_whisper */ | |
2950 msn_chat_send, /* chat_send */ | |
2951 msn_keepalive, /* keepalive */ | |
2952 NULL, /* register_user */ | |
2953 NULL, /* get_cb_info */ | |
2954 msn_alias_buddy, /* alias_buddy */ | |
2955 msn_group_buddy, /* group_buddy */ | |
2956 msn_rename_group, /* rename_group */ | |
2957 NULL, /* buddy_free */ | |
2958 msn_convo_closed, /* convo_closed */ | |
2959 msn_normalize, /* normalize */ | |
2960 msn_set_buddy_icon, /* set_buddy_icon */ | |
2961 msn_remove_group, /* remove_group */ | |
2962 NULL, /* get_cb_real_name */ | |
2963 NULL, /* set_chat_topic */ | |
2964 NULL, /* find_blist_chat */ | |
2965 NULL, /* roomlist_get_list */ | |
2966 NULL, /* roomlist_cancel */ | |
2967 NULL, /* roomlist_expand_category */ | |
2968 msn_can_receive_file, /* can_receive_file */ | |
2969 msn_send_file, /* send_file */ | |
2970 msn_new_xfer, /* new_xfer */ | |
2971 msn_offline_message, /* offline_message */ | |
2972 NULL, /* whiteboard_prpl_ops */ | |
2973 NULL, /* send_raw */ | |
2974 NULL, /* roomlist_room_serialize */ | |
2975 NULL, /* unregister_user */ | |
2976 msn_send_attention, /* send_attention */ | |
2977 msn_attention_types, /* attention_types */ | |
2978 msn_get_account_text_table, /* get_account_text_table */ | |
2979 NULL, /* initiate_media */ | |
2980 NULL, /* get_media_caps */ | |
2981 NULL, /* get_moods */ | |
29894
ec89b1d8571a
Implement [gs]et_public_alias in MSN.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29892
diff
changeset
|
2982 msn_set_public_alias, /* set_public_alias */ |
32031
cd1d9e04c587
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32028
diff
changeset
|
2983 msn_get_public_alias /* get_public_alias */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2984 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2985 |
15822 | 2986 static PurplePluginInfo info = |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2987 { |
15822 | 2988 PURPLE_PLUGIN_MAGIC, |
2989 PURPLE_MAJOR_VERSION, | |
2990 PURPLE_MINOR_VERSION, | |
24430
ad685dadbaca
Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents:
24428
diff
changeset
|
2991 PURPLE_PLUGIN_PROTOCOL, /**< type */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2992 NULL, /**< ui_requirement */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2993 0, /**< flags */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2994 NULL, /**< dependencies */ |
24430
ad685dadbaca
Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents:
24428
diff
changeset
|
2995 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2996 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2997 "prpl-msn", /**< id */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2998 "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
|
2999 DISPLAY_VERSION, /**< version */ |
24431
75545fdf8944
String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents:
24430
diff
changeset
|
3000 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:
24430
diff
changeset
|
3001 N_("Windows Live Messenger Protocol Plugin"), /**< description */ |
24430
ad685dadbaca
Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents:
24428
diff
changeset
|
3002 NULL, /**< author */ |
ad685dadbaca
Our in-tree prpls probably shouldn't list authors who don't work on
Mark Doliner <mark@kingant.net>
parents:
24428
diff
changeset
|
3003 PURPLE_WEBSITE, /**< homepage */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3004 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3005 msn_load, /**< load */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3006 msn_unload, /**< unload */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3007 NULL, /**< destroy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3008 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3009 NULL, /**< ui_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3010 &prpl_info, /**< extra_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3011 NULL, /**< prefs_info */ |
16667
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16475
diff
changeset
|
3012 msn_actions, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16475
diff
changeset
|
3013 |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16475
diff
changeset
|
3014 /* padding */ |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16475
diff
changeset
|
3015 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16475
diff
changeset
|
3016 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16475
diff
changeset
|
3017 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16475
diff
changeset
|
3018 NULL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3019 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3020 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3021 static void |
15822 | 3022 init_plugin(PurplePlugin *plugin) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3023 { |
15822 | 3024 PurpleAccountOption *option; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3025 |
15822 | 3026 option = purple_account_option_string_new(_("Server"), "server", |
23505
efa4534fd23a
Clean up some #define's in msn.h and various supporting changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23488
diff
changeset
|
3027 MSN_SERVER); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3028 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
|
3029 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3030 |
23505
efa4534fd23a
Clean up some #define's in msn.h and various supporting changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23488
diff
changeset
|
3031 option = purple_account_option_int_new(_("Port"), "port", MSN_PORT); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3032 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
|
3033 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3034 |
15822 | 3035 option = purple_account_option_bool_new(_("Use HTTP Method"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3036 "http_method", FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3037 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
|
3038 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3039 |
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
|
3040 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:
19719
diff
changeset
|
3041 "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:
19719
diff
changeset
|
3042 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:
19719
diff
changeset
|
3043 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:
19719
diff
changeset
|
3044 |
15822 | 3045 option = purple_account_option_bool_new(_("Show custom smileys"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3046 "custom_smileys", TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3047 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
|
3048 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3049 |
30005
d6f9f4320bf1
Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29894
diff
changeset
|
3050 option = purple_account_option_bool_new(_("Allow direct connections"), |
d6f9f4320bf1
Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29894
diff
changeset
|
3051 "direct_connect", TRUE); |
d6f9f4320bf1
Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29894
diff
changeset
|
3052 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
d6f9f4320bf1
Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29894
diff
changeset
|
3053 option); |
d6f9f4320bf1
Add a pref for allowing direct connections.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29894
diff
changeset
|
3054 |
30990
05b3fa3725a1
Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30978
diff
changeset
|
3055 option = purple_account_option_bool_new(_("Allow connecting from multiple locations"), |
05b3fa3725a1
Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30978
diff
changeset
|
3056 "mpop", TRUE); |
05b3fa3725a1
Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30978
diff
changeset
|
3057 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
05b3fa3725a1
Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30978
diff
changeset
|
3058 option); |
05b3fa3725a1
Read the MPOP setting from the AB.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30978
diff
changeset
|
3059 |
15822 | 3060 purple_cmd_register("nudge", "", PURPLE_CMD_P_PRPL, |
3061 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PRPL_ONLY, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3062 "prpl-msn", msn_cmd_nudge, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3063 _("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
|
3064 |
15822 | 3065 purple_prefs_remove("/plugins/prpl/msn"); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15590
diff
changeset
|
3066 |
15822 | 3067 purple_signal_connect(purple_get_core(), "uri-handler", plugin, |
3068 PURPLE_CALLBACK(msn_uri_handler), NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3069 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3070 |
15822 | 3071 PURPLE_INIT_PLUGIN(msn, init_plugin, info); |