Mercurial > pidgin
annotate src/protocols/msn/msn.c @ 14140:ee80f766b7e3
[gaim-migrate @ 16782]
Fix a warning:
nexus.c:299: warning: no previous prototype for 'nexus_challenge_data_lookup'
And change this code to use tab indentation
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 16 Aug 2006 06:11:10 +0000 |
parents | 4ec9f5b2a653 |
children |
rev | line source |
---|---|
4542
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
1 /** |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
2 * @file msn.c The MSN protocol plugin |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
3 * |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
4 * gaim |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
5 * |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
6 * Gaim is the legal property of its developers, whose names are too numerous |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
8 * source distribution. |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
9 * |
4542
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
13 * (at your option) any later version. |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
14 * |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
18 * GNU General Public License for more details. |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
19 * |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
23 */ |
9243 | 24 #define PHOTO_SUPPORT 1 |
25 | |
6827
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6801
diff
changeset
|
26 #include <glib.h> |
1cfbb731aa1f
[gaim-migrate @ 7372]
Christian Hammond <chipx86@chipx86.com>
parents:
6801
diff
changeset
|
27 |
4542
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
28 #include "msn.h" |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
29 #include "accountopt.h" |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
30 #include "msg.h" |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
31 #include "page.h" |
8713 | 32 #include "pluginpref.h" |
5626
6275ac113622
[gaim-migrate @ 6033]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
33 #include "prefs.h" |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
34 #include "session.h" |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
35 #include "state.h" |
13628
5773f46e6bdf
[gaim-migrate @ 16015]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
13627
diff
changeset
|
36 #include "util.h" |
11321 | 37 #include "cmds.h" |
9713 | 38 #include "prpl.h" |
13628
5773f46e6bdf
[gaim-migrate @ 16015]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
13627
diff
changeset
|
39 #include "msn-utils.h" |
9943 | 40 #include "version.h" |
4546
a951bb590857
[gaim-migrate @ 4825]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4542
diff
changeset
|
41 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
42 #include "switchboard.h" |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
43 #include "notification.h" |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
44 #include "sync.h" |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
45 #include "slplink.h" |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
46 |
9243 | 47 #if PHOTO_SUPPORT |
48 #include "imgstore.h" | |
49 #endif | |
50 | |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
51 typedef struct |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
52 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
53 GaimConnection *gc; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
54 const char *passport; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
55 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
56 } MsnMobileData; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
57 |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
58 typedef struct |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
59 { |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
60 GaimConnection *gc; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
61 char *name; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
62 |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
63 } MsnGetInfoData; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
64 |
9243 | 65 typedef struct |
66 { | |
67 MsnGetInfoData *info_data; | |
68 char *stripped; | |
69 char *url_buffer; | |
70 GString *s; | |
71 char *photo_url_text; | |
72 char *tooltip_text; | |
9510 | 73 const char *title; |
9243 | 74 |
75 } MsnGetInfoStepTwoData; | |
76 | |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
77 static const char * |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
78 msn_normalize(const GaimAccount *account, const char *str) |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
79 { |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
80 static char buf[BUF_LEN]; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
81 char *tmp; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
82 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
83 g_return_val_if_fail(str != NULL, NULL); |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
84 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
85 g_snprintf(buf, sizeof(buf), "%s%s", str, |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
86 (strchr(str, '@') ? "" : "@hotmail.com")); |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
87 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
88 tmp = g_utf8_strdown(buf, -1); |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
89 strncpy(buf, tmp, sizeof(buf)); |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
90 g_free(tmp); |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
91 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
92 return buf; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
93 } |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
94 |
11321 | 95 static GaimCmdRet |
96 msn_cmd_nudge(GaimConversation *conv, const gchar *cmd, gchar **args, gchar **error, void *data) | |
97 { | |
98 GaimAccount *account = gaim_conversation_get_account(conv); | |
99 GaimConnection *gc = gaim_account_get_connection(account); | |
100 MsnMessage *msg; | |
101 MsnSession *session; | |
102 MsnSwitchBoard *swboard; | |
103 | |
104 msg = msn_message_new_nudge(); | |
105 session = gc->proto_data; | |
106 swboard = msn_session_get_swboard(session, gaim_conversation_get_name(conv), MSN_SB_FLAG_IM); | |
107 | |
13634 | 108 if (swboard == NULL) |
11321 | 109 return GAIM_CMD_RET_FAILED; |
110 | |
111 msn_switchboard_send_msg(swboard, msg, TRUE); | |
112 | |
113 gaim_conversation_write(conv, NULL, _("You have just sent a Nudge!"), GAIM_MESSAGE_SYSTEM, time(NULL)); | |
114 | |
115 return GAIM_CMD_RET_OK; | |
116 } | |
117 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
118 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
119 msn_act_id(GaimConnection *gc, const char *entry) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
120 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
121 MsnCmdProc *cmdproc; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
122 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
123 GaimAccount *account; |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
124 const char *alias; |
2086 | 125 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
126 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
127 cmdproc = session->notification->cmdproc; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
128 account = gaim_connection_get_account(gc); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
129 |
10069
7cbe12859d3a
[gaim-migrate @ 11045]
Luke Schierer <lschiere@pidgin.im>
parents:
10068
diff
changeset
|
130 if(entry && strlen(entry)) |
7cbe12859d3a
[gaim-migrate @ 11045]
Luke Schierer <lschiere@pidgin.im>
parents:
10068
diff
changeset
|
131 alias = gaim_url_encode(entry); |
7cbe12859d3a
[gaim-migrate @ 11045]
Luke Schierer <lschiere@pidgin.im>
parents:
10068
diff
changeset
|
132 else |
7cbe12859d3a
[gaim-migrate @ 11045]
Luke Schierer <lschiere@pidgin.im>
parents:
10068
diff
changeset
|
133 alias = ""; |
3171 | 134 |
8333
85dbaac926a7
[gaim-migrate @ 9057]
Christian Hammond <chipx86@chipx86.com>
parents:
8298
diff
changeset
|
135 if (strlen(alias) > BUDDY_ALIAS_MAXLEN) |
85dbaac926a7
[gaim-migrate @ 9057]
Christian Hammond <chipx86@chipx86.com>
parents:
8298
diff
changeset
|
136 { |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5382
diff
changeset
|
137 gaim_notify_error(gc, NULL, |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5382
diff
changeset
|
138 _("Your new MSN friendly name is too long."), NULL); |
2738
01f0497fe6c8
[gaim-migrate @ 2751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
139 return; |
01f0497fe6c8
[gaim-migrate @ 2751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
140 } |
01f0497fe6c8
[gaim-migrate @ 2751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
141 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
142 msn_cmdproc_send(cmdproc, "REA", "%s %s", |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
143 gaim_account_get_username(account), |
10069
7cbe12859d3a
[gaim-migrate @ 11045]
Luke Schierer <lschiere@pidgin.im>
parents:
10068
diff
changeset
|
144 alias); |
2086 | 145 } |
146 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
147 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
148 msn_set_prp(GaimConnection *gc, const char *type, const char *entry) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
149 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
150 MsnCmdProc *cmdproc; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
151 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
152 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
153 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
154 cmdproc = session->notification->cmdproc; |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
155 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
156 if (entry == NULL || *entry == '\0') |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
157 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
158 msn_cmdproc_send(cmdproc, "PRP", "%s", type); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
159 } |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
160 else |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
161 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
162 msn_cmdproc_send(cmdproc, "PRP", "%s %s", type, |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
163 gaim_url_encode(entry)); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
164 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
165 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
166 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
167 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
168 msn_set_home_phone_cb(GaimConnection *gc, const char *entry) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
169 { |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
170 msn_set_prp(gc, "PHH", entry); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
171 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
172 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
173 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
174 msn_set_work_phone_cb(GaimConnection *gc, const char *entry) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
175 { |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
176 msn_set_prp(gc, "PHW", entry); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
177 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
178 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
179 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
180 msn_set_mobile_phone_cb(GaimConnection *gc, const char *entry) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
181 { |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
182 msn_set_prp(gc, "PHM", entry); |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
183 } |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
184 |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
185 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
186 enable_msn_pages_cb(GaimConnection *gc) |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
187 { |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
188 msn_set_prp(gc, "MOB", "Y"); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
189 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
190 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
191 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
192 disable_msn_pages_cb(GaimConnection *gc) |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
193 { |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
194 msn_set_prp(gc, "MOB", "N"); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
195 } |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
196 |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
197 static void |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
198 send_to_mobile(GaimConnection *gc, const char *who, const char *entry) |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
199 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
200 MsnTransaction *trans; |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8595
diff
changeset
|
201 MsnSession *session; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
202 MsnCmdProc *cmdproc; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
203 MsnPage *page; |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8595
diff
changeset
|
204 char *payload; |
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8595
diff
changeset
|
205 size_t payload_len; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
206 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
207 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
208 cmdproc = session->notification->cmdproc; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
209 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
210 page = msn_page_new(); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
211 msn_page_set_body(page, entry); |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8595
diff
changeset
|
212 |
9092
9e5a709c30a8
[gaim-migrate @ 9869]
Christian Hammond <chipx86@chipx86.com>
parents:
9091
diff
changeset
|
213 payload = msn_page_gen_payload(page, &payload_len); |
8646
1e211dde3cae
[gaim-migrate @ 9398]
Christian Hammond <chipx86@chipx86.com>
parents:
8595
diff
changeset
|
214 |
10225 | 215 trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %d", who, payload_len); |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
216 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
217 msn_transaction_set_payload(trans, payload, payload_len); |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
218 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
219 msn_page_destroy(page); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
220 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
221 msn_cmdproc_send_trans(cmdproc, trans); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
222 } |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
223 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
224 static void |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
225 send_to_mobile_cb(MsnMobileData *data, const char *entry) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
226 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
227 send_to_mobile(data->gc, data->passport, entry); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
228 g_free(data); |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
229 } |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
230 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
231 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
232 close_mobile_page_cb(MsnMobileData *data, const char *entry) |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
233 { |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
234 g_free(data); |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
235 } |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
236 |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
237 /* -- */ |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
238 |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
239 static void |
9015 | 240 msn_show_set_friendly_name(GaimPluginAction *action) |
2086 | 241 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
242 GaimConnection *gc; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
243 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
244 gc = (GaimConnection *) action->context; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
245 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
246 gaim_request_input(gc, NULL, _("Set your friendly name."), |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
247 _("This is the name that other MSN buddies will " |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
248 "see you as."), |
8697 | 249 gaim_connection_get_display_name(gc), FALSE, FALSE, NULL, |
5481
084147a0d9e4
[gaim-migrate @ 5877]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
250 _("OK"), G_CALLBACK(msn_act_id), |
084147a0d9e4
[gaim-migrate @ 5877]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
251 _("Cancel"), NULL, gc); |
2086 | 252 } |
253 | |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
254 static void |
9015 | 255 msn_show_set_home_phone(GaimPluginAction *action) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
256 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
257 GaimConnection *gc; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
258 MsnSession *session; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
259 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
260 gc = (GaimConnection *) action->context; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
261 session = gc->proto_data; |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
262 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
263 gaim_request_input(gc, NULL, _("Set your home phone number."), NULL, |
8697 | 264 msn_user_get_home_phone(session->user), FALSE, FALSE, NULL, |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
265 _("OK"), G_CALLBACK(msn_set_home_phone_cb), |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
266 _("Cancel"), NULL, gc); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
267 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
268 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
269 static void |
9015 | 270 msn_show_set_work_phone(GaimPluginAction *action) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
271 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
272 GaimConnection *gc; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
273 MsnSession *session; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
274 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
275 gc = (GaimConnection *) action->context; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
276 session = gc->proto_data; |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
277 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
278 gaim_request_input(gc, NULL, _("Set your work phone number."), NULL, |
8697 | 279 msn_user_get_work_phone(session->user), FALSE, FALSE, NULL, |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
280 _("OK"), G_CALLBACK(msn_set_work_phone_cb), |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
281 _("Cancel"), NULL, gc); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
282 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
283 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
284 static void |
9015 | 285 msn_show_set_mobile_phone(GaimPluginAction *action) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
286 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
287 GaimConnection *gc; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
288 MsnSession *session; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
289 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
290 gc = (GaimConnection *) action->context; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
291 session = gc->proto_data; |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
292 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
293 gaim_request_input(gc, NULL, _("Set your mobile phone number."), NULL, |
8697 | 294 msn_user_get_mobile_phone(session->user), FALSE, FALSE, NULL, |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
295 _("OK"), G_CALLBACK(msn_set_mobile_phone_cb), |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
296 _("Cancel"), NULL, gc); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
297 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
298 |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
299 static void |
9015 | 300 msn_show_set_mobile_pages(GaimPluginAction *action) |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
301 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
302 GaimConnection *gc; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
303 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
304 gc = (GaimConnection *) action->context; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
305 |
5496
b7c0be69c749
[gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents:
5491
diff
changeset
|
306 gaim_request_action(gc, NULL, _("Allow MSN Mobile pages?"), |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
307 _("Do you want to allow or disallow people on " |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
308 "your buddy list to send you MSN Mobile pages " |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
309 "to your cell phone or other mobile device?"), |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
310 -1, gc, 3, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
311 _("Allow"), G_CALLBACK(enable_msn_pages_cb), |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
312 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
313 _("Cancel"), NULL); |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
314 } |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
315 |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
316 static void |
11321 | 317 msn_show_hotmail_inbox(GaimPluginAction *action) |
318 { | |
319 GaimConnection *gc; | |
320 MsnSession *session; | |
321 | |
322 gc = (GaimConnection *) action->context; | |
323 session = gc->proto_data; | |
324 | |
325 if (session->passport_info.file == NULL) | |
326 { | |
327 gaim_notify_error(gc, NULL, | |
328 _("This Hotmail account may not be active."), NULL); | |
329 return; | |
330 } | |
331 | |
332 gaim_notify_uri(gc, session->passport_info.file); | |
333 } | |
334 | |
335 static void | |
9030 | 336 show_send_to_mobile_cb(GaimBlistNode *node, gpointer ignored) |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
337 { |
9030 | 338 GaimBuddy *buddy; |
339 GaimConnection *gc; | |
9042 | 340 MsnSession *session; |
341 MsnMobileData *data; | |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
342 |
9030 | 343 g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node)); |
344 | |
345 buddy = (GaimBuddy *) node; | |
346 gc = gaim_account_get_connection(buddy->account); | |
347 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
348 session = gc->proto_data; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
349 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
350 data = g_new0(MsnMobileData, 1); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
351 data->gc = gc; |
9030 | 352 data->passport = buddy->name; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
353 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
354 gaim_request_input(gc, NULL, _("Send a mobile message."), NULL, |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
355 NULL, TRUE, FALSE, NULL, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
356 _("Page"), G_CALLBACK(send_to_mobile_cb), |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
357 _("Close"), G_CALLBACK(close_mobile_page_cb), |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
358 data); |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
359 } |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
360 |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
361 static void |
9030 | 362 initiate_chat_cb(GaimBlistNode *node, gpointer data) |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
363 { |
9030 | 364 GaimBuddy *buddy; |
365 GaimConnection *gc; | |
366 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
367 MsnSession *session; |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
368 MsnSwitchBoard *swboard; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
369 |
9030 | 370 g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node)); |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
371 |
9030 | 372 buddy = (GaimBuddy *) node; |
373 gc = gaim_account_get_connection(buddy->account); | |
374 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
375 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
376 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
377 swboard = msn_switchboard_new(session); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
378 msn_switchboard_request(swboard); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
379 msn_switchboard_request_add_user(swboard, buddy->name); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
380 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
381 /* TODO: This might move somewhere else, after USR might be */ |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
382 swboard->chat_id = session->conv_seq++; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
383 swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat"); |
10773 | 384 swboard->flag = MSN_SB_FLAG_IM; |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
385 |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
386 gaim_conv_chat_add_user(GAIM_CONV_CHAT(swboard->conv), |
9846 | 387 gaim_account_get_username(buddy->account), NULL, GAIM_CBFLAGS_NONE, TRUE); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
388 } |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
389 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
390 static void |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
391 t_msn_xfer_init(GaimXfer *xfer) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
392 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
393 MsnSlpLink *slplink; |
10102 | 394 const char *filename; |
395 FILE *fp; | |
396 | |
397 filename = gaim_xfer_get_local_filename(xfer); | |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
398 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
399 slplink = xfer->data; |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
400 |
10589
0f7452b1f777
[gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10568
diff
changeset
|
401 if ((fp = g_fopen(filename, "rb")) == NULL) |
10102 | 402 { |
403 GaimAccount *account; | |
404 const char *who; | |
405 char *msg; | |
406 | |
407 account = slplink->session->account; | |
408 who = slplink->remote_user; | |
409 | |
410 msg = g_strdup_printf(_("Error reading %s: \n%s.\n"), | |
411 filename, strerror(errno)); | |
10654 | 412 gaim_xfer_error(gaim_xfer_get_type(xfer), account, xfer->who, msg); |
10102 | 413 gaim_xfer_cancel_local(xfer); |
414 g_free(msg); | |
415 | |
416 return; | |
417 } | |
418 fclose(fp); | |
419 | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
420 msn_slplink_request_ft(slplink, xfer); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
421 } |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
422 |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
423 static GaimXfer* |
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
424 msn_new_xfer(GaimConnection *gc, const char *who) |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
425 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
426 MsnSession *session; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
427 MsnSlpLink *slplink; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
428 GaimXfer *xfer; |
12161 | 429 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
430 session = gc->proto_data; |
12161 | 431 |
9466 | 432 xfer = gaim_xfer_new(gc->account, GAIM_XFER_SEND, who); |
12161 | 433 |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
434 slplink = msn_session_get_slplink(session, who); |
12161 | 435 |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
436 xfer->data = slplink; |
12161 | 437 |
438 gaim_xfer_set_init_fnc(xfer, t_msn_xfer_init); | |
439 | |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
440 return xfer; |
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
441 } |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
442 |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
443 static void |
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
444 msn_send_file(GaimConnection *gc, const char *who, const char *file) |
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
445 { |
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
446 GaimXfer *xfer = msn_new_xfer(gc, who); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
447 |
9466 | 448 if (file) |
449 gaim_xfer_request_accepted(xfer, file); | |
450 else | |
451 gaim_xfer_request(xfer); | |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
452 } |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
453 |
10116 | 454 static gboolean |
455 msn_can_receive_file(GaimConnection *gc, const char *who) | |
456 { | |
457 GaimAccount *account; | |
458 char *normal; | |
459 gboolean ret; | |
460 | |
461 account = gaim_connection_get_account(gc); | |
462 | |
463 normal = g_strdup(msn_normalize(account, gaim_account_get_username(account))); | |
464 | |
465 ret = strcmp(normal, msn_normalize(account, who)); | |
466 | |
467 g_free(normal); | |
468 | |
469 return ret; | |
470 } | |
471 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
472 /************************************************************************** |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
473 * Protocol Plugin ops |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
474 **************************************************************************/ |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
475 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
476 static const char * |
6695 | 477 msn_list_icon(GaimAccount *a, GaimBuddy *b) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
478 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
479 return "msn"; |
2993 | 480 } |
481 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
482 static void |
9953 | 483 msn_list_emblems(GaimBuddy *b, const char **se, const char **sw, |
484 const char **nw, const char **ne) | |
2086 | 485 { |
5372
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
486 MsnUser *user; |
9967 | 487 GaimPresence *presence; |
9953 | 488 const char *emblems[4] = { NULL, NULL, NULL, NULL }; |
10068
f948913f3c33
[gaim-migrate @ 11044]
Luke Schierer <lschiere@pidgin.im>
parents:
10063
diff
changeset
|
489 int i = 0; |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
490 |
5372
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
491 user = b->proto_data; |
9967 | 492 presence = gaim_buddy_get_presence(b); |
5372
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
493 |
9967 | 494 if (!gaim_presence_is_online(presence)) |
10068
f948913f3c33
[gaim-migrate @ 11044]
Luke Schierer <lschiere@pidgin.im>
parents:
10063
diff
changeset
|
495 emblems[i++] = "offline"; |
9967 | 496 else if (gaim_presence_is_status_active(presence, "busy") || |
497 gaim_presence_is_status_active(presence, "phone")) | |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
498 emblems[i++] = "occupied"; |
10451 | 499 else if (!gaim_presence_is_available(presence)) |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
500 emblems[i++] = "away"; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
501 |
10068
f948913f3c33
[gaim-migrate @ 11044]
Luke Schierer <lschiere@pidgin.im>
parents:
10063
diff
changeset
|
502 if (user == NULL) |
f948913f3c33
[gaim-migrate @ 11044]
Luke Schierer <lschiere@pidgin.im>
parents:
10063
diff
changeset
|
503 { |
f948913f3c33
[gaim-migrate @ 11044]
Luke Schierer <lschiere@pidgin.im>
parents:
10063
diff
changeset
|
504 emblems[0] = "offline"; |
f948913f3c33
[gaim-migrate @ 11044]
Luke Schierer <lschiere@pidgin.im>
parents:
10063
diff
changeset
|
505 } |
10275 | 506 else |
507 { | |
508 if (user->mobile) | |
509 emblems[i++] = "wireless"; | |
510 } | |
10068
f948913f3c33
[gaim-migrate @ 11044]
Luke Schierer <lschiere@pidgin.im>
parents:
10063
diff
changeset
|
511 |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
512 *se = emblems[0]; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
513 *sw = emblems[1]; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
514 *nw = emblems[2]; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
515 *ne = emblems[3]; |
2086 | 516 } |
517 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
518 static char * |
9951 | 519 msn_status_text(GaimBuddy *buddy) |
2086 | 520 { |
10044 | 521 GaimPresence *presence; |
522 GaimStatus *status; | |
523 | |
524 presence = gaim_buddy_get_presence(buddy); | |
525 status = gaim_presence_get_active_status(presence); | |
9951 | 526 |
10057
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
527 if (!gaim_presence_is_available(presence) && !gaim_presence_is_idle(presence)) |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
528 { |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
529 return g_strdup(gaim_status_get_name(status)); |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
530 } |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
531 |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
532 return NULL; |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
533 } |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
534 |
12970
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
535 static void |
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
536 msn_tooltip_text(GaimBuddy *buddy, GString *str, gboolean full) |
10057
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
537 { |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
538 MsnUser *user; |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
539 GaimPresence *presence = gaim_buddy_get_presence(buddy); |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
540 GaimStatus *status = gaim_presence_get_active_status(presence); |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
541 |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
542 user = buddy->proto_data; |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
543 |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
544 if (gaim_presence_is_online(presence)) |
10044 | 545 { |
12970
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
546 g_string_append_printf(str, _("\n<b>%s:</b> %s"), _("Status"), |
10057
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
547 gaim_presence_is_idle(presence) ? |
5d2a08d82e7a
[gaim-migrate @ 11022]
Luke Schierer <lschiere@pidgin.im>
parents:
10049
diff
changeset
|
548 _("Idle") : gaim_status_get_name(status)); |
10044 | 549 } |
2086 | 550 |
12948
563fb4f1e9fc
[gaim-migrate @ 15301]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
551 if (full && user) |
10093 | 552 { |
12970
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
553 g_string_append_printf(str, _("\n<b>%s:</b> %s"), _("Has you"), |
10093 | 554 (user->list_op & (1 << MSN_LIST_RL)) ? |
555 _("Yes") : _("No")); | |
12948
563fb4f1e9fc
[gaim-migrate @ 15301]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
556 |
563fb4f1e9fc
[gaim-migrate @ 15301]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
557 /* XXX: This is being shown in non-full tooltips because the |
563fb4f1e9fc
[gaim-migrate @ 15301]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
558 * XXX: blocked icon overlay isn't always accurate for MSN. |
563fb4f1e9fc
[gaim-migrate @ 15301]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
559 * XXX: This can die as soon as gaim_privacy_check() knows that |
563fb4f1e9fc
[gaim-migrate @ 15301]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
560 * XXX: this prpl always honors both the allow and deny lists. */ |
563fb4f1e9fc
[gaim-migrate @ 15301]
Richard Laager <rlaager@wiktel.com>
parents:
12943
diff
changeset
|
561 if (user) |
12970
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
562 g_string_append_printf(str, _("\n<b>%s:</b> %s"), _("Blocked"), |
10275 | 563 (user->list_op & (1 << MSN_LIST_BL)) ? |
564 _("Yes") : _("No")); | |
10093 | 565 } |
2086 | 566 } |
567 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
568 static GList * |
9951 | 569 msn_status_types(GaimAccount *account) |
2086 | 570 { |
9967 | 571 GaimStatusType *status; |
9951 | 572 GList *types = NULL; |
573 | |
9967 | 574 status = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, |
12595
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
575 NULL, NULL, FALSE, TRUE, FALSE); |
9967 | 576 types = g_list_append(types, status); |
2086 | 577 |
12595
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
578 status = gaim_status_type_new_full(GAIM_STATUS_AWAY, |
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
579 NULL, NULL, FALSE, TRUE, FALSE); |
9967 | 580 types = g_list_append(types, status); |
581 | |
12595
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
582 status = gaim_status_type_new_full(GAIM_STATUS_AWAY, |
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
583 "brb", _("Be Right Back"), FALSE, TRUE, FALSE); |
9967 | 584 types = g_list_append(types, status); |
585 | |
12595
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
586 status = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE, |
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
587 "busy", _("Busy"), FALSE, TRUE, FALSE); |
9967 | 588 types = g_list_append(types, status); |
589 | |
12595
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
590 status = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE, |
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
591 "phone", _("On the Phone"), FALSE, TRUE, FALSE); |
9967 | 592 types = g_list_append(types, status); |
593 | |
12595
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
594 status = gaim_status_type_new_full(GAIM_STATUS_AWAY, |
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
595 "lunch", _("Out to Lunch"), FALSE, TRUE, FALSE); |
9967 | 596 types = g_list_append(types, status); |
597 | |
12595
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
598 status = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE, |
3169cd6727ad
[gaim-migrate @ 14925]
Richard Laager <rlaager@wiktel.com>
parents:
12489
diff
changeset
|
599 NULL, NULL, FALSE, TRUE, FALSE); |
9967 | 600 types = g_list_append(types, status); |
9951 | 601 |
12658 | 602 status = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, |
603 NULL, NULL, FALSE, TRUE, FALSE); | |
604 types = g_list_append(types, status); | |
605 | |
9951 | 606 return types; |
2086 | 607 } |
608 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
609 static GList * |
9015 | 610 msn_actions(GaimPlugin *plugin, gpointer context) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
611 { |
11321 | 612 GaimConnection *gc = (GaimConnection *)context; |
613 GaimAccount *account; | |
614 const char *user; | |
615 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
616 GList *m = NULL; |
9015 | 617 GaimPluginAction *act; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
618 |
12243
d3cb077caf3e
[gaim-migrate @ 14545]
Richard Laager <rlaager@wiktel.com>
parents:
12216
diff
changeset
|
619 act = gaim_plugin_action_new(_("Set Friendly Name..."), |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
620 msn_show_set_friendly_name); |
9015 | 621 m = g_list_append(m, act); |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
622 m = g_list_append(m, NULL); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
623 |
12243
d3cb077caf3e
[gaim-migrate @ 14545]
Richard Laager <rlaager@wiktel.com>
parents:
12216
diff
changeset
|
624 act = gaim_plugin_action_new(_("Set Home Phone Number..."), |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
625 msn_show_set_home_phone); |
9015 | 626 m = g_list_append(m, act); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
627 |
12243
d3cb077caf3e
[gaim-migrate @ 14545]
Richard Laager <rlaager@wiktel.com>
parents:
12216
diff
changeset
|
628 act = gaim_plugin_action_new(_("Set Work Phone Number..."), |
9015 | 629 msn_show_set_work_phone); |
630 m = g_list_append(m, act); | |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
631 |
12243
d3cb077caf3e
[gaim-migrate @ 14545]
Richard Laager <rlaager@wiktel.com>
parents:
12216
diff
changeset
|
632 act = gaim_plugin_action_new(_("Set Mobile Phone Number..."), |
9015 | 633 msn_show_set_mobile_phone); |
634 m = g_list_append(m, act); | |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
635 m = g_list_append(m, NULL); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
636 |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
637 #if 0 |
12243
d3cb077caf3e
[gaim-migrate @ 14545]
Richard Laager <rlaager@wiktel.com>
parents:
12216
diff
changeset
|
638 act = gaim_plugin_action_new(_("Enable/Disable Mobile Devices..."), |
9015 | 639 msn_show_set_mobile_support); |
640 m = g_list_append(m, act); | |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
641 #endif |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
642 |
12243
d3cb077caf3e
[gaim-migrate @ 14545]
Richard Laager <rlaager@wiktel.com>
parents:
12216
diff
changeset
|
643 act = gaim_plugin_action_new(_("Allow/Disallow Mobile Pages..."), |
9015 | 644 msn_show_set_mobile_pages); |
645 m = g_list_append(m, act); | |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
646 |
11321 | 647 account = gaim_connection_get_account(gc); |
648 user = msn_normalize(account, gaim_account_get_username(account)); | |
649 | |
650 if (strstr(user, "@hotmail.com") != NULL) | |
651 { | |
652 m = g_list_append(m, NULL); | |
653 act = gaim_plugin_action_new(_("Open Hotmail Inbox"), | |
654 msn_show_hotmail_inbox); | |
655 m = g_list_append(m, act); | |
656 } | |
657 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
658 return m; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
659 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
660 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
661 static GList * |
9030 | 662 msn_buddy_menu(GaimBuddy *buddy) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
663 { |
5372
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
664 MsnUser *user; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
665 |
9030 | 666 GList *m = NULL; |
12919
248b8b39c671
[gaim-migrate @ 15272]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12886
diff
changeset
|
667 GaimMenuAction *act; |
6858
885c6528843b
[gaim-migrate @ 7403]
Christian Hammond <chipx86@chipx86.com>
parents:
6842
diff
changeset
|
668 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
669 g_return_val_if_fail(buddy != NULL, NULL); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
670 |
9030 | 671 user = buddy->proto_data; |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
672 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
673 if (user != NULL) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
674 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
675 if (user->mobile) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
676 { |
12919
248b8b39c671
[gaim-migrate @ 15272]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12886
diff
changeset
|
677 act = gaim_menu_action_new(_("Send to Mobile"), |
248b8b39c671
[gaim-migrate @ 15272]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12886
diff
changeset
|
678 GAIM_CALLBACK(show_send_to_mobile_cb), |
248b8b39c671
[gaim-migrate @ 15272]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12886
diff
changeset
|
679 NULL, NULL); |
9030 | 680 m = g_list_append(m, act); |
5382
b18332105302
[gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents:
5379
diff
changeset
|
681 } |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
682 } |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
683 |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
684 if (g_ascii_strcasecmp(buddy->name, |
13020
72300c551dc2
[gaim-migrate @ 15373]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12970
diff
changeset
|
685 gaim_account_get_username(buddy->account))) |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
686 { |
12919
248b8b39c671
[gaim-migrate @ 15272]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12886
diff
changeset
|
687 act = gaim_menu_action_new(_("Initiate _Chat"), |
248b8b39c671
[gaim-migrate @ 15272]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12886
diff
changeset
|
688 GAIM_CALLBACK(initiate_chat_cb), |
248b8b39c671
[gaim-migrate @ 15272]
Etan Reisner <pidgin@unreliablesource.net>
parents:
12886
diff
changeset
|
689 NULL, NULL); |
9030 | 690 m = g_list_append(m, act); |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
691 } |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
692 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
693 return m; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
694 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
695 |
9030 | 696 static GList * |
697 msn_blist_node_menu(GaimBlistNode *node) | |
698 { | |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
699 if(GAIM_BLIST_NODE_IS_BUDDY(node)) |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
700 { |
9030 | 701 return msn_buddy_menu((GaimBuddy *) node); |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
702 } |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
703 else |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
704 { |
9030 | 705 return NULL; |
706 } | |
707 } | |
708 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
709 static void |
11837 | 710 msn_login(GaimAccount *account) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
711 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
712 GaimConnection *gc; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
713 MsnSession *session; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
714 const char *username; |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
715 const char *host; |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7277
diff
changeset
|
716 gboolean http_method = FALSE; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
717 int port; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
718 |
7277
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
719 gc = gaim_account_get_connection(account); |
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
720 |
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
721 if (!gaim_ssl_is_supported()) |
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
722 { |
10914 | 723 gc->wants_to_die = TRUE; |
7277
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
724 gaim_connection_error(gc, |
8499
467b01d02f9c
[gaim-migrate @ 9235]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
725 _("SSL support is needed for MSN. Please install a supported " |
467b01d02f9c
[gaim-migrate @ 9235]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
726 "SSL library. See http://gaim.sf.net/faq-ssl.php for more " |
467b01d02f9c
[gaim-migrate @ 9235]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
727 "information.")); |
7277
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
728 |
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
729 return; |
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
730 } |
2972dad4438b
[gaim-migrate @ 7856]
Christian Hammond <chipx86@chipx86.com>
parents:
7262
diff
changeset
|
731 |
13914 | 732 http_method = gaim_account_get_bool(account, "http_method", FALSE); |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7277
diff
changeset
|
733 |
10463 | 734 host = gaim_account_get_string(account, "server", MSN_SERVER); |
10481 | 735 port = gaim_account_get_int(account, "port", MSN_PORT); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
736 |
10481 | 737 session = msn_session_new(account); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
738 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
739 gc->proto_data = session; |
9775 | 740 gc->flags |= GAIM_CONNECTION_HTML | GAIM_CONNECTION_FORMATTING_WBFO | GAIM_CONNECTION_NO_BGCOLOR | GAIM_CONNECTION_NO_FONTSIZE | GAIM_CONNECTION_NO_URLDESC; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
741 |
10481 | 742 msn_session_set_login_step(session, MSN_LOGIN_STEP_START); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
743 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
744 /* Hmm, I don't like this. */ |
10481 | 745 /* XXX shx: Me neither */ |
7322 | 746 username = msn_normalize(account, gaim_account_get_username(account)); |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
747 |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
748 if (strcmp(username, gaim_account_get_username(account))) |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
749 gaim_account_set_username(account, username); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
750 |
10568 | 751 if (!msn_session_connect(session, host, port, http_method)) |
752 gaim_connection_error(gc, _("Failed to connect to server.")); | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
753 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
754 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
755 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
756 msn_close(GaimConnection *gc) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
757 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
758 MsnSession *session; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
759 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
760 session = gc->proto_data; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
761 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
762 g_return_if_fail(session != NULL); |
8298
c719f9a181d4
[gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents:
8291
diff
changeset
|
763 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
764 msn_session_destroy(session); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
765 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
766 gc->proto_data = NULL; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
767 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
768 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
769 static int |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
770 msn_send_im(GaimConnection *gc, const char *who, const char *message, |
12216 | 771 GaimMessageFlags flags) |
2086 | 772 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
773 GaimAccount *account; |
10275 | 774 MsnMessage *msg; |
775 char *msgformat; | |
776 char *msgtext; | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
777 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
778 account = gaim_connection_get_account(gc); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
779 |
10275 | 780 msn_import_html(message, &msgformat, &msgtext); |
781 | |
782 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) | |
783 { | |
784 g_free(msgformat); | |
785 g_free(msgtext); | |
786 | |
787 return -E2BIG; | |
788 } | |
789 | |
790 msg = msn_message_new_plain(msgtext); | |
791 msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); | |
792 | |
793 g_free(msgformat); | |
794 g_free(msgtext); | |
795 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
796 if (g_ascii_strcasecmp(who, gaim_account_get_username(account))) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
797 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
798 MsnSession *session; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
799 MsnSwitchBoard *swboard; |
8595
1d5e31e518fc
[gaim-migrate @ 9346]
Christian Hammond <chipx86@chipx86.com>
parents:
8591
diff
changeset
|
800 |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
801 session = gc->proto_data; |
10773 | 802 swboard = msn_session_get_swboard(session, who, MSN_SB_FLAG_IM); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
803 |
10481 | 804 msn_switchboard_send_msg(swboard, msg, TRUE); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
805 } |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
806 else |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
807 { |
10275 | 808 char *body_str, *body_enc, *pre, *post; |
809 const char *format; | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
810 /* |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
811 * In MSN, you can't send messages to yourself, so |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
812 * we'll fake like we received it ;) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
813 */ |
10275 | 814 body_str = msn_message_to_string(msg); |
10732
c4cb90065e1d
[gaim-migrate @ 12334]
Luke Schierer <lschiere@pidgin.im>
parents:
10716
diff
changeset
|
815 body_enc = g_markup_escape_text(body_str, -1); |
10275 | 816 g_free(body_str); |
817 | |
818 format = msn_message_get_attr(msg, "X-MMS-IM-Format"); | |
819 msn_parse_format(format, &pre, &post); | |
10568 | 820 body_str = g_strdup_printf("%s%s%s", pre ? pre : "", |
821 body_enc ? body_enc : "", post ? post : ""); | |
10346 | 822 g_free(body_enc); |
10275 | 823 g_free(pre); |
824 g_free(post); | |
825 | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
826 serv_got_typing_stopped(gc, who); |
10275 | 827 serv_got_im(gc, who, body_str, flags, time(NULL)); |
828 g_free(body_str); | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
829 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
830 |
10275 | 831 msn_message_destroy(msg); |
832 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
833 return 1; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
834 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
835 |
13842 | 836 static unsigned int |
837 msn_send_typing(GaimConnection *gc, const char *who, GaimTypingState state) | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
838 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
839 GaimAccount *account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
840 MsnSession *session; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
841 MsnSwitchBoard *swboard; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
842 MsnMessage *msg; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
843 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
844 account = gaim_connection_get_account(gc); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
845 session = gc->proto_data; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
846 |
13842 | 847 /* |
848 * TODO: I feel like this should be "if (state != GAIM_TYPING)" | |
849 * but this is how it was before, and I don't want to break | |
850 * anything. --KingAnt | |
851 */ | |
852 if (state == GAIM_NOT_TYPING) | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
853 return 0; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
854 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
855 if (!g_ascii_strcasecmp(who, gaim_account_get_username(account))) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
856 { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
857 /* We'll just fake it, since we're sending to ourself. */ |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5793
diff
changeset
|
858 serv_got_typing(gc, who, MSN_TYPING_RECV_TIMEOUT, GAIM_TYPING); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
859 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
860 return MSN_TYPING_SEND_TIMEOUT; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
861 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
862 |
10621 | 863 swboard = msn_session_find_swboard(session, who); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
864 |
10481 | 865 if (swboard == NULL || !msn_switchboard_can_send(swboard)) |
10346 | 866 return 0; |
867 | |
10773 | 868 swboard->flag |= MSN_SB_FLAG_IM; |
869 | |
10225 | 870 msg = msn_message_new(MSN_MSG_TYPING); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
871 msn_message_set_content_type(msg, "text/x-msmsgscontrol"); |
5505
870207a49f2f
[gaim-migrate @ 5904]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
872 msn_message_set_flag(msg, 'U'); |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
873 msn_message_set_attr(msg, "TypingUser", |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
874 gaim_account_get_username(account)); |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
875 msn_message_set_bin_data(msg, "\r\n", 2); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
876 |
10481 | 877 msn_switchboard_send_msg(swboard, msg, FALSE); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
878 |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
879 msn_message_destroy(msg); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
880 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
881 return MSN_TYPING_SEND_TIMEOUT; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
882 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
883 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
884 static void |
9967 | 885 msn_set_status(GaimAccount *account, GaimStatus *status) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
886 { |
9967 | 887 GaimConnection *gc; |
11992 | 888 MsnSession *session; |
9967 | 889 |
890 gc = gaim_account_get_connection(account); | |
891 | |
11028 | 892 if (gc != NULL) |
11992 | 893 { |
10646 | 894 session = gc->proto_data; |
11992 | 895 msn_change_status(session); |
896 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
897 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
898 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
899 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
900 msn_set_idle(GaimConnection *gc, int idle) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
901 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
902 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
903 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
904 session = gc->proto_data; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
905 |
11992 | 906 msn_change_status(session); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
907 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
908 |
11992 | 909 #if 0 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
910 static void |
10044 | 911 fake_userlist_add_buddy(MsnUserList *userlist, |
912 const char *who, int list_id, | |
913 const char *group_name) | |
914 { | |
915 MsnUser *user; | |
916 static int group_id_c = 1; | |
917 int group_id; | |
918 | |
919 group_id = -1; | |
920 | |
921 if (group_name != NULL) | |
922 { | |
923 MsnGroup *group; | |
924 group = msn_group_new(userlist, group_id_c, group_name); | |
925 group_id = group_id_c++; | |
926 } | |
927 | |
928 user = msn_userlist_find_user(userlist, who); | |
929 | |
930 if (user == NULL) | |
931 { | |
932 user = msn_user_new(userlist, who, NULL); | |
933 msn_userlist_add_user(userlist, user); | |
934 } | |
935 else | |
936 if (user->list_op & (1 << list_id)) | |
937 { | |
938 if (list_id == MSN_LIST_FL) | |
939 { | |
940 if (group_id >= 0) | |
941 if (g_list_find(user->group_ids, | |
942 GINT_TO_POINTER(group_id))) | |
943 return; | |
944 } | |
945 else | |
946 return; | |
947 } | |
948 | |
949 if (group_id >= 0) | |
950 { | |
951 user->group_ids = g_list_append(user->group_ids, | |
952 GINT_TO_POINTER(group_id)); | |
953 } | |
954 | |
955 user->list_op |= (1 << list_id); | |
956 } | |
11992 | 957 #endif |
10044 | 958 |
959 static void | |
9285 | 960 msn_add_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
961 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
962 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
963 MsnUserList *userlist; |
7261 | 964 const char *who; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
965 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
966 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
967 userlist = session->userlist; |
9285 | 968 who = msn_normalize(gc->account, buddy->name); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
969 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
970 if (!session->logged_in) |
10044 | 971 { |
11992 | 972 #if 0 |
10044 | 973 fake_userlist_add_buddy(session->sync_userlist, who, MSN_LIST_FL, |
974 group ? group->name : NULL); | |
11992 | 975 #else |
976 gaim_debug_error("msn", "msn_add_buddy called before connected\n"); | |
977 #endif | |
10044 | 978 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
979 return; |
10044 | 980 } |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
981 |
10044 | 982 #if 0 |
9290
2e5faf12a24c
[gaim-migrate @ 10093]
Christian Hammond <chipx86@chipx86.com>
parents:
9285
diff
changeset
|
983 if (group != NULL && group->name != NULL) |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
984 gaim_debug_info("msn", "msn_add_buddy: %s, %s\n", who, group->name); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
985 else |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
986 gaim_debug_info("msn", "msn_add_buddy: %s\n", who); |
10044 | 987 #endif |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
988 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
989 #if 0 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
990 /* Which is the max? */ |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
991 if (session->fl_users_count >= 150) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
992 { |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
993 gaim_debug_info("msn", "Too many buddies\n"); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
994 /* Buddy list full */ |
9285 | 995 /* TODO: gaim should be notified of this */ |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
996 return; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
997 } |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
998 #endif |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
999 |
10044 | 1000 /* XXX - Would group ever be NULL here? I don't think so... |
1001 * shx: Yes it should; MSN handles non-grouped buddies, and this is only | |
1002 * internal. */ | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1003 msn_userlist_add_buddy(userlist, who, MSN_LIST_FL, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1004 group ? group->name : NULL); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1005 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1006 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1007 static void |
9285 | 1008 msn_rem_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1009 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1010 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1011 MsnUserList *userlist; |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1012 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1013 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1014 userlist = session->userlist; |
9091
97a1fb329cd2
[gaim-migrate @ 9868]
Christian Hammond <chipx86@chipx86.com>
parents:
9086
diff
changeset
|
1015 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1016 if (!session->logged_in) |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1017 return; |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1018 |
9285 | 1019 /* XXX - Does buddy->name need to be msn_normalize'd here? --KingAnt */ |
1020 msn_userlist_rem_buddy(userlist, buddy->name, MSN_LIST_FL, group->name); | |
2086 | 1021 } |
1022 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1023 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1024 msn_add_permit(GaimConnection *gc, const char *who) |
2086 | 1025 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1026 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1027 MsnUserList *userlist; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1028 MsnUser *user; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1029 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1030 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1031 userlist = session->userlist; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1032 user = msn_userlist_find_user(userlist, who); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1033 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1034 if (!session->logged_in) |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1035 return; |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1036 |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1037 if (user != NULL && user->list_op & MSN_LIST_BL_OP) |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1038 msn_userlist_rem_buddy(userlist, who, MSN_LIST_BL, NULL); |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1039 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1040 msn_userlist_add_buddy(userlist, who, MSN_LIST_AL, NULL); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1041 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1042 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1043 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1044 msn_add_deny(GaimConnection *gc, const char *who) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1045 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1046 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1047 MsnUserList *userlist; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1048 MsnUser *user; |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1049 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1050 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1051 userlist = session->userlist; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1052 user = msn_userlist_find_user(userlist, who); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1053 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1054 if (!session->logged_in) |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1055 return; |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1056 |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1057 if (user != NULL && user->list_op & MSN_LIST_AL_OP) |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1058 msn_userlist_rem_buddy(userlist, who, MSN_LIST_AL, NULL); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1059 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1060 msn_userlist_add_buddy(userlist, who, MSN_LIST_BL, NULL); |
2086 | 1061 } |
1062 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1063 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1064 msn_rem_permit(GaimConnection *gc, const char *who) |
2086 | 1065 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1066 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1067 MsnUserList *userlist; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1068 MsnUser *user; |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1069 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1070 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1071 userlist = session->userlist; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1072 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1073 if (!session->logged_in) |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1074 return; |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1075 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1076 user = msn_userlist_find_user(userlist, who); |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1077 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1078 msn_userlist_rem_buddy(userlist, who, MSN_LIST_AL, NULL); |
2086 | 1079 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1080 if (user != NULL && user->list_op & MSN_LIST_RL_OP) |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1081 msn_userlist_add_buddy(userlist, who, MSN_LIST_BL, NULL); |
2086 | 1082 } |
1083 | |
12323
fc464a0abccc
[gaim-migrate @ 14627]
Richard Laager <rlaager@wiktel.com>
parents:
12318
diff
changeset
|
1084 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1085 msn_rem_deny(GaimConnection *gc, const char *who) |
2086 | 1086 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1087 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1088 MsnUserList *userlist; |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1089 MsnUser *user; |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1090 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1091 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1092 userlist = session->userlist; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1093 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1094 if (!session->logged_in) |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1095 return; |
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1096 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1097 user = msn_userlist_find_user(userlist, who); |
2213
a226ebf4be47
[gaim-migrate @ 2223]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2210
diff
changeset
|
1098 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1099 msn_userlist_rem_buddy(userlist, who, MSN_LIST_BL, NULL); |
7563
cb9c3b6d6de9
[gaim-migrate @ 8179]
Christian Hammond <chipx86@chipx86.com>
parents:
7469
diff
changeset
|
1100 |
9363
997c28571364
[gaim-migrate @ 10171]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
1101 if (user != NULL && user->list_op & MSN_LIST_RL_OP) |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1102 msn_userlist_add_buddy(userlist, who, MSN_LIST_AL, NULL); |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1103 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1104 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1105 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1106 msn_set_permit_deny(GaimConnection *gc) |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1107 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1108 GaimAccount *account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1109 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1110 MsnCmdProc *cmdproc; |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1111 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1112 account = gaim_connection_get_account(gc); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1113 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1114 cmdproc = session->notification->cmdproc; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1115 |
8175 | 1116 if (account->perm_deny == GAIM_PRIVACY_ALLOW_ALL || |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1117 account->perm_deny == GAIM_PRIVACY_DENY_USERS) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1118 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1119 msn_cmdproc_send(cmdproc, "BLP", "%s", "AL"); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1120 } |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1121 else |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1122 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1123 msn_cmdproc_send(cmdproc, "BLP", "%s", "BL"); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1124 } |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1125 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1126 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1127 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1128 msn_chat_invite(GaimConnection *gc, int id, const char *msg, |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1129 const char *who) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1130 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1131 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1132 MsnSwitchBoard *swboard; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1133 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1134 session = gc->proto_data; |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1135 |
10621 | 1136 swboard = msn_session_find_swboard_with_id(session, id); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1137 |
10533 | 1138 if (swboard == NULL) |
1139 { | |
1140 /* if we have no switchboard, everyone else left the chat already */ | |
1141 swboard = msn_switchboard_new(session); | |
1142 msn_switchboard_request(swboard); | |
1143 swboard->chat_id = id; | |
1144 swboard->conv = gaim_find_chat(gc, id); | |
1145 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1146 |
10773 | 1147 swboard->flag |= MSN_SB_FLAG_IM; |
1148 | |
10533 | 1149 msn_switchboard_request_add_user(swboard, who); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1150 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1151 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1152 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1153 msn_chat_leave(GaimConnection *gc, int id) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1154 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1155 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1156 MsnSwitchBoard *swboard; |
10621 | 1157 GaimConversation *conv; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1158 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1159 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1160 |
10621 | 1161 swboard = msn_session_find_swboard_with_id(session, id); |
10533 | 1162 |
1163 /* if swboard is NULL we were the only person left anyway */ | |
1164 if (swboard == NULL) | |
1165 return; | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1166 |
10621 | 1167 conv = swboard->conv; |
1168 | |
10773 | 1169 msn_switchboard_release(swboard, MSN_SB_FLAG_IM); |
10621 | 1170 |
1171 /* If other switchboards managed to associate themselves with this | |
1172 * conv, make sure they know it's gone! */ | |
1173 if (conv != NULL) | |
1174 { | |
1175 while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL) | |
1176 swboard->conv = NULL; | |
1177 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1178 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1179 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1180 static int |
12216 | 1181 msn_chat_send(GaimConnection *gc, int id, const char *message, GaimMessageFlags flags) |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1182 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1183 GaimAccount *account; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1184 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1185 MsnSwitchBoard *swboard; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1186 MsnMessage *msg; |
8922 | 1187 char *msgformat; |
1188 char *msgtext; | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1189 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1190 account = gaim_connection_get_account(gc); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1191 session = gc->proto_data; |
10621 | 1192 swboard = msn_session_find_swboard_with_id(session, id); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1193 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1194 if (swboard == NULL) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1195 return -EINVAL; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1196 |
10345 | 1197 if (!swboard->ready) |
1198 return 0; | |
10274 | 1199 |
10773 | 1200 swboard->flag |= MSN_SB_FLAG_IM; |
1201 | |
10345 | 1202 msn_import_html(message, &msgformat, &msgtext); |
10274 | 1203 |
10345 | 1204 if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) |
1205 { | |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1206 g_free(msgformat); |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1207 g_free(msgtext); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1208 |
10345 | 1209 return -E2BIG; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1210 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1211 |
10345 | 1212 msg = msn_message_new_plain(msgtext); |
1213 msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); | |
10481 | 1214 msn_switchboard_send_msg(swboard, msg, FALSE); |
10345 | 1215 msn_message_destroy(msg); |
1216 | |
1217 g_free(msgformat); | |
1218 g_free(msgtext); | |
1219 | |
1220 serv_got_chat_in(gc, id, gaim_account_get_username(account), 0, | |
1221 message, time(NULL)); | |
1222 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1223 return 0; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1224 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1225 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1226 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1227 msn_keepalive(GaimConnection *gc) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1228 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1229 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1230 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1231 session = gc->proto_data; |
10481 | 1232 |
10602 | 1233 if (!session->http_method) |
1234 { | |
1235 MsnCmdProc *cmdproc; | |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1236 |
10602 | 1237 cmdproc = session->notification->cmdproc; |
1238 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1239 msn_cmdproc_send_quick(cmdproc, "PNG", NULL, NULL); |
10602 | 1240 } |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1241 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1242 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1243 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1244 msn_group_buddy(GaimConnection *gc, const char *who, |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1245 const char *old_group_name, const char *new_group_name) |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1246 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1247 MsnSession *session; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1248 MsnUserList *userlist; |
9198
ab6636c5a136
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
1249 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1250 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1251 userlist = session->userlist; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1252 |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1253 msn_userlist_move_buddy(userlist, who, old_group_name, new_group_name); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1254 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1255 |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1256 static void |
9285 | 1257 msn_rename_group(GaimConnection *gc, const char *old_name, |
1258 GaimGroup *group, GList *moved_buddies) | |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1259 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1260 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1261 MsnCmdProc *cmdproc; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1262 int old_gid; |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1263 const char *enc_new_group_name; |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1264 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1265 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1266 cmdproc = session->notification->cmdproc; |
9285 | 1267 enc_new_group_name = gaim_url_encode(group->name); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1268 |
9285 | 1269 old_gid = msn_userlist_find_group_id(session->userlist, old_name); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1270 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1271 if (old_gid >= 0) |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1272 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1273 msn_cmdproc_send(cmdproc, "REG", "%d %s 0", old_gid, |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1274 enc_new_group_name); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1275 } |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1276 else |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1277 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1278 msn_cmdproc_send(cmdproc, "ADG", "%s 0", enc_new_group_name); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1279 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1280 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1281 |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1282 static void |
6059 | 1283 msn_convo_closed(GaimConnection *gc, const char *who) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1284 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1285 MsnSession *session; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1286 MsnSwitchBoard *swboard; |
10621 | 1287 GaimConversation *conv; |
6026
01dd6b652c22
[gaim-migrate @ 6476]
Christian Hammond <chipx86@chipx86.com>
parents:
6024
diff
changeset
|
1288 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1289 session = gc->proto_data; |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1290 |
10621 | 1291 swboard = msn_session_find_swboard(session, who); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1292 |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1293 /* |
10602 | 1294 * Don't perform an assertion here. If swboard is NULL, then the |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1295 * switchboard was either closed by the other party, or the person |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1296 * is talking to himself. |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1297 */ |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1298 if (swboard == NULL) |
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1299 return; |
4349 | 1300 |
10621 | 1301 conv = swboard->conv; |
1302 | |
10773 | 1303 msn_switchboard_release(swboard, MSN_SB_FLAG_IM); |
10621 | 1304 |
1305 /* If other switchboards managed to associate themselves with this | |
1306 * conv, make sure they know it's gone! */ | |
1307 if (conv != NULL) | |
1308 { | |
1309 while ((swboard = msn_session_find_swboard_with_conv(session, conv)) != NULL) | |
1310 swboard->conv = NULL; | |
1311 } | |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1312 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1313 |
6516 | 1314 static void |
7590
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7563
diff
changeset
|
1315 msn_set_buddy_icon(GaimConnection *gc, const char *filename) |
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7563
diff
changeset
|
1316 { |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1317 MsnSession *session; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1318 MsnUser *user; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1319 |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1320 session = gc->proto_data; |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1321 user = session->user; |
7590
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7563
diff
changeset
|
1322 |
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7563
diff
changeset
|
1323 msn_user_set_buddy_icon(user, filename); |
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7563
diff
changeset
|
1324 |
11992 | 1325 msn_change_status(session); |
7590
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7563
diff
changeset
|
1326 } |
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7563
diff
changeset
|
1327 |
3a48ade4f510
[gaim-migrate @ 8208]
Christian Hammond <chipx86@chipx86.com>
parents:
7563
diff
changeset
|
1328 static void |
9285 | 1329 msn_remove_group(GaimConnection *gc, GaimGroup *group) |
6885
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6859
diff
changeset
|
1330 { |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1331 MsnSession *session; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1332 MsnCmdProc *cmdproc; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1333 int group_id; |
6885
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6859
diff
changeset
|
1334 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1335 session = gc->proto_data; |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1336 cmdproc = session->notification->cmdproc; |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1337 |
9285 | 1338 if ((group_id = msn_userlist_find_group_id(session->userlist, group->name)) >= 0) |
6885
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6859
diff
changeset
|
1339 { |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1340 msn_cmdproc_send(cmdproc, "RMG", "%d", group_id); |
6885
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6859
diff
changeset
|
1341 } |
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6859
diff
changeset
|
1342 } |
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6859
diff
changeset
|
1343 |
9243 | 1344 static char * |
10044 | 1345 msn_tooltip_info_text(MsnGetInfoData *info_data) |
1346 { | |
1347 GString *s; | |
9243 | 1348 GaimBuddy *b; |
1349 | |
10044 | 1350 s = g_string_sized_new(80); /* wild guess */ |
1351 | |
9243 | 1352 b = gaim_find_buddy(gaim_connection_get_account(info_data->gc), |
10044 | 1353 info_data->name); |
9243 | 1354 |
10044 | 1355 if (b) |
1356 { | |
12970
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
1357 GString *str = g_string_new(""); |
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
1358 char *tmp; |
10044 | 1359 |
1360 if (b->alias && b->alias[0]) | |
1361 { | |
9243 | 1362 char *aliastext = g_markup_escape_text(b->alias, -1); |
1363 g_string_append_printf(s, _("<b>Alias:</b> %s<br>"), aliastext); | |
1364 g_free(aliastext); | |
1365 } | |
10044 | 1366 |
1367 if (b->server_alias) | |
1368 { | |
9243 | 1369 char *nicktext = g_markup_escape_text(b->server_alias, -1); |
9510 | 1370 g_string_append_printf(s, _("<b>%s:</b> "), _("Nickname")); |
9684 | 1371 g_string_append_printf(s, "<font sml=\"msn\">%s</font><br>", |
9243 | 1372 nicktext); |
1373 g_free(nicktext); | |
1374 } | |
10044 | 1375 |
12970
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
1376 msn_tooltip_text(b, str, TRUE); |
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
1377 tmp = gaim_strreplace((*str->str == '\n' ? str->str + 1 : str->str), |
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
1378 "\n", "<br>"); |
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
1379 g_string_free(str, TRUE); |
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
1380 g_string_append_printf(s, "%s<br>", tmp); |
ec9b92104904
[gaim-migrate @ 15323]
Richard Laager <rlaager@wiktel.com>
parents:
12948
diff
changeset
|
1381 g_free(tmp); |
9243 | 1382 } |
1383 | |
1384 return g_string_free(s, FALSE); | |
1385 } | |
1386 | |
1387 #if PHOTO_SUPPORT | |
1388 | |
10044 | 1389 static char * |
1390 msn_get_photo_url(const char *url_text) | |
1391 { | |
13390 | 1392 char *p, *q; |
9243 | 1393 |
13390 | 1394 if ((p = strstr(url_text, " contactparams:photopreauthurl=\"")) != NULL) |
13389 | 1395 { |
13390 | 1396 p += strlen(" contactparams:photopreauthurl=\""); |
13389 | 1397 } |
9243 | 1398 |
13390 | 1399 if (p && (strncmp(p, "http://", 8) == 0) && ((q = strchr(p, '"')) != NULL)) |
1400 return g_strndup(p, q - p); | |
13389 | 1401 |
13390 | 1402 return NULL; |
9243 | 1403 } |
1404 | |
1405 static void msn_got_photo(void *data, const char *url_text, size_t len); | |
1406 | |
1407 #endif | |
1408 | |
13389 | 1409 #if 0 |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1410 static char *msn_info_date_reformat(const char *field, size_t len) |
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1411 { |
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1412 char *tmp = g_strndup(field, len); |
13119
fcde3faa1f57
[gaim-migrate @ 15481]
Richard Laager <rlaager@wiktel.com>
parents:
13104
diff
changeset
|
1413 time_t t = gaim_str_to_time(tmp, FALSE, NULL, NULL, NULL); |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1414 |
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1415 g_free(tmp); |
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1416 return g_strdup(gaim_date_format_short(localtime(&t))); |
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1417 } |
13389 | 1418 #endif |
1419 | |
1420 #define MSN_GOT_INFO_GET_FIELD(a, b) \ | |
1421 found = gaim_markup_extract_info_field(stripped, stripped_len, s, \ | |
1422 "\n" a "\t", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \ | |
1423 if (found) \ | |
1424 sect_info = TRUE; | |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1425 |
6885
66dd420d3d23
[gaim-migrate @ 7431]
Christian Hammond <chipx86@chipx86.com>
parents:
6859
diff
changeset
|
1426 static void |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1427 msn_got_info(void *data, const char *url_text, size_t len) |
6516 | 1428 { |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1429 MsnGetInfoData *info_data = (MsnGetInfoData *)data; |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1430 char *stripped, *p, *q; |
6516 | 1431 char buf[1024]; |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1432 char *tooltip_text; |
6516 | 1433 char *user_url = NULL; |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1434 gboolean found; |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1435 gboolean has_info = FALSE; |
13389 | 1436 gboolean sect_info = FALSE; |
9510 | 1437 const char* title = NULL; |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1438 char *url_buffer; |
13389 | 1439 char *personal = NULL; |
1440 char *business = NULL; | |
1441 GString *s, *s2; | |
7675 | 1442 int stripped_len; |
9243 | 1443 #if PHOTO_SUPPORT |
1444 char *photo_url_text = NULL; | |
1445 MsnGetInfoStepTwoData *info2_data = NULL; | |
1446 #endif | |
6516 | 1447 |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1448 gaim_debug_info("msn", "In msn_got_info\n"); |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1449 |
13479
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1450 /* Make sure the connection is still valid */ |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1451 if (g_list_find(gaim_connections_get_all(), info_data->gc) == NULL) |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1452 { |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1453 gaim_debug_warning("msn", "invalid connection. ignoring buddy info.\n"); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1454 g_free(info_data->name); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1455 g_free(info_data); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1456 return; |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1457 } |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1458 |
9243 | 1459 tooltip_text = msn_tooltip_info_text(info_data); |
9510 | 1460 title = _("MSN Profile"); |
9243 | 1461 |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1462 if (url_text == NULL || strcmp(url_text, "") == 0) |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1463 { |
9243 | 1464 g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>", |
1465 tooltip_text, _("Error retrieving profile")); | |
1466 | |
11533
c9b815aeddc1
[gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents:
11531
diff
changeset
|
1467 gaim_notify_userinfo(info_data->gc, info_data->name, buf, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1468 |
9243 | 1469 g_free(tooltip_text); |
6516 | 1470 return; |
1471 } | |
1472 | |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1473 url_buffer = g_strdup(url_text); |
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1474 |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1475 /* If they have a homepage link, MSN masks it such that we need to |
7095
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1476 * fetch the url out before gaim_markup_strip_html() nukes it */ |
13389 | 1477 /* I don't think this works with the new spaces profiles - Stu 3/2/06 */ |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1478 if ((p = strstr(url_text, |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1479 "Take a look at my </font><A class=viewDesc title=\"")) != NULL) |
6516 | 1480 { |
1481 p += 50; | |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1482 |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1483 if ((q = strchr(p, '"')) != NULL) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1484 user_url = g_strndup(p, q - p); |
6516 | 1485 } |
1486 | |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1487 /* |
7095
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1488 * gaim_markup_strip_html() doesn't strip out character entities like |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1489 * and · |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1490 */ |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1491 while ((p = strstr(url_buffer, " ")) != NULL) |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1492 { |
9243 | 1493 *p = ' '; /* Turn 's into ordinary blanks */ |
1494 p += 1; | |
1495 memmove(p, p + 5, strlen(p + 5)); | |
1496 url_buffer[strlen(url_buffer) - 5] = '\0'; | |
6516 | 1497 } |
1498 | |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1499 while ((p = strstr(url_buffer, "·")) != NULL) |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1500 { |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1501 memmove(p, p + 6, strlen(p + 6)); |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1502 url_buffer[strlen(url_buffer) - 6] = '\0'; |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1503 } |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1504 |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1505 /* Nuke the nasty \r's that just get in the way */ |
11920 | 1506 gaim_str_strip_char(url_buffer, '\r'); |
6516 | 1507 |
8735
92cbf9713795
[gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents:
8713
diff
changeset
|
1508 /* MSN always puts in ' for apostrophes...replace them */ |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1509 while ((p = strstr(url_buffer, "'")) != NULL) |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1510 { |
6516 | 1511 *p = '\''; |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1512 memmove(p + 1, p + 5, strlen(p + 5)); |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1513 url_buffer[strlen(url_buffer) - 4] = '\0'; |
6516 | 1514 } |
1515 | |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1516 /* Nuke the html, it's easier than trying to parse the horrid stuff */ |
7095
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1517 stripped = gaim_markup_strip_html(url_buffer); |
7675 | 1518 stripped_len = strlen(stripped); |
6516 | 1519 |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1520 gaim_debug_misc("msn", "stripped = %p\n", stripped); |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1521 gaim_debug_misc("msn", "url_buffer = %p\n", url_buffer); |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1522 |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1523 /* Gonna re-use the memory we've already got for url_buffer */ |
7675 | 1524 /* No we're not. */ |
1525 s = g_string_sized_new(strlen(url_buffer)); | |
13389 | 1526 s2 = g_string_sized_new(strlen(url_buffer)); |
6516 | 1527 |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1528 /* Extract their Name and put it in */ |
13389 | 1529 MSN_GOT_INFO_GET_FIELD("Name", _("Name")) |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1530 |
13389 | 1531 /* General */ |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1532 MSN_GOT_INFO_GET_FIELD("Nickname", _("Nickname")); |
13389 | 1533 MSN_GOT_INFO_GET_FIELD("Age", _("Age")); |
1534 MSN_GOT_INFO_GET_FIELD("Gender", _("Gender")); | |
1535 MSN_GOT_INFO_GET_FIELD("Occupation", _("Occupation")); | |
1536 MSN_GOT_INFO_GET_FIELD("Location", _("Location")); | |
6516 | 1537 |
13389 | 1538 /* Extract their Interests and put it in */ |
7675 | 1539 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
13389 | 1540 "\nInterests\t", 0, " (/default.aspx?page=searchresults", 0, |
1541 "Undisclosed", _("Hobbies and Interests") /* _("Interests") */, | |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1542 0, NULL, NULL); |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1543 |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1544 if (found) |
13389 | 1545 sect_info = TRUE; |
1546 | |
1547 MSN_GOT_INFO_GET_FIELD("More about me", _("A Little About Me")); | |
1548 | |
1549 if (sect_info) | |
1550 { | |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1551 /* trim off the trailing "<br>\n" */ |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1552 g_string_truncate(s, strlen(s->str) - 5); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1553 g_string_append_printf(s2, _("%s<b>General</b><br>%s"), |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1554 (*tooltip_text) ? "<hr>" : "", s->str); |
13389 | 1555 s = g_string_truncate(s, 0); |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1556 has_info = TRUE; |
13389 | 1557 sect_info = FALSE; |
1558 } | |
6516 | 1559 |
13389 | 1560 |
1561 /* Social */ | |
1562 MSN_GOT_INFO_GET_FIELD("Marital status", _("Marital Status")); | |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1563 MSN_GOT_INFO_GET_FIELD("Interested in", _("Interests")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1564 MSN_GOT_INFO_GET_FIELD("Pets", _("Pets")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1565 MSN_GOT_INFO_GET_FIELD("Hometown", _("Hometown")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1566 MSN_GOT_INFO_GET_FIELD("Places lived", _("Places Lived")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1567 MSN_GOT_INFO_GET_FIELD("Fashion", _("Fashion")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1568 MSN_GOT_INFO_GET_FIELD("Humor", _("Humor")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1569 MSN_GOT_INFO_GET_FIELD("Music", _("Music")); |
13389 | 1570 MSN_GOT_INFO_GET_FIELD("Favorite quote", _("Favorite Quote")); |
1571 | |
1572 if (sect_info) | |
1573 { | |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1574 g_string_append_printf(s2, _("%s<b>Social</b><br>%s"), has_info ? "<br><hr>" : "", s->str); |
13389 | 1575 s = g_string_truncate(s, 0); |
1576 has_info = TRUE; | |
1577 sect_info = FALSE; | |
1578 } | |
1579 | |
1580 /* Contact Info */ | |
1581 /* Personal */ | |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1582 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1583 MSN_GOT_INFO_GET_FIELD("Significant other", _("Significant Other")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1584 MSN_GOT_INFO_GET_FIELD("Home phone", _("Home Phone")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1585 MSN_GOT_INFO_GET_FIELD("Home phone 2", _("Home Phone 2")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1586 MSN_GOT_INFO_GET_FIELD("Home address", _("Home Address")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1587 MSN_GOT_INFO_GET_FIELD("Personal Mobile", _("Personal Mobile")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1588 MSN_GOT_INFO_GET_FIELD("Home fax", _("Home Fax")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1589 MSN_GOT_INFO_GET_FIELD("Personal e-mail", _("Personal E-Mail")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1590 MSN_GOT_INFO_GET_FIELD("Personal IM", _("Personal IM")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1591 MSN_GOT_INFO_GET_FIELD("Birthday", _("Birthday")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1592 MSN_GOT_INFO_GET_FIELD("Anniversary", _("Anniversary")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1593 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes")); |
13389 | 1594 |
1595 if (sect_info) | |
1596 { | |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1597 personal = g_strdup_printf(_("<br><b>Personal</b><br>%s"), s->str); |
13389 | 1598 s = g_string_truncate(s, 0); |
1599 sect_info = FALSE; | |
1600 } | |
1601 | |
1602 /* Business */ | |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1603 MSN_GOT_INFO_GET_FIELD("Name", _("Name")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1604 MSN_GOT_INFO_GET_FIELD("Job title", _("Job Title")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1605 MSN_GOT_INFO_GET_FIELD("Company", _("Company")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1606 MSN_GOT_INFO_GET_FIELD("Department", _("Department")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1607 MSN_GOT_INFO_GET_FIELD("Profession", _("Profession")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1608 MSN_GOT_INFO_GET_FIELD("Work phone 1", _("Work Phone")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1609 MSN_GOT_INFO_GET_FIELD("Work phone 2", _("Work Phone 2")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1610 MSN_GOT_INFO_GET_FIELD("Work address", _("Work Address")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1611 MSN_GOT_INFO_GET_FIELD("Work mobile", _("Work Mobile")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1612 MSN_GOT_INFO_GET_FIELD("Work pager", _("Work Pager")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1613 MSN_GOT_INFO_GET_FIELD("Work fax", _("Work Fax")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1614 MSN_GOT_INFO_GET_FIELD("Work e-mail", _("Work E-Mail")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1615 MSN_GOT_INFO_GET_FIELD("Work IM", _("Work IM")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1616 MSN_GOT_INFO_GET_FIELD("Start date", _("Start Date")); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1617 MSN_GOT_INFO_GET_FIELD("Notes", _("Notes")); |
13389 | 1618 |
1619 if (sect_info) | |
1620 { | |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1621 business = g_strdup_printf(_("<br><b>Business</b><br>%s"), s->str); |
13389 | 1622 s = g_string_truncate(s, 0); |
1623 sect_info = FALSE; | |
1624 } | |
1625 | |
1626 if ((personal != NULL) || (business != NULL)) | |
1627 { | |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1628 /* trim off the trailing "<br>\n" */ |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1629 g_string_truncate(s, strlen(s->str) - 5); |
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1630 |
13389 | 1631 has_info = TRUE; |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1632 g_string_append_printf(s2, _("<hr><b>Contact Info</b>%s%s"), |
13389 | 1633 personal ? personal : "", |
1634 business ? business : ""); | |
1635 } | |
1636 | |
1637 g_free(personal); | |
1638 g_free(business); | |
1639 g_string_free(s, TRUE); | |
1640 s = s2; | |
1641 | |
1642 #if 0 /* these probably don't show up any more */ | |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1643 /* |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1644 * The fields, 'A Little About Me', 'Favorite Things', 'Hobbies |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1645 * and Interests', 'Favorite Quote', and 'My Homepage' may or may |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1646 * not appear, in any combination. However, they do appear in |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1647 * certain order, so we can successively search to pin down the |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1648 * distinct values. |
6516 | 1649 */ |
1650 | |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1651 /* Check if they have A Little About Me */ |
7675 | 1652 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1653 " A Little About Me \n\n", 0, "Favorite Things", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1654 _("A Little About Me"), 0, NULL, NULL); |
6516 | 1655 |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1656 if (!found) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1657 { |
7675 | 1658 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1659 " A Little About Me \n\n", 0, "Hobbies and Interests", '\n', |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1660 NULL, _("A Little About Me"), 0, NULL, NULL); |
7095
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1661 } |
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1662 |
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1663 if (!found) |
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1664 { |
7675 | 1665 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1666 " A Little About Me \n\n", 0, "Favorite Quote", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1667 _("A Little About Me"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1668 } |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1669 |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1670 if (!found) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1671 { |
7675 | 1672 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1673 " A Little About Me \n\n", 0, "My Homepage \n\nTake a look", |
1674 '\n', | |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1675 NULL, _("A Little About Me"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1676 } |
6516 | 1677 |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1678 if (!found) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1679 { |
7675 | 1680 gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1681 " A Little About Me \n\n", 0, "last updated", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1682 _("A Little About Me"), 0, NULL, NULL); |
7095
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1683 } |
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1684 |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1685 if (found) |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1686 has_info = TRUE; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1687 |
7095
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1688 /* Check if they have Favorite Things */ |
7675 | 1689 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1690 " Favorite Things \n\n", 0, "Hobbies and Interests", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1691 _("Favorite Things"), 0, NULL, NULL); |
7095
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1692 |
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1693 if (!found) |
c8bf2da398e3
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
1694 { |
7675 | 1695 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1696 " Favorite Things \n\n", 0, "Favorite Quote", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1697 _("Favorite Things"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1698 } |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1699 |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1700 if (!found) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1701 { |
7675 | 1702 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1703 " Favorite Things \n\n", 0, "My Homepage \n\nTake a look", '\n', |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1704 NULL, _("Favorite Things"), 0, NULL, NULL); |
6516 | 1705 } |
1706 | |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1707 if (!found) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1708 { |
7675 | 1709 gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1710 " Favorite Things \n\n", 0, "last updated", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1711 _("Favorite Things"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1712 } |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1713 |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1714 if (found) |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1715 has_info = TRUE; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1716 |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1717 /* Check if they have Hobbies and Interests */ |
7675 | 1718 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1719 " Hobbies and Interests \n\n", 0, "Favorite Quote", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1720 _("Hobbies and Interests"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1721 |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1722 if (!found) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1723 { |
7675 | 1724 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1725 " Hobbies and Interests \n\n", 0, "My Homepage \n\nTake a look", |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1726 '\n', NULL, _("Hobbies and Interests"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1727 } |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1728 |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1729 if (!found) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1730 { |
7675 | 1731 gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1732 " Hobbies and Interests \n\n", 0, "last updated", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1733 _("Hobbies and Interests"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1734 } |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1735 |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1736 if (found) |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1737 has_info = TRUE; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1738 |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1739 /* Check if they have Favorite Quote */ |
7675 | 1740 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1741 "Favorite Quote \n\n", 0, "My Homepage \n\nTake a look", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1742 _("Favorite Quote"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1743 |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1744 if (!found) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1745 { |
7675 | 1746 gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1747 "Favorite Quote \n\n", 0, "last updated", '\n', NULL, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1748 _("Favorite Quote"), 0, NULL, NULL); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1749 } |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1750 |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1751 if (found) |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1752 has_info = TRUE; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1753 |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1754 /* Extract the last updated date and put it in */ |
7675 | 1755 found = gaim_markup_extract_info_field(stripped, stripped_len, s, |
9243 | 1756 " last updated:", 1, "\n", 0, NULL, _("Last Updated"), 0, |
13104
e1e5462b7d81
[gaim-migrate @ 15466]
Richard Laager <rlaager@wiktel.com>
parents:
13020
diff
changeset
|
1757 NULL, msn_info_date_reformat); |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1758 |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1759 if (found) |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1760 has_info = TRUE; |
13389 | 1761 #endif |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1762 |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1763 /* If we were able to fetch a homepage url earlier, stick it in there */ |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1764 if (user_url != NULL) |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1765 { |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1766 g_snprintf(buf, sizeof(buf), |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1767 "<b>%s:</b><br><a href=\"%s\">%s</a><br>\n", |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1768 _("Homepage"), user_url, user_url); |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1769 |
7675 | 1770 g_string_append(s, buf); |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1771 |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1772 g_free(user_url); |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1773 |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1774 has_info = TRUE; |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1775 } |
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1776 |
9510 | 1777 if (!has_info) |
1778 { | |
1779 /* MSN doesn't actually distinguish between "unknown member" and | |
1780 * a known member with an empty profile. Try to explain this fact. | |
1781 * Note that if we have a nonempty tooltip_text, we know the user | |
1782 * exists. | |
1783 */ | |
13389 | 1784 /* This doesn't work with the new spaces profiles - Stu 3/2/06 |
9510 | 1785 char *p = strstr(url_buffer, "Unknown Member </TITLE>"); |
13389 | 1786 * This might not work for long either ... */ |
1787 char *p = strstr(url_buffer, "form id=\"SpacesSearch\" name=\"SpacesSearch\""); | |
9510 | 1788 GaimBuddy *b = gaim_find_buddy |
1789 (gaim_connection_get_account(info_data->gc), info_data->name); | |
1790 g_string_append_printf(s, "<br><b>%s</b><br>%s<br><br>", | |
1791 _("Error retrieving profile"), | |
1792 ((p && b)? | |
1793 _("The user has not created a public profile."): | |
1794 p? _("MSN reported not being able to find the user's profile. " | |
1795 "This either means that the user does not exist, " | |
1796 "or that the user exists " | |
1797 "but has not created a public profile."): | |
1798 _("Gaim could not find " /* This should never happen */ | |
1799 "any information in the user's profile. " | |
1800 "The user most likely does not exist."))); | |
9243 | 1801 } |
9510 | 1802 /* put a link to the actual profile URL */ |
13544
46559ab11aed
[gaim-migrate @ 15921]
Richard Laager <rlaager@wiktel.com>
parents:
13481
diff
changeset
|
1803 g_string_append_printf(s, _("<hr><b>%s:</b> "), _("Profile URL")); |
9510 | 1804 g_string_append_printf(s, "<br><a href=\"%s%s\">%s%s</a><br>", |
1805 PROFILE_URL, info_data->name, PROFILE_URL, info_data->name); | |
1806 | |
6859
17514a2f976a
[gaim-migrate @ 7404]
Christian Hammond <chipx86@chipx86.com>
parents:
6858
diff
changeset
|
1807 /* Finish it off, and show it to them */ |
7675 | 1808 g_string_append(s, "</body></html>\n"); |
7062
86ed8b2aa665
[gaim-migrate @ 7626]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
1809 |
9243 | 1810 #if PHOTO_SUPPORT |
9569 | 1811 /* Find the URL to the photo; must be before the marshalling [Bug 994207] */ |
1812 photo_url_text = msn_get_photo_url(url_text); | |
9243 | 1813 |
1814 /* Marshall the existing state */ | |
1815 info2_data = g_malloc0(sizeof(MsnGetInfoStepTwoData)); | |
1816 info2_data->info_data = info_data; | |
1817 info2_data->stripped = stripped; | |
1818 info2_data->url_buffer = url_buffer; | |
1819 info2_data->s = s; | |
1820 info2_data->photo_url_text = photo_url_text; | |
1821 info2_data->tooltip_text = tooltip_text; | |
9510 | 1822 info2_data->title = title; |
9243 | 1823 |
1824 /* Try to put the photo in there too, if there's one */ | |
10044 | 1825 if (photo_url_text) |
1826 { | |
9243 | 1827 gaim_url_fetch(photo_url_text, FALSE, NULL, FALSE, msn_got_photo, |
10044 | 1828 info2_data); |
1829 } | |
1830 else | |
1831 { | |
9243 | 1832 /* Emulate a callback */ |
1833 msn_got_photo(info2_data, NULL, 0); | |
1834 } | |
1835 } | |
1836 | |
10044 | 1837 static void |
1838 msn_got_photo(void *data, const char *url_text, size_t len) | |
9243 | 1839 { |
1840 MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)data; | |
1841 int id = -1; | |
1842 | |
1843 /* Unmarshall the saved state */ | |
1844 MsnGetInfoData *info_data = info2_data->info_data; | |
1845 char *stripped = info2_data->stripped; | |
1846 char *url_buffer = info2_data->url_buffer; | |
1847 GString *s = info2_data->s; | |
1848 char *photo_url_text = info2_data->photo_url_text; | |
1849 char *tooltip_text = info2_data->tooltip_text; | |
1850 | |
13479
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1851 /* Make sure the connection is still valid if we got here by fetching a photo url */ |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1852 if (url_text && |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1853 g_list_find(gaim_connections_get_all(), info_data->gc) == NULL) |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1854 { |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1855 gaim_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n"); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1856 g_free(stripped); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1857 g_free(url_buffer); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1858 g_string_free(s, TRUE); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1859 g_free(tooltip_text); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1860 g_free(info_data->name); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1861 g_free(info_data); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1862 g_free(photo_url_text); |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1863 g_free(info2_data); |
13481
56898561b8a9
[gaim-migrate @ 15857]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13479
diff
changeset
|
1864 |
13479
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1865 return; |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1866 } |
90740e70af91
[gaim-migrate @ 15855]
Evan Schoenberg <evan.s@dreskin.net>
parents:
13390
diff
changeset
|
1867 |
9243 | 1868 /* Try to put the photo in there too, if there's one and is readable */ |
10044 | 1869 if (data && url_text && len != 0) |
1870 { | |
9243 | 1871 if (strstr(url_text, "400 Bad Request") |
10044 | 1872 || strstr(url_text, "403 Forbidden") |
1873 || strstr(url_text, "404 Not Found")) | |
1874 { | |
9243 | 1875 |
1876 gaim_debug_info("msn", "Error getting %s: %s\n", | |
1877 photo_url_text, url_text); | |
10044 | 1878 } |
1879 else | |
1880 { | |
9243 | 1881 char buf[1024]; |
1882 gaim_debug_info("msn", "%s is %d bytes\n", photo_url_text, len); | |
1883 id = gaim_imgstore_add(url_text, len, NULL); | |
1884 g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id); | |
1885 g_string_prepend(s, buf); | |
1886 } | |
1887 } | |
1888 | |
1889 /* We continue here from msn_got_info, as if nothing has happened */ | |
1890 #endif | |
1891 | |
9510 | 1892 g_string_prepend(s, tooltip_text); |
11533
c9b815aeddc1
[gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents:
11531
diff
changeset
|
1893 gaim_notify_userinfo(info_data->gc, info_data->name, s->str, NULL, NULL); |
7062
86ed8b2aa665
[gaim-migrate @ 7626]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
1894 |
6516 | 1895 g_free(stripped); |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1896 g_free(url_buffer); |
7675 | 1897 g_string_free(s, TRUE); |
9243 | 1898 g_free(tooltip_text); |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1899 g_free(info_data->name); |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1900 g_free(info_data); |
9243 | 1901 #if PHOTO_SUPPORT |
1902 g_free(photo_url_text); | |
1903 g_free(info2_data); | |
1904 if (id != -1) | |
1905 gaim_imgstore_unref(id); | |
1906 #endif | |
6516 | 1907 } |
1908 | |
1909 static void | |
1910 msn_get_info(GaimConnection *gc, const char *name) | |
1911 { | |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1912 MsnGetInfoData *data; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1913 char *url; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1914 |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1915 data = g_new0(MsnGetInfoData, 1); |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1916 data->gc = gc; |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1917 data->name = g_strdup(name); |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1918 |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1919 url = g_strdup_printf("%s%s", PROFILE_URL, name); |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1920 |
7094
2343c3aa1dec
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
7062
diff
changeset
|
1921 gaim_url_fetch(url, FALSE, |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1922 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)", |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
1923 TRUE, msn_got_info, data); |
7104
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1924 |
7700a28929bd
[gaim-migrate @ 7669]
Christian Hammond <chipx86@chipx86.com>
parents:
7095
diff
changeset
|
1925 g_free(url); |
6516 | 1926 } |
1927 | |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1928 static gboolean msn_load(GaimPlugin *plugin) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1929 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1930 msn_notification_init(); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1931 msn_switchboard_init(); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1932 msn_sync_init(); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1933 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1934 return TRUE; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1935 } |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1936 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1937 static gboolean msn_unload(GaimPlugin *plugin) |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1938 { |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1939 msn_notification_end(); |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1940 msn_switchboard_end(); |
9193
502707ca1836
[gaim-migrate @ 9988]
Christian Hammond <chipx86@chipx86.com>
parents:
9158
diff
changeset
|
1941 msn_sync_end(); |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1942 |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1943 return TRUE; |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1944 } |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
1945 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1946 static GaimPluginProtocolInfo prpl_info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1947 { |
9308 | 1948 OPT_PROTO_MAIL_CHECK, |
9475 | 1949 NULL, /* user_splits */ |
1950 NULL, /* protocol_options */ | |
9555 | 1951 {"png", 0, 0, 96, 96, GAIM_ICON_SCALE_SEND}, /* icon_spec */ |
9475 | 1952 msn_list_icon, /* list_icon */ |
1953 msn_list_emblems, /* list_emblems */ | |
1954 msn_status_text, /* status_text */ | |
1955 msn_tooltip_text, /* tooltip_text */ | |
9951 | 1956 msn_status_types, /* away_states */ |
1957 msn_blist_node_menu, /* blist_node_menu */ | |
9475 | 1958 NULL, /* chat_info */ |
9754 | 1959 NULL, /* chat_info_defaults */ |
9951 | 1960 msn_login, /* login */ |
1961 msn_close, /* close */ | |
9475 | 1962 msn_send_im, /* send_im */ |
1963 NULL, /* set_info */ | |
1964 msn_send_typing, /* send_typing */ | |
1965 msn_get_info, /* get_info */ | |
9967 | 1966 msn_set_status, /* set_away */ |
9475 | 1967 msn_set_idle, /* set_idle */ |
1968 NULL, /* change_passwd */ | |
1969 msn_add_buddy, /* add_buddy */ | |
1970 NULL, /* add_buddies */ | |
1971 msn_rem_buddy, /* remove_buddy */ | |
1972 NULL, /* remove_buddies */ | |
1973 msn_add_permit, /* add_permit */ | |
1974 msn_add_deny, /* add_deny */ | |
1975 msn_rem_permit, /* rem_permit */ | |
1976 msn_rem_deny, /* rem_deny */ | |
9951 | 1977 msn_set_permit_deny, /* set_permit_deny */ |
9475 | 1978 NULL, /* join_chat */ |
1979 NULL, /* reject chat invite */ | |
10463 | 1980 NULL, /* get_chat_name */ |
9475 | 1981 msn_chat_invite, /* chat_invite */ |
1982 msn_chat_leave, /* chat_leave */ | |
1983 NULL, /* chat_whisper */ | |
1984 msn_chat_send, /* chat_send */ | |
1985 msn_keepalive, /* keepalive */ | |
1986 NULL, /* register_user */ | |
1987 NULL, /* get_cb_info */ | |
1988 NULL, /* get_cb_away */ | |
1989 NULL, /* alias_buddy */ | |
1990 msn_group_buddy, /* group_buddy */ | |
1991 msn_rename_group, /* rename_group */ | |
1992 NULL, /* buddy_free */ | |
1993 msn_convo_closed, /* convo_closed */ | |
1994 msn_normalize, /* normalize */ | |
1995 msn_set_buddy_icon, /* set_buddy_icon */ | |
1996 msn_remove_group, /* remove_group */ | |
1997 NULL, /* get_cb_real_name */ | |
1998 NULL, /* set_chat_topic */ | |
1999 NULL, /* find_blist_chat */ | |
2000 NULL, /* roomlist_get_list */ | |
2001 NULL, /* roomlist_cancel */ | |
2002 NULL, /* roomlist_expand_category */ | |
10116 | 2003 msn_can_receive_file, /* can_receive_file */ |
12143
cbebda5f019c
[gaim-migrate @ 14444]
Richard Laager <rlaager@wiktel.com>
parents:
11992
diff
changeset
|
2004 msn_send_file, /* send_file */ |
12600
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12595
diff
changeset
|
2005 msn_new_xfer, /* new_xfer */ |
12645
fc28451f5d96
[gaim-migrate @ 14983]
Richard Laager <rlaager@wiktel.com>
parents:
12600
diff
changeset
|
2006 NULL, /* offline_message */ |
12600
e856f985a0b9
[gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents:
12595
diff
changeset
|
2007 NULL, /* whiteboard_prpl_ops */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2008 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2009 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2010 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2011 { |
9943 | 2012 GAIM_PLUGIN_MAGIC, |
2013 GAIM_MAJOR_VERSION, | |
2014 GAIM_MINOR_VERSION, | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2015 GAIM_PLUGIN_PROTOCOL, /**< type */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2016 NULL, /**< ui_requirement */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2017 0, /**< flags */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2018 NULL, /**< dependencies */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2019 GAIM_PRIORITY_DEFAULT, /**< priority */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2020 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2021 "prpl-msn", /**< id */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2022 "MSN", /**< name */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2023 VERSION, /**< version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2024 /** summary */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2025 N_("MSN Protocol Plugin"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2026 /** description */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2027 N_("MSN Protocol Plugin"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2028 "Christian Hammond <chipx86@gnupdate.org>", /**< author */ |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6228
diff
changeset
|
2029 GAIM_WEBSITE, /**< homepage */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2030 |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
2031 msn_load, /**< load */ |
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
2032 msn_unload, /**< unload */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2033 NULL, /**< destroy */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2034 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2035 NULL, /**< ui_info */ |
8808
bbd8cdaf0ad5
[gaim-migrate @ 9570]
Christian Hammond <chipx86@chipx86.com>
parents:
8749
diff
changeset
|
2036 &prpl_info, /**< extra_info */ |
10487 | 2037 NULL, /**< prefs_info */ |
9015 | 2038 msn_actions |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2039 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2040 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
2041 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
2042 init_plugin(GaimPlugin *plugin) |
2086 | 2043 { |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
2044 GaimAccountOption *option; |
3572 | 2045 |
13705
2f7b356812bc
[gaim-migrate @ 16108]
Richard Laager <rlaager@wiktel.com>
parents:
13634
diff
changeset
|
2046 option = gaim_account_option_string_new(_("Server"), "server", |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
2047 MSN_SERVER); |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
2048 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
2049 option); |
3572 | 2050 |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
2051 option = gaim_account_option_int_new(_("Port"), "port", 1863); |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
2052 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
2053 option); |
2086 | 2054 |
9158
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
2055 option = gaim_account_option_bool_new(_("Use HTTP Method"), |
c30d81b4dd22
[gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
2056 "http_method", FALSE); |
7288
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7277
diff
changeset
|
2057 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7277
diff
changeset
|
2058 option); |
ff9127038a5a
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
7277
diff
changeset
|
2059 |
12886 | 2060 option = gaim_account_option_bool_new(_("Show custom smileys"), |
2061 "custom_smileys", TRUE); | |
2062 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, | |
2063 option); | |
2064 | |
11321 | 2065 gaim_cmd_register("nudge", "", GAIM_CMD_P_PRPL, |
2066 GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_PRPL_ONLY, | |
2067 "prpl-msn", msn_cmd_nudge, | |
12318
e346a085bb4f
[gaim-migrate @ 14622]
Richard Laager <rlaager@wiktel.com>
parents:
12243
diff
changeset
|
2068 _("nudge: nudge a user to get their attention"), NULL); |
11321 | 2069 |
10487 | 2070 gaim_prefs_remove("/plugins/prpl/msn"); |
2086 | 2071 } |
2072 | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
2073 GAIM_INIT_PLUGIN(msn, init_plugin, info); |