Mercurial > pidgin.yaz
annotate libpurple/protocols/msn/msn.c @ 22896:087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
the XMPP conference. After some thought and discussion, I decided to have the
prpls create the hash table on each call. This allows some dynamic key
creation in case we would need it in the future.
author | John Bailey <rekkanoryo@rekkanoryo.org> |
---|---|
date | Wed, 30 Apr 2008 05:37:19 +0000 |
parents | 0be4c1f0fa55 |
children | 1cd829a1d27e |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file msn.c The MSN protocol plugin |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15823 | 4 * purple |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * |
15823 | 6 * Purple is the legal property of its developers, whose names are too numerous |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19465
diff
changeset
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 #define PHOTO_SUPPORT 1 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include <glib.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 #include "msn.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include "accountopt.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "msg.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #include "page.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "pluginpref.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "prefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "session.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "state.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "cmds.h" |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
38 #include "core.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "prpl.h" |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
40 #include "msnutils.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "version.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "switchboard.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "notification.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "sync.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 #include "slplink.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 #include "imgstore.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 { |
15823 | 54 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 const char *passport; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 } MsnMobileData; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 { |
15823 | 61 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 } MsnGetInfoData; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 typedef struct |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 MsnGetInfoData *info_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 char *stripped; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 char *url_buffer; |
15823 | 71 PurpleNotifyUserInfo *user_info; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 char *photo_url_text; |
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 } MsnGetInfoStepTwoData; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 |
17072
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
76 typedef struct |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
77 { |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
78 PurpleConnection *gc; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
79 const char *who; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
80 char *msg; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
81 PurpleMessageFlags flags; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
82 time_t when; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
83 } MsnIMData; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
84 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 static const char * |
15823 | 86 msn_normalize(const PurpleAccount *account, const char *str) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 static char buf[BUF_LEN]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 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
|
92 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 g_snprintf(buf, sizeof(buf), "%s%s", str, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 (strchr(str, '@') ? "" : "@hotmail.com")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 tmp = g_utf8_strdown(buf, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 strncpy(buf, tmp, sizeof(buf)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
99 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 return buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
103 static gboolean |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
104 msn_send_attention(PurpleConnection *gc, const char *username, guint type) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 msg = msn_message_new_nudge(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 session = gc->proto_data; |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
112 swboard = msn_session_get_swboard(session, username, MSN_SB_FLAG_IM); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 if (swboard == NULL) |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
115 return FALSE; |
15374
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 msn_switchboard_send_msg(swboard, msg, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
119 return TRUE; |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
120 } |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
121 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
122 static GList * |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
123 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
|
124 { |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
125 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
|
126 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
127 if (!list) { |
22097
eab7d03edfcb
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22043
diff
changeset
|
128 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
|
129 _("%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
|
130 } |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
131 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
132 return list; |
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 |
22896
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
135 static GHashTable * |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
136 msn_get_account_text_table() |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
137 { |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
138 GHashTable *table; |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
139 |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
140 table = g_hash_table_new(g_str_hash, g_str_equal); |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
141 |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
142 g_hash_table_insert(table, "login_label", (gpointer)_("E-mail Address...")); |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
143 |
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
144 return table; |
22894
0be4c1f0fa55
This patch from Jaywalker enables text to appear in the screen name entry box.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22518
diff
changeset
|
145 } |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
146 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
147 static PurpleCmdRet |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
148 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
|
149 { |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
150 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
|
151 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
|
152 const gchar *username; |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
153 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
154 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
|
155 |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
156 serv_send_attention(gc, username, MSN_NUDGE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 |
15823 | 158 return PURPLE_CMD_RET_OK; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 |
19797
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
161 void |
15823 | 162 msn_act_id(PurpleConnection *gc, const char *entry) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 MsnSession *session; |
15823 | 166 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 const char *alias; |
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 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 cmdproc = session->notification->cmdproc; |
15823 | 171 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 if(entry && strlen(entry)) |
15823 | 174 alias = purple_url_encode(entry); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 alias = ""; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 if (strlen(alias) > BUDDY_ALIAS_MAXLEN) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 { |
15823 | 180 purple_notify_error(gc, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 _("Your new MSN friendly name is too long."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
185 if (*alias == '\0') { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
186 alias = purple_url_encode(purple_account_get_username(account)); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
187 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
188 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
189 msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
190 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 static void |
15823 | 194 msn_set_prp(PurpleConnection *gc, const char *type, const char *entry) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 if (entry == NULL || *entry == '\0') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 msn_cmdproc_send(cmdproc, "PRP", "%s", type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 msn_cmdproc_send(cmdproc, "PRP", "%s %s", type, |
15823 | 209 purple_url_encode(entry)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 static void |
15823 | 214 msn_set_home_phone_cb(PurpleConnection *gc, const char *entry) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 msn_set_prp(gc, "PHH", entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 static void |
15823 | 220 msn_set_work_phone_cb(PurpleConnection *gc, const char *entry) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 msn_set_prp(gc, "PHW", entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 static void |
15823 | 226 msn_set_mobile_phone_cb(PurpleConnection *gc, const char *entry) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 msn_set_prp(gc, "PHM", entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 static void |
15823 | 232 enable_msn_pages_cb(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 msn_set_prp(gc, "MOB", "Y"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 static void |
15823 | 238 disable_msn_pages_cb(PurpleConnection *gc) |
15374
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 msn_set_prp(gc, "MOB", "N"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 static void |
15823 | 244 send_to_mobile(PurpleConnection *gc, const char *who, const char *entry) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 MsnTransaction *trans; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 MsnPage *page; |
22518
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
250 MsnUser *user; |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
251 char *payload = NULL; |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
252 const char *mobile_number = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 size_t payload_len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 page = msn_page_new(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 msn_page_set_body(page, entry); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 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
|
262 |
22518
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
263 if ((user = msn_userlist_find_user(session->userlist, who)) && |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
264 (mobile_number = msn_user_get_mobile_phone(user)) && |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
265 mobile_number[0] == '+') { |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
266 /* if msn_user_get_mobile_phone() has a + in front, it's a number |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
267 that from the buddy's contact card */ |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
268 trans = msn_transaction_new(cmdproc, "PGD", "tel:%s 1 %d", |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
269 mobile_number, payload_len); |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
270 } else { |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
271 /* otherwise we send to whatever phone number the buddy registered |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
272 with msn */ |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
273 trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %d", who, |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
274 payload_len); |
6aa076a2ea6f
Another patch from Maiku that improves the way we send mobile messages, this
Ka-Hing Cheung <khc@hxbc.us>
parents:
22433
diff
changeset
|
275 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 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
|
278 g_free(payload); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 msn_page_destroy(page); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 msn_cmdproc_send_trans(cmdproc, trans); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 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
|
287 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 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
|
289 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 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
|
294 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 /* -- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 static void |
15823 | 301 msn_show_set_friendly_name(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 { |
15823 | 303 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 |
15823 | 305 gc = (PurpleConnection *) action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
307 purple_request_input(gc, NULL, _("Set your friendly name."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 _("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
|
309 "see you as."), |
15823 | 310 purple_connection_get_display_name(gc), FALSE, FALSE, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 _("OK"), G_CALLBACK(msn_act_id), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
312 _("Cancel"), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
313 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
314 gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 static void |
15823 | 318 msn_show_set_home_phone(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 { |
15823 | 320 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 |
15823 | 323 gc = (PurpleConnection *) action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
326 purple_request_input(gc, NULL, _("Set your home phone number."), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 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
|
328 _("OK"), G_CALLBACK(msn_set_home_phone_cb), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
329 _("Cancel"), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
330 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
331 gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 static void |
15823 | 335 msn_show_set_work_phone(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 { |
15823 | 337 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 |
15823 | 340 gc = (PurpleConnection *) action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
343 purple_request_input(gc, NULL, _("Set your work phone number."), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 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
|
345 _("OK"), G_CALLBACK(msn_set_work_phone_cb), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
346 _("Cancel"), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
347 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
348 gc); |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 static void |
15823 | 352 msn_show_set_mobile_phone(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 { |
15823 | 354 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 |
15823 | 357 gc = (PurpleConnection *) action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
360 purple_request_input(gc, NULL, _("Set your mobile phone number."), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 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
|
362 _("OK"), G_CALLBACK(msn_set_mobile_phone_cb), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
363 _("Cancel"), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
364 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
365 gc); |
15374
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 |
15823 | 369 msn_show_set_mobile_pages(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
370 { |
15823 | 371 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 |
15823 | 373 gc = (PurpleConnection *) action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
374 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
375 purple_request_action(gc, NULL, _("Allow MSN Mobile pages?"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 _("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
|
377 "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
|
378 "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
|
379 PURPLE_DEFAULT_ACTION_NONE, |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
380 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
381 gc, 3, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
382 _("Allow"), G_CALLBACK(enable_msn_pages_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
383 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
384 _("Cancel"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
385 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 static void |
15823 | 388 msn_show_hotmail_inbox(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
389 { |
15823 | 390 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
392 |
15823 | 393 gc = (PurpleConnection *) action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
394 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
396 if (session->passport_info.file == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
397 { |
15823 | 398 purple_notify_error(gc, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
399 _("This Hotmail account may not be active."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
400 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
401 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
402 |
15823 | 403 purple_notify_uri(gc, session->passport_info.file); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
404 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
405 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
406 static void |
15823 | 407 show_send_to_mobile_cb(PurpleBlistNode *node, gpointer ignored) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 { |
15823 | 409 PurpleBuddy *buddy; |
410 PurpleConnection *gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 MsnMobileData *data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 |
15823 | 414 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 |
15823 | 416 buddy = (PurpleBuddy *) node; |
417 gc = purple_account_get_connection(buddy->account); | |
15374
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 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 data = g_new0(MsnMobileData, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 data->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 data->passport = buddy->name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
424 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
425 purple_request_input(gc, NULL, _("Send a mobile message."), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
426 NULL, TRUE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
427 _("Page"), G_CALLBACK(send_to_mobile_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
428 _("Close"), G_CALLBACK(close_mobile_page_cb), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
429 purple_connection_get_account(gc), purple_buddy_get_name(buddy), NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
430 data); |
15374
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 |
16848
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16675
diff
changeset
|
433 static gboolean |
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16675
diff
changeset
|
434 msn_offline_message(const PurpleBuddy *buddy) { |
16878
680b5910933b
Fix declaration after statement.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16848
diff
changeset
|
435 MsnUser *user; |
16848
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16675
diff
changeset
|
436 if (buddy == NULL) |
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16675
diff
changeset
|
437 return FALSE; |
16878
680b5910933b
Fix declaration after statement.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16848
diff
changeset
|
438 user = buddy->proto_data; |
16848
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16675
diff
changeset
|
439 return user && user->mobile; |
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16675
diff
changeset
|
440 } |
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16675
diff
changeset
|
441 |
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
|
442 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
|
443 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
|
444 { |
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
|
445 PurpleAccount *account; |
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
|
446 MsnSession *session; |
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
|
447 MsnCmdProc *cmdproc; |
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
|
448 |
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
|
449 account = purple_connection_get_account(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
|
450 session = gc->proto_data; |
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
|
451 cmdproc = session->notification->cmdproc; |
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
|
452 |
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
|
453 if (account->perm_deny == PURPLE_PRIVACY_ALLOW_ALL || |
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
|
454 account->perm_deny == PURPLE_PRIVACY_DENY_USERS) |
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
|
455 { |
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
|
456 msn_cmdproc_send(cmdproc, "BLP", "%s", "AL"); |
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
|
457 } |
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
|
458 else |
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
|
459 { |
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
|
460 msn_cmdproc_send(cmdproc, "BLP", "%s", "BL"); |
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
|
461 } |
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
|
462 } |
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
|
463 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
464 static void |
15823 | 465 initiate_chat_cb(PurpleBlistNode *node, gpointer data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 { |
15823 | 467 PurpleBuddy *buddy; |
468 PurpleConnection *gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
471 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 |
15823 | 473 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 |
15823 | 475 buddy = (PurpleBuddy *) node; |
476 gc = purple_account_get_connection(buddy->account); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 swboard = msn_switchboard_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 msn_switchboard_request(swboard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 msn_switchboard_request_add_user(swboard, buddy->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
483 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
484 /* 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
|
485 swboard->chat_id = msn_switchboard_get_chat_id(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 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
|
487 swboard->flag = MSN_SB_FLAG_IM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 |
15823 | 489 purple_conv_chat_add_user(PURPLE_CONV_CHAT(swboard->conv), |
490 purple_account_get_username(buddy->account), NULL, PURPLE_CBFLAGS_NONE, TRUE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 static void |
15823 | 494 t_msn_xfer_init(PurpleXfer *xfer) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 { |
17065
21830d70709b
Patch from sourceforge tracker 1652005 from wabz to fix displaying file
Stu Tomlinson <stu@nosnilmot.com>
parents:
16878
diff
changeset
|
496 MsnSlpLink *slplink = xfer->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 msn_slplink_request_ft(slplink, xfer); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 |
15823 | 500 static PurpleXfer* |
501 msn_new_xfer(PurpleConnection *gc, const char *who) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 MsnSlpLink *slplink; |
15823 | 505 PurpleXfer *xfer; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 |
15823 | 509 xfer = purple_xfer_new(gc->account, PURPLE_XFER_SEND, who); |
19797
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
510 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 if (xfer) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 slplink = msn_session_get_slplink(session, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 xfer->data = slplink; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 |
15823 | 517 purple_xfer_set_init_fnc(xfer, t_msn_xfer_init); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 return xfer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 static void |
15823 | 524 msn_send_file(PurpleConnection *gc, const char *who, const char *file) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 { |
15823 | 526 PurpleXfer *xfer = msn_new_xfer(gc, who); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 if (file) |
15823 | 529 purple_xfer_request_accepted(xfer, file); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 else |
15823 | 531 purple_xfer_request(xfer); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
533 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 static gboolean |
15823 | 535 msn_can_receive_file(PurpleConnection *gc, const char *who) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 { |
15823 | 537 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 char *normal; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
539 gboolean ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 |
15823 | 541 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
542 |
15823 | 543 normal = g_strdup(msn_normalize(account, purple_account_get_username(account))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
545 ret = strcmp(normal, msn_normalize(account, who)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 g_free(normal); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 * Protocol Plugin ops |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 static const char * |
15823 | 557 msn_list_icon(PurpleAccount *a, PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 return "msn"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
562 /* |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
563 * Set the User status text |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
564 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 static char * |
15823 | 566 msn_status_text(PurpleBuddy *buddy) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
567 { |
15823 | 568 PurplePresence *presence; |
569 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
|
570 const char *msg; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 |
15823 | 572 presence = purple_buddy_get_presence(buddy); |
573 status = purple_presence_get_active_status(presence); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
574 |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
575 /* I think status message should take precedence over media */ |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
576 msg = 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
|
577 if (msg && *msg) |
20462
3537f82db107
don't strip html on the status line, so that we don't accidentally strip
Ka-Hing Cheung <khc@hxbc.us>
parents:
20459
diff
changeset
|
578 return g_markup_escape_text(msg, -1); |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
579 |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
580 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
|
581 const char *title, *artist; |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
582 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
|
583 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
|
584 title = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
585 artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
586 |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
587 media = g_strdup_printf("%s%s%s", title, artist ? " - " : "", |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
588 artist ? artist : ""); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
589 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
|
590 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
|
591 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
|
592 } |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
593 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
597 static void |
15823 | 598 msn_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 MsnUser *user; |
15823 | 601 PurplePresence *presence = purple_buddy_get_presence(buddy); |
602 PurpleStatus *status = purple_presence_get_active_status(presence); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
604 user = buddy->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
605 |
15823 | 606 if (purple_presence_is_online(presence)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
607 { |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
608 const char *psm, *name; |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
609 char *currentmedia = NULL; |
19797
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
610 char *tmp; |
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
611 |
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
612 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
|
613 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
|
614 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
|
615 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
616 const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST); |
22000
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21819
diff
changeset
|
617 const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM); |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21819
diff
changeset
|
618 currentmedia = purple_util_format_song_info(title, artist, album, 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
|
619 /* We could probably just use user->media.title etc. here */ |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
620 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
621 |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
622 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
|
623 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
|
624 } 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
|
625 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
|
626 } |
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
|
627 |
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
|
628 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
|
629 char *tmp2; |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
630 |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
631 if (purple_presence_is_idle(presence)) { |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
632 tmp2 = g_markup_printf_escaped("%s/%s", name, _("Idle")); |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
633 } else { |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
634 tmp2 = g_markup_escape_text(name, -1); |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
635 } |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
636 |
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
|
637 if (psm != NULL && *psm) { |
b5a2938b4549
Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents:
20488
diff
changeset
|
638 tmp = g_markup_escape_text(psm, -1); |
b5a2938b4549
Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents:
20488
diff
changeset
|
639 purple_notify_user_info_add_pair(user_info, tmp2, tmp); |
b5a2938b4549
Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents:
20488
diff
changeset
|
640 g_free(tmp); |
b5a2938b4549
Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents:
20488
diff
changeset
|
641 } 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
|
642 purple_notify_user_info_add_pair(user_info, _("Status"), tmp2); |
b5a2938b4549
Fixes #2502, now we show the status name in the tooltip instead of "Status"
Ka-Hing Cheung <khc@hxbc.us>
parents:
20488
diff
changeset
|
643 } |
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
|
644 |
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
|
645 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
|
646 } 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
|
647 if (psm != NULL && *psm) { |
b4a141f9294a
don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@hxbc.us>
parents:
20554
diff
changeset
|
648 tmp = g_markup_escape_text(psm, -1); |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
649 if (purple_presence_is_idle(presence)) { |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
650 purple_notify_user_info_add_pair(user_info, _("Idle"), tmp); |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
651 } else { |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
652 purple_notify_user_info_add_pair(user_info, _("Status"), tmp); |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
653 } |
20567
b4a141f9294a
don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@hxbc.us>
parents:
20554
diff
changeset
|
654 g_free(tmp); |
21139
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
655 } else { |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
656 if (purple_presence_is_idle(presence)) { |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
657 purple_notify_user_info_add_pair(user_info, _("Status"), |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
658 _("Idle")); |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
659 } else { |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
660 purple_notify_user_info_add_pair(user_info, _("Status"), |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
661 purple_status_get_name(status)); |
0df8263c21b8
show the idle status on tooltip as well, Fixes #3744
Ka-Hing Cheung <khc@hxbc.us>
parents:
21113
diff
changeset
|
662 } |
20567
b4a141f9294a
don't show empty "Status: " anymore, which fixes a glib runtime warning
Ka-Hing Cheung <khc@hxbc.us>
parents:
20554
diff
changeset
|
663 } |
19797
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
664 } |
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
|
665 |
19797
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
666 if (currentmedia) { |
22000
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21819
diff
changeset
|
667 purple_notify_user_info_add_pair(user_info, _("Now Listening"), 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
|
668 g_free(currentmedia); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
669 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 /* 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
|
673 * XXX: blocked icon overlay isn't always accurate for MSN. |
15823 | 674 * XXX: This can die as soon as purple_privacy_check() knows that |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 * 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
|
676 /* 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
|
677 * 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
|
678 * 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
|
679 * 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
|
680 */ |
27c72bd82a81
We really don't need to display Blocked: status in the tooltip for every
Stu Tomlinson <stu@nosnilmot.com>
parents:
21000
diff
changeset
|
681 if (full && user) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 { |
22259
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
683 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
|
684 |
15823 | 685 purple_notify_user_info_add_pair(user_info, _("Blocked"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 ((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
|
687 |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
688 phone = msn_user_get_home_phone(user); |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
689 if (phone != NULL) |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
690 purple_notify_user_info_add_pair(user_info, _("Home Phone Number"), phone); |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
691 |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
692 phone = msn_user_get_work_phone(user); |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
693 if (phone != NULL) |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
694 purple_notify_user_info_add_pair(user_info, _("Work Phone Number"), phone); |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
695 |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
696 phone = msn_user_get_mobile_phone(user); |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
697 if (phone != NULL) |
6e5d37105189
Display buddies' phone numbers in the tooltip for MSN buddies if we have
Stu Tomlinson <stu@nosnilmot.com>
parents:
22138
diff
changeset
|
698 purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), phone); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
701 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 static GList * |
15823 | 703 msn_status_types(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 { |
15823 | 705 PurpleStatusType *status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 GList *types = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
708 status = purple_status_type_new_with_attrs( |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
709 PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
710 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
711 NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
714 status = purple_status_type_new_with_attrs( |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
715 PURPLE_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
716 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
717 NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
720 status = purple_status_type_new_with_attrs( |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
721 PURPLE_STATUS_AWAY, "brb", _("Be Right Back"), TRUE, TRUE, FALSE, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
722 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
723 NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
724 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
726 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
|
727 PURPLE_STATUS_UNAVAILABLE, "busy", _("Busy"), TRUE, TRUE, FALSE, |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
728 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
729 NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 types = g_list_append(types, status); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
731 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
|
732 PURPLE_STATUS_UNAVAILABLE, "phone", _("On the Phone"), TRUE, TRUE, FALSE, |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
733 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
734 NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
735 types = g_list_append(types, status); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
736 status = purple_status_type_new_with_attrs( |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
737 PURPLE_STATUS_AWAY, "lunch", _("Out to Lunch"), TRUE, TRUE, FALSE, |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
738 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
739 NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
740 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 |
15823 | 742 status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 NULL, NULL, FALSE, TRUE, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
744 types = g_list_append(types, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
745 |
15823 | 746 status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 NULL, NULL, FALSE, TRUE, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
748 types = g_list_append(types, status); |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
749 |
15823 | 750 status = purple_status_type_new_full(PURPLE_STATUS_MOBILE, |
15541
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
751 "mobile", NULL, FALSE, FALSE, TRUE); |
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
752 types = g_list_append(types, status); |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
753 |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
754 status = purple_status_type_new_with_attrs(PURPLE_STATUS_TUNE, |
20642
ba6cd9c25853
Is there any reason these statuses were set to not saveable and
Mark Doliner <mark@kingant.net>
parents:
20570
diff
changeset
|
755 "tune", NULL, TRUE, TRUE, TRUE, |
20570
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
756 PURPLE_TUNE_ARTIST, _("Artist"), purple_value_new(PURPLE_TYPE_STRING), |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
757 PURPLE_TUNE_ALBUM, _("Album"), purple_value_new(PURPLE_TYPE_STRING), |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
758 PURPLE_TUNE_TITLE, _("Title"), purple_value_new(PURPLE_TYPE_STRING), |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
759 NULL); |
5913725cbcd6
Use an independant status type for 'current media' stuff, instead of using
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20567
diff
changeset
|
760 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
|
761 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
762 return types; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
763 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
764 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
765 static GList * |
15823 | 766 msn_actions(PurplePlugin *plugin, gpointer context) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
767 { |
15823 | 768 PurpleConnection *gc = (PurpleConnection *)context; |
769 PurpleAccount *account; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
770 const char *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
771 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
772 GList *m = NULL; |
15823 | 773 PurplePluginAction *act; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
774 |
15823 | 775 act = purple_plugin_action_new(_("Set Friendly Name..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
776 msn_show_set_friendly_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
777 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
778 m = g_list_append(m, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
779 |
15823 | 780 act = purple_plugin_action_new(_("Set Home Phone Number..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 msn_show_set_home_phone); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
782 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
783 |
15823 | 784 act = purple_plugin_action_new(_("Set Work Phone Number..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 msn_show_set_work_phone); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
786 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 |
15823 | 788 act = purple_plugin_action_new(_("Set Mobile Phone Number..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
789 msn_show_set_mobile_phone); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
791 m = g_list_append(m, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
792 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
793 #if 0 |
15823 | 794 act = purple_plugin_action_new(_("Enable/Disable Mobile Devices..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
795 msn_show_set_mobile_support); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
796 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
797 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
798 |
15823 | 799 act = purple_plugin_action_new(_("Allow/Disallow Mobile Pages..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
800 msn_show_set_mobile_pages); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
801 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
802 |
15823 | 803 account = purple_connection_get_account(gc); |
804 user = msn_normalize(account, purple_account_get_username(account)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
805 |
17192
d92776c252b8
Support for @msn.com accounts when opening Inbox, and unconditioanlly request
Stu Tomlinson <stu@nosnilmot.com>
parents:
17187
diff
changeset
|
806 if ((strstr(user, "@hotmail.") != NULL) || |
d92776c252b8
Support for @msn.com accounts when opening Inbox, and unconditioanlly request
Stu Tomlinson <stu@nosnilmot.com>
parents:
17187
diff
changeset
|
807 (strstr(user, "@msn.com") != NULL)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
808 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
809 m = g_list_append(m, NULL); |
15823 | 810 act = purple_plugin_action_new(_("Open Hotmail Inbox"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
811 msn_show_hotmail_inbox); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
812 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
813 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
814 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
815 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
816 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
817 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
818 static GList * |
15823 | 819 msn_buddy_menu(PurpleBuddy *buddy) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
821 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
822 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 GList *m = NULL; |
15823 | 824 PurpleMenuAction *act; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 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
|
827 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 user = buddy->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
830 if (user != NULL) |
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 if (user->mobile) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 { |
15823 | 834 act = purple_menu_action_new(_("Send to Mobile"), |
835 PURPLE_CALLBACK(show_send_to_mobile_cb), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
836 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 if (g_ascii_strcasecmp(buddy->name, |
15823 | 842 purple_account_get_username(buddy->account))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 { |
15823 | 844 act = purple_menu_action_new(_("Initiate _Chat"), |
845 PURPLE_CALLBACK(initiate_chat_cb), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
847 m = g_list_append(m, act); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
850 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 static GList * |
15823 | 854 msn_blist_node_menu(PurpleBlistNode *node) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 { |
15823 | 856 if(PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 { |
15823 | 858 return msn_buddy_menu((PurpleBuddy *) node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 else |
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 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
865 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 static void |
15823 | 867 msn_login(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 { |
15823 | 869 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
870 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 const char *username; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 const char *host; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 gboolean http_method = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 |
15823 | 876 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 |
15823 | 878 if (!purple_ssl_is_supported()) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 { |
21358 | 880 purple_connection_error_reason (gc, |
881 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
882 _("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
|
883 "SSL library.")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 |
15823 | 887 http_method = purple_account_get_bool(account, "http_method", FALSE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
888 |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
889 if (http_method) |
20277
c37128d87d5a
Merged MSN_HTTPCONN_SERVER fix
Evan Schoenberg <evan.s@dreskin.net>
parents:
20044
diff
changeset
|
890 host = purple_account_get_string(account, "http_method_server", MSN_HTTPCONN_SERVER); |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
891 else |
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
892 host = purple_account_get_string(account, "server", MSN_SERVER); |
15823 | 893 port = purple_account_get_int(account, "port", MSN_PORT); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 session = msn_session_new(account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
897 gc->proto_data = session; |
15823 | 898 gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 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
|
901 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 /* Hmm, I don't like this. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 /* XXX shx: Me neither */ |
15823 | 904 username = msn_normalize(account, purple_account_get_username(account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
905 |
15823 | 906 if (strcmp(username, purple_account_get_username(account))) |
907 purple_account_set_username(account, username); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 if (!msn_session_connect(session, host, port, http_method)) |
21358 | 910 purple_connection_error_reason (gc, |
911 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
20120
557c4c67bd29
Use purple_connection_error_reason in prpl-msn.
Will Thompson <will.thompson@collabora.co.uk>
parents:
20086
diff
changeset
|
912 _("Failed to connect to server.")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 static void |
15823 | 916 msn_close(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
922 g_return_if_fail(session != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
923 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
924 msn_session_destroy(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 gc->proto_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
928 |
17072
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
929 static gboolean |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
930 msn_send_me_im(gpointer data) |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
931 { |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
932 MsnIMData *imdata = data; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
933 serv_got_im(imdata->gc, imdata->who, imdata->msg, imdata->flags, imdata->when); |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
934 g_free(imdata->msg); |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
935 g_free(imdata); |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
936 return FALSE; |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
937 } |
cb4380df3005
In MSN we fake sending messages to yourself. This had a small bug in that
Stu Tomlinson <stu@nosnilmot.com>
parents:
17065
diff
changeset
|
938 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 static int |
15823 | 940 msn_send_im(PurpleConnection *gc, const char *who, const char *message, |
941 PurpleMessageFlags flags) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 { |
15823 | 943 PurpleAccount *account; |
944 PurpleBuddy *buddy = purple_find_buddy(gc->account, who); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 char *msgformat; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 char *msgtext; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 |
20471
530a92d50c5e
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20459
diff
changeset
|
949 purple_debug_info("MSNP14","send IM {%s} to %s\n",message,who); |
15823 | 950 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 |
15541
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
952 if (buddy) { |
15823 | 953 PurplePresence *p = purple_buddy_get_presence(buddy); |
954 if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) { | |
955 char *text = purple_markup_strip_html(message); | |
15541
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
956 send_to_mobile(gc, who, text); |
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
957 g_free(text); |
15591
1d0d25848c5d
Get rid of a minor compile warning
Mark Doliner <mark@kingant.net>
parents:
15541
diff
changeset
|
958 return 1; |
15541
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
959 } |
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
960 } |
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
961 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
962 msn_import_html(message, &msgformat, &msgtext); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
963 if(msn_user_is_online(account, who)|| |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
964 msn_user_is_yahoo(account, who)){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
965 /*User online,then send Online Instant Message*/ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
967 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
968 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
969 g_free(msgformat); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
970 g_free(msgtext); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
971 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
972 return -E2BIG; |
15541
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
973 } |
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
974 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
975 msg = msn_message_new_plain(msgtext); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
976 msg->remote_user = g_strdup(who); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
977 msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
979 g_free(msgformat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
980 g_free(msgtext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
981 |
20471
530a92d50c5e
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20459
diff
changeset
|
982 purple_debug_info("MSNP14","prepare to send online Message\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
983 if (g_ascii_strcasecmp(who, purple_account_get_username(account))) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
984 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
985 MsnSession *session; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
986 MsnSwitchBoard *swboard; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
987 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
988 session = gc->proto_data; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
989 if(msn_user_is_yahoo(account,who)){ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
990 /*we send the online and offline Message to Yahoo User via UBM*/ |
20471
530a92d50c5e
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20459
diff
changeset
|
991 purple_debug_info("MSNP14","send to Yahoo User\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
992 uum_send_msg(session,msg); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
993 }else{ |
20471
530a92d50c5e
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20459
diff
changeset
|
994 purple_debug_info("MSNP14","send via switchboard\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
995 swboard = msn_session_get_swboard(session, who, MSN_SB_FLAG_IM); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
996 msn_switchboard_send_msg(swboard, msg, TRUE); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
997 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
998 } |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
999 else |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1000 { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1001 char *body_str, *body_enc, *pre, *post; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1002 const char *format; |
20413 | 1003 MsnIMData *imdata = g_new0(MsnIMData, 1); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1004 /* |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1005 * In MSN, you can't send messages to yourself, so |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1006 * we'll fake like we received it ;) |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1007 */ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1008 body_str = msn_message_to_string(msg); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1009 body_enc = g_markup_escape_text(body_str, -1); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1010 g_free(body_str); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1011 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1012 format = msn_message_get_attr(msg, "X-MMS-IM-Format"); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1013 msn_parse_format(format, &pre, &post); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1014 body_str = g_strdup_printf("%s%s%s", pre ? pre : "", |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1015 body_enc ? body_enc : "", post ? post : ""); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1016 g_free(body_enc); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1017 g_free(pre); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1018 g_free(post); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1019 |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1020 serv_got_typing_stopped(gc, who); |
20413 | 1021 imdata->gc = gc; |
1022 imdata->who = who; | |
1023 imdata->msg = body_str; | |
1024 imdata->flags = flags; | |
1025 imdata->when = time(NULL); | |
20856
306f3c0bccd4
Prevent null pointer deref to fix CID 349. I don't think this is possible, but I suppose it may happen with a different UI.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20775
diff
changeset
|
1026 purple_timeout_add(0, msn_send_me_im, imdata); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1027 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1029 msn_message_destroy(msg); |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1030 }else { |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1031 /*send Offline Instant Message,only to MSN Passport User*/ |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1032 MsnSession *session; |
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1033 char *friendname; |
20425
5048651671e1
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents:
20422
diff
changeset
|
1034 |
20471
530a92d50c5e
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20459
diff
changeset
|
1035 purple_debug_info("MSNP14","prepare to send offline Message\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1036 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1037 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1038 friendname = msn_encode_mime(account->username); |
20534
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20524
diff
changeset
|
1039 msn_oim_prep_send_msg_info(session->oim, |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20524
diff
changeset
|
1040 purple_account_get_username(account), |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20524
diff
changeset
|
1041 friendname, who, message); |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20524
diff
changeset
|
1042 msn_oim_send_msg(session->oim); |
7e69275a4eef
oim migrated to new soap code, quadruply duplicated message!
Ka-Hing Cheung <khc@hxbc.us>
parents:
20524
diff
changeset
|
1043 g_free(friendname); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1044 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1045 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1046 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1047 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1048 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1049 static unsigned int |
15823 | 1050 msn_send_typing(PurpleConnection *gc, const char *who, PurpleTypingState state) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1051 { |
15823 | 1052 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1053 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1054 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1055 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1056 |
15823 | 1057 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1058 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1059 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1060 /* |
15823 | 1061 * TODO: I feel like this should be "if (state != PURPLE_TYPING)" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1062 * 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
|
1063 * anything. --KingAnt |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1064 */ |
15823 | 1065 if (state == PURPLE_NOT_TYPING) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1066 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1067 |
15823 | 1068 if (!g_ascii_strcasecmp(who, purple_account_get_username(account))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1069 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1070 /* We'll just fake it, since we're sending to ourself. */ |
15823 | 1071 serv_got_typing(gc, who, MSN_TYPING_RECV_TIMEOUT, PURPLE_TYPING); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1072 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1073 return MSN_TYPING_SEND_TIMEOUT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1074 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1075 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1076 swboard = msn_session_find_swboard(session, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1077 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1078 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
|
1079 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1080 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1081 swboard->flag |= MSN_SB_FLAG_IM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1082 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1083 msg = msn_message_new(MSN_MSG_TYPING); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1084 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
|
1085 msn_message_set_flag(msg, 'U'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1086 msn_message_set_attr(msg, "TypingUser", |
15823 | 1087 purple_account_get_username(account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1088 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
|
1089 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1090 msn_switchboard_send_msg(swboard, msg, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1091 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1092 msn_message_destroy(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1093 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1094 return MSN_TYPING_SEND_TIMEOUT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1095 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1096 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1097 static void |
15823 | 1098 msn_set_status(PurpleAccount *account, PurpleStatus *status) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1099 { |
15823 | 1100 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1101 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1102 |
15823 | 1103 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1104 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1105 if (gc != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1106 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1107 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1108 msn_change_status(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1109 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1110 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1111 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1112 static void |
15823 | 1113 msn_set_idle(PurpleConnection *gc, int idle) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1114 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1115 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1116 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1117 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1118 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1119 msn_change_status(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1120 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1121 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1122 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1123 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1124 fake_userlist_add_buddy(MsnUserList *userlist, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1125 const char *who, int list_id, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1126 const char *group_name) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1127 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1128 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1129 static int group_id_c = 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1130 int group_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1131 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1132 group_id = -1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1134 if (group_name != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1135 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1136 MsnGroup *group; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1137 group = msn_group_new(userlist, group_id_c, group_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 group_id = group_id_c++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1139 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1140 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1141 user = msn_userlist_find_user(userlist, who); |
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 if (user == NULL) |
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 user = msn_user_new(userlist, who, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1146 msn_userlist_add_user(userlist, user); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1147 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1148 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1149 if (user->list_op & (1 << list_id)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1151 if (list_id == MSN_LIST_FL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1152 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1153 if (group_id >= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1154 if (g_list_find(user->group_ids, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1155 GINT_TO_POINTER(group_id))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1157 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1158 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1159 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1160 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1161 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1162 if (group_id >= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1163 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1164 user->group_ids = g_list_append(user->group_ids, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1165 GINT_TO_POINTER(group_id)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1166 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1167 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1168 user->list_op |= (1 << list_id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1169 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1170 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1171 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 static void |
15823 | 1173 msn_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1175 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1177 const char *who; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1178 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1179 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1180 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 who = msn_normalize(gc->account, buddy->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1182 |
20856
306f3c0bccd4
Prevent null pointer deref to fix CID 349. I don't think this is possible, but I suppose it may happen with a different UI.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20775
diff
changeset
|
1183 purple_debug_info("MSN","Add user:%s to group:%s\n", who, (group && group->name) ? group->name : "(null)"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1184 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1186 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 fake_userlist_add_buddy(session->sync_userlist, who, MSN_LIST_FL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 group ? group->name : NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 #else |
15823 | 1190 purple_debug_error("msn", "msn_add_buddy called before connected\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1191 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1194 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1195 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1197 if (group != NULL && group->name != NULL) |
15823 | 1198 purple_debug_info("msn", "msn_add_buddy: %s, %s\n", who, group->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 else |
15823 | 1200 purple_debug_info("msn", "msn_add_buddy: %s\n", who); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1202 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1204 /* Which is the max? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 if (session->fl_users_count >= 150) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 { |
15823 | 1207 purple_debug_info("msn", "Too many buddies\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1208 /* Buddy list full */ |
15823 | 1209 /* TODO: purple should be notified of this */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1210 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1211 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1212 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1213 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1214 /* 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
|
1215 * shx: Yes it should; MSN handles non-grouped buddies, and this is only |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 * internal. */ |
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
|
1217 msn_userlist_add_buddy(userlist, who, group ? group->name : NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1218 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1219 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1220 static void |
15823 | 1221 msn_rem_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1222 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1223 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1224 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1225 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1226 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1227 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1230 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1231 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1232 /* XXX - Does buddy->name need to be msn_normalize'd here? --KingAnt */ |
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
|
1233 msn_userlist_rem_buddy(userlist, buddy->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1234 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1236 static void |
15823 | 1237 msn_add_permit(PurpleConnection *gc, const char *who) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1238 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1239 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1243 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 user = msn_userlist_find_user(userlist, who); |
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 (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1248 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 |
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
|
1250 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
|
1251 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 |
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
|
1253 /* delete contact from Block list and add it to Allow in the callback */ |
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
|
1254 msn_del_contact_from_list(session->contact, NULL, who, MSN_LIST_BL); |
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
|
1255 } 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
|
1256 /* just add the contact to Allow list */ |
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
|
1257 msn_add_contact_to_list(session->contact, NULL, who, MSN_LIST_AL); |
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
|
1258 } |
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
|
1259 |
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
|
1260 |
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
|
1261 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 static void |
15823 | 1265 msn_add_deny(PurpleConnection *gc, const char *who) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 user = msn_userlist_find_user(userlist, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1275 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 |
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
|
1278 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
|
1279 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 |
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
|
1281 /* delete contact from Allow list and add it to Block in the callback */ |
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
|
1282 msn_del_contact_from_list(session->contact, NULL, who, MSN_LIST_AL); |
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
|
1283 } 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
|
1284 /* just add the contact to Block list */ |
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
|
1285 msn_add_contact_to_list(session->contact, NULL, who, MSN_LIST_BL); |
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
|
1286 } |
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
|
1287 |
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
|
1288 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 } |
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 static void |
15823 | 1292 msn_rem_permit(PurpleConnection *gc, const char *who) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1294 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 MsnUser *user; |
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 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1299 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1301 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 user = msn_userlist_find_user(userlist, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 |
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
|
1306 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 |
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
|
1308 msn_del_contact_from_list(session->contact, NULL, who, MSN_LIST_AL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 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
|
1311 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1314 static void |
15823 | 1315 msn_rem_deny(PurpleConnection *gc, const char *who) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 MsnUser *user; |
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 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 userlist = session->userlist; |
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 if (!session->logged_in) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 user = msn_userlist_find_user(userlist, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 |
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
|
1329 msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 |
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
|
1331 msn_del_contact_from_list(session->contact, NULL, who, MSN_LIST_BL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 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
|
1334 msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 static void |
15823 | 1338 msn_set_permit_deny(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1339 { |
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
|
1340 msn_send_privacy(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 static void |
15823 | 1344 msn_chat_invite(PurpleConnection *gc, int id, const char *msg, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 const char *who) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 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
|
1353 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 if (swboard == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 /* 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
|
1357 swboard = msn_switchboard_new(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 msn_switchboard_request(swboard); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 swboard->chat_id = id; |
15823 | 1360 swboard->conv = purple_find_chat(gc, id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 } |
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 swboard->flag |= MSN_SB_FLAG_IM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 msn_switchboard_request_add_user(swboard, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 static void |
15823 | 1369 msn_chat_leave(PurpleConnection *gc, int id) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 MsnSwitchBoard *swboard; |
15823 | 1373 PurpleConversation *conv; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1374 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1375 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 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
|
1378 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1379 /* 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
|
1380 if (swboard == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 conv = swboard->conv; |
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 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
|
1386 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1387 /* 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
|
1388 * 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
|
1389 if (conv != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1390 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1391 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
|
1392 swboard->conv = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1393 } |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1396 static int |
15823 | 1397 msn_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1398 { |
15823 | 1399 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1400 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1401 MsnSwitchBoard *swboard; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1402 MsnMessage *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1403 char *msgformat; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1404 char *msgtext; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1405 |
15823 | 1406 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1407 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1408 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
|
1409 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 if (swboard == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1411 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1412 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1413 if (!swboard->ready) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1414 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1416 swboard->flag |= MSN_SB_FLAG_IM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1417 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1418 msn_import_html(message, &msgformat, &msgtext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1419 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1420 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 g_free(msgformat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 g_free(msgtext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1424 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1425 return -E2BIG; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1427 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1428 msg = msn_message_new_plain(msgtext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1430 msn_switchboard_send_msg(swboard, msg, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1431 msn_message_destroy(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1433 g_free(msgformat); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1434 g_free(msgtext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1435 |
15823 | 1436 serv_got_chat_in(gc, id, purple_account_get_username(account), 0, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1437 message, time(NULL)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1438 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1439 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1440 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1441 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1442 static void |
15823 | 1443 msn_keepalive(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1444 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1445 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1446 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1447 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1448 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1449 if (!session->http_method) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1450 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1451 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1452 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1453 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1454 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1455 msn_cmdproc_send_quick(cmdproc, "PNG", NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1456 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1457 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1458 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1459 static void |
15823 | 1460 msn_group_buddy(PurpleConnection *gc, const char *who, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1461 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
|
1462 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1463 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1464 MsnUserList *userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1465 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1466 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1467 userlist = session->userlist; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1468 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1469 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
|
1470 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1471 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1472 static void |
15823 | 1473 msn_rename_group(PurpleConnection *gc, const char *old_name, |
1474 PurpleGroup *group, GList *moved_buddies) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1475 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1476 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1477 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1478 session = gc->proto_data; |
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
|
1479 |
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
|
1480 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
|
1481 g_return_if_fail(session->userlist != 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
|
1482 |
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
|
1483 if (msn_userlist_find_group_with_name(session->userlist, old_name) != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1484 { |
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
|
1485 msn_contact_rename_group(session, old_name, group->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1486 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1487 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1488 { |
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
|
1489 /* not found */ |
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
|
1490 msn_add_group(session, NULL, group->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1491 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1492 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1493 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1494 static void |
15823 | 1495 msn_convo_closed(PurpleConnection *gc, const char *who) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1496 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1497 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1498 MsnSwitchBoard *swboard; |
15823 | 1499 PurpleConversation *conv; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1500 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1501 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1502 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1503 swboard = msn_session_find_swboard(session, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1504 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1505 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1506 * 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
|
1507 * 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
|
1508 * is talking to himself. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1509 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1510 if (swboard == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1511 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1512 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1513 conv = swboard->conv; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1514 |
17247
d63075ed73c9
When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
17197
diff
changeset
|
1515 /* If we release the switchboard here, it may still have messages |
d63075ed73c9
When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
17197
diff
changeset
|
1516 pending ACK which would result in incorrect unsent message errors. |
d63075ed73c9
When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
17197
diff
changeset
|
1517 Just let it timeout... This is *so* going to screw with people who |
d63075ed73c9
When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
17197
diff
changeset
|
1518 use dumb clients that report "User has closed the conversation window" */ |
d63075ed73c9
When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
17197
diff
changeset
|
1519 /* msn_switchboard_release(swboard, MSN_SB_FLAG_IM); */ |
d63075ed73c9
When closing IM windows on MSN, don't release the switchboard connection
Stu Tomlinson <stu@nosnilmot.com>
parents:
17197
diff
changeset
|
1520 swboard->conv = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1521 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1522 /* 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
|
1523 * 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
|
1524 if (conv != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1525 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1526 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
|
1527 swboard->conv = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1528 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1529 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1530 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1531 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
|
1532 msn_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1533 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1534 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1535 MsnUser *user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1536 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1537 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1538 user = session->user; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1539 |
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
|
1540 msn_user_set_buddy_icon(user, img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1541 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1542 msn_change_status(session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1543 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1544 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1545 static void |
15823 | 1546 msn_remove_group(PurpleConnection *gc, PurpleGroup *group) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1547 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1548 MsnSession *session; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1549 MsnCmdProc *cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1550 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1551 session = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1552 cmdproc = session->notification->cmdproc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1553 |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20482
diff
changeset
|
1554 purple_debug_info("MSN", "Remove group %s\n", group->name); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1555 /*we can't delete the default 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
|
1556 if(!strcmp(group->name, MSN_INDIVIDUALS_GROUP_NAME)|| |
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
|
1557 !strcmp(group->name, MSN_NON_IM_GROUP_NAME)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1558 { |
20484
98613886411a
Handle special cases in buddy/group management (wrt MSN_INDIVIDUALS_GROUP and MSN_NON_IM_GROUP).
Carlos Silva <typ0@pidgin.im>
parents:
20482
diff
changeset
|
1559 purple_debug_info("MSN", "This group can't be removed, returning.\n"); |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1560 return ; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1561 } |
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
|
1562 |
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
|
1563 msn_del_group(session, group->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1564 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1565 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1566 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1567 * 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
|
1568 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1569 static gboolean |
15823 | 1570 msn_tooltip_extract_info_text(PurpleNotifyUserInfo *user_info, MsnGetInfoData *info_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1571 { |
15823 | 1572 PurpleBuddy *b; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1573 |
15823 | 1574 b = purple_find_buddy(purple_connection_get_account(info_data->gc), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1575 info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1577 if (b) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1578 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1579 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1580 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1581 if (b->alias && b->alias[0]) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1582 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1583 char *aliastext = g_markup_escape_text(b->alias, -1); |
15823 | 1584 purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1585 g_free(aliastext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1586 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1587 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1588 if (b->server_alias) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1589 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1590 char *nicktext = g_markup_escape_text(b->server_alias, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1591 tmp = g_strdup_printf("<font sml=\"msn\">%s</font><br>", nicktext); |
15823 | 1592 purple_notify_user_info_add_pair(user_info, _("Nickname"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1593 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1594 g_free(nicktext); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1595 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1596 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1597 /* Add the tooltip information */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1598 msn_tooltip_text(b, user_info, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1599 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1600 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1601 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1602 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1603 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1604 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1605 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1606 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1607 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1608 static char * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1609 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
|
1610 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1611 char *p, *q; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1612 |
20425
5048651671e1
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents:
20422
diff
changeset
|
1613 if ((p = strstr(url_text, PHOTO_URL)) != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1614 { |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1615 p += strlen(PHOTO_URL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1616 } |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1617 if (p && (strncmp(p, "http://",strlen("http://")) == 0) && ((q = strchr(p, '"')) != NULL)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1618 return g_strndup(p, q - p); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1619 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1620 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1621 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1622 |
15823 | 1623 static void msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer data, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1624 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
|
1625 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1626 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1627 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1628 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1629 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
|
1630 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1631 char *tmp = g_strndup(field, len); |
15823 | 1632 time_t t = purple_str_to_time(tmp, FALSE, NULL, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1633 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1634 g_free(tmp); |
15823 | 1635 return g_strdup(purple_date_format_short(localtime(&t))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1636 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1637 #endif |
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 #define MSN_GOT_INFO_GET_FIELD(a, b) \ |
15823 | 1640 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1641 "\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
|
1642 if (found) \ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1643 sect_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 |
17665
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1645 #define MSN_GOT_INFO_GET_FIELD_NO_SEARCH(a, b) \ |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1646 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, \ |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1647 "\n" a ":", 0, "\n", 0, "Undisclosed", b, 0, NULL, msn_info_strip_search_link); \ |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1648 if (found) \ |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1649 sect_info = TRUE; |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1650 |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1651 static char * |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1652 msn_info_strip_search_link(const char *field, size_t len) |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1653 { |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1654 const char *c; |
20554 | 1655 if ((c = strstr(field, " (http://")) == NULL) |
17665
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1656 return g_strndup(field, len); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1657 return g_strndup(field, c - field); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1658 } |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1659 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1660 static void |
15823 | 1661 msn_got_info(PurpleUtilFetchUrlData *url_data, gpointer data, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1662 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
|
1663 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1664 MsnGetInfoData *info_data = (MsnGetInfoData *)data; |
15823 | 1665 PurpleNotifyUserInfo *user_info; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1666 char *stripped, *p, *q, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1667 char *user_url = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1668 gboolean found; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1669 gboolean has_tooltip_text = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1670 gboolean has_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1671 gboolean sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1672 gboolean has_contact_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1673 char *url_buffer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1674 int stripped_len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1675 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1676 char *photo_url_text = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1677 MsnGetInfoStepTwoData *info2_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1678 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1679 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
1680 purple_debug_info("msn", "In msn_got_info,url_text:{%s}\n",url_text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1681 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1682 /* Make sure the connection is still valid */ |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
1683 if (g_list_find(purple_connections_get_all(), info_data->gc) == NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1684 { |
15823 | 1685 purple_debug_warning("msn", "invalid connection. ignoring buddy info.\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1686 g_free(info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1687 g_free(info_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1688 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1689 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1690 |
15823 | 1691 user_info = purple_notify_user_info_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1692 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
|
1693 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1694 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
|
1695 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1696 tmp = g_strdup_printf("<b>%s</b>", _("Error retrieving profile")); |
15823 | 1697 purple_notify_user_info_add_pair(user_info, NULL, tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1698 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1699 |
15823 | 1700 purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); |
1701 purple_notify_user_info_destroy(user_info); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1702 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1703 g_free(info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1704 g_free(info_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1705 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1706 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1707 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1708 url_buffer = g_strdup(url_text); |
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 /* If they have a homepage link, MSN masks it such that we need to |
15823 | 1711 * fetch the url out before purple_markup_strip_html() nukes it */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1712 /* 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
|
1713 if ((p = strstr(url_text, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1714 "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
|
1715 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1716 p += 50; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1717 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1718 if ((q = strchr(p, '"')) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1719 user_url = g_strndup(p, q - p); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1720 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1722 /* |
15823 | 1723 * purple_markup_strip_html() doesn't strip out character entities like |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1724 * and · |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1725 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1726 while ((p = strstr(url_buffer, " ")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1727 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1728 *p = ' '; /* Turn 's into ordinary blanks */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1729 p += 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1730 memmove(p, p + 5, strlen(p + 5)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1731 url_buffer[strlen(url_buffer) - 5] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1732 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1733 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1734 while ((p = strstr(url_buffer, "·")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1735 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1736 memmove(p, p + 6, strlen(p + 6)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1737 url_buffer[strlen(url_buffer) - 6] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1738 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1739 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1740 /* Nuke the nasty \r's that just get in the way */ |
15823 | 1741 purple_str_strip_char(url_buffer, '\r'); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1742 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1743 /* 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
|
1744 while ((p = strstr(url_buffer, "'")) != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1746 *p = '\''; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 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
|
1748 url_buffer[strlen(url_buffer) - 4] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1749 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1750 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1751 /* Nuke the html, it's easier than trying to parse the horrid stuff */ |
15823 | 1752 stripped = purple_markup_strip_html(url_buffer); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 stripped_len = strlen(stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1754 |
15823 | 1755 purple_debug_misc("msn", "stripped = %p\n", stripped); |
1756 purple_debug_misc("msn", "url_buffer = %p\n", url_buffer); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 /* General section header */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1759 if (has_tooltip_text) |
15823 | 1760 purple_notify_user_info_add_section_break(user_info); |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1761 |
15823 | 1762 purple_notify_user_info_add_section_header(user_info, _("General")); |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1763 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 /* Extract their Name and put it in */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1765 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1766 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1767 /* General */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1768 MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname")); |
17665
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1769 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Age", _("Age")); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1770 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Gender", _("Gender")); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1771 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Occupation", _("Occupation")); |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
1772 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Location", _("Location")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1773 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1774 /* Extract their Interests and put it in */ |
15823 | 1775 found = purple_markup_extract_info_field(stripped, stripped_len, user_info, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1776 "\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
|
1777 "Undisclosed", _("Hobbies and Interests") /* _("Interests") */, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1778 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1779 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1781 sect_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1783 MSN_GOT_INFO_GET_FIELD("More about me", _("A Little About Me")); |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1784 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 if (sect_info) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1786 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1789 } |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1790 else |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1791 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 /* Remove the section header */ |
15823 | 1793 purple_notify_user_info_remove_last_item(user_info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1794 if (has_tooltip_text) |
15823 | 1795 purple_notify_user_info_remove_last_item(user_info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1796 } |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1797 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1798 /* Social */ |
15823 | 1799 purple_notify_user_info_add_section_break(user_info); |
1800 purple_notify_user_info_add_section_header(user_info, _("Social")); | |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1801 |
22433
616a76954a97
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents:
22259
diff
changeset
|
1802 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
|
1803 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
|
1804 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
|
1805 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Hometown", _("Hometown")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1806 MSN_GOT_INFO_GET_FIELD("Places lived", _("Places Lived")); |
22433
616a76954a97
Improve "Get Info" parsing on MSN - ignore all URLs in fields instead of
Stu Tomlinson <stu@nosnilmot.com>
parents:
22259
diff
changeset
|
1807 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
|
1808 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
|
1809 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
|
1810 MSN_GOT_INFO_GET_FIELD_NO_SEARCH("Favorite quote", _("Favorite Quote")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1811 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1812 if (sect_info) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1813 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1814 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1815 sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1816 } |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1817 else |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1818 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1819 /* Remove the section header */ |
15823 | 1820 purple_notify_user_info_remove_last_item(user_info); |
1821 purple_notify_user_info_remove_last_item(user_info); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1822 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1823 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1824 /* Contact Info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1825 /* Personal */ |
15823 | 1826 purple_notify_user_info_add_section_break(user_info); |
1827 purple_notify_user_info_add_section_header(user_info, _("Contact Info")); | |
1828 purple_notify_user_info_add_section_header(user_info, _("Personal")); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1829 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1830 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1831 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
|
1832 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
|
1833 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
|
1834 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
|
1835 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
|
1836 MSN_GOT_INFO_GET_FIELD("Home fax", _("Home Fax")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1837 MSN_GOT_INFO_GET_FIELD("Personal e-mail", _("Personal E-Mail")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1838 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
|
1839 MSN_GOT_INFO_GET_FIELD("Birthday", _("Birthday")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 MSN_GOT_INFO_GET_FIELD("Anniversary", _("Anniversary")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1841 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1843 if (sect_info) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1844 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1847 has_contact_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 } |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1849 else |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 /* Remove the section header */ |
15823 | 1852 purple_notify_user_info_remove_last_item(user_info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1855 /* Business */ |
15823 | 1856 purple_notify_user_info_add_section_header(user_info, _("Work")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1857 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1858 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
|
1859 MSN_GOT_INFO_GET_FIELD("Company", _("Company")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 MSN_GOT_INFO_GET_FIELD("Department", _("Department")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1861 MSN_GOT_INFO_GET_FIELD("Profession", _("Profession")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 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
|
1863 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
|
1864 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
|
1865 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
|
1866 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
|
1867 MSN_GOT_INFO_GET_FIELD("Work fax", _("Work Fax")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 MSN_GOT_INFO_GET_FIELD("Work e-mail", _("Work E-Mail")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 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
|
1870 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
|
1871 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1872 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1873 if (sect_info) |
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 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1876 sect_info = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1877 has_contact_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 } |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
1879 else |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 /* Remove the section header */ |
15823 | 1882 purple_notify_user_info_remove_last_item(user_info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1883 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1884 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1885 if (!has_contact_info) |
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 /* Remove the Contact Info section header */ |
15823 | 1888 purple_notify_user_info_remove_last_item(user_info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1890 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1891 #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
|
1892 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1893 * 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
|
1894 * 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
|
1895 * 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
|
1896 * 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
|
1897 * distinct values. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1898 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1899 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1900 /* Check if they have A Little About Me */ |
15823 | 1901 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1902 " 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
|
1903 _("A Little About Me"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1904 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1905 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1906 { |
15823 | 1907 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1908 " 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
|
1909 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
|
1910 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1911 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1912 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1913 { |
15823 | 1914 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1915 " 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
|
1916 _("A Little About Me"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1917 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1918 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1920 { |
15823 | 1921 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1922 " 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
|
1923 '\n', |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1924 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
|
1925 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1926 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1928 { |
15823 | 1929 purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1930 " 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
|
1931 _("A Little About Me"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1932 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1933 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1934 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1935 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1936 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1937 /* Check if they have Favorite Things */ |
15823 | 1938 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1939 " 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
|
1940 _("Favorite Things"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1941 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1943 { |
15823 | 1944 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 " 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
|
1946 _("Favorite Things"), 0, NULL, NULL); |
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 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 { |
15823 | 1951 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 " 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
|
1953 NULL, _("Favorite Things"), 0, NULL, NULL); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1956 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 { |
15823 | 1958 purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 " 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
|
1960 _("Favorite Things"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1962 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1963 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1964 has_info = TRUE; |
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 /* Check if they have Hobbies and Interests */ |
15823 | 1967 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1968 " 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
|
1969 _("Hobbies and Interests"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1970 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1971 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1972 { |
15823 | 1973 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 " 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
|
1975 '\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
|
1976 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1978 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 { |
15823 | 1980 purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1981 " 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
|
1982 _("Hobbies and Interests"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1983 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1985 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1987 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 /* Check if they have Favorite Quote */ |
15823 | 1989 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 "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
|
1991 _("Favorite Quote"), 0, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1992 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1993 if (!found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1994 { |
15823 | 1995 purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1996 "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
|
1997 _("Favorite Quote"), 0, NULL, NULL); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2000 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2001 has_info = TRUE; |
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 /* Extract the last updated date and put it in */ |
15823 | 2004 found = purple_markup_extract_info_field(stripped, stripped_len, s, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2005 " 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
|
2006 NULL, msn_info_date_reformat); |
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 if (found) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2009 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2010 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2011 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2012 /* 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
|
2013 if (user_url != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2014 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2015 tmp = g_strdup_printf("<a href=\"%s\">%s</a>", user_url, user_url); |
15823 | 2016 purple_notify_user_info_add_pair(user_info, _("Homepage"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2017 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2018 g_free(user_url); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2019 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2020 has_info = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2021 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2022 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2023 if (!has_info) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2024 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2025 /* 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
|
2026 * 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
|
2027 * 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
|
2028 * exists. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2029 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2030 /* 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
|
2031 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
|
2032 * This might not work for long either ... */ |
17665
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
2033 /* Nope, it failed some time before 5/2/07 :( |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2034 char *p = strstr(url_buffer, "form id=\"SpacesSearch\" name=\"SpacesSearch\""); |
17665
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
2035 * Let's see how long this one holds out for ... */ |
02abb6713cf2
Improve parsing user info for MSN, Fixes #690
Stu Tomlinson <stu@nosnilmot.com>
parents:
17247
diff
changeset
|
2036 char *p = strstr(url_buffer, "<form id=\"profile_form\" name=\"profile_form\" action=\"http://spaces.live.com/profile.aspx?cid=0\""); |
15823 | 2037 PurpleBuddy *b = purple_find_buddy |
2038 (purple_connection_get_account(info_data->gc), info_data->name); | |
2039 purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 ((p && b) ? _("The user has not created a public profile.") : |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2041 (p ? _("MSN reported not being able to find the user's profile. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2042 "This either means that the user does not exist, " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2043 "or that the user exists " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2044 "but has not created a public profile.") : |
15383
21bc8d84974f
I think this changes every user-visible string that contains 'Gaim.' We probably want the UI to be able
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
2045 _("Could not find " /* This should never happen */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2046 "any information in the user's profile. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2047 "The user most likely does not exist.")))); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2048 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2049 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2050 /* put a link to the actual profile URL */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2051 tmp = g_strdup_printf("<a href=\"%s%s\">%s%s</a>", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2052 PROFILE_URL, info_data->name, PROFILE_URL, info_data->name); |
15823 | 2053 purple_notify_user_info_add_pair(user_info, _("Profile URL"), tmp); |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
2054 g_free(tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2055 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2056 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2057 /* 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
|
2058 photo_url_text = msn_get_photo_url(url_text); |
20775
d3443cb6a60f
Fix null printf.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20708
diff
changeset
|
2059 purple_debug_info("MSNP14","photo url:{%s}\n", photo_url_text ? photo_url_text : "(null)"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2060 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2061 /* 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
|
2062 info2_data = g_new0(MsnGetInfoStepTwoData, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2063 info2_data->info_data = info_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2064 info2_data->stripped = stripped; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2065 info2_data->url_buffer = url_buffer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2066 info2_data->user_info = user_info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2067 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
|
2068 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2069 /* 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
|
2070 if (photo_url_text) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2071 { |
15823 | 2072 purple_util_fetch_url(photo_url_text, FALSE, NULL, FALSE, msn_got_photo, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2073 info2_data); |
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2076 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2077 /* Emulate a callback */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2078 /* TODO: Huh? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2079 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
|
2080 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2081 } |
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 static void |
15823 | 2084 msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 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
|
2086 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2087 MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2088 int id = -1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2089 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2090 /* Unmarshall the saved state */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2091 MsnGetInfoData *info_data = info2_data->info_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2092 char *stripped = info2_data->stripped; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2093 char *url_buffer = info2_data->url_buffer; |
15823 | 2094 PurpleNotifyUserInfo *user_info = info2_data->user_info; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 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
|
2096 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2097 /* Make sure the connection is still valid if we got here by fetching a photo url */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2098 if (url_text && (error_message != NULL || |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
2099 g_list_find(purple_connections_get_all(), info_data->gc) == NULL)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2100 { |
15823 | 2101 purple_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2102 g_free(stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2103 g_free(url_buffer); |
20950
52deb2160496
Fix some (rather large) leakage.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20856
diff
changeset
|
2104 purple_notify_user_info_destroy(user_info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2105 g_free(info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2106 g_free(info_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2107 g_free(photo_url_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2108 g_free(info2_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2109 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2111 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2112 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2113 /* 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
|
2114 if (user_data && url_text && len != 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2115 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2116 if (strstr(url_text, "400 Bad Request") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2117 || strstr(url_text, "403 Forbidden") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 || strstr(url_text, "404 Not Found")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2120 |
15823 | 2121 purple_debug_info("msn", "Error getting %s: %s\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2122 photo_url_text, url_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2124 else |
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 char buf[1024]; |
15823 | 2127 purple_debug_info("msn", "%s is %d 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
|
2128 id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id); |
15823 | 2130 purple_notify_user_info_prepend_pair(user_info, NULL, buf); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2131 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2132 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2134 /* 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
|
2135 #endif |
15823 | 2136 purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2137 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2138 g_free(stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2139 g_free(url_buffer); |
15823 | 2140 purple_notify_user_info_destroy(user_info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2141 g_free(info_data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2142 g_free(info_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2143 #if PHOTO_SUPPORT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2144 g_free(photo_url_text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2145 g_free(info2_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2146 if (id != -1) |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
2147 purple_imgstore_unref_by_id(id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2148 #endif |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2151 static void |
15823 | 2152 msn_get_info(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2154 MsnGetInfoData *data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2155 char *url; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 data = g_new0(MsnGetInfoData, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 data->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2159 data->name = g_strdup(name); |
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 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
|
2162 |
15823 | 2163 purple_util_fetch_url(url, FALSE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2164 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 TRUE, msn_got_info, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2167 g_free(url); |
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 |
15823 | 2170 static gboolean msn_load(PurplePlugin *plugin) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2171 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2172 msn_notification_init(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2173 msn_switchboard_init(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 msn_sync_init(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2175 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2176 return TRUE; |
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 |
15823 | 2179 static gboolean msn_unload(PurplePlugin *plugin) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2181 msn_notification_end(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2182 msn_switchboard_end(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2183 msn_sync_end(); |
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 return TRUE; |
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 |
15823 | 2188 static PurpleAccount *find_acct(const char *prpl, const char *acct_id) |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2189 { |
15823 | 2190 PurpleAccount *acct = NULL; |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2191 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2192 /* If we have a specific acct, use it */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2193 if (acct_id) { |
15823 | 2194 acct = purple_accounts_find(acct_id, prpl); |
2195 if (acct && !purple_account_is_connected(acct)) | |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2196 acct = NULL; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2197 } else { /* Otherwise find an active account for the protocol */ |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
2198 GList *l = purple_accounts_get_all(); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2199 while (l) { |
15823 | 2200 if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) |
2201 && purple_account_is_connected(l->data)) { | |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2202 acct = l->data; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2203 break; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2204 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2205 l = l->next; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2206 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2207 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2208 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2209 return acct; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2210 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2211 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2212 static gboolean msn_uri_handler(const char *proto, const char *cmd, GHashTable *params) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2213 { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2214 char *acct_id = g_hash_table_lookup(params, "account"); |
15823 | 2215 PurpleAccount *acct; |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2216 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2217 if (g_ascii_strcasecmp(proto, "msnim")) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2218 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2219 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2220 acct = find_acct("prpl-msn", acct_id); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2221 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2222 if (!acct) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2223 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2224 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2225 /* msnim:chat?contact=user@domain.tld */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2226 if (!g_ascii_strcasecmp(cmd, "Chat")) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2227 char *sname = g_hash_table_lookup(params, "contact"); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2228 if (sname) { |
15823 | 2229 PurpleConversation *conv = purple_find_conversation_with_account( |
2230 PURPLE_CONV_TYPE_IM, sname, acct); | |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2231 if (conv == NULL) |
15823 | 2232 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, sname); |
2233 purple_conversation_present(conv); | |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2234 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2235 /*else |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2236 **If pidgindialogs_im() was in the core, we could use it here. |
15823 | 2237 * It is all purple_request_* based, but I'm not sure it really belongs in the core |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2238 pidgindialogs_im();*/ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2239 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2240 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2241 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2242 /* msnim:add?contact=user@domain.tld */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2243 else if (!g_ascii_strcasecmp(cmd, "Add")) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2244 char *name = g_hash_table_lookup(params, "contact"); |
15823 | 2245 purple_blist_request_add_buddy(acct, name, NULL, NULL); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2246 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2247 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2248 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2249 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2250 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2251 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2252 |
15823 | 2253 static PurplePluginProtocolInfo prpl_info = |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2254 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2255 OPT_PROTO_MAIL_CHECK, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2256 NULL, /* user_splits */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2257 NULL, /* protocol_options */ |
15823 | 2258 {"png", 0, 0, 96, 96, 0, PURPLE_ICON_SCALE_SEND}, /* icon_spec */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2259 msn_list_icon, /* list_icon */ |
15541
d74985add99f
This is my attempt at MSN mobile status, but I suspect MSN mobile status doesn't exist. If it's confirmed that it doesn't, I'll revert this. But I want to keep it for posterity, in case it does exist
Sean Egan <seanegan@gmail.com>
parents:
15463
diff
changeset
|
2260 NULL, /* list_emblems */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2261 msn_status_text, /* status_text */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2262 msn_tooltip_text, /* tooltip_text */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2263 msn_status_types, /* away_states */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2264 msn_blist_node_menu, /* blist_node_menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2265 NULL, /* chat_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2266 NULL, /* chat_info_defaults */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2267 msn_login, /* login */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2268 msn_close, /* close */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2269 msn_send_im, /* send_im */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2270 NULL, /* set_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2271 msn_send_typing, /* send_typing */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2272 msn_get_info, /* get_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2273 msn_set_status, /* set_away */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2274 msn_set_idle, /* set_idle */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2275 NULL, /* change_passwd */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2276 msn_add_buddy, /* add_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2277 NULL, /* add_buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2278 msn_rem_buddy, /* remove_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2279 NULL, /* remove_buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2280 msn_add_permit, /* add_permit */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2281 msn_add_deny, /* add_deny */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2282 msn_rem_permit, /* rem_permit */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2283 msn_rem_deny, /* rem_deny */ |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
2284 msn_set_permit_deny, /* set_permit_deny */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2285 NULL, /* join_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2286 NULL, /* reject chat invite */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2287 NULL, /* get_chat_name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2288 msn_chat_invite, /* chat_invite */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2289 msn_chat_leave, /* chat_leave */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2290 NULL, /* chat_whisper */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2291 msn_chat_send, /* chat_send */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2292 msn_keepalive, /* keepalive */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2293 NULL, /* register_user */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2294 NULL, /* get_cb_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2295 NULL, /* get_cb_away */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2296 NULL, /* alias_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2297 msn_group_buddy, /* group_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2298 msn_rename_group, /* rename_group */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2299 NULL, /* buddy_free */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2300 msn_convo_closed, /* convo_closed */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2301 msn_normalize, /* normalize */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2302 msn_set_buddy_icon, /* set_buddy_icon */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2303 msn_remove_group, /* remove_group */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2304 NULL, /* get_cb_real_name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2305 NULL, /* set_chat_topic */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2306 NULL, /* find_blist_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2307 NULL, /* roomlist_get_list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2308 NULL, /* roomlist_cancel */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2309 NULL, /* roomlist_expand_category */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2310 msn_can_receive_file, /* can_receive_file */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 msn_send_file, /* send_file */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2312 msn_new_xfer, /* new_xfer */ |
16848
133932a97faa
Make MSN mobile buddies offline, mobile, and offline-messagable. Fixes #215
Sean Egan <seanegan@gmail.com>
parents:
16675
diff
changeset
|
2313 msn_offline_message, /* offline_message */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2314 NULL, /* whiteboard_prpl_ops */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2315 NULL, /* send_raw */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2316 NULL, /* roomlist_room_serialize */ |
19488
ebe2d2e71223
Fixed merge errors stemming from the fact that the main branch and my branch both added something to the prpl struct
Andreas Monitzer <pidgin@monitzer.com>
parents:
19465
diff
changeset
|
2317 NULL, /* unregister_user */ |
19465
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
2318 msn_send_attention, /* send_attention */ |
d9d9283680a4
In MSN prpl, use attention API. Can be disabled by undefining
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18063
diff
changeset
|
2319 msn_attention_types, /* attention_types */ |
22896
087c3ed328d3
This modifies Jaywalker's patch to use a GHashTable, per Stu's suggestion in
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22894
diff
changeset
|
2320 msn_get_account_text_table /* get_account_text_table */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2321 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2322 |
15823 | 2323 static PurplePluginInfo info = |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2324 { |
15823 | 2325 PURPLE_PLUGIN_MAGIC, |
2326 PURPLE_MAJOR_VERSION, | |
2327 PURPLE_MINOR_VERSION, | |
2328 PURPLE_PLUGIN_PROTOCOL, /**< type */ | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2329 NULL, /**< ui_requirement */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2330 0, /**< flags */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2331 NULL, /**< dependencies */ |
15823 | 2332 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2334 "prpl-msn", /**< id */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2335 "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
|
2336 DISPLAY_VERSION, /**< version */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2337 /** summary */ |
19797
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
2338 N_("Windows Live Messenger Protocol Plugin"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2339 /** description */ |
19797
60bc06498746
Committing khc's msnp14 changes from Trac Ticket #148. --rlaager
Ka-Hing Cheung <khc@hxbc.us>
parents:
15823
diff
changeset
|
2340 N_("Windows Live Messenger Protocol Plugin"), |
20425
5048651671e1
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents:
20422
diff
changeset
|
2341 "Christian Hammond <chipx86@gnupdate.org>, " |
5048651671e1
Revert a bunch of whitespace changes so reviewing a diff against
Stu Tomlinson <stu@nosnilmot.com>
parents:
20422
diff
changeset
|
2342 "MaYuan <mayuan2006@gmail.com>", /**< author */ |
15823 | 2343 PURPLE_WEBSITE, /**< homepage */ |
15374
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 msn_load, /**< load */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2346 msn_unload, /**< unload */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2347 NULL, /**< destroy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2348 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2349 NULL, /**< ui_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2350 &prpl_info, /**< extra_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2351 NULL, /**< prefs_info */ |
16675
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16483
diff
changeset
|
2352 msn_actions, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16483
diff
changeset
|
2353 |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16483
diff
changeset
|
2354 /* padding */ |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16483
diff
changeset
|
2355 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16483
diff
changeset
|
2356 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16483
diff
changeset
|
2357 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16483
diff
changeset
|
2358 NULL |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2359 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2360 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2361 static void |
15823 | 2362 init_plugin(PurplePlugin *plugin) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2363 { |
15823 | 2364 PurpleAccountOption *option; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2365 |
15823 | 2366 option = purple_account_option_string_new(_("Server"), "server", |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
2367 WLM_SERVER); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 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
|
2369 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 |
20394
4a099e4d0d09
propagate from branch 'im.pidgin.pidgin' (head 98b6b547b29ea1192b73cc4e1de1e674edef4328)
Richard Laager <rlaager@wiktel.com>
parents:
15823
diff
changeset
|
2371 option = purple_account_option_int_new(_("Port"), "port", WLM_PORT); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2372 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
|
2373 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 |
15823 | 2375 option = purple_account_option_bool_new(_("Use HTTP Method"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2376 "http_method", FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2377 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
|
2378 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2379 |
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
|
2380 option = purple_account_option_string_new(_("HTTP Method Server"), |
19993
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
2381 "http_method_server", MSN_HTTPCONN_SERVER); |
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
2382 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
2383 option); |
e73e510d56ec
A fix from Laszlo Pandy to make the MSN HTTP Method work again. Fixes #2638 and should make a number of people happy. This introduces a new string that isn't marked as translatable for 2.2.0 because it is so late in the game.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19718
diff
changeset
|
2384 |
15823 | 2385 option = purple_account_option_bool_new(_("Show custom smileys"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 "custom_smileys", TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 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
|
2388 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2389 |
15823 | 2390 purple_cmd_register("nudge", "", PURPLE_CMD_P_PRPL, |
2391 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_PRPL_ONLY, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2392 "prpl-msn", msn_cmd_nudge, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2393 _("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
|
2394 |
15823 | 2395 purple_prefs_remove("/plugins/prpl/msn"); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15591
diff
changeset
|
2396 |
15823 | 2397 purple_signal_connect(purple_get_core(), "uri-handler", plugin, |
2398 PURPLE_CALLBACK(msn_uri_handler), NULL); | |
15374
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 |
15823 | 2401 PURPLE_INIT_PLUGIN(msn, init_plugin, info); |