Mercurial > pidgin.yaz
annotate src/protocols/msn/msn.c @ 6702:302ee2792e91
[gaim-migrate @ 7228]
Removing a buddy from a group in MSN should no longer remove all instances
of that buddy.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 02 Sep 2003 04:36:16 +0000 |
parents | b7e113a59b51 |
children | 2beae1058ca4 |
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 * |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
7 * |
4542
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
8 * 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
|
9 * 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
|
10 * the Free Software Foundation; either version 2 of the License, or |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
11 * (at your option) any later version. |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
12 * |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
13 * 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
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
16 * GNU General Public License for more details. |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
17 * |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
18 * 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
|
19 * along with this program; if not, write to the Free Software |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
20 * 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
|
21 */ |
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
22 #include "msn.h" |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
23 #include "accountopt.h" |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
24 #include "msg.h" |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
25 #include "page.h" |
5626
6275ac113622
[gaim-migrate @ 6033]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
26 #include "prefs.h" |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
27 #include "session.h" |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
28 #include "state.h" |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
29 #include "utils.h" |
5717 | 30 #include "multi.h" |
6516 | 31 #include "html.h" |
4546
a951bb590857
[gaim-migrate @ 4825]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4542
diff
changeset
|
32 |
4687 | 33 #define BUDDY_ALIAS_MAXLEN 388 |
4542
86b0a0243be8
[gaim-migrate @ 4821]
Christian Hammond <chipx86@chipx86.com>
parents:
4508
diff
changeset
|
34 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
35 static GaimPlugin *my_protocol = NULL; |
4249 | 36 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
37 static char *msn_normalize(const char *str); |
2086 | 38 |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
39 typedef struct |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
40 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
41 GaimConnection *gc; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
42 const char *passport; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
43 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
44 } MsnMobileData; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
45 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
46 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
47 msn_act_id(GaimConnection *gc, const char *entry) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
48 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
49 MsnSession *session = gc->proto_data; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
50 GaimAccount *account = gaim_connection_get_account(gc); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
51 char outparams[MSN_BUF_LEN]; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
52 char *alias; |
2086 | 53 |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
54 if (entry == NULL || *entry == '\0') |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
55 alias = g_strdup(""); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
56 else |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
57 alias = g_strdup(entry); |
3171 | 58 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
59 if (strlen(alias) >= BUDDY_ALIAS_MAXLEN) { |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5382
diff
changeset
|
60 gaim_notify_error(gc, NULL, |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5382
diff
changeset
|
61 _("Your new MSN friendly name is too long."), NULL); |
2738
01f0497fe6c8
[gaim-migrate @ 2751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
62 return; |
01f0497fe6c8
[gaim-migrate @ 2751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
63 } |
01f0497fe6c8
[gaim-migrate @ 2751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
64 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
65 g_snprintf(outparams, sizeof(outparams), "%s %s", |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
66 gaim_account_get_username(account), msn_url_encode(alias)); |
2086 | 67 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
68 g_free(alias); |
2086 | 69 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
70 if (!msn_servconn_send_command(session->notification_conn, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
71 "REA", outparams)) { |
2738
01f0497fe6c8
[gaim-migrate @ 2751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2688
diff
changeset
|
72 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
73 gaim_connection_error(gc, _("Write error")); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
74 return; |
2688
98b1ac8ddea3
[gaim-migrate @ 2701]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2681
diff
changeset
|
75 } |
2086 | 76 } |
77 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
78 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
79 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
|
80 { |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
81 MsnSession *session = gc->proto_data; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
82 char outparams[MSN_BUF_LEN]; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
83 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
84 if (entry == NULL || *entry == '\0') |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
85 g_snprintf(outparams, sizeof(outparams), "%s ", type); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
86 else |
6228
36897deb064b
[gaim-migrate @ 6721]
Christian Hammond <chipx86@chipx86.com>
parents:
6149
diff
changeset
|
87 g_snprintf(outparams, sizeof(outparams), "%s %s", type, |
36897deb064b
[gaim-migrate @ 6721]
Christian Hammond <chipx86@chipx86.com>
parents:
6149
diff
changeset
|
88 msn_url_encode(entry)); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
89 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
90 if (!msn_servconn_send_command(session->notification_conn, |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
91 "PRP", outparams)) { |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
92 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
93 gaim_connection_error(gc, _("Write error")); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
94 return; |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
95 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
96 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
97 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
98 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
99 msn_set_home_phone_cb(GaimConnection *gc, const char *entry) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
100 { |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
101 msn_set_prp(gc, "PHH", entry); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
102 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
103 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
104 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
105 msn_set_work_phone_cb(GaimConnection *gc, const char *entry) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
106 { |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
107 msn_set_prp(gc, "PHW", entry); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
108 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
109 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
110 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
111 msn_set_mobile_phone_cb(GaimConnection *gc, const char *entry) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
112 { |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
113 msn_set_prp(gc, "PHM", entry); |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
114 } |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
115 |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
116 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
117 enable_msn_pages_cb(GaimConnection *gc) |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
118 { |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
119 msn_set_prp(gc, "MOB", "Y"); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
120 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
121 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
122 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
123 disable_msn_pages_cb(GaimConnection *gc) |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
124 { |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
125 msn_set_prp(gc, "MOB", "N"); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
126 } |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
127 |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
128 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
129 send_to_mobile_cb(MsnMobileData *data, const char *entry) |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
130 { |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
131 MsnSession *session = data->gc->proto_data; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
132 MsnServConn *servconn = session->notification_conn; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
133 MsnUser *user; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
134 MsnPage *page; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
135 char *page_str; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
136 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
137 user = msn_user_new(session, data->passport, NULL); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
138 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
139 page = msn_page_new(); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
140 msn_page_set_receiver(page, user); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
141 msn_page_set_transaction_id(page, ++session->trId); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
142 msn_page_set_body(page, entry); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
143 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
144 page_str = msn_page_build_string(page); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
145 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
146 msn_user_destroy(user); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
147 msn_page_destroy(page); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
148 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
149 if (!msn_servconn_write(servconn, page_str, strlen(page_str))) { |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
150 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
151 gaim_connection_error(data->gc, _("Write error")); |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
152 } |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
153 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
154 g_free(page_str); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
155 } |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
156 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
157 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
158 close_mobile_page_cb(MsnMobileData *data, const char *entry) |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
159 { |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
160 g_free(data); |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
161 } |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
162 |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
163 /* -- */ |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
164 |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
165 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
166 msn_show_set_friendly_name(GaimConnection *gc) |
2086 | 167 { |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
168 gaim_request_input(gc, NULL, _("Set your friendly name."), |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
169 _("This is the name that other MSN buddies will " |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
170 "see you as."), |
6035
8c44020a958e
[gaim-migrate @ 6485]
Christian Hammond <chipx86@chipx86.com>
parents:
6026
diff
changeset
|
171 gaim_connection_get_display_name(gc), FALSE, FALSE, |
5481
084147a0d9e4
[gaim-migrate @ 5877]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
172 _("OK"), G_CALLBACK(msn_act_id), |
084147a0d9e4
[gaim-migrate @ 5877]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
173 _("Cancel"), NULL, gc); |
2086 | 174 } |
175 | |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
176 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
177 msn_show_set_home_phone(GaimConnection *gc) |
5363
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 MsnSession *session = gc->proto_data; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
180 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
181 gaim_request_input(gc, NULL, _("Set your home phone number."), NULL, |
6035
8c44020a958e
[gaim-migrate @ 6485]
Christian Hammond <chipx86@chipx86.com>
parents:
6026
diff
changeset
|
182 msn_user_get_home_phone(session->user), FALSE, FALSE, |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
183 _("OK"), G_CALLBACK(msn_set_home_phone_cb), |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
184 _("Cancel"), NULL, gc); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
185 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
186 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
187 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
188 msn_show_set_work_phone(GaimConnection *gc) |
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 MsnSession *session = gc->proto_data; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
191 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
192 gaim_request_input(gc, NULL, _("Set your work phone number."), NULL, |
6035
8c44020a958e
[gaim-migrate @ 6485]
Christian Hammond <chipx86@chipx86.com>
parents:
6026
diff
changeset
|
193 msn_user_get_work_phone(session->user), FALSE, FALSE, |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
194 _("OK"), G_CALLBACK(msn_set_work_phone_cb), |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
195 _("Cancel"), NULL, gc); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
196 } |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
197 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
198 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
199 msn_show_set_mobile_phone(GaimConnection *gc) |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
200 { |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
201 MsnSession *session = gc->proto_data; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
202 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
203 gaim_request_input(gc, NULL, _("Set your mobile phone number."), NULL, |
6035
8c44020a958e
[gaim-migrate @ 6485]
Christian Hammond <chipx86@chipx86.com>
parents:
6026
diff
changeset
|
204 msn_user_get_mobile_phone(session->user), FALSE, FALSE, |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
205 _("OK"), G_CALLBACK(msn_set_mobile_phone_cb), |
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
206 _("Cancel"), NULL, gc); |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
207 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
208 |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
209 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
210 msn_show_set_mobile_pages(GaimConnection *gc) |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
211 { |
5496
b7c0be69c749
[gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents:
5491
diff
changeset
|
212 gaim_request_action(gc, NULL, _("Allow MSN Mobile pages?"), |
b7c0be69c749
[gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents:
5491
diff
changeset
|
213 _("Do you want to allow or disallow people on " |
b7c0be69c749
[gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents:
5491
diff
changeset
|
214 "your buddy list to send you MSN Mobile pages " |
b7c0be69c749
[gaim-migrate @ 5892]
Christian Hammond <chipx86@chipx86.com>
parents:
5491
diff
changeset
|
215 "to your cell phone or other mobile device?"), |
5498
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5496
diff
changeset
|
216 -1, gc, 3, |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
217 _("Allow"), G_CALLBACK(enable_msn_pages_cb), |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
218 _("Disallow"), G_CALLBACK(disable_msn_pages_cb), |
5498
cce2d7868c78
[gaim-migrate @ 5894]
Christian Hammond <chipx86@chipx86.com>
parents:
5496
diff
changeset
|
219 _("Cancel"), NULL); |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
220 } |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
221 |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
222 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
223 show_send_to_mobile_cb(GaimConnection *gc, const char *passport) |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
224 { |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
225 MsnUser *user; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
226 MsnSession *session = gc->proto_data; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
227 MsnMobileData *data; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
228 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
229 user = msn_users_find_with_passport(session->users, passport); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
230 |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
231 data = g_new0(MsnMobileData, 1); |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
232 data->gc = gc; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
233 data->passport = passport; |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
234 |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
235 gaim_request_input(gc, NULL, _("Send a mobile message."), NULL, |
6035
8c44020a958e
[gaim-migrate @ 6485]
Christian Hammond <chipx86@chipx86.com>
parents:
6026
diff
changeset
|
236 NULL, TRUE, FALSE, |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
237 _("Page"), G_CALLBACK(send_to_mobile_cb), |
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
238 _("Close"), G_CALLBACK(close_mobile_page_cb), |
5491
4bcae8503866
[gaim-migrate @ 5887]
Christian Hammond <chipx86@chipx86.com>
parents:
5481
diff
changeset
|
239 data); |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
240 } |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
241 |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
242 static void |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
243 initiate_chat_cb(GaimConnection *gc, const char *passport) |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
244 { |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
245 GaimAccount *account = gaim_connection_get_account(gc); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
246 MsnSession *session = gc->proto_data; |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
247 MsnSwitchBoard *swboard; |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
248 MsnUser *user; |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
249 |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
250 if ((swboard = msn_session_open_switchboard(session)) == NULL) { |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
251 gaim_connection_error(gc, _("Write error")); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
252 |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
253 return; |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
254 } |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
255 |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
256 user = msn_user_new(session, passport, NULL); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
257 |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
258 msn_switchboard_set_user(swboard, user); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
259 |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
260 swboard->total_users = 1; |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
261 |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
262 swboard->chat = serv_got_joined_chat(gc, ++swboard->chat_id, "MSN Chat"); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
263 |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
264 gaim_chat_add_user(GAIM_CHAT(swboard->chat), |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
265 gaim_account_get_username(account), NULL); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
266 } |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
267 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
268 /************************************************************************** |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
269 * Protocol Plugin ops |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
270 **************************************************************************/ |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
271 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
272 static const char * |
6695 | 273 msn_list_icon(GaimAccount *a, GaimBuddy *b) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
274 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
275 return "msn"; |
2993 | 276 } |
277 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
278 static void |
6695 | 279 msn_list_emblems(GaimBuddy *b, char **se, char **sw, |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
280 char **nw, char **ne) |
2086 | 281 { |
5372
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
282 MsnUser *user; |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
283 char *emblems[4] = { NULL, NULL, NULL, NULL }; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
284 int away_type = MSN_AWAY_TYPE(b->uc); |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
285 int i = 0; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
286 |
5372
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
287 user = b->proto_data; |
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
288 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
289 if (b->present == GAIM_BUDDY_OFFLINE) |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
290 emblems[i++] = "offline"; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
291 else if (away_type == MSN_BUSY || away_type == MSN_PHONE) |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
292 emblems[i++] = "occupied"; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
293 else if (away_type != 0) |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
294 emblems[i++] = "away"; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
295 |
5378
a991ff4d5d40
[gaim-migrate @ 5754]
Christian Hammond <chipx86@chipx86.com>
parents:
5372
diff
changeset
|
296 if (user == NULL) { |
a991ff4d5d40
[gaim-migrate @ 5754]
Christian Hammond <chipx86@chipx86.com>
parents:
5372
diff
changeset
|
297 gaim_debug(GAIM_DEBUG_ERROR, "msn", |
a991ff4d5d40
[gaim-migrate @ 5754]
Christian Hammond <chipx86@chipx86.com>
parents:
5372
diff
changeset
|
298 "buddy %s does not have a MsnUser attached!\n", |
5379
90a76f1d6e64
[gaim-migrate @ 5755]
Christian Hammond <chipx86@chipx86.com>
parents:
5378
diff
changeset
|
299 b->name); |
5378
a991ff4d5d40
[gaim-migrate @ 5754]
Christian Hammond <chipx86@chipx86.com>
parents:
5372
diff
changeset
|
300 } |
a991ff4d5d40
[gaim-migrate @ 5754]
Christian Hammond <chipx86@chipx86.com>
parents:
5372
diff
changeset
|
301 else if (user->mobile) |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
302 emblems[i++] = "wireless"; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
303 |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
304 *se = emblems[0]; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
305 *sw = emblems[1]; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
306 *nw = emblems[2]; |
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
307 *ne = emblems[3]; |
2086 | 308 } |
309 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
310 static char * |
6695 | 311 msn_status_text(GaimBuddy *b) |
2086 | 312 { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
313 if (b->uc & UC_UNAVAILABLE) |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
314 return g_strdup(msn_away_get_text(MSN_AWAY_TYPE(b->uc))); |
2086 | 315 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
316 return NULL; |
2086 | 317 } |
318 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
319 static char * |
6695 | 320 msn_tooltip_text(GaimBuddy *b) |
2086 | 321 { |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
322 char *text = NULL; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
323 /* MsnUser *user = b->proto_data; */ |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
324 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
325 if (GAIM_BUDDY_IS_ONLINE(b)) { |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
326 text = g_strdup_printf(_("<b>Status:</b> %s"), |
5361
953aa05279f4
[gaim-migrate @ 5737]
Christian Hammond <chipx86@chipx86.com>
parents:
5351
diff
changeset
|
327 msn_away_get_text(MSN_AWAY_TYPE(b->uc))); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
328 } |
2086 | 329 |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
330 return text; |
2086 | 331 } |
332 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
333 static GList * |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
334 msn_away_states(GaimConnection *gc) |
2086 | 335 { |
336 GList *m = NULL; | |
337 | |
3263 | 338 m = g_list_append(m, _("Available")); |
339 m = g_list_append(m, _("Away From Computer")); | |
340 m = g_list_append(m, _("Be Right Back")); | |
341 m = g_list_append(m, _("Busy")); | |
342 m = g_list_append(m, _("On The Phone")); | |
343 m = g_list_append(m, _("Out To Lunch")); | |
344 m = g_list_append(m, _("Hidden")); | |
2086 | 345 |
346 return m; | |
347 } | |
348 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
349 static GList * |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
350 msn_actions(GaimConnection *gc) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
351 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
352 GList *m = NULL; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
353 struct proto_actions_menu *pam; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
354 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
355 pam = g_new0(struct proto_actions_menu, 1); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
356 pam->label = _("Set Friendly Name"); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
357 pam->callback = msn_show_set_friendly_name; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
358 pam->gc = gc; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
359 m = g_list_append(m, pam); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
360 |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
361 m = g_list_append(m, NULL); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
362 |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
363 pam = g_new0(struct proto_actions_menu, 1); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
364 pam->label = _("Set Home Phone Number"); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
365 pam->callback = msn_show_set_home_phone; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
366 pam->gc = gc; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
367 m = g_list_append(m, pam); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
368 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
369 pam = g_new0(struct proto_actions_menu, 1); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
370 pam->label = _("Set Work Phone Number"); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
371 pam->callback = msn_show_set_work_phone; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
372 pam->gc = gc; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
373 m = g_list_append(m, pam); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
374 |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
375 pam = g_new0(struct proto_actions_menu, 1); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
376 pam->label = _("Set Mobile Phone Number"); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
377 pam->callback = msn_show_set_mobile_phone; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
378 pam->gc = gc; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
379 m = g_list_append(m, pam); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
380 |
5364
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
381 m = g_list_append(m, NULL); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
382 |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
383 #if 0 |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
384 pam = g_new0(struct proto_actions_menu, 1); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
385 pam->label = _("Enable/Disable Mobile Devices"); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
386 pam->callback = msn_show_set_mobile_support; |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
387 pam->gc = gc; |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
388 m = g_list_append(m, pam); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
389 #endif |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
390 |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
391 pam = g_new0(struct proto_actions_menu, 1); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
392 pam->label = _("Allow/Disallow Mobile Pages"); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
393 pam->callback = msn_show_set_mobile_pages; |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
394 pam->gc = gc; |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
395 m = g_list_append(m, pam); |
379beab3d157
[gaim-migrate @ 5740]
Christian Hammond <chipx86@chipx86.com>
parents:
5363
diff
changeset
|
396 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
397 return m; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
398 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
399 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
400 static GList * |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
401 msn_buddy_menu(GaimConnection *gc, const char *who) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
402 { |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
403 GaimAccount *account = gaim_connection_get_account(gc); |
5372
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
404 MsnUser *user; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
405 struct proto_buddy_menu *pbm; |
6695 | 406 GaimBuddy *b; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
407 GList *m = NULL; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
408 |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
409 b = gaim_find_buddy(gc->account, who); |
5372
fa0217bec87e
[gaim-migrate @ 5748]
Christian Hammond <chipx86@chipx86.com>
parents:
5369
diff
changeset
|
410 user = b->proto_data; |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
411 |
5382
b18332105302
[gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents:
5379
diff
changeset
|
412 if (user != NULL) { |
b18332105302
[gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents:
5379
diff
changeset
|
413 if (user->mobile) { |
b18332105302
[gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents:
5379
diff
changeset
|
414 pbm = g_new0(struct proto_buddy_menu, 1); |
b18332105302
[gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents:
5379
diff
changeset
|
415 pbm->label = _("Send to Mobile"); |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
416 pbm->callback = show_send_to_mobile_cb; |
5382
b18332105302
[gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents:
5379
diff
changeset
|
417 pbm->gc = gc; |
b18332105302
[gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents:
5379
diff
changeset
|
418 m = g_list_append(m, pbm); |
b18332105302
[gaim-migrate @ 5758]
Christian Hammond <chipx86@chipx86.com>
parents:
5379
diff
changeset
|
419 } |
5369
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
420 } |
a87818e9dc54
[gaim-migrate @ 5745]
Christian Hammond <chipx86@chipx86.com>
parents:
5364
diff
changeset
|
421 |
6148
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
422 if (g_ascii_strcasecmp(who, gaim_account_get_username(account))) { |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
423 pbm = g_new0(struct proto_buddy_menu, 1); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
424 pbm->label = _("Initiate Chat"); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
425 pbm->callback = initiate_chat_cb; |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
426 pbm->gc = gc; |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
427 m = g_list_append(m, pbm); |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
428 } |
82e7eaa67406
[gaim-migrate @ 6622]
Christian Hammond <chipx86@chipx86.com>
parents:
6059
diff
changeset
|
429 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
430 return m; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
431 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
432 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
433 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
434 msn_login(GaimAccount *account) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
435 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
436 GaimConnection *gc; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
437 MsnSession *session; |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
438 const char *username; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
439 const char *server; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
440 int port; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
441 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
442 server = gaim_account_get_string(account, "server", MSN_SERVER); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
443 port = gaim_account_get_int(account, "port", MSN_PORT); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
444 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
445 gc = gaim_account_get_connection(account); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
446 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
447 session = msn_session_new(account, server, port); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
448 session->prpl = my_protocol; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
449 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
450 gc->proto_data = session; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
451 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
452 gaim_connection_update_progress(gc, _("Connecting"), 0, MSN_CONNECT_STEPS); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
453 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
454 /* Hmm, I don't like this. */ |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
455 username = msn_normalize(gaim_account_get_username(account)); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
456 |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
457 if (strcmp(username, gaim_account_get_username(account))) |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
458 gaim_account_set_username(account, username); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
459 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
460 if (!msn_session_connect(session)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
461 gaim_connection_error(gc, _("Unable to connect")); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
462 |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
463 return; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
464 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
465 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
466 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
467 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
468 msn_close(GaimConnection *gc) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
469 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
470 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
471 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
472 msn_session_destroy(session); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
473 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
474 gc->proto_data = NULL; |
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 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
477 static int |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
478 msn_send_im(GaimConnection *gc, const char *who, const char *message, |
6622 | 479 int len, GaimImFlags flags) |
2086 | 480 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
481 GaimAccount *account = gaim_connection_get_account(gc); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
482 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
483 MsnSwitchBoard *swboard; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
484 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
485 swboard = msn_session_find_switch_with_passport(session, who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
486 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
487 if (g_ascii_strcasecmp(who, gaim_account_get_username(account))) { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
488 MsnMessage *msg; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
489 MsnUser *user; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
490 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
491 user = msn_user_new(session, who, NULL); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
492 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
493 msg = msn_message_new(); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
494 msn_message_set_receiver(msg, user); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
495 msn_message_set_attr(msg, "X-MMS-IM-Format", |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
496 "FN=Arial; EF=; CO=0; PF=0"); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
497 msn_message_set_body(msg, message); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
498 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
499 if (swboard != NULL) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
500 if (!msn_switchboard_send_msg(swboard, msg)) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
501 msn_switchboard_destroy(swboard); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
502 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
503 else { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
504 if ((swboard = msn_session_open_switchboard(session)) == NULL) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
505 msn_message_destroy(msg); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
506 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
507 gaim_connection_error(gc, _("Write error")); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
508 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
509 return 1; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
510 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
511 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
512 msn_switchboard_set_user(swboard, user); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
513 msn_switchboard_send_msg(swboard, msg); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
514 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
515 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
516 msn_user_destroy(user); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
517 msn_message_destroy(msg); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
518 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
519 else { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
520 /* |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
521 * In MSN, you can't send messages to yourself, so |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
522 * we'll fake like we received it ;) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
523 */ |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
524 serv_got_typing_stopped(gc, (char *)who); |
6622 | 525 serv_got_im(gc, who, message, flags, |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
526 time(NULL), -1); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
527 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
528 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
529 return 1; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
530 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
531 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
532 static int |
6059 | 533 msn_send_typing(GaimConnection *gc, const char *who, int typing) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
534 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
535 GaimAccount *account = gaim_connection_get_account(gc); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
536 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
537 MsnSwitchBoard *swboard; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
538 MsnMessage *msg; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
539 MsnUser *user; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
540 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
541 if (!typing) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
542 return 0; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
543 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
544 if (!g_ascii_strcasecmp(who, gaim_account_get_username(account))) { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
545 /* 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
|
546 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
|
547 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
548 return MSN_TYPING_SEND_TIMEOUT; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
549 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
550 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
551 swboard = msn_session_find_switch_with_passport(session, who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
552 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
553 if (swboard == NULL) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
554 return 0; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
555 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
556 user = msn_user_new(session, who, NULL); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
557 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
558 msg = msn_message_new(); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
559 msn_message_set_content_type(msg, "text/x-msmsgscontrol"); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
560 msn_message_set_receiver(msg, user); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
561 msn_message_set_charset(msg, NULL); |
5505
870207a49f2f
[gaim-migrate @ 5904]
Christian Hammond <chipx86@chipx86.com>
parents:
5498
diff
changeset
|
562 msn_message_set_flag(msg, 'U'); |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
563 msn_message_set_attr(msg, "TypingUser", |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
564 gaim_account_get_username(account)); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
565 msn_message_set_attr(msg, "User-Agent", NULL); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
566 msn_message_set_body(msg, "\r\n"); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
567 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
568 if (!msn_switchboard_send_msg(swboard, msg)) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
569 msn_switchboard_destroy(swboard); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
570 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
571 msn_user_destroy(user); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
572 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
573 return MSN_TYPING_SEND_TIMEOUT; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
574 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
575 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
576 static void |
6059 | 577 msn_set_away(GaimConnection *gc, const char *state, const char *msg) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
578 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
579 MsnSession *session = gc->proto_data; |
4270 | 580 const char *away; |
2086 | 581 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
582 if (gc->away != NULL) { |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4069
diff
changeset
|
583 g_free(gc->away); |
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4069
diff
changeset
|
584 gc->away = NULL; |
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4069
diff
changeset
|
585 } |
2086 | 586 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
587 if (msg != NULL) { |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4069
diff
changeset
|
588 gc->away = g_strdup(""); |
2086 | 589 away = "AWY"; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
590 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
591 else if (state) { |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4069
diff
changeset
|
592 gc->away = g_strdup(""); |
2086 | 593 |
3538 | 594 if (!strcmp(state, _("Away From Computer"))) |
2086 | 595 away = "AWY"; |
3538 | 596 else if (!strcmp(state, _("Be Right Back"))) |
2086 | 597 away = "BRB"; |
3538 | 598 else if (!strcmp(state, _("Busy"))) |
2086 | 599 away = "BSY"; |
3538 | 600 else if (!strcmp(state, _("On The Phone"))) |
2086 | 601 away = "PHN"; |
3538 | 602 else if (!strcmp(state, _("Out To Lunch"))) |
2086 | 603 away = "LUN"; |
3538 | 604 else if (!strcmp(state, _("Hidden"))) |
2152
f631cfc8e824
[gaim-migrate @ 2162]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
605 away = "HDN"; |
2086 | 606 else { |
4111
ee884f1d7ae3
[gaim-migrate @ 4326]
Christian Hammond <chipx86@chipx86.com>
parents:
4069
diff
changeset
|
607 g_free(gc->away); |
2086 | 608 gc->away = NULL; |
609 away = "NLN"; | |
610 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
611 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
612 else if (gc->is_idle) |
2086 | 613 away = "IDL"; |
614 else | |
615 away = "NLN"; | |
616 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
617 if (!msn_servconn_send_command(session->notification_conn, "CHG", away)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
618 gaim_connection_error(gc, _("Write error")); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
619 return; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
620 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
621 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
622 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
623 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
624 msn_set_idle(GaimConnection *gc, int idle) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
625 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
626 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
627 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
628 if (gc->away != NULL) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
629 return; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
630 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
631 if (!msn_servconn_send_command(session->notification_conn, "CHG", |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
632 (idle ? "IDL" : "NLN"))) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
633 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
634 gaim_connection_error(gc, _("Write error")); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
635 return; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
636 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
637 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
638 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
639 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
640 msn_add_buddy(GaimConnection *gc, const char *name) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
641 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
642 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
643 char *who; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
644 char outparams[MSN_BUF_LEN]; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
645 GSList *l; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
646 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
647 who = msn_normalize(name); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
648 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
649 if (strchr(who, ' ')) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
650 /* This is a broken blist entry. */ |
2086 | 651 return; |
652 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
653 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
654 for (l = session->lists.forward; l != NULL; l = l->next) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
655 MsnUser *user = l->data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
656 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
657 if (!gaim_utf8_strcasecmp(who, msn_user_get_passport(user))) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
658 break; |
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 if (l != NULL) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
662 return; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
663 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
664 g_snprintf(outparams, sizeof(outparams), |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
665 "FL %s %s", who, who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
666 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
667 if (!msn_servconn_send_command(session->notification_conn, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
668 "ADD", outparams)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
669 gaim_connection_error(gc, _("Write error")); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
670 return; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
671 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
672 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
673 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
674 static void |
6702
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
675 msn_rem_buddy(GaimConnection *gc, const char *who, const char *group_name) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
676 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
677 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
678 char outparams[MSN_BUF_LEN]; |
6702
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
679 MsnGroup *group; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
680 |
6702
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
681 group = msn_groups_find_with_name(session->groups, group_name); |
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
682 |
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
683 if (group == NULL) |
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
684 g_snprintf(outparams, sizeof(outparams), "FL %s", who); |
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
685 else |
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
686 g_snprintf(outparams, sizeof(outparams), "FL %s %d", who, |
302ee2792e91
[gaim-migrate @ 7228]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
687 msn_group_get_id(group)); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
688 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
689 if (!msn_servconn_send_command(session->notification_conn, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
690 "REM", outparams)) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
691 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
692 gaim_connection_error(gc, _("Write error")); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
693 return; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
694 } |
2086 | 695 } |
696 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
697 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
698 msn_add_permit(GaimConnection *gc, const char *who) |
2086 | 699 { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
700 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
701 char buf[MSN_BUF_LEN]; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
702 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
703 if (!strchr(who, '@')) { |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
704 g_snprintf(buf, sizeof(buf), |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
705 _("An MSN screenname must be in the form \"user@server.com\". " |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
706 "Perhaps you meant %s@hotmail.com. No changes were made " |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
707 "to your allow list."), who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
708 |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5382
diff
changeset
|
709 gaim_notify_error(gc, NULL, _("Invalid MSN screenname"), buf); |
6378
01289157fc37
[gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
710 gaim_privacy_permit_remove(gc->account, who, TRUE); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
711 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
712 return; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
713 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
714 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
715 if (g_slist_find_custom(gc->account->deny, who, (GCompareFunc)strcmp)) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
716 gaim_debug(GAIM_DEBUG_INFO, "msn", "Moving %s from BL to AL\n", who); |
6378
01289157fc37
[gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
717 gaim_privacy_deny_remove(gc->account, who, TRUE); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
718 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
719 g_snprintf(buf, sizeof(buf), "BL %s", who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
720 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
721 if (!msn_servconn_send_command(session->notification_conn, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
722 "REM", buf)) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
723 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
724 gaim_connection_error(gc, _("Write error")); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
725 return; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
726 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
727 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
728 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
729 g_snprintf(buf, sizeof(buf), "AL %s %s", who, who); |
2086 | 730 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
731 if (!msn_servconn_send_command(session->notification_conn, "ADD", buf)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
732 gaim_connection_error(gc, _("Write error")); |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
733 return; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
734 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
735 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
736 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
737 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
738 msn_add_deny(GaimConnection *gc, const char *who) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
739 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
740 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
741 char buf[MSN_BUF_LEN]; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
742 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
743 if (!strchr(who, '@')) { |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
6695
diff
changeset
|
744 g_snprintf(buf, sizeof(buf), |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
745 _("An MSN screenname must be in the form \"user@server.com\". " |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
746 "Perhaps you meant %s@hotmail.com. No changes were made " |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
747 "to your block list."), who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
748 |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5382
diff
changeset
|
749 gaim_notify_error(gc, NULL, _("Invalid MSN screenname"), buf); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
750 |
6378
01289157fc37
[gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
751 gaim_privacy_deny_remove(gc->account, who, TRUE); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
752 |
2086 | 753 return; |
5309
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 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
756 if (g_slist_find_custom(gc->account->permit, who, (GCompareFunc)strcmp)) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
757 gaim_debug(GAIM_DEBUG_INFO, "msn", "Moving %s from AL to BL\n", who); |
6378
01289157fc37
[gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
758 gaim_privacy_permit_remove(gc->account, who, TRUE); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
759 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
760 g_snprintf(buf, sizeof(buf), "AL %s", who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
761 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
762 if (!msn_servconn_send_command(session->notification_conn, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
763 "REM", buf)) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
764 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
765 gaim_connection_error(gc, _("Write error")); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
766 return; |
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 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
770 g_snprintf(buf, sizeof(buf), "BL %s %s", who, who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
771 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
772 if (!msn_servconn_send_command(session->notification_conn, "ADD", buf)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
773 gaim_connection_error(gc, _("Write error")); |
2086 | 774 return; |
775 } | |
776 } | |
777 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
778 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
779 msn_rem_permit(GaimConnection *gc, const char *who) |
2086 | 780 { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
781 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
782 char buf[MSN_BUF_LEN]; |
2086 | 783 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
784 g_snprintf(buf, sizeof(buf), "AL %s", who); |
4150 | 785 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
786 if (!msn_servconn_send_command(session->notification_conn, "REM", buf)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
787 gaim_connection_error(gc, _("Write error")); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
788 return; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
789 } |
2086 | 790 |
6378
01289157fc37
[gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
791 gaim_privacy_deny_add(gc->account, who, TRUE); |
2600
8aade06646b5
[gaim-migrate @ 2613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2597
diff
changeset
|
792 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
793 g_snprintf(buf, sizeof(buf), "BL %s %s", who, who); |
2952 | 794 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
795 if (!msn_servconn_send_command(session->notification_conn, "ADD", buf)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
796 gaim_connection_error(gc, _("Write error")); |
2086 | 797 return; |
798 } | |
799 } | |
800 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
801 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
802 msn_rem_deny(GaimConnection *gc, const char *who) |
2086 | 803 { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
804 MsnSession *session = gc->proto_data; |
2086 | 805 char buf[MSN_BUF_LEN]; |
806 | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
807 g_snprintf(buf, sizeof(buf), "BL %s", who); |
2086 | 808 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
809 if (!msn_servconn_send_command(session->notification_conn, "REM", buf)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
810 gaim_connection_error(gc, _("Write error")); |
2213
a226ebf4be47
[gaim-migrate @ 2223]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2210
diff
changeset
|
811 return; |
a226ebf4be47
[gaim-migrate @ 2223]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2210
diff
changeset
|
812 } |
a226ebf4be47
[gaim-migrate @ 2223]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2210
diff
changeset
|
813 |
6378
01289157fc37
[gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
814 gaim_privacy_permit_add(gc->account, who, TRUE); |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
815 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
816 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
817 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
818 msn_set_permit_deny(GaimConnection *gc) |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
819 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
820 GaimAccount *account = gaim_connection_get_account(gc); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
821 MsnSession *session = gc->proto_data; |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
822 char buf[MSN_BUF_LEN]; |
2665
b0478af51be0
[gaim-migrate @ 2678]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2611
diff
changeset
|
823 GSList *s, *t = NULL; |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
824 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
825 if (account->perm_deny == PERMIT_ALL || |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
826 account->perm_deny == DENY_SOME) { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
827 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
828 strcpy(buf, "AL"); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
829 } |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
830 else |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
831 strcpy(buf, "BL"); |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
832 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
833 if (!msn_servconn_send_command(session->notification_conn, "BLP", buf)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
834 gaim_connection_error(gc, _("Write error")); |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
835 return; |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
836 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
837 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
838 /* |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
839 * This is safe because we'll always come here after we've gotten |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
840 * the list off the server, and data is never removed. So if the |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
841 * lengths are equal we don't know about anyone locally and so |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
842 * there's no sense in going through them all. |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
843 */ |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
844 if (g_slist_length(gc->account->permit) == |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
845 g_slist_length(session->lists.allow)) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
846 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
847 g_slist_free(session->lists.allow); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
848 session->lists.allow = NULL; |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
849 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
850 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
851 if (g_slist_length(gc->account->deny) == |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
852 g_slist_length(session->lists.block)) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
853 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
854 g_slist_free(session->lists.block); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
855 session->lists.block = NULL; |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
856 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
857 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
858 if (session->lists.allow == NULL && session->lists.block == NULL) |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
859 return; |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
860 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
861 if (session->lists.allow != NULL) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
862 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
863 for (s = g_slist_nth(gc->account->permit, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
864 g_slist_length(session->lists.allow)); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
865 s != NULL; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
866 s = s->next) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
867 |
3200 | 868 char *who = s->data; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
869 |
3200 | 870 if (!strchr(who, '@')) { |
871 t = g_slist_append(t, who); | |
872 continue; | |
873 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
874 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
875 if (g_slist_find(session->lists.block, who)) { |
3294 | 876 t = g_slist_append(t, who); |
877 continue; | |
878 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
879 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
880 g_snprintf(buf, sizeof(buf), "AL %s %s", who, who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
881 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
882 if (!msn_servconn_send_command(session->notification_conn, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
883 "ADD", buf)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
884 gaim_connection_error(gc, _("Write error")); |
3200 | 885 return; |
886 } | |
2665
b0478af51be0
[gaim-migrate @ 2678]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2611
diff
changeset
|
887 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
888 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
889 for (; t != NULL; t = t->next) |
6378
01289157fc37
[gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
890 gaim_privacy_permit_remove(gc->account, t->data, TRUE); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
891 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
892 if (t != NULL) |
3200 | 893 g_slist_free(t); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
894 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
895 t = NULL; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
896 g_slist_free(session->lists.allow); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
897 session->lists.allow = NULL; |
3200 | 898 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
899 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
900 if (session->lists.block) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
901 for (s = g_slist_nth(gc->account->deny, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
902 g_slist_length(session->lists.block)); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
903 s != NULL; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
904 s = s->next) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
905 |
3200 | 906 char *who = s->data; |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
907 |
3200 | 908 if (!strchr(who, '@')) { |
909 t = g_slist_append(t, who); | |
910 continue; | |
911 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
912 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
913 if (g_slist_find(session->lists.block, who)) { |
3294 | 914 t = g_slist_append(t, who); |
915 continue; | |
916 } | |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
917 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
918 g_snprintf(buf, sizeof(buf), "BL %s %s", who, who); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
919 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
920 if (!msn_servconn_send_command(session->notification_conn, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
921 "ADD", buf)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
922 gaim_connection_error(gc, _("Write error")); |
3200 | 923 return; |
924 } | |
2665
b0478af51be0
[gaim-migrate @ 2678]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2611
diff
changeset
|
925 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
926 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
927 for (; t != NULL; t = t->next) |
6378
01289157fc37
[gaim-migrate @ 6883]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
928 gaim_privacy_deny_remove(gc->account, t->data, TRUE); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
929 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
930 if (t != NULL) |
3200 | 931 g_slist_free(t); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
932 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
933 g_slist_free(session->lists.block); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
934 session->lists.block = NULL; |
3200 | 935 } |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
936 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
937 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
938 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
939 msn_chat_invite(GaimConnection *gc, int id, const char *msg, |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
940 const char *who) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
941 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
942 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
943 MsnSwitchBoard *swboard = msn_session_find_switch_with_id(session, id); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
944 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
945 if (swboard == NULL) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
946 return; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
947 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
948 if (!msn_switchboard_send_command(swboard, "CAL", who)) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
949 msn_switchboard_destroy(swboard); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
950 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
951 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
952 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
953 msn_chat_leave(GaimConnection *gc, int id) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
954 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
955 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
956 MsnSwitchBoard *swboard = msn_session_find_switch_with_id(session, id); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
957 char buf[6]; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
958 |
6149
6f4979d8cc3c
[gaim-migrate @ 6623]
Christian Hammond <chipx86@chipx86.com>
parents:
6148
diff
changeset
|
959 if (swboard == NULL) { |
6f4979d8cc3c
[gaim-migrate @ 6623]
Christian Hammond <chipx86@chipx86.com>
parents:
6148
diff
changeset
|
960 serv_got_chat_left(gc, id); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
961 return; |
6149
6f4979d8cc3c
[gaim-migrate @ 6623]
Christian Hammond <chipx86@chipx86.com>
parents:
6148
diff
changeset
|
962 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
963 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
964 strcpy(buf, "OUT\r\n"); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
965 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
966 if (!msn_servconn_write(swboard->servconn, buf, strlen(buf))) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
967 msn_switchboard_destroy(swboard); |
6023
f8edfcb55a34
[gaim-migrate @ 6473]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
968 |
6024
a23a1d51f573
[gaim-migrate @ 6474]
Christian Hammond <chipx86@chipx86.com>
parents:
6023
diff
changeset
|
969 serv_got_chat_left(gc, id); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
970 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
971 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
972 static int |
6059 | 973 msn_chat_send(GaimConnection *gc, int id, const char *message) |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
974 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
975 GaimAccount *account = gaim_connection_get_account(gc); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
976 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
977 MsnSwitchBoard *swboard = msn_session_find_switch_with_id(session, id); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
978 MsnMessage *msg; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
979 char *send; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
980 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
981 if (swboard == NULL) |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
982 return -EINVAL; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
983 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
984 send = add_cr(message); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
985 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
986 msg = msn_message_new(); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
987 msn_message_set_attr(msg, "X-MMS-IM-Format", "FN=Arial; EF=; CO=0; PF=0"); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
988 msn_message_set_body(msg, send); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
989 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
990 g_free(send); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
991 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
992 if (!msn_switchboard_send_msg(swboard, msg)) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
993 msn_switchboard_destroy(swboard); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
994 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
995 msn_message_destroy(msg); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
996 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
997 return 0; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
998 } |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
999 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1000 msn_message_destroy(msg); |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1001 |
6059 | 1002 serv_got_chat_in(gc, id, gaim_account_get_username(account), |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1003 0, message, time(NULL)); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1004 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1005 return 0; |
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 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1008 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1009 msn_keepalive(GaimConnection *gc) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1010 { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1011 MsnSession *session = gc->proto_data; |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1012 char buf[MSN_BUF_LEN]; |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1013 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1014 g_snprintf(buf, sizeof(buf), "PNG\r\n"); |
2665
b0478af51be0
[gaim-migrate @ 2678]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2611
diff
changeset
|
1015 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1016 if (msn_servconn_write(session->notification_conn, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1017 buf, strlen(buf)) < 0) { |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1018 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1019 gaim_connection_error(gc, _("Write error")); |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1020 return; |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1021 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1022 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1023 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1024 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1025 msn_group_buddy(GaimConnection *gc, const char *who, |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1026 const char *old_group_name, const char *new_group_name) |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1027 { |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1028 MsnSession *session = gc->proto_data; |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1029 char outparams[MSN_BUF_LEN]; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1030 MsnGroup *old_group, *new_group; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1031 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1032 old_group = msn_groups_find_with_name(session->groups, old_group_name); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1033 new_group = msn_groups_find_with_name(session->groups, new_group_name); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1034 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1035 if (new_group == NULL) { |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1036 g_snprintf(outparams, sizeof(outparams), "%s 0", |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1037 msn_url_encode(new_group_name)); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1038 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1039 if (!msn_servconn_send_command(session->notification_conn, |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1040 "ADG", outparams)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1041 gaim_connection_error(gc, _("Write error")); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1042 return; |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1043 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1044 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1045 /* I hate this. So much. */ |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1046 session->moving_buddy = TRUE; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1047 session->dest_group_name = g_strdup(new_group_name); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1048 session->old_group = old_group; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1049 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1050 session->moving_user = |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1051 msn_users_find_with_passport(session->users, who); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1052 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1053 msn_user_ref(session->moving_user); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1054 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1055 else { |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1056 g_snprintf(outparams, sizeof(outparams), "FL %s %s %d", |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1057 who, who, msn_group_get_id(new_group)); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1058 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1059 if (!msn_servconn_send_command(session->notification_conn, |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1060 "ADD", outparams)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1061 gaim_connection_error(gc, _("Write error")); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1062 return; |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1063 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1064 } |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1065 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1066 if (old_group != NULL) { |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1067 g_snprintf(outparams, sizeof(outparams), "FL %s %d", |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1068 who, msn_group_get_id(old_group)); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1069 |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1070 if (!msn_servconn_send_command(session->notification_conn, |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1071 "REM", outparams)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1072 gaim_connection_error(gc, _("Write error")); |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1073 return; |
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1074 } |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1075 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1076 if (msn_users_get_count(msn_group_get_users(old_group)) <= 0) { |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1077 g_snprintf(outparams, sizeof(outparams), "%d", |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1078 msn_group_get_id(old_group)); |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1079 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1080 if (!msn_servconn_send_command(session->notification_conn, |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1081 "RMG", outparams)) { |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1082 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1083 gaim_connection_error(gc, _("Write error")); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1084 return; |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1085 } |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1086 } |
5322
a4d017bee1de
[gaim-migrate @ 5694]
Christian Hammond <chipx86@chipx86.com>
parents:
5318
diff
changeset
|
1087 } |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1088 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1089 |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1090 static void |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1091 msn_rename_group(GaimConnection *gc, const char *old_group_name, |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1092 const char *new_group_name, GList *members) |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1093 { |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1094 MsnSession *session = gc->proto_data; |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1095 char outparams[MSN_BUF_LEN]; |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1096 MsnGroup *old_group; |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1097 |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1098 if ((old_group = msn_groups_find_with_name(session->groups, |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1099 old_group_name)) != NULL) { |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1100 |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1101 g_snprintf(outparams, sizeof(outparams), "%d %s 0", |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1102 msn_group_get_id(old_group), |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1103 msn_url_encode(new_group_name)); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1104 |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1105 if (!msn_servconn_send_command(session->notification_conn, |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1106 "REG", outparams)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1107 gaim_connection_error(gc, _("Write error")); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1108 return; |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1109 } |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1110 |
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1111 msn_group_set_name(old_group, new_group_name); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1112 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1113 else { |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1114 g_snprintf(outparams, sizeof(outparams), "%s 0", |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1115 msn_url_encode(new_group_name)); |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1116 |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1117 if (!msn_servconn_send_command(session->notification_conn, |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1118 "ADG", outparams)) { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1119 gaim_connection_error(gc, _("Write error")); |
5518
bf2a7a7b739d
[gaim-migrate @ 5918]
Christian Hammond <chipx86@chipx86.com>
parents:
5507
diff
changeset
|
1120 return; |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1121 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1122 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1123 } |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1124 |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1125 static void |
6695 | 1126 msn_buddy_free(GaimBuddy *b) |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1127 { |
5363
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1128 if (b->proto_data != NULL) { |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1129 msn_user_destroy(b->proto_data); |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1130 b->proto_data = NULL; |
ebebc833cf77
[gaim-migrate @ 5739]
Christian Hammond <chipx86@chipx86.com>
parents:
5361
diff
changeset
|
1131 } |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1132 } |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1133 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1134 static void |
6059 | 1135 msn_convo_closed(GaimConnection *gc, const char *who) |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1136 { |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1137 GaimAccount *account = gaim_connection_get_account(gc); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1138 MsnSession *session = gc->proto_data; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1139 MsnSwitchBoard *swboard; |
6026
01dd6b652c22
[gaim-migrate @ 6476]
Christian Hammond <chipx86@chipx86.com>
parents:
6024
diff
changeset
|
1140 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1141 swboard = msn_session_find_switch_with_passport(session, who); |
4349 | 1142 |
6026
01dd6b652c22
[gaim-migrate @ 6476]
Christian Hammond <chipx86@chipx86.com>
parents:
6024
diff
changeset
|
1143 if (swboard != NULL && swboard->chat == NULL) { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1144 char sendbuf[256]; |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1145 |
5564
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1146 g_snprintf(sendbuf, sizeof(sendbuf), "BYE %s\r\n", |
187c740f2a4e
[gaim-migrate @ 5966]
Christian Hammond <chipx86@chipx86.com>
parents:
5518
diff
changeset
|
1147 gaim_account_get_username(account)); |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1148 |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1149 msn_servconn_write(swboard->servconn, sendbuf, strlen(sendbuf)); |
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 msn_switchboard_destroy(swboard); |
3294 | 1152 } |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1153 } |
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1154 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1155 static char * |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1156 msn_normalize(const char *str) |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1157 { |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1158 static char buf[BUF_LEN]; |
3294 | 1159 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1160 g_return_val_if_fail(str != NULL, NULL); |
2597
2ced57c58653
[gaim-migrate @ 2610]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2591
diff
changeset
|
1161 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1162 g_snprintf(buf, sizeof(buf), "%s%s", str, |
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1163 (strchr(str, '@') ? "" : "@hotmail.com")); |
4349 | 1164 |
5309
e2e53316a21d
[gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
5221
diff
changeset
|
1165 return buf; |
2607
e0d4a23aac89
[gaim-migrate @ 2620]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2603
diff
changeset
|
1166 } |
e0d4a23aac89
[gaim-migrate @ 2620]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2603
diff
changeset
|
1167 |
6516 | 1168 static void |
1169 msn_got_info(gpointer data, char *url_text, unsigned long len) | |
1170 { | |
1171 char *stripped,*p,*q; | |
1172 char buf[1024]; | |
1173 char *user_url = NULL; | |
1174 | |
1175 if (!url_text || !strcmp(url_text,"")) { | |
1176 g_show_info_text(NULL, NULL, 2, | |
6573 | 1177 _("<html><body><b>Error retrieving profile</b></body></html>"), NULL); |
6516 | 1178 return; |
1179 } | |
1180 | |
1181 /* if they have a homepage link, MSN masks it such that we need to | |
1182 * fetch the url out before strip_html() nukes it */ | |
1183 if((p = strstr(url_text, "Take a look at my </font><A class=viewDesc title=\"")) != NULL ) | |
1184 { | |
1185 p += 50; | |
1186 if((q = strchr(p, '"')) != NULL) | |
1187 user_url = g_strndup(p,q-p); | |
1188 } | |
1189 | |
1190 /* strip_html() doesn't strip out character entities like and · */ | |
1191 while ((p = strstr(url_text, " ")) != NULL) { | |
1192 memmove(p, p+6, strlen(p+6)); | |
1193 url_text[strlen(url_text)-6] = '\0'; | |
1194 } | |
1195 while ((p = strstr(url_text, "·")) != NULL) { | |
1196 memmove(p, p+6, strlen(p+6)); | |
1197 url_text[strlen(url_text)-6] = '\0'; | |
1198 } | |
1199 | |
1200 /* nuke the nasty \r's that just get in the way */ | |
1201 while ((p = strchr(url_text, '\r')) != NULL) { | |
1202 memmove(p, p+1, strlen(p+1)); | |
1203 url_text[strlen(url_text)-1] = '\0'; | |
1204 } | |
1205 | |
1206 /* MSN always puts in ' for apostrophies...replace them */ | |
1207 while ((p = strstr(url_text, "'")) != NULL) { | |
1208 *p = '\''; | |
1209 memmove(p+1, p+5, strlen(p+5)); | |
1210 url_text[strlen(url_text)-4] = '\0'; | |
1211 } | |
1212 | |
1213 /* nuke the html, it's easier than trying to parse the horrid stuff */ | |
1214 stripped = strip_html(url_text); | |
1215 | |
1216 /* gonna re-use the memory we've already got for url_text */ | |
1217 strcpy(url_text, "<html><body>\n"); | |
1218 | |
1219 /* extract their Name and put it in */ | |
1220 info_extract_field(stripped, url_text, "\tName", 0, "\t", '\n', | |
6657 | 1221 "Undisclosed", _("Name"), 0, NULL); |
6516 | 1222 |
1223 /* extract their Age and put it in */ | |
1224 info_extract_field(stripped, url_text, "\tAge", 0, "\t", '\n', | |
6657 | 1225 "Undisclosed", _("Age"), 0, NULL); |
6516 | 1226 |
1227 /* extract their Gender and put it in */ | |
1228 info_extract_field(stripped, url_text, "\tGender", 6, "\t", '\n', | |
6657 | 1229 "Undisclosed", _("Gender"), 0, NULL); |
6516 | 1230 |
1231 /* extract their MaritalStatus and put it in */ | |
1232 info_extract_field(stripped, url_text, "\tMaritalStatus", 0, "\t", '\n', | |
6657 | 1233 "Undisclosed", _("Marital Status"), 0, NULL); |
6516 | 1234 |
1235 /* extract their Location and put it in */ | |
1236 info_extract_field(stripped, url_text, "\tLocation", 0, "\t", '\n', | |
6657 | 1237 "Undisclosed", _("Location"), 0, NULL); |
6516 | 1238 |
1239 /* extract their Occupation and put it in */ | |
1240 info_extract_field(stripped, url_text, "\t Occupation", 6, "\t", '\n', | |
6657 | 1241 "Undisclosed", _("Occupation"), 0, NULL); |
6516 | 1242 |
1243 /* the fields, 'A Little About Me', 'Favorite Things', 'Hobbies and Interests', | |
1244 * 'Favorite Quote', and 'My Homepage' may or may not appear, in any combination. | |
1245 * however, they do appear in certain order, so we can successively search to | |
1246 * pin down the distinct values. | |
1247 */ | |
1248 | |
1249 /* check if they have A Little About Me */ | |
1250 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Favorite Things", '\n', | |
6573 | 1251 NULL, _("A Little About Me"), 0, NULL)) |
6516 | 1252 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Hobbies and Interests", '\n', |
6573 | 1253 NULL, _("A Little About Me"), 0, NULL)) |
6516 | 1254 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Favorite Quote", '\n', |
6573 | 1255 NULL, _("A Little About Me"), 0, NULL)) |
6516 | 1256 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "My Homepage\tTake a look", '\n', |
6573 | 1257 NULL, _("A Little About Me"), 0, NULL)) |
6516 | 1258 info_extract_field(stripped, url_text, "\tA Little About Me", 1, "last updated", '\n', |
6573 | 1259 NULL, _("A Little About Me"), 0, NULL); |
6516 | 1260 |
1261 /* check if they have Favorite Things */ | |
1262 if(!info_extract_field(stripped, url_text, "Favorite Things", 1, "Hobbies and Interests", '\n', | |
6573 | 1263 NULL, _("Favorite Things"), 0, NULL)) |
6516 | 1264 if(!info_extract_field(stripped, url_text, "Favorite Things", 1, "Favorite Quote", '\n', |
1265 NULL, "Favorite Things", 0, NULL)) | |
1266 if(info_extract_field(stripped, url_text, "Favorite Things", 1, "My Homepage\tTake a look", '\n', | |
6573 | 1267 NULL, _("Favorite Things"), 0, NULL)) |
6516 | 1268 info_extract_field(stripped, url_text, "Favorite Things", 1, "last updated", '\n', |
6573 | 1269 NULL, _("Favorite Things"), 0, NULL); |
6516 | 1270 |
1271 /* check if they have Hobbies and Interests */ | |
1272 if(!info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "Favorite Quote", '\n', | |
6573 | 1273 NULL, _("Hobbies and Interests"), 0, NULL)) |
6516 | 1274 if(info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "My Homepage\tTake a look", '\n', |
6573 | 1275 NULL, _("Hobbies and Interests"), 0, NULL)) |
6516 | 1276 info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "last updated", '\n', |
6573 | 1277 NULL, _("Hobbies and Interests"), 0, NULL); |
6516 | 1278 |
1279 /* check if they have Favorite Quote */ | |
1280 if(!info_extract_field(stripped, url_text, "Favorite Quote", 1, "My Homepage\tTake a look", '\n', | |
6573 | 1281 NULL, _("Favorite Quote"), 0, NULL)) |
6516 | 1282 info_extract_field(stripped, url_text, "Favorite Quote", 1, "last updated", '\n', |
6573 | 1283 NULL, _("Favorite Quote"), 0, NULL); |
6516 | 1284 |
1285 /* extract the last updated date and put it in */ | |
1286 info_extract_field(stripped, url_text, "\tlast updated:", 1, "\n", '\n', | |
6573 | 1287 NULL, _("Last Updated"), 0, NULL); |
6516 | 1288 |
1289 /* if we were able to fetch a homepage url earlier, stick it in there */ | |
1290 if(user_url) | |
1291 { | |
6623 | 1292 g_snprintf(buf,sizeof(buf),"<b>%s:</b><br><a href=\"%s\">%s</a><br>\n",_("Homepage"),user_url,user_url); |
6516 | 1293 strcat(url_text,buf); |
1294 } | |
1295 | |
1296 /* finish it off, and show it to them */ | |
1297 strcat(url_text, "</body></html>\n"); | |
1298 g_show_info_text(NULL, NULL, 2, url_text, NULL); | |
1299 g_free(stripped); | |
1300 } | |
1301 | |
1302 static void | |
1303 msn_get_info(GaimConnection *gc, const char *name) | |
1304 { | |
1305 char url[256]; | |
1306 g_snprintf(url, sizeof url, "%s%s", PROFILE_URL, name); | |
1307 grab_url(url, FALSE, msn_got_info, NULL,"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",1); | |
1308 } | |
1309 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1310 static GaimPluginProtocolInfo prpl_info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1311 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1312 GAIM_PROTO_MSN, |
5351
2aa7e4237142
[gaim-migrate @ 5727]
Christian Hammond <chipx86@chipx86.com>
parents:
5327
diff
changeset
|
1313 OPT_PROTO_MAIL_CHECK | OPT_PROTO_BUDDY_ICON, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1314 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1315 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1316 msn_list_icon, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1317 msn_list_emblems, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1318 msn_status_text, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1319 msn_tooltip_text, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1320 msn_away_states, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1321 msn_actions, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1322 msn_buddy_menu, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1323 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1324 msn_login, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1325 msn_close, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1326 msn_send_im, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1327 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1328 msn_send_typing, |
6516 | 1329 msn_get_info, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1330 msn_set_away, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1331 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1332 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1333 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1334 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1335 msn_set_idle, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1336 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1337 msn_add_buddy, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1338 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1339 msn_rem_buddy, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1340 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1341 msn_add_permit, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1342 msn_add_deny, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1343 msn_rem_permit, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1344 msn_rem_deny, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1345 msn_set_permit_deny, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1346 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1347 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1348 msn_chat_invite, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1349 msn_chat_leave, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1350 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1351 msn_chat_send, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1352 msn_keepalive, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1353 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1354 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1355 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1356 NULL, |
5318
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1357 msn_group_buddy, |
bd98232872a3
[gaim-migrate @ 5690]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
1358 msn_rename_group, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1359 msn_buddy_free, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1360 msn_convo_closed, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1361 msn_normalize |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1362 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1363 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1364 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1365 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1366 2, /**< api_version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1367 GAIM_PLUGIN_PROTOCOL, /**< type */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1368 NULL, /**< ui_requirement */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1369 0, /**< flags */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1370 NULL, /**< dependencies */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1371 GAIM_PRIORITY_DEFAULT, /**< priority */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1372 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1373 "prpl-msn", /**< id */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1374 "MSN", /**< name */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1375 VERSION, /**< version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1376 /** summary */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1377 N_("MSN Protocol Plugin"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1378 /** description */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1379 N_("MSN Protocol Plugin"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1380 "Christian Hammond <chipx86@gnupdate.org>", /**< author */ |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6228
diff
changeset
|
1381 GAIM_WEBSITE, /**< homepage */ |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1382 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1383 NULL, /**< load */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1384 NULL, /**< unload */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1385 NULL, /**< destroy */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1386 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1387 NULL, /**< ui_info */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1388 &prpl_info /**< extra_info */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1389 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1390 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1391 static void |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
1392 init_plugin(GaimPlugin *plugin) |
2086 | 1393 { |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
1394 GaimAccountOption *option; |
3572 | 1395 |
5685
43ea75092684
[gaim-migrate @ 6106]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
1396 option = gaim_account_option_string_new(_("Login server"), "server", |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
1397 MSN_SERVER); |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
1398 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
1399 option); |
3572 | 1400 |
5638
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
1401 option = gaim_account_option_int_new(_("Port"), "port", 1863); |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
1402 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
0bdfa28c678e
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5626
diff
changeset
|
1403 option); |
2086 | 1404 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5191
diff
changeset
|
1405 my_protocol = plugin; |
5626
6275ac113622
[gaim-migrate @ 6033]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1406 |
6275ac113622
[gaim-migrate @ 6033]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1407 gaim_prefs_add_none("/plugins/prpl/msn"); |
6275ac113622
[gaim-migrate @ 6033]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1408 gaim_prefs_add_bool("/plugins/prpl/msn/conv_close_notice", TRUE); |
6275ac113622
[gaim-migrate @ 6033]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1409 gaim_prefs_add_bool("/plugins/prpl/msn/conv_timeout_notice", TRUE); |
2086 | 1410 } |
1411 | |
5793
952710ac6635
[gaim-migrate @ 6218]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
1412 GAIM_INIT_PLUGIN(msn, init_plugin, info); |