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