Mercurial > pidgin
annotate libpurple/protocols/oscar/oscar.c @ 31936:2b387aaeb89d
Don't access PurpleBuddy->proto_data directly, rather use the accessor functions.
author | andrew.victor@mxit.com |
---|---|
date | Tue, 23 Aug 2011 20:48:43 +0000 |
parents | 99ca503ea087 |
children | 7c65c7054905 3828a61c44da |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15822 | 2 * purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4 * Some code copyright (C) 1998-1999, Mark Spencer <markster@marko.net> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * Some code copyright (C) 1999-2001, Eric Warmenhoven |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6 * Some code copyright (C) 2001-2003, Sean Egan |
20629
77fda34d4289
A patch from Collin from ComBOTS, I guess. This fixes setting your
Mark Doliner <mark@kingant.net>
parents:
20582
diff
changeset
|
7 * Some code copyright (C) 2001-2007, Mark Doliner <thekingant@users.sourceforge.net> |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * Some code copyright (C) 2005, Jonathan Clark <ardentlygnarly@users.sourceforge.net> |
20629
77fda34d4289
A patch from Collin from ComBOTS, I guess. This fixes setting your
Mark Doliner <mark@kingant.net>
parents:
20582
diff
changeset
|
9 * Some code copyright (C) 2007, ComBOTS Product GmbH (htfv) <foss@combots.com> |
21998
31a631d08d46
Credit for 1858be5916da7bce36f3c991bcd71fc65271048d. References #4052.
Mark Doliner <mark@kingant.net>
parents:
21997
diff
changeset
|
10 * Some code copyright (C) 2008, Aman Gupta |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * Most libfaim code copyright (C) 1998-2001 Adam Fritzler <afritz@auk.cx> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * Some libfaim code copyright (C) 2001-2004 Mark Doliner <thekingant@users.sourceforge.net> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19654
diff
changeset
|
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #include "internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "account.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "accountopt.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "buddyicon.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "cipher.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "conversation.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "core.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "debug.h" |
30381
a347a4cd1caf
Moved encoding-related functions to a separate file, renamed some of them,
ivan.komarov@soc.pidgin.im
parents:
30376
diff
changeset
|
40 #include "encoding.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "imgstore.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 #include "network.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "notify.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "privacy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "prpl.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 #include "proxy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 #include "request.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 #include "version.h" |
30372
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
50 #include "visibility.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 #include "oscarcommon.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 #include "oscar.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 #include "peer.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 |
15866
2c3765732dba
I don't know if the OSCAR checksum stuff will be copied to pidgin.im, but it certainly won't be at a website that's not ours (wrong because of the sed).
Richard Laager <rlaager@wiktel.com>
parents:
15865
diff
changeset
|
56 #define AIMHASHDATA "http://pidgin.im/aim_data.php3" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 #define OSCAR_CONNECT_STEPS 6 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 |
29606
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
60 static guint64 purple_caps = |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
61 OSCAR_CAPABILITY_CHAT |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
62 | OSCAR_CAPABILITY_BUDDYICON |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
63 | OSCAR_CAPABILITY_DIRECTIM |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
64 | OSCAR_CAPABILITY_SENDFILE |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
65 | OSCAR_CAPABILITY_UNICODE |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
66 | OSCAR_CAPABILITY_INTEROPERATE |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
67 | OSCAR_CAPABILITY_SHORTCAPS |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
68 | OSCAR_CAPABILITY_TYPING |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
69 | OSCAR_CAPABILITY_ICQSERVERRELAY |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29529
diff
changeset
|
70 | OSCAR_CAPABILITY_NEWCAPS |
30398
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
71 | OSCAR_CAPABILITY_XTRAZ |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
72 | OSCAR_CAPABILITY_HTML_MSGS; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 static guint8 features_aim[] = {0x01, 0x01, 0x01, 0x02}; |
29733
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
29732
diff
changeset
|
75 static guint8 features_icq[] = {0x01}; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 struct create_room { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 int exchange; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 struct oscar_ask_directim_data |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 char *who; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 |
15822 | 88 /* All the libfaim->purple callback functions */ |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
89 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
90 /* Only used when connecting with the old-style BUCP login */ |
15822 | 91 static int purple_parse_auth_resp (OscarData *, FlapConnection *, FlapFrame *, ...); |
92 static int purple_parse_login (OscarData *, FlapConnection *, FlapFrame *, ...); | |
93 static int purple_parse_auth_securid_request(OscarData *, FlapConnection *, FlapFrame *, ...); | |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
94 |
15822 | 95 static int purple_handle_redirect (OscarData *, FlapConnection *, FlapFrame *, ...); |
96 static int purple_info_change (OscarData *, FlapConnection *, FlapFrame *, ...); | |
97 static int purple_account_confirm (OscarData *, FlapConnection *, FlapFrame *, ...); | |
98 static int purple_parse_oncoming (OscarData *, FlapConnection *, FlapFrame *, ...); | |
99 static int purple_parse_offgoing (OscarData *, FlapConnection *, FlapFrame *, ...); | |
100 static int purple_parse_incoming_im(OscarData *, FlapConnection *, FlapFrame *, ...); | |
101 static int purple_parse_misses (OscarData *, FlapConnection *, FlapFrame *, ...); | |
102 static int purple_parse_clientauto (OscarData *, FlapConnection *, FlapFrame *, ...); | |
103 static int purple_parse_motd (OscarData *, FlapConnection *, FlapFrame *, ...); | |
104 static int purple_chatnav_info (OscarData *, FlapConnection *, FlapFrame *, ...); | |
105 static int purple_conv_chat_join (OscarData *, FlapConnection *, FlapFrame *, ...); | |
106 static int purple_conv_chat_leave (OscarData *, FlapConnection *, FlapFrame *, ...); | |
107 static int purple_conv_chat_info_update (OscarData *, FlapConnection *, FlapFrame *, ...); | |
108 static int purple_conv_chat_incoming_msg(OscarData *, FlapConnection *, FlapFrame *, ...); | |
109 static int purple_email_parseupdate(OscarData *, FlapConnection *, FlapFrame *, ...); | |
110 static int purple_icon_parseicon (OscarData *, FlapConnection *, FlapFrame *, ...); | |
111 static int purple_parse_searcherror(OscarData *, FlapConnection *, FlapFrame *, ...); | |
112 static int purple_parse_searchreply(OscarData *, FlapConnection *, FlapFrame *, ...); | |
113 static int purple_bosrights (OscarData *, FlapConnection *, FlapFrame *, ...); | |
114 static int purple_connerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
115 static int purple_parse_mtn (OscarData *, FlapConnection *, FlapFrame *, ...); | |
116 static int purple_parse_locaterights(OscarData *, FlapConnection *, FlapFrame *, ...); | |
117 static int purple_parse_buddyrights(OscarData *, FlapConnection *, FlapFrame *, ...); | |
118 static int purple_parse_genericerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
119 static int purple_memrequest (OscarData *, FlapConnection *, FlapFrame *, ...); | |
120 static int purple_selfinfo (OscarData *, FlapConnection *, FlapFrame *, ...); | |
121 static int purple_popup (OscarData *, FlapConnection *, FlapFrame *, ...); | |
122 static int purple_ssi_parseerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
123 static int purple_ssi_parserights (OscarData *, FlapConnection *, FlapFrame *, ...); | |
124 static int purple_ssi_parselist (OscarData *, FlapConnection *, FlapFrame *, ...); | |
125 static int purple_ssi_parseack (OscarData *, FlapConnection *, FlapFrame *, ...); | |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
126 static int purple_ssi_parseaddmod (OscarData *, FlapConnection *, FlapFrame *, ...); |
15822 | 127 static int purple_ssi_authgiven (OscarData *, FlapConnection *, FlapFrame *, ...); |
128 static int purple_ssi_authrequest (OscarData *, FlapConnection *, FlapFrame *, ...); | |
129 static int purple_ssi_authreply (OscarData *, FlapConnection *, FlapFrame *, ...); | |
130 static int purple_ssi_gotadded (OscarData *, FlapConnection *, FlapFrame *, ...); | |
131 | |
18816
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
132 static void purple_icons_fetch(PurpleConnection *gc); |
15822 | 133 |
134 void oscar_set_info(PurpleConnection *gc, const char *info); | |
135 static void oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, gboolean setstatus, PurpleStatus *status); | |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
136 static void oscar_set_extended_status(PurpleConnection *gc); |
15822 | 137 static gboolean purple_ssi_rerequestdata(gpointer data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 |
30361
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30359
diff
changeset
|
139 void oscar_free_name_data(struct name_data *data) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 g_free(data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 g_free(data->nick); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 #ifdef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 const char *oscar_get_locale_charset(void) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 static const char *charset = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 if (charset == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 g_get_charset(&charset); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 return charset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 static char *oscar_icqstatus(int state) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 /* Make a cute little string that shows the status of the dude or dudet */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 if (state & AIM_ICQ_STATE_CHAT) |
24915
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24879
diff
changeset
|
157 return g_strdup(_("Free For Chat")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 else if (state & AIM_ICQ_STATE_DND) |
24915
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24879
diff
changeset
|
159 return g_strdup(_("Do Not Disturb")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 else if (state & AIM_ICQ_STATE_OUT) |
24915
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24879
diff
changeset
|
161 return g_strdup(_("Not Available")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 else if (state & AIM_ICQ_STATE_BUSY) |
24915
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24879
diff
changeset
|
163 return g_strdup(_("Occupied")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 else if (state & AIM_ICQ_STATE_AWAY) |
24915
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24879
diff
changeset
|
165 return g_strdup(_("Away")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 else if (state & AIM_ICQ_STATE_WEBAWARE) |
24915
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24879
diff
changeset
|
167 return g_strdup(_("Web Aware")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 else if (state & AIM_ICQ_STATE_INVISIBLE) |
24915
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24879
diff
changeset
|
169 return g_strdup(_("Invisible")); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
170 else if (state & AIM_ICQ_STATE_EVIL) |
29457
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
171 return g_strdup(_("Evil")); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
172 else if (state & AIM_ICQ_STATE_DEPRESSION) |
29457
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
173 return g_strdup(_("Depression")); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
174 else if (state & AIM_ICQ_STATE_ATHOME) |
29460 | 175 return g_strdup(_("At home")); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
176 else if (state & AIM_ICQ_STATE_ATWORK) |
29457
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
177 return g_strdup(_("At work")); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
178 else if (state & AIM_ICQ_STATE_LUNCH) |
29457
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
179 return g_strdup(_("At lunch")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 else |
24915
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24879
diff
changeset
|
181 return g_strdup(_("Online")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 static char *extract_name(const char *name) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 char *tmp, *x; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 int i, j; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 if (!name) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 x = strchr(name, '-'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 if (!x) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 x = strchr(x + 1, '-'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 if (!x) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 tmp = g_strdup(++x); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 for (i = 0, j = 0; x[i]; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 char hex[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 if (x[i] != '%') { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 tmp[j++] = x[i]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 strncpy(hex, x + ++i, 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 hex[2] = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 i++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 tmp[j++] = strtol(hex, NULL, 16); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 tmp[j] = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 return tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 static struct chat_connection * |
15822 | 218 find_oscar_chat(PurpleConnection *gc, int id) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
220 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 for (cur = od->oscar_chats; cur != NULL; cur = cur->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 if (cc->id == id) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 return cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 static struct chat_connection * |
15822 | 235 find_oscar_chat_by_conn(PurpleConnection *gc, FlapConnection *conn) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
237 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 for (cur = od->oscar_chats; cur != NULL; cur = cur->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 if (cc->conn == conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 return cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 static struct chat_connection * |
15822 | 252 find_oscar_chat_by_conv(PurpleConnection *gc, PurpleConversation *conv) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
254 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 for (cur = od->oscar_chats; cur != NULL; cur = cur->next) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 if (cc->conv == conv) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 return cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 oscar_chat_destroy(struct chat_connection *cc) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 g_free(cc->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 g_free(cc->show); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 g_free(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 static void |
15822 | 277 oscar_chat_kill(PurpleConnection *gc, struct chat_connection *cc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
279 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 /* Notify the conversation window that we've left the chat */ |
15822 | 282 serv_got_chat_left(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(cc->conv))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 /* Destroy the chat_connection */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 od->oscar_chats = g_slist_remove(od->oscar_chats, cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 oscar_chat_destroy(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 /** |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
290 * This is called from the callback functions for establishing |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
291 * a TCP connection with an oscar host if an error occurred. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 static void |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
294 connection_common_error_cb(FlapConnection *conn, const gchar *error_message) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 OscarData *od; |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
297 PurpleConnection *gc; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
298 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
299 od = conn->od; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
300 gc = od->gc; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
301 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
302 purple_debug_error("oscar", "unable to connect to FLAP " |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
303 "server of type 0x%04hx\n", conn->type); |
25381
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
304 |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
305 if (conn->type == SNAC_FAMILY_AUTH) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
306 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
307 /* This only happens when connecting with the old-style BUCP login */ |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
308 gchar *msg; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
309 msg = g_strdup_printf(_("Unable to connect to authentication server: %s"), |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
310 error_message); |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
311 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
312 g_free(msg); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
313 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
314 else if (conn->type == SNAC_FAMILY_LOCATE) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
315 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
316 gchar *msg; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
317 msg = g_strdup_printf(_("Unable to connect to BOS server: %s"), |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
318 error_message); |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
319 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
320 g_free(msg); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
321 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
322 else |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
323 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
324 /* Maybe we should call this for BOS connections, too? */ |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
325 flap_connection_schedule_destroy(conn, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
326 OSCAR_DISCONNECT_COULD_NOT_CONNECT, error_message); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
327 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
328 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
329 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
330 /** |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
331 * This is called from the callback functions for establishing |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
332 * a TCP connection with an oscar host. Depending on the type |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
333 * of host, we do a few different things here. |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
334 */ |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
335 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
336 connection_common_established_cb(FlapConnection *conn) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 { |
25381
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
338 OscarData *od; |
15822 | 339 PurpleConnection *gc; |
340 PurpleAccount *account; | |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
341 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 od = conn->od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 gc = od->gc; |
15822 | 344 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 |
15822 | 346 purple_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 conn->type); |
25381
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
348 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 if (conn->cookie == NULL) |
24450
a3c119fd31e3
Fix the indentation level on the code changed by the last patch.
Richard Laager <rlaager@wiktel.com>
parents:
24449
diff
changeset
|
350 flap_connection_send_version(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
353 if (purple_account_get_bool(account, "use_clientlogin", OSCAR_DEFAULT_USE_CLIENTLOGIN)) |
29945 | 354 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
355 ClientInfo aiminfo = CLIENTINFO_PURPLE_AIM; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
356 ClientInfo icqinfo = CLIENTINFO_PURPLE_ICQ; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
357 flap_connection_send_version_with_cookie_and_clientinfo(od, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
358 conn, conn->cookielen, conn->cookie, |
28499
4575d8daba12
oscar: Fix 'Allow multiple simultaenous logins' with clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28498
diff
changeset
|
359 od->icq ? &icqinfo : &aiminfo, |
4575d8daba12
oscar: Fix 'Allow multiple simultaenous logins' with clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28498
diff
changeset
|
360 purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
361 } else { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
362 flap_connection_send_version_with_cookie(od, conn, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
363 conn->cookielen, conn->cookie); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
364 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
365 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
366 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 g_free(conn->cookie); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 conn->cookie = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
370 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
371 if (conn->type == SNAC_FAMILY_AUTH) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
373 /* This only happens when connecting with the old-style BUCP login */ |
15822 | 374 aim_request_login(od, conn, purple_account_get_username(account)); |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
375 purple_debug_info("oscar", "Username sent, waiting for response\n"); |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
376 purple_connection_update_progress(gc, _("Username sent"), 1, OSCAR_CONNECT_STEPS); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
377 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
378 else if (conn->type == SNAC_FAMILY_LOCATE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 { |
15822 | 380 purple_connection_update_progress(gc, _("Connection established, cookie sent"), 4, OSCAR_CONNECT_STEPS); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
381 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
382 else if (conn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
383 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
384 od->oscar_chats = g_slist_prepend(od->oscar_chats, conn->new_conn_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
385 conn->new_conn_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
388 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
389 static void |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
390 connection_established_cb(gpointer data, gint source, const gchar *error_message) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
391 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
392 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
393 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
394 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
395 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
396 conn->connect_data = NULL; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
397 conn->fd = source; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
398 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
399 if (source < 0) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
400 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
401 connection_common_error_cb(conn, error_message); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
402 return; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
403 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
404 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
405 conn->watcher_incoming = purple_input_add(conn->fd, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
406 PURPLE_INPUT_READ, flap_connection_recv_cb, conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
407 connection_common_established_cb(conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
408 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
409 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
410 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
411 ssl_connection_established_cb(gpointer data, PurpleSslConnection *gsc, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
412 PurpleInputCondition cond) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
413 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
414 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
415 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
416 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
417 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
418 purple_ssl_input_add(gsc, flap_connection_recv_cb_ssl, conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
419 connection_common_established_cb(conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
420 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
421 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
422 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
423 ssl_connection_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
424 gpointer data) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
425 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
426 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
427 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
428 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
429 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
430 if (conn->watcher_outgoing) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
431 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
432 purple_input_remove(conn->watcher_outgoing); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
433 conn->watcher_outgoing = 0; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
434 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
435 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
436 /* sslconn frees the connection on error */ |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
437 conn->gsc = NULL; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
438 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
439 connection_common_error_cb(conn, purple_ssl_strerror(error)); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
440 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
441 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
442 static void |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 flap_connection_established_bos(OscarData *od, FlapConnection *conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
444 { |
15822 | 445 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
446 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
447 aim_srv_reqpersonalinfo(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
448 |
15822 | 449 purple_debug_info("oscar", "ssi: requesting rights and list\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 aim_ssi_reqrights(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
451 aim_ssi_reqdata(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 if (od->getblisttimer > 0) |
15822 | 453 purple_timeout_remove(od->getblisttimer); |
25576
7f552614ec8a
applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents:
25536
diff
changeset
|
454 od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 aim_locate_reqrights(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 aim_buddylist_reqrights(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 aim_im_reqparams(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
459 aim_bos_reqrights(od, conn); /* TODO: Don't call this with ssi */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 |
15822 | 461 purple_connection_update_progress(gc, _("Finalizing connection"), 5, OSCAR_CONNECT_STEPS); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
462 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
464 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 flap_connection_established_admin(OscarData *od, FlapConnection *conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 { |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
467 aim_srv_clientready(od, conn); |
15822 | 468 purple_debug_info("oscar", "connected to admin\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 if (od->chpass) { |
15822 | 471 purple_debug_info("oscar", "changing password\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 aim_admin_changepasswd(od, conn, od->newp, od->oldp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 g_free(od->oldp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 od->oldp = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 g_free(od->newp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 od->newp = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 od->chpass = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 if (od->setnick) { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
480 purple_debug_info("oscar", "formatting username\n"); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
481 aim_admin_setnick(od, conn, od->newformatting); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
482 g_free(od->newformatting); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
483 od->newformatting = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
484 od->setnick = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 if (od->conf) { |
15822 | 487 purple_debug_info("oscar", "confirming account\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 aim_admin_reqconfirm(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
489 od->conf = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 if (od->reqemail) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
492 purple_debug_info("oscar", "requesting email address\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 aim_admin_getinfo(od, conn, 0x0011); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 od->reqemail = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 if (od->setemail) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
497 purple_debug_info("oscar", "setting email address\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 aim_admin_setemail(od, conn, od->email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 g_free(od->email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 od->email = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 od->setemail = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 flap_connection_established_chat(OscarData *od, FlapConnection *conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 { |
15822 | 508 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 struct chat_connection *chatcon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 static int id = 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
512 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 chatcon = find_oscar_chat_by_conn(gc, conn); |
20862
9bdc5144bd96
Fix CID 340; potential NULL deref.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20840
diff
changeset
|
515 if (chatcon) { |
9bdc5144bd96
Fix CID 340; potential NULL deref.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20840
diff
changeset
|
516 chatcon->id = id; |
9bdc5144bd96
Fix CID 340; potential NULL deref.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20840
diff
changeset
|
517 chatcon->conv = serv_got_joined_chat(gc, id++, chatcon->show); |
9bdc5144bd96
Fix CID 340; potential NULL deref.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20840
diff
changeset
|
518 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 flap_connection_established_chatnav(OscarData *od, FlapConnection *conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 { |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
524 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 aim_chatnav_reqrights(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 flap_connection_established_alert(OscarData *od, FlapConnection *conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 aim_email_sendcookies(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 aim_email_activate(od); |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
533 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
537 flap_connection_established_bart(OscarData *od, FlapConnection *conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 { |
15822 | 539 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
541 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
542 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
543 od->iconconnecting = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 |
18816
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
545 purple_icons_fetch(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 flap_connection_established(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 { |
15822 | 551 purple_debug_info("oscar", "FLAP connection of type 0x%04hx is " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 "now fully connected\n", conn->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 if (conn->type == SNAC_FAMILY_LOCATE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 flap_connection_established_bos(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 else if (conn->type == SNAC_FAMILY_ADMIN) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 flap_connection_established_admin(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 else if (conn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 flap_connection_established_chat(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 else if (conn->type == SNAC_FAMILY_CHATNAV) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 flap_connection_established_chatnav(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 else if (conn->type == SNAC_FAMILY_ALERT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 flap_connection_established_alert(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 else if (conn->type == SNAC_FAMILY_BART) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 flap_connection_established_bart(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
567 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
569 static void |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
570 idle_reporting_pref_cb(const char *name, PurplePrefType type, |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
571 gconstpointer value, gpointer data) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
572 { |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
573 PurpleConnection *gc; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
574 OscarData *od; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
575 gboolean report_idle; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
576 guint32 presence; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
577 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
578 gc = data; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
579 od = purple_connection_get_protocol_data(gc); |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
580 report_idle = strcmp((const char *)value, "none") != 0; |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
581 presence = aim_ssi_getpresence(&od->ssi.local); |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
582 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
583 if (report_idle) |
28495
c26a59000df9
oscar: Update the details of the buddy preferences based on the OSCAR docs.
Paul Aurich <paul@darkrain42.org>
parents:
28492
diff
changeset
|
584 aim_ssi_setpresence(od, presence | AIM_SSI_PRESENCE_FLAG_SHOWIDLE); |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
585 else |
28495
c26a59000df9
oscar: Update the details of the buddy preferences based on the OSCAR docs.
Paul Aurich <paul@darkrain42.org>
parents:
28492
diff
changeset
|
586 aim_ssi_setpresence(od, presence & ~AIM_SSI_PRESENCE_FLAG_SHOWIDLE); |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
587 } |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
588 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
589 /** |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
590 * Should probably make a "Use recent buddies group" account preference |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
591 * so that this option is surfaced to the user. |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
592 */ |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
593 static void |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
594 recent_buddies_pref_cb(const char *name, PurplePrefType type, |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
595 gconstpointer value, gpointer data) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
596 { |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
597 PurpleConnection *gc; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
598 OscarData *od; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
599 guint32 presence; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
600 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
601 gc = data; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
602 od = purple_connection_get_protocol_data(gc); |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
603 presence = aim_ssi_getpresence(&od->ssi.local); |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
604 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
605 if (value) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
606 aim_ssi_setpresence(od, presence & ~AIM_SSI_PRESENCE_FLAG_NORECENTBUDDIES); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
607 else |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
608 aim_ssi_setpresence(od, presence | AIM_SSI_PRESENCE_FLAG_NORECENTBUDDIES); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
609 } |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
610 |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
611 static const gchar *login_servers[] = { |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
612 AIM_DEFAULT_LOGIN_SERVER, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
613 AIM_DEFAULT_SSL_LOGIN_SERVER, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
614 ICQ_DEFAULT_LOGIN_SERVER, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
615 ICQ_DEFAULT_SSL_LOGIN_SERVER, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
616 }; |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
617 |
30904
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
618 static const gchar * |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
619 get_login_server(gboolean is_icq, gboolean use_ssl) |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
620 { |
30891
a636aa086d0b
A gboolean doesn't need to be '1' to be TRUE. This is safer.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30656
diff
changeset
|
621 return login_servers[(is_icq ? 2 : 0) + (use_ssl ? 1 : 0)]; |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
622 } |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
623 |
30904
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
624 static gint |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
625 compare_handlers(gconstpointer a, gconstpointer b) |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
626 { |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
627 guint aa = GPOINTER_TO_UINT(a); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
628 guint bb = GPOINTER_TO_UINT(b); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
629 guint family1 = aa >> 16; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
630 guint family2 = bb >> 16; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
631 guint subtype1 = aa & 0xFFFF; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
632 guint subtype2 = bb & 0xFFFF; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
633 if (family1 != family2) { |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
634 return family1 - family2; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
635 } |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
636 return subtype1 - subtype2; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
637 } |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
638 |
30917
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
639 #if !GLIB_CHECK_VERSION(2,14,0) |
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
640 static void hash_table_get_list_of_keys(gpointer key, gpointer value, gpointer user_data) |
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
641 { |
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
642 GList **handlers = (GList **)user_data; |
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
643 |
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
644 *handlers = g_list_prepend(*handlers, key); |
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
645 } |
30918 | 646 #endif /* GLIB < 2.14.0 */ |
30917
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
647 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 void |
15822 | 649 oscar_login(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
650 { |
15822 | 651 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 OscarData *od; |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
653 const gchar *encryption_type; |
30904
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
654 GList *handlers; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
655 GList *sorted_handlers; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
656 GList *cur; |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
657 GString *msg = g_string_new(""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 |
15822 | 659 gc = purple_account_get_connection(account); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
660 od = oscar_data_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
661 od->gc = gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
662 purple_connection_set_protocol_data(gc, od); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 |
15822 | 664 oscar_data_addhandler(od, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, purple_connerr, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 oscar_data_addhandler(od, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, flap_connection_established, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 |
15822 | 667 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0003, purple_info_change, 0); |
668 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0005, purple_info_change, 0); | |
669 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0007, purple_account_confirm, 0); | |
670 oscar_data_addhandler(od, SNAC_FAMILY_ALERT, 0x0001, purple_parse_genericerr, 0); | |
671 oscar_data_addhandler(od, SNAC_FAMILY_ALERT, SNAC_SUBTYPE_ALERT_MAILSTATUS, purple_email_parseupdate, 0); | |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
672 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
673 /* These are only needed when connecting with the old-style BUCP login */ |
15822 | 674 oscar_data_addhandler(od, SNAC_FAMILY_AUTH, 0x0003, purple_parse_auth_resp, 0); |
675 oscar_data_addhandler(od, SNAC_FAMILY_AUTH, 0x0007, purple_parse_login, 0); | |
676 oscar_data_addhandler(od, SNAC_FAMILY_AUTH, SNAC_SUBTYPE_AUTH_SECURID_REQUEST, purple_parse_auth_securid_request, 0); | |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
677 |
15822 | 678 oscar_data_addhandler(od, SNAC_FAMILY_BART, SNAC_SUBTYPE_BART_RESPONSE, purple_icon_parseicon, 0); |
679 oscar_data_addhandler(od, SNAC_FAMILY_BOS, 0x0001, purple_parse_genericerr, 0); | |
680 oscar_data_addhandler(od, SNAC_FAMILY_BOS, 0x0003, purple_bosrights, 0); | |
681 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, 0x0001, purple_parse_genericerr, 0); | |
682 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_RIGHTSINFO, purple_parse_buddyrights, 0); | |
683 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_ONCOMING, purple_parse_oncoming, 0); | |
684 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_OFFGOING, purple_parse_offgoing, 0); | |
685 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, 0x0001, purple_parse_genericerr, 0); | |
686 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_USERJOIN, purple_conv_chat_join, 0); | |
687 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_USERLEAVE, purple_conv_chat_leave, 0); | |
688 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_ROOMINFOUPDATE, purple_conv_chat_info_update, 0); | |
689 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_INCOMINGMSG, purple_conv_chat_incoming_msg, 0); | |
690 oscar_data_addhandler(od, SNAC_FAMILY_CHATNAV, 0x0001, purple_parse_genericerr, 0); | |
691 oscar_data_addhandler(od, SNAC_FAMILY_CHATNAV, SNAC_SUBTYPE_CHATNAV_INFO, purple_chatnav_info, 0); | |
692 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ERROR, purple_ssi_parseerr, 0); | |
693 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RIGHTSINFO, purple_ssi_parserights, 0); | |
694 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_LIST, purple_ssi_parselist, 0); | |
695 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_SRVACK, purple_ssi_parseack, 0); | |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
696 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ADD, purple_ssi_parseaddmod, 0); |
20632
0bd4e35741f4
Whoops, I forgot to register the callback function for the incoming
Mark Doliner <mark@kingant.net>
parents:
20630
diff
changeset
|
697 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_MOD, purple_ssi_parseaddmod, 0); |
15822 | 698 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTH, purple_ssi_authgiven, 0); |
699 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTHREQ, purple_ssi_authrequest, 0); | |
700 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTHREP, purple_ssi_authreply, 0); | |
701 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ADDED, purple_ssi_gotadded, 0); | |
702 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_INCOMING, purple_parse_incoming_im, 0); | |
703 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_MISSEDCALL, purple_parse_misses, 0); | |
704 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_CLIENTAUTORESP, purple_parse_clientauto, 0); | |
705 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_MTN, purple_parse_mtn, 0); | |
706 oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_RIGHTSINFO, purple_parse_locaterights, 0); | |
707 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x0001, purple_parse_genericerr, 0); | |
708 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x000f, purple_selfinfo, 0); | |
709 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x001f, purple_memrequest, 0); | |
710 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, SNAC_SUBTYPE_OSERVICE_REDIRECT, purple_handle_redirect, 0); | |
711 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, SNAC_SUBTYPE_OSERVICE_MOTD, purple_parse_motd, 0); | |
712 oscar_data_addhandler(od, SNAC_FAMILY_POPUP, 0x0002, purple_popup, 0); | |
713 oscar_data_addhandler(od, SNAC_FAMILY_USERLOOKUP, SNAC_SUBTYPE_USERLOOKUP_ERROR, purple_parse_searcherror, 0); | |
714 oscar_data_addhandler(od, SNAC_FAMILY_USERLOOKUP, 0x0003, purple_parse_searchreply, 0); | |
715 | |
30904
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
716 g_string_append(msg, "Registered handlers: "); |
30917
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
717 #if GLIB_CHECK_VERSION(2,14,0) |
30904
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
718 handlers = g_hash_table_get_keys(od->handlerlist); |
30917
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
719 #else |
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
720 handlers = NULL; |
e17ac5b9621f
g_hash_table_get_keys is GLIB>2.14.0 but we maintain compatibility with 2.12.0.
Mark Doliner <mark@kingant.net>
parents:
30904
diff
changeset
|
721 g_hash_table_foreach(od->handlerlist, hash_table_get_list_of_keys, &handlers); |
30918 | 722 #endif /* GLIB < 2.14.0 */ |
30904
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
723 sorted_handlers = g_list_sort(g_list_copy(handlers), compare_handlers); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
724 for (cur = sorted_handlers; cur; cur = cur->next) { |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
725 guint x = GPOINTER_TO_UINT(cur->data); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
726 g_string_append_printf(msg, "%04x/%04x, ", x >> 16, x & 0xFFFF); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
727 } |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
728 g_list_free(sorted_handlers); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
729 g_list_free(handlers); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
730 purple_debug_misc("oscar", "%s\n", msg->str); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
731 g_string_free(msg, TRUE); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
732 |
15822 | 733 purple_debug_misc("oscar", "oscar_login: gc = %p\n", gc); |
734 | |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
735 if (!oscar_util_valid_name(purple_account_get_username(account))) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
736 gchar *buf; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
737 buf = g_strdup_printf(_("Unable to sign on as %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account)); |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
738 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 g_free(buf); |
20971
bff8c5241e20
When signing on to an oscar account, if we check your screen name and
Mark Doliner <mark@kingant.net>
parents:
20959
diff
changeset
|
740 return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
742 |
29733
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
29732
diff
changeset
|
743 gc->flags |= PURPLE_CONNECTION_HTML; |
31849
4c046f6564cd
Change the heuristic we use for setting od->icq. We used to set it to
Mark Doliner <mark@kingant.net>
parents:
31838
diff
changeset
|
744 if (g_str_equal(purple_account_get_protocol_id(account), "prpl-icq")) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
745 od->icq = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 } else { |
15822 | 747 gc->flags |= PURPLE_CONNECTION_AUTO_RESP; |
748 } | |
749 | |
31760
eec7f176e21d
Fix crash selecting Tools->Set Mood when you're online with an
Mark Doliner <mark@kingant.net>
parents:
31668
diff
changeset
|
750 /* Set this flag based on the protocol_id rather than the username, |
eec7f176e21d
Fix crash selecting Tools->Set Mood when you're online with an
Mark Doliner <mark@kingant.net>
parents:
31668
diff
changeset
|
751 because that is what's tied to the get_moods prpl callback. */ |
eec7f176e21d
Fix crash selecting Tools->Set Mood when you're online with an
Mark Doliner <mark@kingant.net>
parents:
31668
diff
changeset
|
752 if (g_str_equal(purple_account_get_protocol_id(account), "prpl-icq")) |
eec7f176e21d
Fix crash selecting Tools->Set Mood when you're online with an
Mark Doliner <mark@kingant.net>
parents:
31668
diff
changeset
|
753 gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS; |
eec7f176e21d
Fix crash selecting Tools->Set Mood when you're online with an
Mark Doliner <mark@kingant.net>
parents:
31668
diff
changeset
|
754 |
27237
76cf0b261e25
Set od->default_port even when using the standard auth method.
Paul Aurich <paul@darkrain42.org>
parents:
27194
diff
changeset
|
755 od->default_port = purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT); |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
756 |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
757 encryption_type = purple_account_get_string(account, "encryption", OSCAR_DEFAULT_ENCRYPTION); |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
758 if (!purple_ssl_is_supported() && strcmp(encryption_type, OSCAR_REQUIRE_ENCRYPTION) == 0) { |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
759 purple_connection_error( |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
760 gc, |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
761 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
762 _("You required encryption in your account settings, but encryption is not supported by your system.")); |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
763 return; |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
764 } |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
765 od->use_ssl = purple_ssl_is_supported() && strcmp(encryption_type, OSCAR_NO_ENCRYPTION) != 0; |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
766 |
15822 | 767 /* Connect to core Purple signals */ |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
768 purple_prefs_connect_callback(gc, "/purple/away/idle_reporting", idle_reporting_pref_cb, gc); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
769 purple_prefs_connect_callback(gc, "/plugins/prpl/oscar/recent_buddies", recent_buddies_pref_cb, gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
770 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
771 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
772 * On 2008-03-05 AOL released some documentation on the OSCAR protocol |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
773 * which includes a new login method called clientLogin. It is similar |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
774 * (though not the same?) as what the AIM 6.0 series uses to |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
775 * authenticate. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
776 * |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
777 * AIM 5.9 and lower use an MD5-based login procedure called "BUCP". |
27358
46e0f65b14a1
The XOR method is disabled in family_auth.c
Paul Aurich <paul@darkrain42.org>
parents:
27278
diff
changeset
|
778 * This authentication method is used for both ICQ and AIM when |
46e0f65b14a1
The XOR method is disabled in family_auth.c
Paul Aurich <paul@darkrain42.org>
parents:
27278
diff
changeset
|
779 * clientLogin is not enabled. |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
780 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
781 if (purple_account_get_bool(account, "use_clientlogin", OSCAR_DEFAULT_USE_CLIENTLOGIN)) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
782 send_client_login(od, purple_account_get_username(account)); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
783 } else { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
784 FlapConnection *newconn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
785 const char *server; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
786 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
787 newconn = flap_connection_new(od, SNAC_FAMILY_AUTH); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
788 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
789 if (od->use_ssl) { |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
790 server = purple_account_get_string(account, "server", get_login_server(od->icq, TRUE)); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
791 |
25381
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
792 /* |
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
793 * If the account's server is what the oscar prpl has offered as |
25246
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
794 * the default login server through the vast eons (all two of |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
795 * said default options, AFAIK) and the user wants SSL, we'll |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
796 * do what we know is best for them and change the setting out |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
797 * from under them to the SSL login server. |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
798 */ |
30961
04ffd3b52283
Properly handle an AIM login server of login.messaging.aol.com. Fixes #12948.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
30958
diff
changeset
|
799 if (!strcmp(server, get_login_server(od->icq, FALSE)) || !strcmp(server, AIM_ALT_LOGIN_SERVER)) { |
25246
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
800 purple_debug_info("oscar", "Account uses SSL, so changing server to default SSL server\n"); |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
801 purple_account_set_string(account, "server", get_login_server(od->icq, TRUE)); |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
802 server = get_login_server(od->icq, TRUE); |
25246
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
803 } |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
804 |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
805 newconn->gsc = purple_ssl_connect(account, server, |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
806 purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT), |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
807 ssl_connection_established_cb, ssl_connection_error_cb, newconn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
808 } else { |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
809 server = purple_account_get_string(account, "server", get_login_server(od->icq, FALSE)); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
810 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
811 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
812 * See the comment above. We do the reverse here. If they don't want |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
813 * SSL but their server is set to OSCAR_DEFAULT_SSL_LOGIN_SERVER, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
814 * set it back to the default. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
815 */ |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
816 if (!strcmp(server, get_login_server(od->icq, TRUE))) { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
817 purple_debug_info("oscar", "Account does not use SSL, so changing server back to non-SSL\n"); |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
818 purple_account_set_string(account, "server", get_login_server(od->icq, FALSE)); |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
819 server = get_login_server(od->icq, FALSE); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
820 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
821 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
822 newconn->connect_data = purple_proxy_connect(NULL, account, server, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
823 purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT), |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
824 connection_established_cb, newconn); |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
825 } |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
826 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
827 if (newconn->gsc == NULL && newconn->connect_data == NULL) { |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
828 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
829 _("Unable to connect")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
830 return; |
25246
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
831 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
832 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 |
15822 | 834 purple_connection_update_progress(gc, _("Connecting"), 0, OSCAR_CONNECT_STEPS); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
836 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 void |
15822 | 838 oscar_close(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
842 od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 while (od->oscar_chats) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 struct chat_connection *cc = od->oscar_chats->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
847 od->oscar_chats = g_slist_remove(od->oscar_chats, cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 oscar_chat_destroy(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
850 while (od->create_rooms) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 struct create_room *cr = od->create_rooms->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 g_free(cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 od->create_rooms = g_slist_remove(od->create_rooms, cr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 g_free(cr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 oscar_data_destroy(od); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
858 purple_connection_set_protocol_data(gc, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 |
15822 | 860 purple_prefs_disconnect_by_handle(gc); |
861 | |
862 purple_debug_info("oscar", "Signed off.\n"); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 |
15822 | 865 /* XXX - Should use purple_util_fetch_url for the below stuff */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 struct pieceofcrap { |
15822 | 867 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 unsigned long offset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 unsigned long len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
870 char *modname; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 int fd; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 unsigned int inpa; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 |
15822 | 876 static void damn_you(gpointer data, gint source, PurpleInputCondition c) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 struct pieceofcrap *pos = data; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
879 OscarData *od = purple_connection_get_protocol_data(pos->gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
880 char in = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
881 int x = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
882 unsigned char m[17]; |
23715
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
883 GString *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 while (read(pos->fd, &in, 1) == 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 if (in == '\n') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
887 x++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
888 else if (in != '\r') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 x = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
890 if (x == 2) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
891 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 in = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 if (in != '\n') { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 char buf[256]; |
24879
5a435e953bc6
Don't mention TOC in this error message. I think this error is too
Mark Doliner <mark@kingant.net>
parents:
24694
diff
changeset
|
896 g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. " |
5a435e953bc6
Don't mention TOC in this error message. I think this error is too
Mark Doliner <mark@kingant.net>
parents:
24694
diff
changeset
|
897 "If so, check %s for updates."), |
27427
4f24d5da4cb3
Create a oscar_get_ui_info_string() function that looks up a value in the
Mark Doliner <mark@kingant.net>
parents:
27393
diff
changeset
|
898 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15822 | 899 purple_notify_warning(pos->gc, NULL, |
15382
21bc8d84974f
I think this changes every user-visible string that contains 'Gaim.' We probably want the UI to be able
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
900 _("Unable to get a valid AIM login hash."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
901 buf); |
15822 | 902 purple_input_remove(pos->inpa); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 close(pos->fd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
905 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 if (read(pos->fd, m, 16) != 16) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 { |
15822 | 909 purple_debug_warning("oscar", "Could not read full AIM login hash " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
910 "from " AIMHASHDATA "--that's bad.\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 m[16] = '\0'; |
23715
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
913 |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
914 msg = g_string_new("Sending hash: "); |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
915 for (x = 0; x < 16; x++) |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
916 g_string_append_printf(msg, "%02hhx ", (unsigned char)m[x]); |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
917 g_string_append(msg, "\n"); |
24453
0320b4a33432
Backport the 'purple_debug_*(msg)' -> 'purple_debug_*("%s", msg);' fixes.
Richard Laager <rlaager@wiktel.com>
parents:
24450
diff
changeset
|
918 purple_debug_misc("oscar", "%s", msg->str); |
23715
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
919 g_string_free(msg, TRUE); |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
920 |
15822 | 921 purple_input_remove(pos->inpa); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
922 close(pos->fd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
923 aim_sendmemblock(od, pos->conn, 0, 16, m, AIM_SENDMEMBLOCK_FLAG_ISHASH); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
924 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
928 straight_to_hell(gpointer data, gint source, const gchar *error_message) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 struct pieceofcrap *pos = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
931 gchar *buf; |
22568
c65c96e231b5
Printf warning fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22486
diff
changeset
|
932 gssize result; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
934 pos->fd = source; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
935 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 if (source < 0) { |
22105
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
937 buf = g_strdup_printf(_("You may be disconnected shortly. " |
27377
714f9352e844
Change these two strings to match another one. total_number_of_strings--
Mark Doliner <mark@kingant.net>
parents:
27358
diff
changeset
|
938 "If so, check %s for updates."), |
27427
4f24d5da4cb3
Create a oscar_get_ui_info_string() function that looks up a value in the
Mark Doliner <mark@kingant.net>
parents:
27393
diff
changeset
|
939 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15822 | 940 purple_notify_warning(pos->gc, NULL, |
15382
21bc8d84974f
I think this changes every user-visible string that contains 'Gaim.' We probably want the UI to be able
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
941 _("Unable to get a valid AIM login hash."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 g_free(pos->modname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 buf = g_strdup_printf("GET " AIMHASHDATA "?offset=%ld&len=%ld&modname=%s HTTP/1.0\n\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 pos->offset, pos->len, pos->modname ? pos->modname : ""); |
22105
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
951 result = send(pos->fd, buf, strlen(buf), 0); |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
952 if (result != strlen(buf)) { |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
953 if (result < 0) |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
954 purple_debug_error("oscar", "Error writing %" G_GSIZE_FORMAT |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
955 " bytes to fetch AIM hash data: %s\n", |
22106
06c58cffd4c4
I forgot that we're supposed to be using g_strerror() to guarantee a
Mark Doliner <mark@kingant.net>
parents:
22105
diff
changeset
|
956 strlen(buf), g_strerror(errno)); |
22105
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
957 else |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
958 purple_debug_error("oscar", "Tried to write %" |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
959 G_GSIZE_FORMAT " bytes to fetch AIM hash data but " |
22568
c65c96e231b5
Printf warning fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22486
diff
changeset
|
960 "instead wrote %" G_GSSIZE_FORMAT " bytes\n", |
22105
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
961 strlen(buf), result); |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
962 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
964 g_free(pos->modname); |
15822 | 965 pos->inpa = purple_input_add(pos->fd, PURPLE_INPUT_READ, damn_you, pos); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
967 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
968 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
969 /* size of icbmui.ocm, the largest module in AIM 3.5 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 #define AIM_MAX_FILE_SIZE 98304 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
971 |
27143
454d46e9cbb7
Make a function static and add two comments
Mark Doliner <mark@kingant.net>
parents:
27137
diff
changeset
|
972 static int purple_memrequest(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
454d46e9cbb7
Make a function static and add two comments
Mark Doliner <mark@kingant.net>
parents:
27137
diff
changeset
|
973 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
974 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
975 struct pieceofcrap *pos; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
976 guint32 offset, len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
977 char *modname; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
979 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
980 offset = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
981 len = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
982 modname = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
983 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
984 |
15822 | 985 purple_debug_misc("oscar", "offset: %u, len: %u, file: %s\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
986 offset, len, (modname ? modname : "aim.exe")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
987 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
988 if (len == 0) { |
15822 | 989 purple_debug_misc("oscar", "len is 0, hashing NULL\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
990 aim_sendmemblock(od, conn, offset, len, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
991 AIM_SENDMEMBLOCK_FLAG_ISREQUEST); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
992 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
994 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
995 pos = g_new0(struct pieceofcrap, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
996 pos->gc = od->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
997 pos->conn = conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
998 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
999 pos->offset = offset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 pos->len = len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1001 pos->modname = g_strdup(modname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1002 |
27118
a9899d234dfa
Pass the handle in here, which causes the connection attempt to be
Mark Doliner <mark@kingant.net>
parents:
27098
diff
changeset
|
1003 if (purple_proxy_connect(pos->gc, pos->gc->account, "pidgin.im", 80, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1004 straight_to_hell, pos) == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1005 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1006 char buf[256]; |
17450
3d035cdd103b
Add some notes about why Yahoo! web messenger login doesn't work
Mark Doliner <mark@kingant.net>
parents:
17370
diff
changeset
|
1007 g_free(pos->modname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1008 g_free(pos); |
23402
c6b29adc22d1
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evan.s@dreskin.net>
parents:
23399
diff
changeset
|
1009 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. " |
27377
714f9352e844
Change these two strings to match another one. total_number_of_strings--
Mark Doliner <mark@kingant.net>
parents:
27358
diff
changeset
|
1011 "If so, check %s for updates."), |
27427
4f24d5da4cb3
Create a oscar_get_ui_info_string() function that looks up a value in the
Mark Doliner <mark@kingant.net>
parents:
27393
diff
changeset
|
1012 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15822 | 1013 purple_notify_warning(pos->gc, NULL, |
15382
21bc8d84974f
I think this changes every user-visible string that contains 'Gaim.' We probably want the UI to be able
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
1014 _("Unable to get a valid login hash."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1016 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1017 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 |
28509
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1021 int oscar_connect_to_bos(PurpleConnection *gc, OscarData *od, const char *host, guint16 port, guint8 *cookie, guint16 cookielen, const char *tls_certname) |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1022 { |
28509
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1023 PurpleAccount *account; |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1024 FlapConnection *conn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1025 |
28509
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1026 account = purple_connection_get_account(gc); |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1027 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1028 conn = flap_connection_new(od, SNAC_FAMILY_LOCATE); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1029 conn->cookielen = cookielen; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1030 conn->cookie = g_memdup(cookie, cookielen); |
28509
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1031 |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1032 /* |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31041
diff
changeset
|
1033 * Use TLS only if the server provided us with a tls_certname. The server might not specify a tls_certname even if we requested to use TLS, |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
1034 * and that is something we should be prepared to. |
28509
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1035 */ |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1036 if (tls_certname) |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1037 { |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1038 conn->gsc = purple_ssl_connect_with_ssl_cn(account, host, port, |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1039 ssl_connection_established_cb, ssl_connection_error_cb, |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1040 tls_certname, conn); |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1041 } |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1042 else |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1043 { |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1044 conn->connect_data = purple_proxy_connect(NULL, |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1045 account, host, port, |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1046 connection_established_cb, conn); |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1047 } |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1048 |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28506
diff
changeset
|
1049 if (conn->gsc == NULL && conn->connect_data == NULL) |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1050 { |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1051 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1052 return 0; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1053 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1054 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1055 od->default_port = port; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1056 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1057 purple_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1058 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1059 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1060 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1061 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1062 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1063 * Only used when connecting with the old-style BUCP login. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1064 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1065 static int |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1066 purple_parse_auth_resp(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1067 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1068 PurpleConnection *gc = od->gc; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1069 PurpleAccount *account = purple_connection_get_account(gc); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1070 char *host; int port; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1071 int i; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1072 FlapConnection *newconn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1073 va_list ap; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1074 struct aim_authresp_info *info; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1075 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1076 port = purple_account_get_int(account, "port", od->default_port); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1077 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1078 va_start(ap, fr); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1079 info = va_arg(ap, struct aim_authresp_info *); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1080 va_end(ap); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1081 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1082 purple_debug_info("oscar", |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1083 "inside auth_resp (Username: %s)\n", info->bn); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1084 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1085 if (info->errorcode || !info->bosip || !info->cookielen || !info->cookie) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1086 char buf[256]; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1087 switch (info->errorcode) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1088 case 0x01: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1089 /* Unregistered username */ |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1090 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_INVALID_USERNAME, _("Username does not exist")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1091 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1092 case 0x05: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1093 /* Incorrect password */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1094 if (!purple_account_get_remember_password(account)) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1095 purple_account_set_password(account, NULL); |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1096 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Incorrect password")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1097 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1098 case 0x11: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1099 /* Suspended account */ |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1100 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1101 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1102 case 0x02: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1103 case 0x14: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1104 /* service temporarily unavailable */ |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1105 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("The AOL Instant Messenger service is temporarily unavailable.")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1106 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1107 case 0x18: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1108 /* username connecting too frequently */ |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1109 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Your username has been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1110 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1111 case 0x1c: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1112 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1113 /* client too old */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1114 g_snprintf(buf, sizeof(buf), _("The client version you are using is too old. Please upgrade at %s"), |
27427
4f24d5da4cb3
Create a oscar_get_ui_info_string() function that looks up a value in the
Mark Doliner <mark@kingant.net>
parents:
27393
diff
changeset
|
1115 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1116 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, buf); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1117 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1118 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1119 case 0x1d: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1120 /* IP address connecting too frequently */ |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1121 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Your IP address has been connecting and disconnecting too frequently. Wait a minute and try again. If you continue to try, you will need to wait even longer.")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1122 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1123 default: |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1124 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Unknown reason")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1125 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1126 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1127 purple_debug_info("oscar", "Login Error Code 0x%04hx\n", info->errorcode); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1128 purple_debug_info("oscar", "Error URL: %s\n", info->errorurl ? info->errorurl : ""); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1129 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1130 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1131 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1132 purple_debug_misc("oscar", "Reg status: %hu\n" |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1133 "Email: %s\n" |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1134 "BOSIP: %s\n", |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1135 info->regstatus, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1136 info->email ? info->email : "null", |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1137 info->bosip ? info->bosip : "null"); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1138 purple_debug_info("oscar", "Closing auth connection...\n"); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1139 flap_connection_schedule_destroy(conn, OSCAR_DISCONNECT_DONE, NULL); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1140 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1141 for (i = 0; i < strlen(info->bosip); i++) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1142 if (info->bosip[i] == ':') { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1143 port = atoi(&(info->bosip[i+1])); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1144 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1145 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1146 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1147 host = g_strndup(info->bosip, i); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1148 newconn = flap_connection_new(od, SNAC_FAMILY_LOCATE); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1149 newconn->cookielen = info->cookielen; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1150 newconn->cookie = g_memdup(info->cookie, info->cookielen); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1151 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1152 if (od->use_ssl) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1153 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1154 /* |
27555
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1155 * This shouldn't be hardcoded to "bos.oscar.aol.com" except that |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1156 * the server isn't sending us a name to use for comparing the |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1157 * certificate common name. |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1158 */ |
27555
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1159 newconn->gsc = purple_ssl_connect_with_ssl_cn(account, host, port, |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1160 ssl_connection_established_cb, ssl_connection_error_cb, |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1161 "bos.oscar.aol.com", newconn); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1162 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1163 else |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1164 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1165 newconn->connect_data = purple_proxy_connect(NULL, account, host, port, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1166 connection_established_cb, newconn); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1167 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1168 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1169 g_free(host); |
27555
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1170 if (newconn->gsc == NULL && newconn->connect_data == NULL) |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1171 { |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1172 purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1173 return 0; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1174 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1175 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1176 purple_connection_update_progress(gc, _("Received authorization"), 3, OSCAR_CONNECT_STEPS); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1177 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1178 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1179 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1180 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1181 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1182 * Only used when connecting with the old-style BUCP login. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1183 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1184 static void |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1185 purple_parse_auth_securid_request_yes_cb(gpointer user_data, const char *msg) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1186 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1187 PurpleConnection *gc = user_data; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1188 OscarData *od = purple_connection_get_protocol_data(gc); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1189 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1190 aim_auth_securid_send(od, msg); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1191 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1192 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1193 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1194 * Only used when connecting with the old-style BUCP login. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1195 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1196 static void |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1197 purple_parse_auth_securid_request_no_cb(gpointer user_data, const char *value) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1198 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1199 PurpleConnection *gc = user_data; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1200 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1201 /* Disconnect */ |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1202 purple_connection_error(gc, |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1203 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1204 _("The SecurID key entered is invalid")); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1205 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1206 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1207 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1208 * Only used when connecting with the old-style BUCP login. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1209 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1210 static int |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1211 purple_parse_auth_securid_request(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1212 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1213 PurpleConnection *gc = od->gc; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1214 PurpleAccount *account = purple_connection_get_account(gc); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1215 gchar *primary; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1216 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1217 purple_debug_info("oscar", "Got SecurID request\n"); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1218 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1219 primary = g_strdup_printf("Enter the SecurID key for %s.", purple_account_get_username(account)); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1220 purple_request_input(gc, NULL, _("Enter SecurID"), primary, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1221 _("Enter the 6 digit number from the digital display."), |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1222 FALSE, FALSE, NULL, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1223 _("_OK"), G_CALLBACK(purple_parse_auth_securid_request_yes_cb), |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1224 _("_Cancel"), G_CALLBACK(purple_parse_auth_securid_request_no_cb), |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1225 account, NULL, NULL, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1226 gc); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1227 g_free(primary); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1228 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1229 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1230 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1231 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1232 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1233 * Only used when connecting with the old-style BUCP login. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1234 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 static int |
15822 | 1236 purple_parse_login(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 { |
15822 | 1238 PurpleConnection *gc; |
1239 PurpleAccount *account; | |
20629
77fda34d4289
A patch from Collin from ComBOTS, I guess. This fixes setting your
Mark Doliner <mark@kingant.net>
parents:
20582
diff
changeset
|
1240 ClientInfo aiminfo = CLIENTINFO_PURPLE_AIM; |
77fda34d4289
A patch from Collin from ComBOTS, I guess. This fixes setting your
Mark Doliner <mark@kingant.net>
parents:
20582
diff
changeset
|
1241 ClientInfo icqinfo = CLIENTINFO_PURPLE_ICQ; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1243 char *key; |
17192
c72295a65f7a
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <mark@kingant.net>
parents:
17143
diff
changeset
|
1244 gboolean truncate_pass; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1246 gc = od->gc; |
15822 | 1247 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1248 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 key = va_arg(ap, char *); |
17192
c72295a65f7a
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <mark@kingant.net>
parents:
17143
diff
changeset
|
1251 truncate_pass = va_arg(ap, int); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 |
15822 | 1254 aim_send_login(od, conn, purple_account_get_username(account), |
17192
c72295a65f7a
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <mark@kingant.net>
parents:
17143
diff
changeset
|
1255 purple_connection_get_password(gc), truncate_pass, |
23311
f1a0258b44f4
Added paramater to aim_send_login() to allow control over whether we want
Evan Schoenberg <evan.s@dreskin.net>
parents:
23270
diff
changeset
|
1256 od->icq ? &icqinfo : &aiminfo, key, |
24031
32bab3989963
Clean up some debugging to avoid potential NULL string printf.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23939
diff
changeset
|
1257 purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); |
15822 | 1258 |
1259 purple_connection_update_progress(gc, _("Password sent"), 2, OSCAR_CONNECT_STEPS); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1261 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 static int |
15822 | 1265 purple_handle_redirect(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 { |
15822 | 1267 PurpleConnection *gc = od->gc; |
1268 PurpleAccount *account = purple_connection_get_account(gc); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 char *host, *separator; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 FlapConnection *newconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 struct aim_redirect_data *redir; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1275 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 redir = va_arg(ap, struct aim_redirect_data *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1278 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1279 port = od->default_port; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 separator = strchr(redir->ip, ':'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 if (separator != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1283 host = g_strndup(redir->ip, separator - redir->ip); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 port = atoi(separator + 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1286 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1287 host = g_strdup(redir->ip); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1289 if (!redir->use_ssl) { |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1290 const gchar *encryption_type = purple_account_get_string(account, "encryption", OSCAR_DEFAULT_ENCRYPTION); |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1291 if (strcmp(encryption_type, OSCAR_OPPORTUNISTIC_ENCRYPTION) == 0) { |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1292 purple_debug_warning("oscar", "We won't use SSL for FLAP type 0x%04hx.\n", redir->group); |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1293 } else if (strcmp(encryption_type, OSCAR_REQUIRE_ENCRYPTION) == 0) { |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1294 purple_debug_error("oscar", "FLAP server %s:%d of type 0x%04hx doesn't support encryption.", host, port, redir->group); |
31872
a5b556ac1de5
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <mark@kingant.net>
parents:
31853
diff
changeset
|
1295 purple_connection_error( |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1296 gc, |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1297 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1298 _("You required encryption in your account settings, but one of the servers doesn't support it.")); |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1299 return 0; |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31041
diff
changeset
|
1300 } |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1301 } |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1302 |
25212
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1303 /* |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1304 * These FLAP servers advertise SSL (type "0x02"), but SSL connections to these hosts |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1305 * die a painful death. iChat and Miranda, when using SSL, still do these in plaintext. |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1306 */ |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1307 if (redir->use_ssl && (redir->group == SNAC_FAMILY_ADMIN || |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1308 redir->group == SNAC_FAMILY_BART)) |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1309 { |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1310 purple_debug_info("oscar", "Ignoring broken SSL for FLAP type 0x%04hx.\n", redir->group); |
25212
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1311 redir->use_ssl = 0; |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1312 } |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1313 |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
1314 purple_debug_info("oscar", "Connecting to FLAP server %s:%d of type 0x%04hx\n", host, port, redir->group); |
25212
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1315 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 newconn = flap_connection_new(od, redir->group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 newconn->cookielen = redir->cookielen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 newconn->cookie = g_memdup(redir->cookie, redir->cookielen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 if (newconn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 cc = g_new0(struct chat_connection, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 cc->conn = newconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 cc->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 cc->name = g_strdup(redir->chat.room); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 cc->exchange = redir->chat.exchange; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 cc->instance = redir->chat.instance; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 cc->show = extract_name(redir->chat.room); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 newconn->new_conn_data = cc; |
15822 | 1330 purple_debug_info("oscar", "Connecting to chat room %s exchange %hu\n", cc->name, cc->exchange); |
1331 } | |
1332 | |
25212
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1333 |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
1334 if (redir->use_ssl) |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1335 { |
27555
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1336 newconn->gsc = purple_ssl_connect_with_ssl_cn(account, host, port, |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1337 ssl_connection_established_cb, ssl_connection_error_cb, |
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
1338 redir->ssl_cert_cn, newconn); |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1339 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1340 else |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1341 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1342 newconn->connect_data = purple_proxy_connect(NULL, account, host, port, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1343 connection_established_cb, newconn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1344 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1345 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1346 if (newconn->gsc == NULL && newconn->connect_data == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 flap_connection_schedule_destroy(newconn, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 OSCAR_DISCONNECT_COULD_NOT_CONNECT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 _("Unable to initialize connection")); |
15822 | 1351 purple_debug_error("oscar", "Unable to connect to FLAP server " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 "of type 0x%04hx\n", redir->group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1353 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 g_free(host); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1357 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 |
23576
a73d527731ff
To decrease the odds of hitting the rate limit ceiling rapidly on a
Evan Schoenberg <evan.s@dreskin.net>
parents:
23436
diff
changeset
|
1359 |
15822 | 1360 static int purple_parse_oncoming(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 { |
15822 | 1362 PurpleConnection *gc; |
1363 PurpleAccount *account; | |
30648
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1364 PurpleBuddy *buddy = NULL; |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1365 PurpleStatus *previous_status = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 struct buddyinfo *bi; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 time_t time_idle = 0, signon = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 int type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 gboolean buddy_is_away = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 const char *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 aim_userinfo_t *info; |
30982
873cd5e068c4
I tested with AIM 7.2.6.1 and ICQ 7.2 build 3159 and both of them
Mark Doliner <mark@kingant.net>
parents:
30961
diff
changeset
|
1373 char *message; |
25386
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
1374 char *itmsurl = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1375 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 gc = od->gc; |
15822 | 1377 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1378 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1379 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1380 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 g_return_val_if_fail(info != NULL, 1); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1384 g_return_val_if_fail(info->bn != NULL, 1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1385 |
30648
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1386 buddy = purple_find_buddy(account, info->bn); |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1387 if (buddy) { |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1388 previous_status = purple_presence_get_active_status(purple_buddy_get_presence(buddy)); |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1389 } |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1390 |
27995
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1391 /* |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1392 * If this is an AIM buddy and their name has formatting, set their |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1393 * server alias. |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1394 */ |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1395 if (!oscar_util_valid_name_icq(info->bn)) { |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1396 gboolean bn_has_formatting = FALSE; |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1397 char *c; |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1398 for (c = info->bn; *c != '\0'; c++) { |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1399 if (!islower(*c)) { |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1400 bn_has_formatting = TRUE; |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1401 break; |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1402 } |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1403 } |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1404 serv_got_alias(gc, info->bn, |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1405 bn_has_formatting ? info->bn : NULL); |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1406 } |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27555
diff
changeset
|
1407 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1408 if (info->present & AIM_USERINFO_PRESENT_FLAGS) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1409 if (info->flags & AIM_FLAG_AWAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1410 buddy_is_away = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1411 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1412 if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1413 type = info->icqinfo.status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1414 if (!(info->icqinfo.status & AIM_ICQ_STATE_CHAT) && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1415 (info->icqinfo.status != AIM_ICQ_STATE_NORMAL)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1416 buddy_is_away = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1417 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1418 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1419 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1420 if (oscar_util_valid_name_icq(info->bn)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 if (type & AIM_ICQ_STATE_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 status_id = OSCAR_STATUS_ID_FREE4CHAT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 else if (type & AIM_ICQ_STATE_DND) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1424 status_id = OSCAR_STATUS_ID_DND; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1425 else if (type & AIM_ICQ_STATE_OUT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 status_id = OSCAR_STATUS_ID_NA; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1427 else if (type & AIM_ICQ_STATE_BUSY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1428 status_id = OSCAR_STATUS_ID_OCCUPIED; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 else if (type & AIM_ICQ_STATE_AWAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1430 status_id = OSCAR_STATUS_ID_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1431 else if (type & AIM_ICQ_STATE_INVISIBLE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 status_id = OSCAR_STATUS_ID_INVISIBLE; |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1433 else if (type & AIM_ICQ_STATE_EVIL) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1434 status_id = OSCAR_STATUS_ID_EVIL; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1435 else if (type & AIM_ICQ_STATE_DEPRESSION) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1436 status_id = OSCAR_STATUS_ID_DEPRESSION; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1437 else if (type & AIM_ICQ_STATE_ATHOME) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1438 status_id = OSCAR_STATUS_ID_ATHOME; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1439 else if (type & AIM_ICQ_STATE_ATWORK) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1440 status_id = OSCAR_STATUS_ID_ATWORK; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1441 else if (type & AIM_ICQ_STATE_LUNCH) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1442 status_id = OSCAR_STATUS_ID_LUNCH; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1443 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1444 status_id = OSCAR_STATUS_ID_AVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1445 } else { |
22873
e8a66e79c49c
Show yourself as invisible in the buddylist when you're invisible
Mark Doliner <mark@kingant.net>
parents:
22866
diff
changeset
|
1446 if (type & AIM_ICQ_STATE_INVISIBLE) |
e8a66e79c49c
Show yourself as invisible in the buddylist when you're invisible
Mark Doliner <mark@kingant.net>
parents:
22866
diff
changeset
|
1447 status_id = OSCAR_STATUS_ID_INVISIBLE; |
e8a66e79c49c
Show yourself as invisible in the buddylist when you're invisible
Mark Doliner <mark@kingant.net>
parents:
22866
diff
changeset
|
1448 else if (buddy_is_away) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1449 status_id = OSCAR_STATUS_ID_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1450 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1451 status_id = OSCAR_STATUS_ID_AVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1452 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1453 |
30648
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1454 if (info->flags & AIM_FLAG_WIRELESS) { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1455 purple_prpl_got_user_status(account, info->bn, OSCAR_STATUS_ID_MOBILE, NULL); |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15462
diff
changeset
|
1456 } else { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1457 purple_prpl_got_user_status_deactive(account, info->bn, OSCAR_STATUS_ID_MOBILE); |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15462
diff
changeset
|
1458 } |
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15462
diff
changeset
|
1459 |
30982
873cd5e068c4
I tested with AIM 7.2.6.1 and ICQ 7.2 build 3159 and both of them
Mark Doliner <mark@kingant.net>
parents:
30961
diff
changeset
|
1460 message = (info->status && info->status_len > 0) |
873cd5e068c4
I tested with AIM 7.2.6.1 and ICQ 7.2 build 3159 and both of them
Mark Doliner <mark@kingant.net>
parents:
30961
diff
changeset
|
1461 ? oscar_encoding_to_utf8(info->status_encoding, info->status, info->status_len) |
873cd5e068c4
I tested with AIM 7.2.6.1 and ICQ 7.2 build 3159 and both of them
Mark Doliner <mark@kingant.net>
parents:
30961
diff
changeset
|
1462 : NULL; |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
1463 |
25386
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
1464 if (strcmp(status_id, OSCAR_STATUS_ID_AVAILABLE) == 0) { |
30982
873cd5e068c4
I tested with AIM 7.2.6.1 and ICQ 7.2 build 3159 and both of them
Mark Doliner <mark@kingant.net>
parents:
30961
diff
changeset
|
1465 /* TODO: If itmsurl is NULL, does that mean the URL has been |
873cd5e068c4
I tested with AIM 7.2.6.1 and ICQ 7.2 build 3159 and both of them
Mark Doliner <mark@kingant.net>
parents:
30961
diff
changeset
|
1466 cleared? Or does it mean the URL should remain unchanged? */ |
30648
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1467 if (info->itmsurl != NULL) { |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1468 itmsurl = (info->itmsurl_len > 0) ? oscar_encoding_to_utf8(info->itmsurl_encoding, info->itmsurl, info->itmsurl_len) : NULL; |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1469 } else if (previous_status != NULL && purple_status_is_available(previous_status)) { |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1470 itmsurl = g_strdup(purple_status_get_attr_string(previous_status, "itmsurl")); |
30386
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1471 } |
31667
17f7badf147e
oscar: Avoid a few printf("%s", NULL)s
Paul Aurich <paul@darkrain42.org>
parents:
31614
diff
changeset
|
1472 purple_debug_info("oscar", "Activating status '%s' for buddy %s, message = '%s', itmsurl = '%s'\n", status_id, info->bn, message ? message : "(null)", itmsurl ? itmsurl : "(null)"); |
30648
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1473 purple_prpl_got_user_status(account, info->bn, status_id, "message", message, "itmsurl", itmsurl, NULL); |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
1474 } else { |
31668
2f74d4c0e63a
oscar: ...fix the *right* line this time.
Paul Aurich <paul@darkrain42.org>
parents:
31667
diff
changeset
|
1475 purple_debug_info("oscar", "Activating status '%s' for buddy %s, message = '%s'\n", status_id, info->bn, message ? message : "(null)"); |
2f74d4c0e63a
oscar: ...fix the *right* line this time.
Paul Aurich <paul@darkrain42.org>
parents:
31667
diff
changeset
|
1476 purple_prpl_got_user_status(account, info->bn, status_id, "message", message, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1477 } |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
1478 |
25386
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
1479 g_free(message); |
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
1480 g_free(itmsurl); |
15622 | 1481 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1482 /* Login time stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1483 if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1484 signon = info->onlinesince; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1485 else if (info->present & AIM_USERINFO_PRESENT_SESSIONLEN) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1486 signon = time(NULL) - info->sessionlen; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1487 purple_prpl_got_user_login_time(account, info->bn, signon); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1488 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1489 /* Idle time stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1490 /* info->idletime is the number of minutes that this user has been idle */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1491 if (info->present & AIM_USERINFO_PRESENT_IDLE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1492 time_idle = time(NULL) - info->idletime * 60; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1493 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1494 if (time_idle > 0) |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1495 purple_prpl_got_user_idle(account, info->bn, TRUE, time_idle); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1496 else |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1497 purple_prpl_got_user_idle(account, info->bn, FALSE, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1498 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1499 /* Server stored icon stuff */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1500 bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, info->bn)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1501 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1502 bi = g_new0(struct buddyinfo, 1); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1503 g_hash_table_insert(od->buddyinfo, g_strdup(purple_normalize(account, info->bn)), bi); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1504 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1505 bi->typingnot = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1506 bi->ico_informed = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1507 bi->ipaddr = info->icqinfo.ipaddr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1508 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1509 if (info->iconcsumlen) { |
16386
e0c9a46b459f
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@wiktel.com>
parents:
16375
diff
changeset
|
1510 const char *saved_b16 = NULL; |
e0c9a46b459f
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@wiktel.com>
parents:
16375
diff
changeset
|
1511 char *b16 = NULL; |
15822 | 1512 PurpleBuddy *b = NULL; |
1513 | |
1514 b16 = purple_base16_encode(info->iconcsum, info->iconcsumlen); | |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1515 b = purple_find_buddy(account, info->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1516 if (b != NULL) |
16386
e0c9a46b459f
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@wiktel.com>
parents:
16375
diff
changeset
|
1517 saved_b16 = purple_buddy_icons_get_checksum_for_user(b); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1518 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1519 if (!b16 || !saved_b16 || strcmp(b16, saved_b16)) { |
20661
408c4bb03915
Invalidate old oscar icons when someone clears their icon.
Mark Doliner <mark@kingant.net>
parents:
20632
diff
changeset
|
1520 /* Invalidate the old icon for this user */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1521 purple_buddy_icons_set_for_user(account, info->bn, NULL, 0, NULL); |
20661
408c4bb03915
Invalidate old oscar icons when someone clears their icon.
Mark Doliner <mark@kingant.net>
parents:
20632
diff
changeset
|
1522 |
408c4bb03915
Invalidate old oscar icons when someone clears their icon.
Mark Doliner <mark@kingant.net>
parents:
20632
diff
changeset
|
1523 /* Fetch the new icon (if we're not already doing so) */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1524 if (g_slist_find_custom(od->requesticon, info->bn, |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1525 (GCompareFunc)oscar_util_name_compare) == NULL) |
18814
f4d67b36f0c1
Use g_slist_find_custom() instead of writing one ourselves
Mark Doliner <mark@kingant.net>
parents:
18813
diff
changeset
|
1526 { |
18816
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
1527 od->requesticon = g_slist_prepend(od->requesticon, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1528 g_strdup(purple_normalize(account, info->bn))); |
18816
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
1529 purple_icons_fetch(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1530 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1531 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1532 g_free(b16); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1533 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1534 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1535 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1536 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1537 |
15822 | 1538 static int purple_parse_offgoing(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
1539 PurpleConnection *gc = od->gc; | |
1540 PurpleAccount *account = purple_connection_get_account(gc); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1541 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1542 aim_userinfo_t *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1543 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1544 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1545 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1546 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1547 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1548 purple_prpl_got_user_status(account, info->bn, OSCAR_STATUS_ID_OFFLINE, NULL); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1549 purple_prpl_got_user_status_deactive(account, info->bn, OSCAR_STATUS_ID_MOBILE); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1550 g_hash_table_remove(od->buddyinfo, purple_normalize(gc->account, info->bn)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1551 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1552 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1553 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1554 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1555 static int incomingim_chan1(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) { |
15822 | 1556 PurpleConnection *gc = od->gc; |
1557 PurpleAccount *account = purple_connection_get_account(gc); | |
1558 PurpleMessageFlags flags = 0; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1559 struct buddyinfo *bi; |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
1560 PurpleStoredImage *img; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1561 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1562 const char *start, *end; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1563 GData *attribs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1564 |
30391
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30390
diff
changeset
|
1565 purple_debug_misc("oscar", "Received IM from %s\n", userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1566 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1567 bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, userinfo->bn)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1568 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1569 bi = g_new0(struct buddyinfo, 1); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1570 g_hash_table_insert(od->buddyinfo, g_strdup(purple_normalize(account, userinfo->bn)), bi); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1571 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1572 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1573 if (args->icbmflags & AIM_IMFLAGS_AWAY) |
15822 | 1574 flags |= PURPLE_MESSAGE_AUTO_RESP; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1575 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1576 if (args->icbmflags & AIM_IMFLAGS_TYPINGNOT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1577 bi->typingnot = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1578 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1579 bi->typingnot = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1580 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1581 if ((args->icbmflags & AIM_IMFLAGS_HASICON) && (args->iconlen) && (args->iconsum) && (args->iconstamp)) { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1582 purple_debug_misc("oscar", "%s has an icon\n", userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1583 if ((args->iconlen != bi->ico_len) || (args->iconsum != bi->ico_csum) || (args->iconstamp != bi->ico_time)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1584 bi->ico_need = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1585 bi->ico_len = args->iconlen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1586 bi->ico_csum = args->iconsum; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1587 bi->ico_time = args->iconstamp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1588 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1589 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1590 |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
1591 img = purple_buddy_icons_find_account_icon(account); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
1592 if ((img != NULL) && |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1593 (args->icbmflags & AIM_IMFLAGS_BUDDYREQ) && !bi->ico_sent && bi->ico_informed) { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
1594 gconstpointer data = purple_imgstore_get_data(img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
1595 size_t len = purple_imgstore_get_size(img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
1596 purple_debug_info("oscar", |
22486
3225c99785b8
Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <mark@kingant.net>
parents:
22468
diff
changeset
|
1597 "Sending buddy icon to %s (%" G_GSIZE_FORMAT " bytes)\n", |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1598 userinfo->bn, len); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1599 aim_im_sendch2_icon(od, userinfo->bn, data, len, |
16613
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
1600 purple_buddy_icons_get_account_icon_timestamp(account), |
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
1601 aimutil_iconsum(data, len)); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
1602 } |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
1603 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1604 |
30391
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30390
diff
changeset
|
1605 tmp = g_strdup(args->msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1606 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1607 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1608 * Convert iChat color tags to normal font tags. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1609 */ |
15822 | 1610 if (purple_markup_find_tag("body", tmp, &start, &end, &attribs)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1611 { |
28669
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1612 int len; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1613 char *tmp2, *body; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1614 const char *ichattextcolor, *ichatballooncolor; |
28669
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1615 const char *slash_body_start, *slash_body_end = NULL; /* </body> */ |
28098
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1616 GData *unused; |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1617 |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1618 /* |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1619 * Find the ending </body> so we can strip off the outer <html/> |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1620 * and <body/> |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1621 */ |
28669
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1622 if (purple_markup_find_tag("/body", end + 1, &slash_body_start, &slash_body_end, &unused)) |
28098
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1623 { |
28669
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1624 body = g_strndup(start, slash_body_end - start + 1); |
28098
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1625 g_datalist_clear(&unused); |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28000
diff
changeset
|
1626 } |
28669
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1627 else |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1628 { |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1629 purple_debug_warning("oscar", "Broken message contains <body> but not </body>!\n"); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1630 /* Take everything after <body> */ |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1631 body = g_strdup(start); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1632 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1633 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1634 ichattextcolor = g_datalist_get_data(&attribs, "ichattextcolor"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1635 if (ichattextcolor != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1636 { |
28669
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1637 tmp2 = g_strdup_printf("<font color=\"%s\">%s</font>", ichattextcolor, body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1638 g_free(body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1639 body = tmp2; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1640 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1641 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1642 ichatballooncolor = g_datalist_get_data(&attribs, "ichatballooncolor"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1643 if (ichatballooncolor != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 { |
28669
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1645 tmp2 = g_strdup_printf("<font back=\"%s\">%s</font>", ichatballooncolor, body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1646 g_free(body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1647 body = tmp2; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1648 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1649 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1650 g_datalist_clear(&attribs); |
28669
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1651 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1652 len = start - tmp; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1653 tmp2 = g_strdup_printf("%.*s%s%s", len, tmp, body, slash_body_end ? slash_body_end + 1: "</body>"); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1654 g_free(tmp); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1655 g_free(body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1656 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1657 tmp = tmp2; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1658 } |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1659 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1660 /* |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1661 * Are there <html/> surrounding tags? If so, strip them out, too. |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1662 */ |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1663 if (purple_markup_find_tag("html", tmp, &start, &end, &attribs)) |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1664 { |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1665 gchar *tmp2; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1666 int len; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1667 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1668 g_datalist_clear(&attribs); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1669 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1670 len = start - tmp; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1671 tmp2 = g_strdup_printf("%.*s%s", len, tmp, end + 1); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1672 g_free(tmp); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1673 tmp = tmp2; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1674 } |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1675 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1676 if (purple_markup_find_tag("/html", tmp, &start, &end, &attribs)) |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1677 { |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1678 gchar *tmp2; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1679 int len; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1680 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1681 g_datalist_clear(&attribs); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1682 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1683 len = start - tmp; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1684 tmp2 = g_strdup_printf("%.*s%s", len, tmp, end + 1); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1685 g_free(tmp); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
28621
diff
changeset
|
1686 tmp = tmp2; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1687 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1688 |
30391
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30390
diff
changeset
|
1689 serv_got_im(gc, userinfo->bn, tmp, flags, (args->icbmflags & AIM_IMFLAGS_OFFLINE) ? args->timestamp : time(NULL)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1690 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1691 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1692 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1693 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1694 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1695 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1696 incomingim_chan2(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, IcbmArgsCh2 *args) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1697 { |
15822 | 1698 PurpleConnection *gc; |
1699 PurpleAccount *account; | |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1700 PurpleMessageFlags flags = 0; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1701 char *message = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1702 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1703 g_return_val_if_fail(od != NULL, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1704 g_return_val_if_fail(od->gc != NULL, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1705 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1706 gc = od->gc; |
15822 | 1707 account = purple_connection_get_account(gc); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1708 od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1709 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1710 if (args == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1711 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1712 |
29607
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
29606
diff
changeset
|
1713 purple_debug_misc("oscar", "Incoming rendezvous message of type %" |
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
29606
diff
changeset
|
1714 G_GUINT64_FORMAT ", user %s, status %hu\n", |
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
29606
diff
changeset
|
1715 args->type, userinfo->bn, args->status); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1716 |
30386
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1717 if (args->msg != NULL) { |
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1718 message = oscar_encoding_to_utf8(args->encoding, args->msg, args->msglen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1719 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1720 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 if (args->type & OSCAR_CAPABILITY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1722 { |
30386
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1723 char *utf8name, *tmp; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1724 GHashTable *components; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1725 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1726 if (!args->info.chat.roominfo.name || !args->info.chat.roominfo.exchange) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1727 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1728 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1729 } |
30386
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1730 utf8name = oscar_encoding_to_utf8(args->encoding, args->info.chat.roominfo.name, args->info.chat.roominfo.namelen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1731 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1732 tmp = extract_name(utf8name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1733 if (tmp != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1734 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1735 g_free(utf8name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1736 utf8name = tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1737 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1738 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1739 components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1740 g_free); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1741 g_hash_table_replace(components, g_strdup("room"), utf8name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1742 g_hash_table_replace(components, g_strdup("exchange"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1743 g_strdup_printf("%d", args->info.chat.roominfo.exchange)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1744 serv_got_chat_invite(gc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 utf8name, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1746 userinfo->bn, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 message, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1748 components); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1749 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1750 |
30386
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1751 else if ((args->type & OSCAR_CAPABILITY_SENDFILE) || (args->type & OSCAR_CAPABILITY_DIRECTIM)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 if (args->status == AIM_RENDEZVOUS_PROPOSE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1754 { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1755 peer_connection_got_proposition(od, userinfo->bn, message, args); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1756 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 else if (args->status == AIM_RENDEZVOUS_CANCEL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 { |
30432
1cdae196aac8
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30404
diff
changeset
|
1759 /* The other user cancelled a peer request */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1760 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1761 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1762 conn = peer_connection_find_by_cookie(od, userinfo->bn, args->cookie); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1763 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 * If conn is NULL it means we haven't tried to create |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1765 * a connection with that user. They may be trying to |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1766 * do something malicious. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1767 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1768 if (conn != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1769 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1770 peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_CLOSED, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1771 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1772 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1773 else if (args->status == AIM_RENDEZVOUS_CONNECTED) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1774 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1775 /* |
19687
b199a9be3e95
Start watching the listener socket immediately after it's created
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
1776 * Remote user has accepted our peer request. If we |
b199a9be3e95
Start watching the listener socket immediately after it's created
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
1777 * wanted to we could look up the PeerConnection using |
b199a9be3e95
Start watching the listener socket immediately after it's created
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
1778 * args->cookie, but we don't need to do anything here. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1779 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1781 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1783 else if (args->type & OSCAR_CAPABILITY_GETFILE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1784 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1786 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 else if (args->type & OSCAR_CAPABILITY_TALK) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1789 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1790 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1791 else if (args->type & OSCAR_CAPABILITY_BUDDYICON) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1793 purple_buddy_icons_set_for_user(account, userinfo->bn, |
16391
24bbd7e46bfe
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@wiktel.com>
parents:
16390
diff
changeset
|
1794 g_memdup(args->info.icon.icon, args->info.icon.length), |
16386
e0c9a46b459f
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@wiktel.com>
parents:
16375
diff
changeset
|
1795 args->info.icon.length, |
e0c9a46b459f
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@wiktel.com>
parents:
16375
diff
changeset
|
1796 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1797 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1798 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1799 else if (args->type & OSCAR_CAPABILITY_ICQSERVERRELAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1800 { |
29424
2c95b7c57ebb
Fix up the X-Status code in many ways:
Richard Laager <rlaager@wiktel.com>
parents:
29420
diff
changeset
|
1801 purple_debug_info("oscar", "Got an ICQ Server Relay message of " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1802 "type %d\n", args->info.rtfmsg.msgtype); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
1803 |
30386
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1804 if (args->info.rtfmsg.msgtype == 1) { |
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1805 if (args->info.rtfmsg.msg != NULL) { |
31041
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1806 char *rtfmsg; |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1807 const char *encoding = args->encoding; |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1808 size_t len = strlen(args->info.rtfmsg.msg); |
30398
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1809 char *tmp, *tmp2; |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1810 |
31041
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1811 if (encoding == NULL && !g_utf8_validate(args->info.rtfmsg.msg, len, NULL)) { |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1812 /* Yet another wonderful Miranda-related hack. If their user disables the "Send Unicode messages" setting, |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1813 * Miranda sends us ch2 messages in whatever Windows codepage is set as default on their user's system (instead of UTF-8). |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1814 * Of course, they don't bother to specify that codepage. Let's just fallback to the encoding OUR users can |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1815 * specify in account options as a last resort. |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1816 */ |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1817 encoding = purple_account_get_string(account, "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1818 purple_debug_info("oscar", "Miranda, is that you? Using '%s' as encoding\n", encoding); |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1819 } |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1820 |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1821 rtfmsg = oscar_encoding_to_utf8(encoding, args->info.rtfmsg.msg, len); |
e358c09cd765
Restore the previous behavior (kind of) of falling back to the specified
ivan.komarov@soc.pidgin.im
parents:
30982
diff
changeset
|
1822 |
30398
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1823 /* Channel 2 messages are supposed to be plain-text (never mind the name "rtfmsg", even |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1824 * the official client doesn't parse them as RTF). Therefore, we should escape them before |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1825 * showing to the user. */ |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1826 tmp = g_markup_escape_text(rtfmsg, -1); |
30386
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
1827 g_free(rtfmsg); |
30398
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1828 tmp2 = purple_strreplace(tmp, "\r\n", "<br>"); |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1829 g_free(tmp); |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1830 |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1831 serv_got_im(gc, userinfo->bn, tmp2, flags, time(NULL)); |
30399
3eb2dd8a1cc7
Miranda expects a client ack from the other side for channel 2 messages,
ivan.komarov@soc.pidgin.im
parents:
30398
diff
changeset
|
1832 aim_im_send_icq_confirmation(od, userinfo->bn, args->cookie); |
30398
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
1833 g_free(tmp2); |
29424
2c95b7c57ebb
Fix up the X-Status code in many ways:
Richard Laager <rlaager@wiktel.com>
parents:
29420
diff
changeset
|
1834 } |
30228
a47346a46cb7
*** Plucked rev 1e62e7c65758de7e0aaa5377f865d4164e4482f5 (ivan.komarov@soc.pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
30146
diff
changeset
|
1835 } else if (args->info.rtfmsg.msgtype == 26) { |
29609
80933c92c080
Move a debug message. I'm assuming it's supposed to be related to this
Mark Doliner <mark@kingant.net>
parents:
29608
diff
changeset
|
1836 purple_debug_info("oscar", "Sending X-Status Reply\n"); |
29608
8d4bed3021dc
Fix some problems in the oscar code that deals with channel 2 icbms.
Mark Doliner <mark@kingant.net>
parents:
29607
diff
changeset
|
1837 icq_relay_xstatus(od, userinfo->bn, args->cookie); |
30228
a47346a46cb7
*** Plucked rev 1e62e7c65758de7e0aaa5377f865d4164e4482f5 (ivan.komarov@soc.pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
30146
diff
changeset
|
1838 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1839 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1841 { |
29607
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
29606
diff
changeset
|
1842 purple_debug_error("oscar", "Unknown request class %" |
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
29606
diff
changeset
|
1843 G_GUINT64_FORMAT "\n", args->type); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1844 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1847 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 /* When someone sends you buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1852 static void |
15822 | 1853 purple_icq_buddyadd(struct name_data *data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 { |
15822 | 1855 PurpleConnection *gc = data->gc; |
1856 | |
1857 purple_blist_request_add_buddy(purple_connection_get_account(gc), data->name, NULL, data->nick); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1858 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1859 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1861 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1863 incomingim_chan4(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch4_args *args, time_t t) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1864 { |
15822 | 1865 PurpleConnection *gc = od->gc; |
1866 PurpleAccount *account = purple_connection_get_account(gc); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1867 gchar **msg1, **msg2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 int i, numtoks; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1870 if (!args->type || !args->msg || !args->uin) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1871 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1872 |
15822 | 1873 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1874 "Received a channel 4 message of type 0x%02hx.\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1875 args->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1876 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1877 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 * Split up the message at the delimeter character, then convert each |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1879 * string to UTF-8. Unless, of course, this is a type 1 message. If |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 * this is a type 1 message, then the delimiter 0xfe could be a valid |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 * character in whatever encoding the message was sent in. Type 1 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1882 * messages are always made up of only one part, so we can easily account |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1883 * for this suck-ass part of the protocol by splitting the string into at |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1884 * most 1 baby string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1885 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 msg1 = g_strsplit(args->msg, "\376", (args->type == 0x01 ? 1 : 0)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 for (numtoks=0; msg1[numtoks]; numtoks++); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 msg2 = (gchar **)g_malloc((numtoks+1)*sizeof(gchar *)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 for (i=0; msg1[i]; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1890 gchar *uin = g_strdup_printf("%u", args->uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1891 |
15822 | 1892 purple_str_strip_char(msg1[i], '\r'); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1893 /* TODO: Should use an encoding other than ASCII? */ |
30391
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30390
diff
changeset
|
1894 msg2[i] = oscar_decode_im(account, uin, AIM_CHARSET_ASCII, msg1[i], strlen(msg1[i])); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1895 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1896 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1897 msg2[i] = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1898 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1899 switch (args->type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1900 case 0x01: { /* MacICQ message or basic offline message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1901 if (i >= 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1902 gchar *uin = g_strdup_printf("%u", args->uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1903 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1904 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1905 /* If the message came from an ICQ user then escape any HTML */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1906 tmp = g_markup_escape_text(msg2[0], -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1907 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1908 if (t) { /* This is an offline message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1909 /* The timestamp is UTC-ish, so we need to get the offset */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1910 #ifdef HAVE_TM_GMTOFF |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1911 time_t now; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1912 struct tm *tm; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1913 now = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1914 tm = localtime(&now); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1915 t += tm->tm_gmtoff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1916 #else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1917 # ifdef HAVE_TIMEZONE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1918 tzset(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 t -= timezone; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1920 # endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1921 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1922 serv_got_im(gc, uin, tmp, 0, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1923 } else { /* This is a message from MacICQ/Miranda */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1924 serv_got_im(gc, uin, tmp, 0, time(NULL)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1925 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1926 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1928 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1929 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1930 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1931 case 0x04: { /* Someone sent you a URL */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1932 if (i >= 2) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1933 if (msg2[1] != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1934 gchar *uin = g_strdup_printf("%u", args->uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1935 gchar *message = g_strdup_printf("<A HREF=\"%s\">%s</A>", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1936 msg2[1], |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1937 (msg2[0] && msg2[0][0]) ? msg2[0] : msg2[1]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1938 serv_got_im(gc, uin, message, 0, time(NULL)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1939 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1940 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1941 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1943 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 case 0x06: { /* Someone requested authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1946 if (i >= 6) { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1947 gchar *bn = g_strdup_printf("%u", args->uin); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1948 gchar *reason = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1949 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 if (msg2[5] != NULL) |
30391
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30390
diff
changeset
|
1951 reason = oscar_decode_im(account, bn, AIM_CHARSET_LATIN_1, msg2[5], strlen(msg2[5])); |
15822 | 1952 |
1953 purple_debug_info("oscar", | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1954 "Received an authorization request from UIN %u\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1955 args->uin); |
30357
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30146
diff
changeset
|
1956 aim_icq_getalias(od, bn, TRUE, reason); |
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30146
diff
changeset
|
1957 g_free(bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1958 g_free(reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1962 case 0x07: { /* Someone has denied you authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1963 if (i >= 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1964 gchar *dialog_msg = g_strdup_printf(_("The user %u has denied your request to add them to your buddy list for the following reason:\n%s"), args->uin, msg2[0] ? msg2[0] : _("No reason given.")); |
15822 | 1965 purple_notify_info(gc, NULL, _("ICQ authorization denied."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1966 dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1967 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1968 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1969 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1970 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1971 case 0x08: { /* Someone has granted you authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1972 gchar *dialog_msg = g_strdup_printf(_("The user %u has granted your request to add them to your buddy list."), args->uin); |
15822 | 1973 purple_notify_info(gc, NULL, "ICQ authorization accepted.", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1975 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1976 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1978 case 0x09: { /* Message from the Godly ICQ server itself, I think */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 if (i >= 5) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1980 gchar *dialog_msg = g_strdup_printf(_("You have received a special message\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); |
15822 | 1981 purple_notify_info(gc, NULL, "ICQ Server Message", dialog_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1982 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1983 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1985 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 case 0x0d: { /* Someone has sent you a pager message from http://www.icq.com/your_uin */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1987 if (i >= 6) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ page\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); |
15822 | 1989 purple_notify_info(gc, NULL, "ICQ Page", dialog_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1992 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1993 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1994 case 0x0e: { /* Someone has emailed you at your_uin@pager.icq.com */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1995 if (i >= 6) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
1996 gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ email from %s [%s]\n\nMessage is:\n%s"), msg2[0], msg2[3], msg2[5]); |
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
1997 purple_notify_info(gc, NULL, "ICQ Email", dialog_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1998 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1999 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2000 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2001 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2002 case 0x12: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2003 /* Ack for authorizing/denying someone. Or possibly an ack for sending any system notice */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2004 /* Someone added you to their buddy list? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2005 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2006 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2007 case 0x13: { /* Someone has sent you some ICQ buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2008 guint i, num; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2009 gchar **text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2010 text = g_strsplit(args->msg, "\376", 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2011 if (text) { |
28393
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2012 /* Read the number of contacts that we were sent */ |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2013 errno = 0; |
28487
d4c28c18c20a
Add a null check, just for the heck of it
Mark Doliner <mark@kingant.net>
parents:
28393
diff
changeset
|
2014 num = text[0] ? strtoul(text[0], NULL, 10) : 0; |
28393
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2015 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2016 if (num > 0 && errno == 0) { |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2017 for (i=0; i<num; i++) { |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2018 struct name_data *data; |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2019 gchar *message; |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2020 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2021 if (!text[i*2 + 1] || !text[i*2 + 2]) { |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2022 /* We're missing the contact name or nickname. Bail out. */ |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2023 gchar *tmp = g_strescape(args->msg, NULL); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2024 purple_debug_error("oscar", "Unknown syntax parsing " |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2025 "ICQ buddies. args->msg=%s\n", tmp); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2026 g_free(tmp); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2027 break; |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2028 } |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2029 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2030 message = g_strdup_printf(_("ICQ user %u has sent you a buddy: %s (%s)"), args->uin, text[i*2+2], text[i*2+1]); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2031 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2032 data = g_new(struct name_data, 1); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2033 data->gc = gc; |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2034 data->name = g_strdup(text[i*2+1]); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2035 data->nick = g_strdup(text[i*2+2]); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2036 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2037 purple_request_action(gc, NULL, message, |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2038 _("Do you want to add this buddy " |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2039 "to your buddy list?"), |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2040 PURPLE_DEFAULT_ACTION_NONE, |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2041 purple_connection_get_account(gc), data->name, NULL, |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2042 data, 2, |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2043 _("_Add"), G_CALLBACK(purple_icq_buddyadd), |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2044 _("_Decline"), G_CALLBACK(oscar_free_name_data)); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2045 g_free(message); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2046 } |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2047 } else { |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2048 gchar *tmp = g_strescape(args->msg, NULL); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2049 purple_debug_error("oscar", "Unknown syntax parsing " |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2050 "ICQ buddies. args->msg=%s\n", tmp); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28388
diff
changeset
|
2051 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2052 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2053 g_strfreev(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2054 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2055 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2056 |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2057 case 0x1a: { /* Handle SMS or someone has sent you a greeting card or requested buddies? */ |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2058 ByteStream qbs; |
30348
605155d68812
Make these unsigned, in case someone figures out how to actually send
Mark Doliner <mark@kingant.net>
parents:
30274
diff
changeset
|
2059 guint16 smstype; |
605155d68812
Make these unsigned, in case someone figures out how to actually send
Mark Doliner <mark@kingant.net>
parents:
30274
diff
changeset
|
2060 guint32 taglen, smslen; |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2061 char *tagstr = NULL, *smsmsg = NULL; |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2062 xmlnode *xmlroot = NULL, *xmltmp = NULL; |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2063 gchar *uin = NULL, *message = NULL; |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2064 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2065 /* From libicq2000-0.3.2/src/ICQ.cpp */ |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2066 byte_stream_init(&qbs, (guint8 *)args->msg, args->msglen); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2067 byte_stream_advance(&qbs, 21); |
27194
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2068 /* expected: 01 00 00 20 00 0e 28 f6 00 11 e7 d3 11 bc f3 00 04 ac 96 9d c2 | 00 00 | 06 00 00 00 | 49 43 51 53 43 53 ...*/ |
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2069 /* unexpected: 00 00 26 00 81 1a 18 bc 0e 6c 18 47 a5 91 6f 18 dc c7 6f 1a | 00 00 | 0d 00 00 00 | 49 43 51 57 65 62 4d 65 73 73 61 67 65 ... */ |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2070 smstype = byte_stream_getle16(&qbs); |
27194
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2071 if (smstype != 0) |
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2072 break; |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2073 taglen = byte_stream_getle32(&qbs); |
30274
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2074 if (taglen > 2000) { |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2075 /* Avoid trying to allocate large amounts of memory, in |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2076 case we get something unexpected. */ |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2077 break; |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2078 } |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2079 tagstr = byte_stream_getstr(&qbs, taglen); |
27194
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2080 if (tagstr == NULL) |
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2081 break; |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2082 byte_stream_advance(&qbs, 3); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2083 byte_stream_advance(&qbs, 4); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2084 smslen = byte_stream_getle32(&qbs); |
30274
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2085 if (smslen > 2000) { |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2086 /* Avoid trying to allocate large amounts of memory, in |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2087 case we get something unexpected. */ |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2088 g_free(tagstr); |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2089 break; |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30228
diff
changeset
|
2090 } |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2091 smsmsg = byte_stream_getstr(&qbs, smslen); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2092 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2093 /* Check if this is an SMS being sent from server */ |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2094 if ((smstype == 0) && (!strcmp(tagstr, "ICQSMS")) && (smsmsg != NULL)) |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2095 { |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2096 xmlroot = xmlnode_from_str(smsmsg, -1); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2097 if (xmlroot != NULL) |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2098 { |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2099 xmltmp = xmlnode_get_child(xmlroot, "sender"); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2100 if (xmltmp != NULL) |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2101 uin = xmlnode_get_data(xmltmp); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2102 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2103 xmltmp = xmlnode_get_child(xmlroot, "text"); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2104 if (xmltmp != NULL) |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2105 message = xmlnode_get_data(xmltmp); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2106 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2107 if ((uin != NULL) && (message != NULL)) |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2108 serv_got_im(gc, uin, message, 0, time(NULL)); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2109 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2110 g_free(uin); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2111 g_free(message); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2112 xmlnode_free(xmlroot); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2113 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2114 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2115 g_free(tagstr); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2116 g_free(smsmsg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2117 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 default: { |
15822 | 2120 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2121 "Received a channel 4 message of unknown type " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2122 "(type 0x%02hhx).\n", args->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2124 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2125 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2126 g_strfreev(msg1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2127 g_strfreev(msg2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2128 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2130 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2131 |
15822 | 2132 static int purple_parse_incoming_im(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2133 guint16 channel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2134 int ret = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2135 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2136 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2137 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2138 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2139 channel = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2140 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2141 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2142 switch (channel) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2143 case 1: { /* standard message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2144 struct aim_incomingim_ch1_args *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2145 args = va_arg(ap, struct aim_incomingim_ch1_args *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2146 ret = incomingim_chan1(od, conn, userinfo, args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2147 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2148 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2149 case 2: { /* rendezvous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2150 IcbmArgsCh2 *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2151 args = va_arg(ap, IcbmArgsCh2 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2152 ret = incomingim_chan2(od, conn, userinfo, args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2154 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2155 case 4: { /* ICQ */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 struct aim_incomingim_ch4_args *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 args = va_arg(ap, struct aim_incomingim_ch4_args *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 ret = incomingim_chan4(od, conn, userinfo, args, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2159 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2161 default: { |
15822 | 2162 purple_debug_warning("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2163 "ICBM received on unsupported channel (channel " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2164 "0x%04hx).", channel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2167 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2168 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2169 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2170 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2171 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2172 |
15822 | 2173 static int purple_parse_misses(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2174 PurpleConnection *gc = od->gc; | |
2175 PurpleAccount *account = purple_connection_get_account(gc); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2176 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2177 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 guint16 chan, nummissed, reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2179 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2181 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2182 chan = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2183 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 nummissed = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2186 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2187 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 switch(reason) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 case 0: /* Invalid (0) */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2190 buf = g_strdup_printf( |
23267 | 2191 dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 "You missed %hu message from %s because it was invalid.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 "You missed %hu messages from %s because they were invalid.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2194 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2195 nummissed, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2196 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2198 case 1: /* Message too large */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2199 buf = g_strdup_printf( |
23267 | 2200 dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2201 "You missed %hu message from %s because it was too large.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2202 "You missed %hu messages from %s because they were too large.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2203 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2204 nummissed, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2205 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2206 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2207 case 2: /* Rate exceeded */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2208 buf = g_strdup_printf( |
23267 | 2209 dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2210 "You missed %hu message from %s because the rate limit has been exceeded.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2211 "You missed %hu messages from %s because the rate limit has been exceeded.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2212 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2213 nummissed, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2214 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2215 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2216 case 3: /* Evil Sender */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 buf = g_strdup_printf( |
23267 | 2218 dngettext(PACKAGE, |
23350
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23338
diff
changeset
|
2219 "You missed %hu message from %s because his/her warning level is too high.", |
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23338
diff
changeset
|
2220 "You missed %hu messages from %s because his/her warning level is too high.", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2221 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2222 nummissed, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2223 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2224 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2225 case 4: /* Evil Receiver */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2226 buf = g_strdup_printf( |
23267 | 2227 dngettext(PACKAGE, |
23350
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23338
diff
changeset
|
2228 "You missed %hu message from %s because your warning level is too high.", |
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23338
diff
changeset
|
2229 "You missed %hu messages from %s because your warning level is too high.", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2230 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2231 nummissed, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2232 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2233 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2234 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2235 buf = g_strdup_printf( |
23267 | 2236 dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2237 "You missed %hu message from %s for an unknown reason.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2238 "You missed %hu messages from %s for an unknown reason.", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2239 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2240 nummissed, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2241 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2242 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2243 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2244 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2245 if (!purple_conv_present_error(userinfo->bn, account, buf)) |
15822 | 2246 purple_notify_error(od->gc, NULL, buf, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2247 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2248 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2249 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2250 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2251 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2252 static int |
15822 | 2253 purple_parse_clientauto_ch2(OscarData *od, const char *who, guint16 reason, const guchar *cookie) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2254 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2255 if (reason == 0x0003) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2256 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2257 /* Rendezvous was refused. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2258 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2259 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2260 conn = peer_connection_find_by_cookie(od, who, cookie); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2261 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2262 if (conn == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2263 { |
15822 | 2264 purple_debug_info("oscar", "Received a rendezvous cancel message " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2265 "for a nonexistant connection from %s.\n", who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2266 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2267 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2268 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2269 peer_connection_destroy(conn, OSCAR_DISCONNECT_REMOTE_REFUSED, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2270 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2271 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2272 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2273 { |
15822 | 2274 purple_debug_warning("oscar", "Received an unknown rendezvous " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2275 "message from %s. Type 0x%04hx\n", who, reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2276 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2277 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2278 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2279 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2280 |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2281 static int purple_parse_clientauto_ch4(OscarData *od, const char *who, guint16 reason, guint32 state, char *msg) { |
15822 | 2282 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2283 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2284 switch(reason) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2285 case 0x0003: { /* Reply from an ICQ status message request */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2286 char *statusmsg, **splitmsg; |
15822 | 2287 PurpleNotifyUserInfo *user_info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2288 |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2289 statusmsg = oscar_icqstatus(state); |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2290 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2291 /* Split at (carriage return/newline)'s, then rejoin later with BRs between. */ |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2292 /* TODO: Don't we need to escape each piece? */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2293 splitmsg = g_strsplit(msg, "\r\n", 0); |
23267 | 2294 |
15822 | 2295 user_info = purple_notify_user_info_new(); |
23267 | 2296 |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2297 purple_notify_user_info_add_pair_plaintext(user_info, _("UIN"), who); |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2298 /* TODO: Check whether it's correct to call add_pair_html, |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2299 or if we should be using add_pair_plaintext */ |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2300 purple_notify_user_info_add_pair_html(user_info, _("Status"), statusmsg); |
15822 | 2301 purple_notify_user_info_add_section_break(user_info); |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2302 purple_notify_user_info_add_pair_html(user_info, NULL, g_strjoinv("<BR>", splitmsg)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2304 g_free(statusmsg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2305 g_strfreev(splitmsg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2306 |
15822 | 2307 purple_notify_userinfo(gc, who, user_info, NULL, NULL); |
2308 purple_notify_user_info_destroy(user_info); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2309 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2310 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2312 case 0x0006: { /* Reply from an ICQ status message request */ |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2313 char *statusmsg, **splitmsg; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2314 PurpleNotifyUserInfo *user_info; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2315 |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2316 statusmsg = oscar_icqstatus(state); |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2317 |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2318 /* Split at (carriage return/newline)'s, then rejoin later with BRs between. */ |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2319 /* TODO: Don't we need to escape each piece? */ |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2320 splitmsg = g_strsplit(msg, "\r\n", 0); |
29610 | 2321 |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2322 user_info = purple_notify_user_info_new(); |
29610 | 2323 |
31904
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2324 purple_notify_user_info_add_pair_plaintext(user_info, _("UIN"), who); |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2325 /* TODO: Check whether it's correct to call add_pair_html, |
3322201b446f
I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <mark@kingant.net>
parents:
31872
diff
changeset
|
2326 or if we should be using add_pair_plaintext */ |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2327 purple_notify_user_info_add_pair_html(user_info, _("Status"), statusmsg); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2328 purple_notify_user_info_add_section_break(user_info); |
31907
99ca503ea087
Rename purple_notify_user_info_add_pair to
Mark Doliner <mark@kingant.net>
parents:
31904
diff
changeset
|
2329 purple_notify_user_info_add_pair_html(user_info, NULL, g_strjoinv("<BR>", splitmsg)); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2330 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2331 g_free(statusmsg); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2332 g_strfreev(splitmsg); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2333 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2334 purple_notify_userinfo(gc, who, user_info, NULL, NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2335 purple_notify_user_info_destroy(user_info); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2336 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
2337 } break; |
29457
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
2338 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2339 default: { |
15822 | 2340 purple_debug_warning("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2341 "Received an unknown client auto-response from %s. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2342 "Type 0x%04hx\n", who, reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2343 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2344 } /* end of switch */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2345 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2346 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2347 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2348 |
15822 | 2349 static int purple_parse_clientauto(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2350 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2351 guint16 chan, reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2352 char *who; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2353 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2354 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2355 chan = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2356 who = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2357 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2358 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2359 if (chan == 0x0002) { /* File transfer declined */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2360 guchar *cookie = va_arg(ap, guchar *); |
15822 | 2361 return purple_parse_clientauto_ch2(od, who, reason, cookie); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2362 } else if (chan == 0x0004) { /* ICQ message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2363 guint32 state = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2364 char *msg = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2365 if (reason == 0x0003) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2366 state = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 } |
15822 | 2369 return purple_parse_clientauto_ch4(od, who, reason, state, msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2371 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2372 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2373 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2375 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2376 |
15822 | 2377 static int purple_parse_genericerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2378 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2379 guint16 reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2380 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2381 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 reason = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2383 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 |
29986
f18b6eb0ed02
Cleanup, basically. Move the icbm snac error handling from oscar.c to
Mark Doliner <mark@kingant.net>
parents:
29947
diff
changeset
|
2385 purple_debug_error("oscar", "snac threw error (reason 0x%04hx: %s)\n", |
f18b6eb0ed02
Cleanup, basically. Move the icbm snac error handling from oscar.c to
Mark Doliner <mark@kingant.net>
parents:
29947
diff
changeset
|
2386 reason, oscar_get_msgerr_reason(reason)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2388 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2389 |
15822 | 2390 static int purple_parse_mtn(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2391 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2392 va_list ap; |
28229
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2393 guint16 channel, event; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2394 char *bn; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2395 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 va_start(ap, fr); |
28229
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2397 channel = (guint16) va_arg(ap, unsigned int); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2398 bn = va_arg(ap, char *); |
28229
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2399 event = (guint16) va_arg(ap, unsigned int); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2400 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 |
28229
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2402 switch (event) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 case 0x0000: { /* Text has been cleared */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2404 serv_got_typing_stopped(gc, bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2405 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2406 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 case 0x0001: { /* Paused typing */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2408 serv_got_typing(gc, bn, 0, PURPLE_TYPED); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2409 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2410 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2411 case 0x0002: { /* Typing */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2412 serv_got_typing(gc, bn, 0, PURPLE_TYPING); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2413 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2414 |
28229
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2415 case 0x000f: { /* Closed IM window */ |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2416 serv_got_typing_stopped(gc, bn); |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2417 } break; |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2418 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2419 default: { |
28229
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2420 purple_debug_info("oscar", "Received unknown typing " |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2421 "notification message from %s. Channel is 0x%04x " |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28228
diff
changeset
|
2422 "and event is 0x%04hx.\n", bn, channel, event); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2423 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2424 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2425 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2426 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2427 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2428 |
15822 | 2429 static int purple_parse_motd(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2430 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2431 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2432 guint16 id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2433 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2434 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2435 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2436 id = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2437 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2438 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2439 |
15822 | 2440 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2441 "MOTD: %s (%hu)\n", msg ? msg : "Unknown", id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2442 if (id < 4) |
15822 | 2443 purple_notify_warning(od->gc, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2444 _("Your AIM connection may be lost."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2445 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2446 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2447 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2448 |
15822 | 2449 static int purple_chatnav_info(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2450 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2451 guint16 type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2452 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2453 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2454 type = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2456 switch(type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2457 case 0x0002: { |
30904
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2458 GString *msg = g_string_new(""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2459 guint8 maxrooms; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2460 struct aim_chat_exchangeinfo *exchanges; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2461 int exchangecount, i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2462 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2463 maxrooms = (guint8) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2464 exchangecount = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2465 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2466 |
30904
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2467 g_string_append_printf(msg, "chat info: Max Concurrent Rooms: %hhd, Exchange List (%d total): ", maxrooms, exchangecount); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2468 for (i = 0; i < exchangecount; i++) { |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2469 g_string_append_printf(msg, "%hu", exchanges[i].number); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2470 if (exchanges[i].name) { |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2471 g_string_append_printf(msg, " %s", exchanges[i].name); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2472 } |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2473 g_string_append(msg, ", "); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2474 } |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2475 purple_debug_misc("oscar", "%s\n", msg->str); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2476 g_string_free(msg, TRUE); |
91d3b40a2f70
No need to clutter the debug log with dozens of lines when
ivan.komarov@soc.pidgin.im
parents:
30903
diff
changeset
|
2477 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2478 while (od->create_rooms) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 struct create_room *cr = od->create_rooms->data; |
15822 | 2480 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2481 "creating room %s\n", cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2482 aim_chatnav_createroom(od, conn, cr->name, cr->exchange); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2483 g_free(cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2484 od->create_rooms = g_slist_remove(od->create_rooms, cr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2485 g_free(cr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2486 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2487 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2488 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2489 case 0x0008: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2490 char *fqcn, *name, *ck; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2491 guint16 instance, flags, maxmsglen, maxoccupancy, unknown, exchange; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2492 guint8 createperms; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2493 guint32 createtime; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2494 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2495 fqcn = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2496 instance = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2497 exchange = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2498 flags = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2499 createtime = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2500 maxmsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2501 maxoccupancy = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2502 createperms = (guint8)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2503 unknown = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2504 name = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2505 ck = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2506 |
15822 | 2507 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2508 "created room: %s %hu %hu %hu %u %hu %hu %hhu %hu %s %s\n", |
28860
49f881831eb9
*** Plucked rev f39cd1fed08fe5f5e3165a087fcc36ed984a6eee (f05c54b03e6bbfdbff38c01697fbd353a969e05e):
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28748
diff
changeset
|
2509 fqcn ? fqcn : "(null)", exchange, instance, flags, createtime, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2510 maxmsglen, maxoccupancy, createperms, unknown, |
28860
49f881831eb9
*** Plucked rev f39cd1fed08fe5f5e3165a087fcc36ed984a6eee (f05c54b03e6bbfdbff38c01697fbd353a969e05e):
Daniel Atallah <daniel.atallah@gmail.com>
parents:
28748
diff
changeset
|
2511 name ? name : "(null)", ck); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2512 aim_chat_join(od, exchange, ck, instance); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2513 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2514 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2515 default: |
15822 | 2516 purple_debug_warning("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2517 "chatnav info: unknown type (%04hx)\n", type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2518 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2519 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2520 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2521 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2522 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2523 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2524 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2525 |
15822 | 2526 static int purple_conv_chat_join(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2527 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2528 int count, i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2529 aim_userinfo_t *info; |
15822 | 2530 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2531 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2532 struct chat_connection *c = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2533 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2534 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2535 count = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2536 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2537 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2538 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2539 c = find_oscar_chat_by_conn(gc, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2540 if (!c) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2541 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2542 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2543 for (i = 0; i < count; i++) |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2544 purple_conv_chat_add_user(PURPLE_CONV_CHAT(c->conv), info[i].bn, NULL, PURPLE_CBFLAGS_NONE, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2545 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2546 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2547 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2548 |
15822 | 2549 static int purple_conv_chat_leave(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2550 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2551 int count, i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2552 aim_userinfo_t *info; |
15822 | 2553 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2554 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2555 struct chat_connection *c = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2556 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2557 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2558 count = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2559 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2560 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2561 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2562 c = find_oscar_chat_by_conn(gc, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2563 if (!c) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2564 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2565 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2566 for (i = 0; i < count; i++) |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2567 purple_conv_chat_remove_user(PURPLE_CONV_CHAT(c->conv), info[i].bn, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2568 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2569 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2570 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2571 |
15822 | 2572 static int purple_conv_chat_info_update(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2573 va_list ap; |
30388
88689cda97d8
Turns out that ncc doesn't catch everything, so continue killing things mercilessly.
ivan.komarov@soc.pidgin.im
parents:
30387
diff
changeset
|
2574 guint16 maxmsglen, maxvisiblemsglen; |
15822 | 2575 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2576 struct chat_connection *ccon = find_oscar_chat_by_conn(gc, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2577 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2578 if (!ccon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2579 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2580 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2581 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2582 maxmsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2583 maxvisiblemsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2584 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2585 |
15822 | 2586 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2587 "inside chat_info_update (maxmsglen = %hu, maxvislen = %hu)\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2588 maxmsglen, maxvisiblemsglen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2589 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2590 ccon->maxlen = maxmsglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2591 ccon->maxvis = maxvisiblemsglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2592 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2593 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2594 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2595 |
15822 | 2596 static int purple_conv_chat_incoming_msg(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2597 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2598 struct chat_connection *ccon = find_oscar_chat_by_conn(gc, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2599 gchar *utf8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2600 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2601 aim_userinfo_t *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2602 int len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2603 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2604 char *charset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2605 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2606 if (!ccon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2607 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2608 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2609 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2610 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2611 len = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2612 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2613 charset = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2614 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2615 |
30386
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30385
diff
changeset
|
2616 utf8 = oscar_encoding_to_utf8(charset, msg, len); |
29523
962bc012a504
This cast is incorrect. It should be (time_t *). But it's actually not needed.
Mark Doliner <mark@kingant.net>
parents:
29476
diff
changeset
|
2617 serv_got_chat_in(gc, ccon->id, info->bn, 0, utf8, time(NULL)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2618 g_free(utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2619 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2620 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2621 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2622 |
15822 | 2623 static int purple_email_parseupdate(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2624 va_list ap; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2625 PurpleConnection *gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2626 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2627 struct aim_emailinfo *emailinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2628 int havenewmail; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2629 char *alertitle, *alerturl; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2630 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2631 gc = od->gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2632 account = purple_connection_get_account(gc); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2633 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2634 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2635 emailinfo = va_arg(ap, struct aim_emailinfo *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2636 havenewmail = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2637 alertitle = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2638 alerturl = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2639 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2640 |
26942
7957a5ed53bb
Re-add purple_account_get_check_mail() check to oscar.
Paul Aurich <paul@darkrain42.org>
parents:
26876
diff
changeset
|
2641 if (account != NULL && emailinfo != NULL && purple_account_get_check_mail(account) && |
7957a5ed53bb
Re-add purple_account_get_check_mail() check to oscar.
Paul Aurich <paul@darkrain42.org>
parents:
26876
diff
changeset
|
2642 emailinfo->unread && havenewmail) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2643 gchar *to = g_strdup_printf("%s%s%s", |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2644 purple_account_get_username(account), |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2645 emailinfo->domain ? "@" : "", |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2646 emailinfo->domain ? emailinfo->domain : ""); |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25576
diff
changeset
|
2647 const char *tos[2] = { to }; |
26852
0b97f73fa3d2
correctly NULL terminate all the arrays since that's what gtknotify assumes,
Ka-Hing Cheung <khc@hxbc.us>
parents:
26764
diff
changeset
|
2648 const char *urls[2] = { emailinfo->url }; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2649 purple_notify_emails(gc, emailinfo->nummsgs, FALSE, NULL, NULL, |
26852
0b97f73fa3d2
correctly NULL terminate all the arrays since that's what gtknotify assumes,
Ka-Hing Cheung <khc@hxbc.us>
parents:
26764
diff
changeset
|
2650 tos, urls, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2651 g_free(to); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2652 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2653 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2654 if (alertitle) |
15822 | 2655 purple_debug_misc("oscar", "Got an alert '%s' %s\n", alertitle, alerturl ? alerturl : ""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2656 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2657 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2658 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2659 |
15822 | 2660 static int purple_icon_parseicon(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2661 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2662 va_list ap; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2663 char *bn; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2664 guint8 iconcsumtype, *iconcsum, *icon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2665 guint16 iconcsumlen, iconlen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2666 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2667 va_start(ap, fr); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2668 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2669 iconcsumtype = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2670 iconcsum = va_arg(ap, guint8 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2671 iconcsumlen = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2672 icon = va_arg(ap, guint8 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2673 iconlen = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2674 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2675 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2676 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2677 * Some AIM clients will send a blank GIF image with iconlen 90 when |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2678 * no icon is set. Ignore these. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2679 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2680 if ((iconlen > 0) && (iconlen != 90)) { |
16386
e0c9a46b459f
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@wiktel.com>
parents:
16375
diff
changeset
|
2681 char *b16 = purple_base16_encode(iconcsum, iconcsumlen); |
15822 | 2682 purple_buddy_icons_set_for_user(purple_connection_get_account(gc), |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2683 bn, g_memdup(icon, iconlen), iconlen, b16); |
16386
e0c9a46b459f
Move the prpl icon checksum code into the core, so we can delete the
Richard Laager <rlaager@wiktel.com>
parents:
16375
diff
changeset
|
2684 g_free(b16); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2685 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2686 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2687 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2688 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2689 |
18816
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2690 static void |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2691 purple_icons_fetch(PurpleConnection *gc) |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2692 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2693 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2694 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2695 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2696 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2697 conn = flap_connection_getbytype(od, SNAC_FAMILY_BART); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2698 if (!conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2699 if (!od->iconconnecting) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2700 aim_srv_requestnew(od, SNAC_FAMILY_BART); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2701 od->iconconnecting = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2702 } |
18816
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2703 return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2704 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2705 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2706 if (od->set_icon) { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
2707 PurpleAccount *account = purple_connection_get_account(gc); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
2708 PurpleStoredImage *img = purple_buddy_icons_find_account_icon(account); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
2709 if (img == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2710 aim_ssi_delicon(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2711 } else { |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
2712 purple_debug_info("oscar", |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
2713 "Uploading icon to icon server\n"); |
18816
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2714 aim_bart_upload(od, purple_imgstore_get_data(img), |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
2715 purple_imgstore_get_size(img)); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
2716 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2717 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2718 od->set_icon = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2719 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2720 |
18816
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2721 while (od->requesticon != NULL) |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2722 { |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2723 userinfo = aim_locate_finduserinfo(od, (char *)od->requesticon->data); |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2724 if ((userinfo != NULL) && (userinfo->iconcsumlen > 0)) |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2725 aim_bart_request(od, od->requesticon->data, userinfo->iconcsumtype, userinfo->iconcsum, userinfo->iconcsumlen); |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2726 |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2727 g_free(od->requesticon->data); |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2728 od->requesticon = g_slist_delete_link(od->requesticon, od->requesticon); |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2729 } |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2730 |
7a27e3729612
Fetch icons all at once instead of one at a time. I tried pretty hard
Mark Doliner <mark@kingant.net>
parents:
18814
diff
changeset
|
2731 purple_debug_misc("oscar", "no more icons to request\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2732 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2733 |
15822 | 2734 static int purple_selfinfo(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2735 int warning_level; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2736 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2737 aim_userinfo_t *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2738 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2739 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2740 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2741 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2742 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2743 purple_connection_set_display_name(od->gc, info->bn); |
21730
e501c2c675cd
Always set gc->display_name to the formatted version of your screen
Mark Doliner <mark@kingant.net>
parents:
21728
diff
changeset
|
2744 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2745 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2746 * What's with the + 0.5? |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2747 * The 0.5 is basically poor-man's rounding. Normally |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2748 * casting "13.7" to an int will truncate to "13," but |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2749 * with 13.7 + 0.5 = 14.2, which becomes "14" when |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2750 * truncated. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2751 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2752 warning_level = info->warnlevel/10.0 + 0.5; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2753 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2754 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2755 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2756 |
15822 | 2757 static int purple_connerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2758 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2759 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2760 guint16 code; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2761 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2762 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2763 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2764 code = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2765 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2766 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2767 |
15822 | 2768 purple_debug_info("oscar", "Disconnected. Code is 0x%04x and msg is %s\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2769 code, (msg != NULL ? msg : "")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2770 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2771 g_return_val_if_fail(conn != NULL, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2772 |
18609
2774acdb1cff
Move a call to purple_connection_error() from oscar.c to
Mark Doliner <mark@kingant.net>
parents:
18608
diff
changeset
|
2773 if (conn->type == SNAC_FAMILY_CHAT) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2774 struct chat_connection *cc; |
18613
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2775 PurpleConversation *conv = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2776 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2777 cc = find_oscar_chat_by_conn(gc, conn); |
18613
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2778 if (cc != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2779 { |
18613
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2780 conv = purple_find_chat(gc, cc->id); |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2781 |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2782 if (conv != NULL) |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2783 { |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2784 /* |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2785 * TOOD: Have flap_connection_destroy_cb() send us the |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2786 * error message stored in 'tmp', which should be |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2787 * human-friendly, and print that to the chat room. |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2788 */ |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2789 gchar *buf; |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2790 buf = g_strdup_printf(_("You have been disconnected from chat " |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2791 "room %s."), cc->name); |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2792 purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_ERROR, time(NULL)); |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2793 g_free(buf); |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2794 } |
c5be17bbb6e4
Get rid of a crash that happens when signing off if you have a chat room
Mark Doliner <mark@kingant.net>
parents:
18611
diff
changeset
|
2795 oscar_chat_kill(gc, cc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2796 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2797 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2798 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2799 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2800 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2801 |
15822 | 2802 static int purple_parse_locaterights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2803 { |
15822 | 2804 PurpleConnection *gc = od->gc; |
2805 PurpleAccount *account = purple_connection_get_account(gc); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2806 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2807 guint16 maxsiglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2808 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2809 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2810 maxsiglen = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2811 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2812 |
15822 | 2813 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2814 "locate rights: max sig len = %d\n", maxsiglen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2815 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2816 od->rights.maxsiglen = od->rights.maxawaymsglen = (guint)maxsiglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2817 |
15822 | 2818 aim_locate_setcaps(od, purple_caps); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2819 oscar_set_info_and_status(account, TRUE, account->user_info, TRUE, |
15822 | 2820 purple_account_get_active_status(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2821 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2822 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2823 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2824 |
15822 | 2825 static int purple_parse_buddyrights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2826 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2827 guint16 maxbuddies, maxwatchers; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2828 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2829 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2830 maxbuddies = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2831 maxwatchers = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2832 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2833 |
15822 | 2834 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2835 "buddy list rights: Max buddies = %hu / Max watchers = %hu\n", maxbuddies, maxwatchers); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2836 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2837 od->rights.maxbuddies = (guint)maxbuddies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2838 od->rights.maxwatchers = (guint)maxwatchers; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2839 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2840 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2841 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2842 |
31205
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2843 static void oscar_format_username(PurpleConnection *gc, const char *new_display_name) |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2844 { |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2845 OscarData *od; |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2846 const char *old_display_name, *username; |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2847 char *tmp, *at_sign; |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2848 |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2849 old_display_name = purple_connection_get_display_name(gc); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2850 if (old_display_name && strchr(old_display_name, '@')) { |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2851 purple_debug_info("oscar", "Cowardly refusing to attempt to format " |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2852 "screen name because the current formatting according to " |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2853 "the server (%s) appears to be an email address\n", |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2854 old_display_name); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2855 return; |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2856 } |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2857 |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2858 username = purple_account_get_username(purple_connection_get_account(gc)); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2859 if (oscar_util_name_compare(username, new_display_name)) { |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2860 purple_notify_error(gc, NULL, _("The new formatting is invalid."), |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2861 _("Username formatting can change only capitalization and whitespace.")); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2862 return; |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2863 } |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2864 |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2865 tmp = g_strdup(new_display_name); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2866 |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2867 /* |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2868 * If our local username is an email address then strip off the domain. |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2869 * This allows formatting to work if the user entered their username as |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2870 * 'something@aim.com' or possibly other AOL-owned domains. |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2871 */ |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2872 at_sign = strchr(tmp, '@'); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2873 if (at_sign) |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2874 at_sign[0] = '\0'; |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2875 |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2876 od = purple_connection_get_protocol_data(gc); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2877 if (!flap_connection_getbytype(od, SNAC_FAMILY_ADMIN)) { |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2878 /* We don't have a connection to an "admin" server. Make one. */ |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2879 od->setnick = TRUE; |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2880 g_free(od->newformatting); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2881 od->newformatting = tmp; |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2882 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2883 } else { |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2884 aim_admin_setnick(od, flap_connection_getbytype(od, SNAC_FAMILY_ADMIN), tmp); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2885 g_free(tmp); |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2886 } |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2887 } |
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2888 |
15822 | 2889 static int purple_bosrights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2890 PurpleConnection *gc; | |
2891 PurpleAccount *account; | |
2892 PurpleStatus *status; | |
27384
eb059c7d8b11
Oh, make sure we still set the itmsurl if we're available but don't have
Mark Doliner <mark@kingant.net>
parents:
27383
diff
changeset
|
2893 gboolean is_available; |
19394
bbaa74c3264a
I'm going to assume this works, without the benefit of testing. Restore AIM idle time on a reconnect. Fixes #333
Sean Egan <seanegan@gmail.com>
parents:
19197
diff
changeset
|
2894 PurplePresence *presence; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2895 const char *username, *message, *itmsurl; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2896 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2897 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2898 guint16 maxpermits, maxdenies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2899 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2900 gc = od->gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2901 od = purple_connection_get_protocol_data(gc); |
15822 | 2902 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2903 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2904 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2905 maxpermits = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2906 maxdenies = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2907 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2908 |
15822 | 2909 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2910 "BOS rights: Max permit = %hu / Max deny = %hu\n", maxpermits, maxdenies); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2911 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2912 od->rights.maxpermits = (guint)maxpermits; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2913 od->rights.maxdenies = (guint)maxdenies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2914 |
15822 | 2915 purple_debug_info("oscar", "buddy list loaded\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2916 |
15822 | 2917 if (purple_account_get_user_info(account) != NULL) |
2918 serv_set_info(gc, purple_account_get_user_info(account)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2919 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2920 username = purple_account_get_username(account); |
31205
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2921 if (!od->icq && strcmp(username, purple_connection_get_display_name(gc)) != 0) { |
22620
e8d35793bd71
Only call oscar_format_screenname() on connecting if we need to
Mark Doliner <mark@kingant.net>
parents:
22568
diff
changeset
|
2922 /* |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2923 * Format the username for AIM accounts if it's different |
22620
e8d35793bd71
Only call oscar_format_screenname() on connecting if we need to
Mark Doliner <mark@kingant.net>
parents:
22568
diff
changeset
|
2924 * than what's currently set. |
e8d35793bd71
Only call oscar_format_screenname() on connecting if we need to
Mark Doliner <mark@kingant.net>
parents:
22568
diff
changeset
|
2925 */ |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2926 oscar_format_username(gc, username); |
31205
b39a2bd81566
Small changes to how we format oscar screen names. We now
Mark Doliner <mark@kingant.net>
parents:
31086
diff
changeset
|
2927 } |
15679
cad32dba756b
Automatically format screenname to account->username
Sean Egan <seanegan@gmail.com>
parents:
15678
diff
changeset
|
2928 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2929 /* Set our available message based on the current status */ |
15822 | 2930 status = purple_account_get_active_status(account); |
27384
eb059c7d8b11
Oh, make sure we still set the itmsurl if we're available but don't have
Mark Doliner <mark@kingant.net>
parents:
27383
diff
changeset
|
2931 is_available = purple_status_is_available(status); |
eb059c7d8b11
Oh, make sure we still set the itmsurl if we're available but don't have
Mark Doliner <mark@kingant.net>
parents:
27383
diff
changeset
|
2932 if (is_available) |
15822 | 2933 message = purple_status_get_attr_string(status, "message"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2934 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2935 message = NULL; |
15822 | 2936 tmp = purple_markup_strip_html(message); |
2937 itmsurl = purple_status_get_attr_string(status, "itmsurl"); | |
27384
eb059c7d8b11
Oh, make sure we still set the itmsurl if we're available but don't have
Mark Doliner <mark@kingant.net>
parents:
27383
diff
changeset
|
2938 aim_srv_setextrainfo(od, FALSE, 0, is_available, tmp, itmsurl); |
30398
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30396
diff
changeset
|
2939 aim_srv_set_dc_info(od); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2940 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2941 |
19394
bbaa74c3264a
I'm going to assume this works, without the benefit of testing. Restore AIM idle time on a reconnect. Fixes #333
Sean Egan <seanegan@gmail.com>
parents:
19197
diff
changeset
|
2942 presence = purple_status_get_presence(status); |
19583
66882abaf8f1
rewster from #pidgin pointed out that the conditional was reversed, and
Ka-Hing Cheung <khc@hxbc.us>
parents:
19394
diff
changeset
|
2943 aim_srv_setidle(od, !purple_presence_is_idle(presence) ? 0 : time(NULL) - purple_presence_get_idle_time(presence)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2945 if (od->icq) { |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
2946 oscar_set_extended_status(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2947 aim_icq_setsecurity(od, |
15822 | 2948 purple_account_get_bool(account, "authorization", OSCAR_DEFAULT_AUTHORIZATION), |
2949 purple_account_get_bool(account, "web_aware", OSCAR_DEFAULT_WEB_AWARE)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2950 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2951 |
27160
763247959e00
It's ok to always request this connection now. It probably still doesn't
Mark Doliner <mark@kingant.net>
parents:
27143
diff
changeset
|
2952 aim_srv_requestnew(od, SNAC_FAMILY_ALERT); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2953 aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2954 |
28388
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2955 od->bos.have_rights = TRUE; |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2956 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2957 /* |
28388
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2958 * If we've already received our feedbag data then we're not waiting on |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2959 * anything else, so send the server clientready. |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2960 * |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2961 * Normally we get bos rights before we get our feedbag data, so this |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2962 * rarely (never?) happens. And I'm not sure it actually matters if we |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2963 * wait for bos rights before calling clientready. But it seems safer |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2964 * to do it this way. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2965 */ |
28388
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2966 if (od->ssi.received_data) { |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2967 aim_srv_clientready(od, conn); |
28506
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28504
diff
changeset
|
2968 |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28504
diff
changeset
|
2969 /* Request offline messages for AIM and ICQ */ |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28504
diff
changeset
|
2970 aim_im_reqofflinemsgs(od); |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28504
diff
changeset
|
2971 |
28388
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2972 purple_connection_set_state(gc, PURPLE_CONNECTED); |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
2973 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2974 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2975 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2976 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2977 |
15822 | 2978 static int purple_popup(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2979 { |
15822 | 2980 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2981 gchar *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2982 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2983 char *msg, *url; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2984 guint16 wid, hei, delay; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2985 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2986 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2987 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2988 url = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2989 wid = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2990 hei = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2991 delay = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2992 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2993 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2994 text = g_strdup_printf("%s<br><a href=\"%s\">%s</a>", msg, url, url); |
15822 | 2995 purple_notify_formatted(gc, NULL, _("Pop-Up Message"), NULL, text, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2996 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2997 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2998 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2999 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3000 |
15822 | 3001 static void oscar_searchresults_add_buddy_cb(PurpleConnection *gc, GList *row, void *user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3002 { |
15822 | 3003 purple_blist_request_add_buddy(purple_connection_get_account(gc), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3004 g_list_nth_data(row, 0), NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3005 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3006 |
15822 | 3007 static int purple_parse_searchreply(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3008 { |
15822 | 3009 PurpleConnection *gc = od->gc; |
3010 PurpleNotifySearchResults *results; | |
3011 PurpleNotifySearchColumn *column; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3012 gchar *secondary; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3013 int i, num; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3014 va_list ap; |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3015 char *email, *usernames; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3016 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3017 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3018 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3019 num = va_arg(ap, int); |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3020 usernames = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3021 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3022 |
15822 | 3023 results = purple_notify_searchresults_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3024 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3025 if (results == NULL) { |
15822 | 3026 purple_debug_error("oscar", "purple_parse_searchreply: " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3027 "Unable to display the search results.\n"); |
15822 | 3028 purple_notify_error(gc, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3029 _("Unable to display the search results."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3030 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3031 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3032 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3033 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3034 secondary = g_strdup_printf( |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3035 dngettext(PACKAGE, "The following username is associated with %s", |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3036 "The following usernames are associated with %s", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3037 num), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3038 email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3039 |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3040 column = purple_notify_searchresults_column_new(_("Username")); |
15822 | 3041 purple_notify_searchresults_column_add(results, column); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3042 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3043 for (i = 0; i < num; i++) { |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3044 GList *row; |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3045 row = g_list_append(NULL, g_strdup(&usernames[i * (MAXSNLEN + 1)])); |
15822 | 3046 purple_notify_searchresults_row_add(results, row); |
3047 } | |
3048 purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_ADD, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3049 oscar_searchresults_add_buddy_cb); |
15822 | 3050 purple_notify_searchresults(gc, NULL, NULL, secondary, results, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3051 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3052 g_free(secondary); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3053 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3054 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3055 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3056 |
15822 | 3057 static int purple_parse_searcherror(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3058 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3059 char *email; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3060 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3061 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3062 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3063 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3064 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3065 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
3066 buf = g_strdup_printf(_("No results found for email address %s"), email); |
15822 | 3067 purple_notify_error(od->gc, NULL, buf, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3068 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3069 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3070 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3071 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3072 |
15822 | 3073 static int purple_account_confirm(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3074 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3075 guint16 status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3076 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3077 char msg[256]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3078 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3079 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3080 status = (guint16) va_arg(ap, unsigned int); /* status code of confirmation request */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3081 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3082 |
15822 | 3083 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3084 "account confirmation returned status 0x%04x (%s)\n", status, |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
3085 status ? "unknown" : "email sent"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3086 if (!status) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
3087 g_snprintf(msg, sizeof(msg), _("You should receive an email asking to confirm %s."), |
15822 | 3088 purple_account_get_username(purple_connection_get_account(gc))); |
3089 purple_notify_info(gc, NULL, _("Account Confirmation Requested"), msg); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3090 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3091 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3092 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3093 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3094 |
15822 | 3095 static int purple_info_change(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3096 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3097 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3098 guint16 perms, err; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3099 char *url, *bn, *email; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3100 int change; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3102 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3103 change = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3104 perms = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3105 err = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3106 url = va_arg(ap, char *); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3107 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3108 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3109 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3110 |
15822 | 3111 purple_debug_misc("oscar", |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3112 "account info: because of %s, perms=0x%04x, err=0x%04x, url=%s, bn=%s, email=%s\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3113 change ? "change" : "request", perms, err, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3114 (url != NULL) ? url : "(null)", |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3115 (bn != NULL) ? bn : "(null)", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3116 (email != NULL) ? email : "(null)"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3117 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3118 if ((err > 0) && (url != NULL)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3119 char *dialog_msg; |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3120 |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3121 if (err == 0x0001) |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3122 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format username because the requested name differs from the original."), err); |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3123 else if (err == 0x0006) |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3124 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format username because it is invalid."), err); |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3125 else if (err == 0x00b) |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3126 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to format username because the requested name is too long."), err); |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3127 else if (err == 0x001d) |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
3128 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because there is already a request pending for this username."), err); |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3129 else if (err == 0x0021) |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
3130 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address has too many usernames associated with it."), err); |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3131 else if (err == 0x0023) |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
3132 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address is invalid."), err); |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3133 else |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3134 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unknown error."), err); |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3135 purple_notify_error(gc, NULL, |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
3136 _("Error Changing Account Info"), dialog_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3137 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3138 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3139 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3140 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3141 if (email != NULL) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
3142 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), |
15822 | 3143 purple_account_get_username(purple_connection_get_account(gc)), email); |
3144 purple_notify_info(gc, NULL, _("Account Info"), dialog_msg); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3145 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3146 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3147 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3148 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3149 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3150 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3151 void |
15822 | 3152 oscar_keepalive(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3153 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3154 OscarData *od; |
31315
04576947c4e0
Send keepalives for all types of network connections. Will hopefully
Mark Doliner <mark@kingant.net>
parents:
31245
diff
changeset
|
3155 GSList *l; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3156 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3157 od = purple_connection_get_protocol_data(gc); |
31315
04576947c4e0
Send keepalives for all types of network connections. Will hopefully
Mark Doliner <mark@kingant.net>
parents:
31245
diff
changeset
|
3158 for (l = od->oscar_connections; l; l = l->next) { |
04576947c4e0
Send keepalives for all types of network connections. Will hopefully
Mark Doliner <mark@kingant.net>
parents:
31245
diff
changeset
|
3159 flap_connection_send_keepalive(od, l->data); |
04576947c4e0
Send keepalives for all types of network connections. Will hopefully
Mark Doliner <mark@kingant.net>
parents:
31245
diff
changeset
|
3160 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3161 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3163 unsigned int |
15822 | 3164 oscar_send_typing(PurpleConnection *gc, const char *name, PurpleTypingState state) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3165 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3166 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3167 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3168 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3169 od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3170 conn = peer_connection_find_by_type(od, name, OSCAR_CAPABILITY_DIRECTIM); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3171 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3172 if ((conn != NULL) && (conn->ready)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3173 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3174 peer_odc_send_typing(conn, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3175 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3176 else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3177 /* Don't send if this turkey is in our deny list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3178 GSList *list; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3179 for (list=gc->account->deny; (list && oscar_util_name_compare(name, list->data)); list=list->next); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3180 if (!list) { |
15822 | 3181 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(gc->account, name)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3182 if (bi && bi->typingnot) { |
15822 | 3183 if (state == PURPLE_TYPING) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3184 aim_im_sendmtn(od, 0x0001, name, 0x0002); |
15822 | 3185 else if (state == PURPLE_TYPED) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3186 aim_im_sendmtn(od, 0x0001, name, 0x0001); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3187 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3188 aim_im_sendmtn(od, 0x0001, name, 0x0000); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3189 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3190 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3191 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3192 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3193 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3194 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3195 /* TODO: Move this into odc.c! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3196 static void |
15822 | 3197 purple_odc_send_im(PeerConnection *conn, const char *message, PurpleMessageFlags imflags) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3198 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3199 GString *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3200 GString *data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3201 gchar *tmp; |
30385
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
3202 gsize tmplen; |
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
3203 guint16 charset; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3204 GData *attribs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3205 const char *start, *end, *last; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3206 int oscar_id = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3207 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3208 msg = g_string_new("<HTML><BODY>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3209 data = g_string_new("<BINARY>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3210 last = message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3211 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3212 /* for each valid IMG tag... */ |
15822 | 3213 while (last && *last && purple_markup_find_tag("img", last, &start, &end, &attribs)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3214 { |
15822 | 3215 PurpleStoredImage *image = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3216 const char *id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3217 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3218 if (start - last) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3219 g_string_append_len(msg, last, start - last); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3220 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3221 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3222 id = g_datalist_get_data(&attribs, "id"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3223 |
15822 | 3224 /* ... if it refers to a valid purple image ... */ |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16330
diff
changeset
|
3225 if (id && (image = purple_imgstore_find_by_id(atoi(id)))) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3226 /* ... append the message from start to the tag ... */ |
15822 | 3227 unsigned long size = purple_imgstore_get_size(image); |
3228 const char *filename = purple_imgstore_get_filename(image); | |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16330
diff
changeset
|
3229 gconstpointer imgdata = purple_imgstore_get_data(image); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3230 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3231 oscar_id++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3232 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3233 /* ... insert a new img tag with the oscar id ... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3234 if (filename) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3235 g_string_append_printf(msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3236 "<IMG SRC=\"%s\" ID=\"%d\" DATASIZE=\"%lu\">", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3237 filename, oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3238 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3239 g_string_append_printf(msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3240 "<IMG ID=\"%d\" DATASIZE=\"%lu\">", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3241 oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3242 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3243 /* ... and append the data to the binary section ... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3244 g_string_append_printf(data, "<DATA ID=\"%d\" SIZE=\"%lu\">", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3245 oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3246 g_string_append_len(data, imgdata, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3247 g_string_append(data, "</DATA>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3248 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3249 /* If the tag is invalid, skip it, thus no else here */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3251 g_datalist_clear(&attribs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3252 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3253 /* continue from the end of the tag */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3254 last = end + 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3255 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3256 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3257 /* append any remaining message data */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3258 if (last && *last) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3259 g_string_append(msg, last); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3260 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3261 g_string_append(msg, "</BODY></HTML>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3263 /* Convert the message to a good encoding */ |
30394 | 3264 tmp = oscar_encode_im(msg->str, &tmplen, &charset, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3265 g_string_free(msg, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3266 msg = g_string_new_len(tmp, tmplen); |
17127
9c8172ddc72d
Fix a leak of the string in each Direct IM message, reported by jas8522 in AdiumTicket:#6982
Evan Schoenberg <evan.s@dreskin.net>
parents:
16945
diff
changeset
|
3267 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3268 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3269 /* Append any binary data that we may have */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3270 if (oscar_id) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3271 msg = g_string_append_len(msg, data->str, data->len); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3272 msg = g_string_append(msg, "</BINARY>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3273 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3274 g_string_free(data, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3275 |
28611
8a90bd0a3b79
Plucked d2a1d52b3bbf29baa53b9ddaa635d50b6332064f from im.pidgin.adium
Evan Schoenberg <evan.s@dreskin.net>
parents:
28509
diff
changeset
|
3276 purple_debug_info("oscar", "sending direct IM %s using charset %i", msg->str, charset); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31041
diff
changeset
|
3277 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
3278 peer_odc_send_im(conn, msg->str, msg->len, charset, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
3279 imflags & PURPLE_MESSAGE_AUTO_RESP); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3280 g_string_free(msg, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3281 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3282 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3283 int |
15822 | 3284 oscar_send_im(PurpleConnection *gc, const char *name, const char *message, PurpleMessageFlags imflags) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3285 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3286 OscarData *od; |
15822 | 3287 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3288 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3289 int ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3290 char *tmp1, *tmp2; |
22352
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3291 gboolean is_sms, is_html; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3292 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3293 od = purple_connection_get_protocol_data(gc); |
15822 | 3294 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3295 ret = 0; |
15822 | 3296 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3297 is_sms = oscar_util_valid_name_sms(name); |
22352
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3298 |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3299 if (od->icq && is_sms) { |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3300 /* |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3301 * We're sending to a phone number and this is ICQ, |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3302 * so send the message as an SMS using aim_icq_sendsms() |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3303 */ |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3304 int ret; |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3305 purple_debug_info("oscar", "Sending SMS to %s.\n", name); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3306 ret = aim_icq_sendsms(od, name, message, purple_account_get_username(account)); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3307 return (ret >= 0 ? 1 : ret); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3308 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3309 |
15822 | 3310 if (imflags & PURPLE_MESSAGE_AUTO_RESP) |
30361
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30359
diff
changeset
|
3311 tmp1 = oscar_util_format_string(message, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3312 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3313 tmp1 = g_strdup(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3314 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3315 conn = peer_connection_find_by_type(od, name, OSCAR_CAPABILITY_DIRECTIM); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3316 if ((conn != NULL) && (conn->ready)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3317 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3318 /* If we're directly connected, send a direct IM */ |
28768
4cb8d0fcfd2f
oscar: Add '\n' to a debug message missing it.
Paul Aurich <paul@darkrain42.org>
parents:
28748
diff
changeset
|
3319 purple_debug_info("oscar", "Sending direct IM with flags %i\n", imflags); |
15822 | 3320 purple_odc_send_im(conn, tmp1, imflags); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3321 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3322 struct buddyinfo *bi; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3323 struct aim_sendimext_args args; |
15822 | 3324 PurpleConversation *conv; |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3325 PurpleStoredImage *img; |
22352
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3326 PurpleBuddy *buddy; |
15822 | 3327 |
3328 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, account); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3329 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3330 if (strstr(tmp1, "<IMG ")) |
15822 | 3331 purple_conversation_write(conv, "", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3332 _("Your IM Image was not sent. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3333 "You must be Direct Connected to send IM Images."), |
15822 | 3334 PURPLE_MESSAGE_ERROR, time(NULL)); |
3335 | |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3336 buddy = purple_find_buddy(account, name); |
22352
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3337 |
15822 | 3338 bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, name)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3339 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3340 bi = g_new0(struct buddyinfo, 1); |
15822 | 3341 g_hash_table_insert(od->buddyinfo, g_strdup(purple_normalize(account, name)), bi); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3342 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3343 |
30385
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
3344 args.flags = 0; |
22352
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3345 |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3346 if (!is_sms && (!buddy || !PURPLE_BUDDY_IS_ONLINE(buddy))) |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3347 args.flags |= AIM_IMFLAGS_OFFLINE; |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
3348 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3349 if (od->icq) { |
29733
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
29732
diff
changeset
|
3350 args.features = features_icq; |
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
29732
diff
changeset
|
3351 args.featureslen = sizeof(features_icq); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3352 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3353 args.features = features_aim; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3354 args.featureslen = sizeof(features_aim); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3355 |
15822 | 3356 if (imflags & PURPLE_MESSAGE_AUTO_RESP) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3357 args.flags |= AIM_IMFLAGS_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3358 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3359 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3360 if (bi->ico_need) { |
15822 | 3361 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3362 "Sending buddy icon request with message\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3363 args.flags |= AIM_IMFLAGS_BUDDYREQ; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3364 bi->ico_need = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3365 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3366 |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3367 img = purple_buddy_icons_find_account_icon(account); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3368 if (img) { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3369 gconstpointer data = purple_imgstore_get_data(img); |
29610 | 3370 args.iconlen = purple_imgstore_get_size(img); |
3371 args.iconsum = aimutil_iconsum(data, args.iconlen); | |
16613
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
3372 args.iconstamp = purple_buddy_icons_get_account_icon_timestamp(account); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3373 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3374 if ((args.iconlen != bi->ico_me_len) || (args.iconsum != bi->ico_me_csum) || (args.iconstamp != bi->ico_me_time)) { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3375 bi->ico_informed = FALSE; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3376 bi->ico_sent = FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3377 } |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3378 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3379 /* |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3380 * TODO: |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3381 * For some reason sending our icon to people only works |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3382 * when we're the ones who initiated the conversation. If |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3383 * the other person sends the first IM then they never get |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3384 * the icon. We should fix that. |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3385 */ |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3386 if (!bi->ico_informed) { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3387 purple_debug_info("oscar", |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3388 "Claiming to have a buddy icon\n"); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3389 args.flags |= AIM_IMFLAGS_HASICON; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3390 bi->ico_me_len = args.iconlen; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3391 bi->ico_me_csum = args.iconsum; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3392 bi->ico_me_time = args.iconstamp; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3393 bi->ico_informed = TRUE; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3394 } |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3395 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3396 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3397 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3398 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3399 args.destbn = name; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3400 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3401 if (oscar_util_valid_name_sms(name)) { |
29733
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
29732
diff
changeset
|
3402 /* Messaging an SMS (mobile) user--strip HTML */ |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
16063
diff
changeset
|
3403 tmp2 = purple_markup_strip_html(tmp1); |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3404 is_html = FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3405 } else { |
30146
17d5518c5cad
Copy the third hunk from 3c30f64efedafc379b6536852bbb3b6ef5f1f6c9 to trunk
Mark Doliner <mark@kingant.net>
parents:
29986
diff
changeset
|
3406 /* ICQ 6 wants its HTML wrapped in these tags. Oblige it. */ |
17d5518c5cad
Copy the third hunk from 3c30f64efedafc379b6536852bbb3b6ef5f1f6c9 to trunk
Mark Doliner <mark@kingant.net>
parents:
29986
diff
changeset
|
3407 tmp2 = g_strdup_printf("<HTML><BODY>%s</BODY></HTML>", tmp1); |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3408 is_html = TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3409 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3410 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3411 tmp1 = tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3412 |
30394 | 3413 args.msg = oscar_encode_im(tmp1, &args.msglen, &args.charset, NULL); |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3414 if (is_html && (args.msglen > MAXMSGLEN)) { |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3415 /* If the length was too long, try stripping the HTML and then running it back through |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3416 * purple_strdup_withhtml() and the encoding process. The result may be shorter. */ |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3417 g_free((char *)args.msg); |
23267 | 3418 |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3419 tmp2 = purple_markup_strip_html(tmp1); |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3420 g_free(tmp1); |
18598
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3421 |
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3422 /* re-escape the entities */ |
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3423 tmp1 = g_markup_escape_text(tmp2, -1); |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3424 g_free(tmp2); |
23267 | 3425 |
18598
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3426 tmp2 = purple_strdup_withhtml(tmp1); |
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3427 g_free(tmp1); |
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3428 tmp1 = tmp2; |
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3429 |
30394 | 3430 args.msg = oscar_encode_im(tmp1, &args.msglen, &args.charset, NULL); |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19642
diff
changeset
|
3431 purple_debug_info("oscar", "Sending %s as %s because the original was too long.\n", |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3432 message, (char *)args.msg); |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3433 } |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
3434 |
30385
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
3435 purple_debug_info("oscar", "Sending IM, charset=0x%04hx, length=%" G_GSIZE_FORMAT "\n", args.charset, args.msglen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3436 ret = aim_im_sendch1_ext(od, &args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3437 g_free((char *)args.msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3438 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3439 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3440 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3441 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3442 if (ret >= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3443 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3444 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3445 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3446 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3447 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3448 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3449 * As of 26 June 2006, ICQ users can request AIM info from |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3450 * everyone, and can request ICQ info from ICQ users, and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3451 * AIM users can only request AIM info. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3452 */ |
15822 | 3453 void oscar_get_info(PurpleConnection *gc, const char *name) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3454 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3455 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3456 if (od->icq && oscar_util_valid_name_icq(name)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3457 aim_icq_getallinfo(od, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3458 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3459 aim_locate_getinfoshort(od, name, 0x00000003); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3460 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3461 |
15822 | 3462 void oscar_set_idle(PurpleConnection *gc, int time) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3463 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3464 aim_srv_setidle(od, time); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3465 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3466 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3467 void |
15822 | 3468 oscar_set_info(PurpleConnection *gc, const char *rawinfo) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3469 { |
15822 | 3470 PurpleAccount *account; |
3471 PurpleStatus *status; | |
3472 | |
3473 account = purple_connection_get_account(gc); | |
3474 status = purple_account_get_active_status(account); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3475 oscar_set_info_and_status(account, TRUE, rawinfo, FALSE, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3476 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3477 |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3478 static guint32 |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3479 oscar_get_extended_status(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3480 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3481 OscarData *od; |
15822 | 3482 PurpleAccount *account; |
3483 PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3484 const gchar *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3485 guint32 data = 0x00000000; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3486 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3487 od = purple_connection_get_protocol_data(gc); |
15822 | 3488 account = purple_connection_get_account(gc); |
3489 status = purple_account_get_active_status(account); | |
3490 status_id = purple_status_get_id(status); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3491 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3492 data |= AIM_ICQ_STATE_HIDEIP; |
15822 | 3493 if (purple_account_get_bool(account, "web_aware", OSCAR_DEFAULT_WEB_AWARE)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3494 data |= AIM_ICQ_STATE_WEBAWARE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3495 |
17561
3bc25e19ce1c
wabz pointed out that this string comparision was being done twice. I
Mark Doliner <mark@kingant.net>
parents:
17450
diff
changeset
|
3496 if (!strcmp(status_id, OSCAR_STATUS_ID_AVAILABLE)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3497 data |= AIM_ICQ_STATE_NORMAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3498 else if (!strcmp(status_id, OSCAR_STATUS_ID_AWAY)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3499 data |= AIM_ICQ_STATE_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3500 else if (!strcmp(status_id, OSCAR_STATUS_ID_DND)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3501 data |= AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3502 else if (!strcmp(status_id, OSCAR_STATUS_ID_NA)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3503 data |= AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3504 else if (!strcmp(status_id, OSCAR_STATUS_ID_OCCUPIED)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3505 data |= AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3506 else if (!strcmp(status_id, OSCAR_STATUS_ID_FREE4CHAT)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3507 data |= AIM_ICQ_STATE_CHAT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3508 else if (!strcmp(status_id, OSCAR_STATUS_ID_INVISIBLE)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3509 data |= AIM_ICQ_STATE_INVISIBLE; |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3510 else if (!strcmp(status_id, OSCAR_STATUS_ID_EVIL)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3511 data |= AIM_ICQ_STATE_EVIL; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3512 else if (!strcmp(status_id, OSCAR_STATUS_ID_DEPRESSION)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3513 data |= AIM_ICQ_STATE_DEPRESSION; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3514 else if (!strcmp(status_id, OSCAR_STATUS_ID_ATWORK)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3515 data |= AIM_ICQ_STATE_ATWORK; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3516 else if (!strcmp(status_id, OSCAR_STATUS_ID_ATHOME)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3517 data |= AIM_ICQ_STATE_ATHOME; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3518 else if (!strcmp(status_id, OSCAR_STATUS_ID_LUNCH)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
3519 data |= AIM_ICQ_STATE_LUNCH; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3520 else if (!strcmp(status_id, OSCAR_STATUS_ID_CUSTOM)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3521 data |= AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3522 |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3523 return data; |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3524 } |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3525 |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3526 static void |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3527 oscar_set_extended_status(PurpleConnection *gc) |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3528 { |
30371
1a81e5b64779
Adium guys need the itmsurl stuff, which I erroneously removed
ivan.komarov@soc.pidgin.im
parents:
30370
diff
changeset
|
3529 aim_srv_setextrainfo(purple_connection_get_protocol_data(gc), TRUE, oscar_get_extended_status(gc), FALSE, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3530 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3531 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3532 static void |
15822 | 3533 oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, |
3534 gboolean setstatus, PurpleStatus *status) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3535 { |
15822 | 3536 PurpleConnection *gc = purple_account_get_connection(account); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3537 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 3538 PurpleStatusType *status_type; |
3539 PurpleStatusPrimitive primitive; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3540 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3541 char *info_encoding = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3542 char *info = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3543 gsize infolen = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3544 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3545 char *away_encoding = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3546 char *away = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3547 gsize awaylen = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3548 |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3549 char *status_text = NULL; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3550 const char *itmsurl = NULL; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3551 |
15822 | 3552 status_type = purple_status_get_type(status); |
3553 primitive = purple_status_type_get_primitive(status_type); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3554 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3555 if (!setinfo) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3556 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3557 /* Do nothing! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3558 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3559 else if (od->rights.maxsiglen == 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3560 { |
15822 | 3561 purple_notify_warning(gc, NULL, _("Unable to set AIM profile."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3562 _("You have probably requested to set your " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3563 "profile before the login procedure completed. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3564 "Your profile remains unset; try setting it " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3565 "again when you are fully connected.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3566 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3567 else if (rawinfo != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3568 { |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3569 char *htmlinfo = purple_strdup_withhtml(rawinfo); |
30394 | 3570 info = oscar_encode_im(htmlinfo, &infolen, NULL, &info_encoding); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3571 g_free(htmlinfo); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3572 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3573 if (infolen > od->rights.maxsiglen) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3574 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3575 gchar *errstr; |
16063
fa8aeab4ca5a
Hopefully prevent libpurple causing problems for 3rd party UIs if they also
Stu Tomlinson <stu@nosnilmot.com>
parents:
16059
diff
changeset
|
3576 errstr = g_strdup_printf(dngettext(PACKAGE, "The maximum profile length of %d byte " |
16135 | 3577 "has been exceeded. It has been truncated for you.", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3578 "The maximum profile length of %d bytes " |
16135 | 3579 "has been exceeded. It has been truncated for you.", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3580 od->rights.maxsiglen), od->rights.maxsiglen); |
15822 | 3581 purple_notify_warning(gc, NULL, _("Profile too long."), errstr); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3582 g_free(errstr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3583 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3584 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3585 |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3586 if (setstatus) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3587 { |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3588 const char *status_html; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3589 |
15822 | 3590 status_html = purple_status_get_attr_string(status, "message"); |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3591 |
26178
37a3f30a8d80
fix a crash when changing to away without a status message
Richard Nelson <wabz@pidgin.im>
parents:
26173
diff
changeset
|
3592 if (status_html == NULL || primitive == PURPLE_STATUS_AVAILABLE || primitive == PURPLE_STATUS_INVISIBLE) |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3593 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3594 /* This is needed for us to un-set any previous away message. */ |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3595 away = g_strdup(""); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3596 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3597 else |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3598 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3599 gchar *linkified; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3600 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3601 /* We do this for icq too so that they work for old third party clients */ |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3602 linkified = purple_markup_linkify(status_html); |
30394 | 3603 away = oscar_encode_im(linkified, &awaylen, NULL, &away_encoding); |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3604 g_free(linkified); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3605 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3606 if (awaylen > od->rights.maxawaymsglen) |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3607 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3608 gchar *errstr; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3609 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3610 errstr = g_strdup_printf(dngettext(PACKAGE, "The maximum away message length of %d byte " |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3611 "has been exceeded. It has been truncated for you.", |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3612 "The maximum away message length of %d bytes " |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3613 "has been exceeded. It has been truncated for you.", |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3614 od->rights.maxawaymsglen), od->rights.maxawaymsglen); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3615 purple_notify_warning(gc, NULL, _("Away message too long."), errstr); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3616 g_free(errstr); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3617 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3618 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3619 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3620 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3621 aim_locate_setprofile(od, |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3622 info_encoding, info, MIN(infolen, od->rights.maxsiglen), |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3623 away_encoding, away, MIN(awaylen, od->rights.maxawaymsglen)); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3624 g_free(info); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3625 g_free(away); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3626 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3627 if (setstatus) |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3628 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3629 const char *status_html; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3630 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3631 status_html = purple_status_get_attr_string(status, "message"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3632 if (status_html != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3633 { |
15822 | 3634 status_text = purple_markup_strip_html(status_html); |
25416
8f544de62330
Patch to properly publish status messages for statuses other than Available.
Daniel Lj <dimmuxx@yahoo.se>
parents:
25391
diff
changeset
|
3635 /* If the status_text is longer than 251 characters then truncate it */ |
18774
88ad571744b4
Looks like AOL increased the length of available messages from 60
Mark Doliner <mark@kingant.net>
parents:
18755
diff
changeset
|
3636 if (strlen(status_text) > MAXAVAILMSGLEN) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3637 { |
18774
88ad571744b4
Looks like AOL increased the length of available messages from 60
Mark Doliner <mark@kingant.net>
parents:
18755
diff
changeset
|
3638 char *tmp = g_utf8_find_prev_char(status_text, &status_text[MAXAVAILMSGLEN - 2]); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3639 strcpy(tmp, "..."); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3640 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3641 } |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3642 |
15822 | 3643 itmsurl = purple_status_get_attr_string(status, "itmsurl"); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
31041
diff
changeset
|
3644 |
30371
1a81e5b64779
Adium guys need the itmsurl stuff, which I erroneously removed
ivan.komarov@soc.pidgin.im
parents:
30370
diff
changeset
|
3645 aim_srv_setextrainfo(od, TRUE, oscar_get_extended_status(gc), TRUE, status_text, itmsurl); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3646 g_free(status_text); |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
3647 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3648 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3649 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3650 static void |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3651 oscar_set_icq_permdeny(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3652 { |
15822 | 3653 PurpleConnection *gc = purple_account_get_connection(account); |
30367
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
3654 OscarData *od = purple_connection_get_protocol_data(gc); |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
3655 gboolean invisible = purple_account_is_status_active(account, OSCAR_STATUS_ID_INVISIBLE); |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
3656 |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
3657 /* |
30367
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
3658 * For ICQ the permit/deny setting controls who can see you |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
3659 * online. Mimicking the official client's behavior, we use PURPLE_PRIVACY_ALLOW_USERS |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
3660 * when our status is "invisible" and PURPLE_PRIVACY_DENY_USERS otherwise. |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
3661 * In the former case, we are visible only to buddies on our "permanently visible" list. |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3662 * In the latter, we are invisible only to buddies on our "permanently invisible" list. |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
3663 */ |
30367
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
3664 aim_ssi_setpermdeny(od, invisible ? PURPLE_PRIVACY_ALLOW_USERS : PURPLE_PRIVACY_DENY_USERS); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3665 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3666 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3667 void |
15822 | 3668 oscar_set_status(PurpleAccount *account, PurpleStatus *status) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3669 { |
28810
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
28772
diff
changeset
|
3670 PurpleConnection *pc; |
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
28772
diff
changeset
|
3671 OscarData *od; |
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
28772
diff
changeset
|
3672 |
15822 | 3673 purple_debug_info("oscar", "Set status to %s\n", purple_status_get_name(status)); |
3674 | |
31407
c446bf0b83d2
Fix unsetting your mood when "None" is selected. (#7431)
Mark Doliner <mark@kingant.net>
parents:
31401
diff
changeset
|
3675 /* Either setting a new status active or setting a status inactive. |
c446bf0b83d2
Fix unsetting your mood when "None" is selected. (#7431)
Mark Doliner <mark@kingant.net>
parents:
31401
diff
changeset
|
3676 * (Only possible for independent status (i.e. X-Status moods.) */ |
c446bf0b83d2
Fix unsetting your mood when "None" is selected. (#7431)
Mark Doliner <mark@kingant.net>
parents:
31401
diff
changeset
|
3677 if (!purple_status_is_active(status) && !purple_status_is_independent(status)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3678 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3679 |
15822 | 3680 if (!purple_account_is_connected(account)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3681 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3682 |
29460 | 3683 pc = purple_account_get_connection(account); |
3684 od = purple_connection_get_protocol_data(pc); | |
3685 | |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
3686 /* There's no need to do the stuff below for mood updates. */ |
29440
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29435
diff
changeset
|
3687 if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) { |
29460 | 3688 aim_locate_setcaps(od, purple_caps); |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
3689 return; |
29440
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29435
diff
changeset
|
3690 } |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
3691 |
30376
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
3692 if (od->icq) { |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
3693 /* Set visibility */ |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3694 oscar_set_icq_permdeny(account); |
30376
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
3695 } |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
3696 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3697 /* Set the AIM-style away message for both AIM and ICQ accounts */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3698 oscar_set_info_and_status(account, FALSE, NULL, TRUE, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3699 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3700 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3701 void |
31401
0cf50b0f7af4
Add invite message support to Oscar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31398
diff
changeset
|
3702 oscar_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, const char *msg) |
0cf50b0f7af4
Add invite message support to Oscar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31398
diff
changeset
|
3703 { |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3704 OscarData *od; |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3705 PurpleAccount *account; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3706 const char *bname, *gname; |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3707 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3708 od = purple_connection_get_protocol_data(gc); |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3709 account = purple_connection_get_account(gc); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3710 bname = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3711 gname = purple_group_get_name(group); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3712 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3713 if (!oscar_util_valid_name(bname)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3714 gchar *buf; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
3715 buf = g_strdup_printf(_("Unable to add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), bname); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3716 if (!purple_conv_present_error(bname, account, buf)) |
24431
75545fdf8944
String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents:
24372
diff
changeset
|
3717 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3718 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3719 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3720 /* Remove from local list */ |
15822 | 3721 purple_blist_remove_buddy(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3722 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3723 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3724 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3725 |
25238
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
3726 if (od->ssi.received_data) { |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3727 if (!aim_ssi_itemlist_finditem(&od->ssi.local, gname, bname, AIM_SSI_TYPE_BUDDY)) { |
25238
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
3728 purple_debug_info("oscar", |
26203 | 3729 "ssi: adding buddy %s to group %s\n", bname, gname); |
3730 aim_ssi_addbuddy(od, bname, gname, NULL, purple_buddy_get_alias_only(buddy), NULL, NULL, 0); | |
25238
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
3731 |
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
3732 /* Mobile users should always be online */ |
26203 | 3733 if (bname[0] == '+') { |
25983
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
3734 purple_prpl_got_user_status(account, bname, |
25238
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
3735 OSCAR_STATUS_ID_AVAILABLE, NULL); |
25983
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
3736 purple_prpl_got_user_status(account, bname, |
25238
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
3737 OSCAR_STATUS_ID_MOBILE, NULL); |
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
3738 } |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3739 } else if (aim_ssi_waitingforauth(&od->ssi.local, |
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3740 aim_ssi_itemlist_findparentname(&od->ssi.local, bname), |
25983
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
3741 bname)) { |
25238
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
3742 /* Not authorized -- Re-request authorization */ |
31401
0cf50b0f7af4
Add invite message support to Oscar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31398
diff
changeset
|
3743 oscar_auth_sendrequest(gc, bname, msg); |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3744 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3745 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3746 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3747 /* XXX - Should this be done from AIM accounts, as well? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3748 if (od->icq) |
30357
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30146
diff
changeset
|
3749 aim_icq_getalias(od, bname, FALSE, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3750 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3751 |
15822 | 3752 void oscar_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3753 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3754 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3755 if (od->ssi.received_data) { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3756 const char *gname = purple_group_get_name(group); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3757 const char *bname = purple_buddy_get_name(buddy); |
15822 | 3758 purple_debug_info("oscar", |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3759 "ssi: deleting buddy %s from group %s\n", bname, gname); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3760 aim_ssi_delbuddy(od, bname, gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3761 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3762 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3763 |
15822 | 3764 void oscar_move_buddy(PurpleConnection *gc, const char *name, const char *old_group, const char *new_group) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3765 OscarData *od = purple_connection_get_protocol_data(gc); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3766 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3767 if (od->ssi.received_data && strcmp(old_group, new_group)) { |
15822 | 3768 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3769 "ssi: moving buddy %s from group %s to group %s\n", name, old_group, new_group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3770 aim_ssi_movebuddy(od, old_group, new_group, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3771 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3772 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3773 |
15822 | 3774 void oscar_alias_buddy(PurpleConnection *gc, const char *name, const char *alias) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3775 OscarData *od = purple_connection_get_protocol_data(gc); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3776 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3777 if (od->ssi.received_data) { |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3778 char *gname = aim_ssi_itemlist_findparentname(&od->ssi.local, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3779 if (gname) { |
15822 | 3780 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3781 "ssi: changing the alias for buddy %s to %s\n", name, alias ? alias : "(none)"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3782 aim_ssi_aliasbuddy(od, gname, name, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3783 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3784 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3785 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3786 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3787 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3788 * FYI, the OSCAR SSI code removes empty groups automatically. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3789 */ |
15822 | 3790 void oscar_rename_group(PurpleConnection *gc, const char *old_name, PurpleGroup *group, GList *moved_buddies) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3791 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3792 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3793 if (od->ssi.received_data) { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3794 const char *gname = purple_group_get_name(group); |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3795 if (aim_ssi_itemlist_finditem(&od->ssi.local, gname, NULL, AIM_SSI_TYPE_GROUP)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3796 GList *cur, *groups = NULL; |
15822 | 3797 PurpleAccount *account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3798 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3799 /* Make a list of what the groups each buddy is in */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3800 for (cur = moved_buddies; cur != NULL; cur = cur->next) { |
15822 | 3801 PurpleBlistNode *node = cur->data; |
3802 /* node is PurpleBuddy, parent is a PurpleContact. | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3803 * We must go two levels up to get the Group */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3804 groups = g_list_append(groups, |
25799
8d562557ed6f
Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25798
diff
changeset
|
3805 purple_buddy_get_group((PurpleBuddy*)node)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3806 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3807 |
15822 | 3808 purple_account_remove_buddies(account, moved_buddies, groups); |
3809 purple_account_add_buddies(account, moved_buddies); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3810 g_list_free(groups); |
15822 | 3811 purple_debug_info("oscar", |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3812 "ssi: moved all buddies from group %s to %s\n", old_name, gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3813 } else { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3814 aim_ssi_rename_group(od, old_name, gname); |
15822 | 3815 purple_debug_info("oscar", |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
3816 "ssi: renamed group %s to %s\n", old_name, gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3817 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3818 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3819 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3820 |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3821 void oscar_remove_group(PurpleConnection *gc, PurpleGroup *group) |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3822 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3823 aim_ssi_delgroup(purple_connection_get_protocol_data(gc), purple_group_get_name(group)); |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3824 } |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3825 |
15822 | 3826 static gboolean purple_ssi_rerequestdata(gpointer data) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3827 OscarData *od = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3828 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3829 aim_ssi_reqdata(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3830 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3831 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3832 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3833 |
15822 | 3834 static int purple_ssi_parseerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3835 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3836 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3837 guint16 reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3838 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3839 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3840 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3841 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3842 |
15822 | 3843 purple_debug_error("oscar", "ssi: SNAC error %hu\n", reason); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3844 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3845 if (reason == 0x0005) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3846 if (od->getblisttimer > 0) |
15822 | 3847 purple_timeout_remove(od->getblisttimer); |
26173
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25977
diff
changeset
|
3848 else |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25977
diff
changeset
|
3849 /* We only show this error the first time it happens */ |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25977
diff
changeset
|
3850 purple_notify_error(gc, NULL, |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25977
diff
changeset
|
3851 _("Unable to Retrieve Buddy List"), |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25977
diff
changeset
|
3852 _("The AIM servers were temporarily unable to send " |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25977
diff
changeset
|
3853 "your buddy list. Your buddy list is not lost, and " |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25977
diff
changeset
|
3854 "will probably become available in a few minutes.")); |
26530
b87843de7c6a
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
26243
diff
changeset
|
3855 od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od); |
21014
0314cb293463
Return if we couldn't get our buddylist rather than trying to
Mark Doliner <mark@kingant.net>
parents:
21000
diff
changeset
|
3856 return 1; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3857 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3858 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3859 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3860 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3861 |
15822 | 3862 static int purple_ssi_parserights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3863 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3864 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3865 int numtypes; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3866 guint16 *maxitems; |
23715
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
3867 GString *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3868 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3869 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3870 numtypes = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3871 maxitems = va_arg(ap, guint16 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3872 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3873 |
23715
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
3874 msg = g_string_new("ssi rights:"); |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
3875 for (i=0; i<numtypes; i++) |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
3876 g_string_append_printf(msg, " max type 0x%04x=%hd,", i, maxitems[i]); |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
3877 g_string_append(msg, "\n"); |
24453
0320b4a33432
Backport the 'purple_debug_*(msg)' -> 'purple_debug_*("%s", msg);' fixes.
Richard Laager <rlaager@wiktel.com>
parents:
24450
diff
changeset
|
3878 purple_debug_misc("oscar", "%s", msg->str); |
23715
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23714
diff
changeset
|
3879 g_string_free(msg, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3880 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3881 if (numtypes >= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3882 od->rights.maxbuddies = maxitems[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3883 if (numtypes >= 1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3884 od->rights.maxgroups = maxitems[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3885 if (numtypes >= 2) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3886 od->rights.maxpermits = maxitems[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3887 if (numtypes >= 3) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3888 od->rights.maxdenies = maxitems[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3889 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3890 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3891 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3892 |
15822 | 3893 static int purple_ssi_parselist(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3894 { |
15822 | 3895 PurpleConnection *gc; |
3896 PurpleAccount *account; | |
3897 PurpleGroup *g; | |
3898 PurpleBuddy *b; | |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3899 GSList *cur, *next, *buddies; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3900 struct aim_ssi_item *curitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3901 guint32 tmp; |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
3902 PurpleStoredImage *img; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3903 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3904 guint16 fmtver, numitems; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3905 guint32 timestamp; |
30367
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
3906 guint16 deny_entry_type = aim_ssi_getdenyentrytype(od); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3907 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3908 gc = od->gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3909 od = purple_connection_get_protocol_data(gc); |
15822 | 3910 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3911 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3912 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3913 fmtver = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3914 numitems = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3915 timestamp = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3916 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3917 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3918 /* Don't attempt to re-request our buddy list later */ |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3919 if (od->getblisttimer != 0) { |
15822 | 3920 purple_timeout_remove(od->getblisttimer); |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3921 od->getblisttimer = 0; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3922 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3923 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3924 purple_debug_info("oscar", "ssi: syncing local list and server list\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3925 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3926 /* Clean the buddy list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3927 aim_ssi_cleanlist(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3928 |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3929 /*** Begin code for pruning buddies from local list if they're not in server list ***/ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3930 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3931 /* Buddies */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3932 cur = NULL; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3933 for (buddies = purple_find_buddies(account, NULL); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3934 buddies; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3935 buddies = g_slist_delete_link(buddies, buddies)) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3936 { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3937 PurpleGroup *g; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3938 const char *gname; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3939 const char *bname; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3940 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3941 b = buddies->data; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3942 g = purple_buddy_get_group(b); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3943 gname = purple_group_get_name(g); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3944 bname = purple_buddy_get_name(b); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3945 |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3946 if (aim_ssi_itemlist_exists(&od->ssi.local, bname)) { |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3947 /* If the buddy is an ICQ user then load his nickname */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3948 const char *servernick = purple_blist_node_get_string((PurpleBlistNode*)b, "servernick"); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3949 char *alias; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3950 const char *balias; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3951 if (servernick) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3952 serv_got_alias(gc, bname, servernick); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3953 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3954 /* Store local alias on server */ |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3955 alias = aim_ssi_getalias(&od->ssi.local, gname, bname); |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3956 balias = purple_buddy_get_local_buddy_alias(b); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3957 if (!alias && balias && *balias) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3958 aim_ssi_aliasbuddy(od, gname, bname, balias); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3959 g_free(alias); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3960 } else { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3961 purple_debug_info("oscar", |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3962 "ssi: removing buddy %s from local list\n", bname); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3963 /* Queue the buddy for removal from the local list */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3964 cur = g_slist_prepend(cur, b); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3965 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3966 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3967 while (cur != NULL) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3968 purple_blist_remove_buddy(cur->data); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3969 cur = g_slist_delete_link(cur, cur); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3970 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3971 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3972 /* Permit list (ICQ doesn't have one) */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3973 if (!od->icq) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3974 next = account->permit; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3975 while (next != NULL) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3976 cur = next; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3977 next = next->next; |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3978 if (!aim_ssi_itemlist_finditem(&od->ssi.local, NULL, cur->data, AIM_SSI_TYPE_PERMIT)) { |
26764
0e99b80b54c6
Make purple_find_buddies(account, NULL) O(# buddies in the account) and rewrite purple_ssi_parselist to take advantage of said efficiency.
hanzz@soc.pidgin.im
parents:
26530
diff
changeset
|
3979 purple_debug_info("oscar", |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3980 "ssi: removing permit %s from local list\n", (const char *)cur->data); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3981 purple_privacy_permit_remove(account, cur->data, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3982 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3983 } |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3984 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3985 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3986 /* Deny list */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3987 next = account->deny; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3988 while (next != NULL) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3989 cur = next; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3990 next = next->next; |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3991 if (!aim_ssi_itemlist_finditem(&od->ssi.local, NULL, cur->data, deny_entry_type)) { |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3992 purple_debug_info("oscar", |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3993 "ssi: removing deny %s from local list\n", (const char *)cur->data); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3994 purple_privacy_deny_remove(account, cur->data, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3995 } |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3996 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3997 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
3998 /* Presence settings (idle time visibility) */ |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
3999 tmp = aim_ssi_getpresence(&od->ssi.local); |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4000 if (tmp != 0xFFFFFFFF) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4001 const char *idle_reporting_pref; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4002 gboolean report_idle; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4003 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4004 idle_reporting_pref = purple_prefs_get_string("/purple/away/idle_reporting"); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4005 report_idle = strcmp(idle_reporting_pref, "none") != 0; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4006 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4007 if (report_idle) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4008 aim_ssi_setpresence(od, tmp | AIM_SSI_PRESENCE_FLAG_SHOWIDLE); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4009 else |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4010 aim_ssi_setpresence(od, tmp & ~AIM_SSI_PRESENCE_FLAG_SHOWIDLE); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4011 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4012 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4013 /*** End code for pruning buddies from local list ***/ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4014 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4015 /*** Begin code for adding from server list to local list ***/ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4016 |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4017 for (curitem=od->ssi.local.data; curitem; curitem=curitem->next) { |
31245
6b2b8cc8e7ae
OOH! I think I found the cause of a bug! I changed this function in revision
Mark Doliner <mark@kingant.net>
parents:
31244
diff
changeset
|
4018 if (curitem->name && !g_utf8_validate(curitem->name, -1, NULL)) { |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4019 /* Got node with invalid UTF-8 in the name. Skip it. */ |
31245
6b2b8cc8e7ae
OOH! I think I found the cause of a bug! I changed this function in revision
Mark Doliner <mark@kingant.net>
parents:
31244
diff
changeset
|
4020 purple_debug_warning("oscar", "ssi: server list contains item of " |
6b2b8cc8e7ae
OOH! I think I found the cause of a bug! I changed this function in revision
Mark Doliner <mark@kingant.net>
parents:
31244
diff
changeset
|
4021 "type 0x%04hhx with a non-utf8 name\n", curitem->type); |
6b2b8cc8e7ae
OOH! I think I found the cause of a bug! I changed this function in revision
Mark Doliner <mark@kingant.net>
parents:
31244
diff
changeset
|
4022 continue; |
6b2b8cc8e7ae
OOH! I think I found the cause of a bug! I changed this function in revision
Mark Doliner <mark@kingant.net>
parents:
31244
diff
changeset
|
4023 } |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4024 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4025 switch (curitem->type) { |
28489 | 4026 case AIM_SSI_TYPE_BUDDY: { /* Buddy */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4027 if (curitem->name) { |
22425
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
4028 struct aim_ssi_item *groupitem; |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
4029 char *gname, *gname_utf8, *alias, *alias_utf8; |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
4030 |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4031 groupitem = aim_ssi_itemlist_find(&od->ssi.local, curitem->gid, 0x0000); |
22425
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
4032 gname = groupitem ? groupitem->name : NULL; |
30401
a6511abec788
A couple of refactorings related to oscar_utf8_try_convert().
ivan.komarov@soc.pidgin.im
parents:
30399
diff
changeset
|
4033 gname_utf8 = oscar_utf8_try_convert(account, od, gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4034 |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
4035 g = purple_find_group(gname_utf8 ? gname_utf8 : _("Orphans")); |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
4036 if (g == NULL) { |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
4037 g = purple_group_new(gname_utf8 ? gname_utf8 : _("Orphans")); |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
4038 purple_blist_add_group(g, NULL); |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
4039 } |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
4040 |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4041 alias = aim_ssi_getalias_from_item(curitem); |
30401
a6511abec788
A couple of refactorings related to oscar_utf8_try_convert().
ivan.komarov@soc.pidgin.im
parents:
30399
diff
changeset
|
4042 alias_utf8 = oscar_utf8_try_convert(account, od, alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4043 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4044 b = purple_find_buddy_in_group(account, curitem->name, g); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4045 if (b) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4046 /* Get server stored alias */ |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4047 purple_blist_alias_buddy(b, alias_utf8); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4048 } else { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4049 b = purple_buddy_new(account, curitem->name, alias_utf8); |
15822 | 4050 |
4051 purple_debug_info("oscar", | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4052 "ssi: adding buddy %s to group %s to local list\n", curitem->name, gname); |
15822 | 4053 purple_blist_add_buddy(b, NULL, g, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4054 } |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4055 |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4056 /* Mobile users should always be online */ |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4057 if (curitem->name[0] == '+') { |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4058 purple_prpl_got_user_status(account, |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4059 purple_buddy_get_name(b), |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4060 OSCAR_STATUS_ID_AVAILABLE, NULL); |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4061 purple_prpl_got_user_status(account, |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4062 purple_buddy_get_name(b), |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4063 OSCAR_STATUS_ID_MOBILE, NULL); |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4064 } |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4065 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4066 g_free(gname_utf8); |
31614
8b2fa46cdfd5
oscar: Fix the leak of 'alias' in this function
Paul Aurich <paul@darkrain42.org>
parents:
31407
diff
changeset
|
4067 g_free(alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4068 g_free(alias_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4069 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4070 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4071 |
28489 | 4072 case AIM_SSI_TYPE_GROUP: { /* Group */ |
31244
3fe2bd895946
There is code above these lines, just before the start of the switch(),
Mark Doliner <mark@kingant.net>
parents:
31205
diff
changeset
|
4073 if (curitem->name != NULL && purple_find_group(curitem->name) == NULL) { |
3fe2bd895946
There is code above these lines, just before the start of the switch(),
Mark Doliner <mark@kingant.net>
parents:
31205
diff
changeset
|
4074 g = purple_group_new(curitem->name); |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
4075 purple_blist_add_group(g, NULL); |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
4076 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4077 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4078 |
30367
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
4079 case AIM_SSI_TYPE_PERMIT: { /* Permit buddy (unless we're on ICQ) */ |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
4080 if (!od->icq && curitem->name) { |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4081 for (cur = account->permit; (cur && oscar_util_name_compare(curitem->name, cur->data)); cur = cur->next); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4082 if (!cur) { |
15822 | 4083 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4084 "ssi: adding permit buddy %s to local list\n", curitem->name); |
15822 | 4085 purple_privacy_permit_add(account, curitem->name, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4086 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4087 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4088 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4089 |
30367
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
4090 case AIM_SSI_TYPE_ICQDENY: |
28489 | 4091 case AIM_SSI_TYPE_DENY: { /* Deny buddy */ |
30367
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30366
diff
changeset
|
4092 if (curitem->type == deny_entry_type && curitem->name) { |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4093 for (cur = account->deny; (cur && oscar_util_name_compare(curitem->name, cur->data)); cur = cur->next); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4094 if (!cur) { |
15822 | 4095 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4096 "ssi: adding deny buddy %s to local list\n", curitem->name); |
15822 | 4097 purple_privacy_deny_add(account, curitem->name, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4098 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4099 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4100 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4101 |
28489 | 4102 case AIM_SSI_TYPE_PDINFO: { /* Permit/deny setting */ |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4103 /* |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4104 * We don't inherit the permit/deny setting from the server |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4105 * for ICQ because, for ICQ, this setting controls who can |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4106 * see your online status when you are invisible. Thus it is |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4107 * a part of your status and not really related to blocking. |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4108 */ |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4109 if (!od->icq && curitem->data) { |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4110 guint8 perm_deny = aim_ssi_getpermdeny(&od->ssi.local); |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4111 if (perm_deny != 0 && perm_deny != account->perm_deny) |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4112 { |
15822 | 4113 purple_debug_info("oscar", |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4114 "ssi: changing permdeny from %d to %hhu\n", account->perm_deny, perm_deny); |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4115 account->perm_deny = perm_deny; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4116 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4117 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4118 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4119 |
28489 | 4120 case AIM_SSI_TYPE_PRESENCEPREFS: { /* Presence setting */ |
15822 | 4121 /* We don't want to change Purple's setting because it applies to all accounts */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4122 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4123 } /* End of switch on curitem->type */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4124 } /* End of for loop */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4125 |
30377
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4126 /*** End code for adding from server list to local list ***/ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30376
diff
changeset
|
4127 |
30376
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
4128 if (od->icq) { |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
4129 oscar_set_icq_permdeny(account); |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
4130 } else { |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
4131 oscar_set_aim_permdeny(gc); |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
4132 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4134 /* Activate SSI */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4135 /* Sending the enable causes other people to be able to see you, and you to see them */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4136 /* Make sure your privacy setting/invisibility is set how you want it before this! */ |
15822 | 4137 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4138 "ssi: activating server-stored buddy list\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4139 aim_ssi_enable(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4140 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4141 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4142 * Make sure our server-stored icon is updated correctly in |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4143 * the event that the local user set a new icon while this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4144 * account was offline. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4145 */ |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
4146 img = purple_buddy_icons_find_account_icon(account); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
4147 oscar_set_icon(gc, img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
4148 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4149 |
28388
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4150 /* |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4151 * If we've already received our bos rights then we're not waiting on |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4152 * anything else, so send the server clientready. |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4153 */ |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4154 if (od->bos.have_rights) { |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4155 aim_srv_clientready(od, conn); |
28506
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28504
diff
changeset
|
4156 |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28504
diff
changeset
|
4157 /* Request offline messages for AIM and ICQ */ |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28504
diff
changeset
|
4158 aim_im_reqofflinemsgs(od); |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28504
diff
changeset
|
4159 |
28388
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4160 purple_connection_set_state(gc, PURPLE_CONNECTED); |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4161 } |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28232
diff
changeset
|
4162 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4163 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4164 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4165 |
15822 | 4166 static int purple_ssi_parseack(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4167 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4168 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4169 struct aim_ssi_tmp *retval; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4170 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4171 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4172 retval = va_arg(ap, struct aim_ssi_tmp *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4173 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4174 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4175 while (retval) { |
15822 | 4176 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4177 "ssi: status is 0x%04hx for a 0x%04hx action with name %s\n", retval->ack, retval->action, retval->item ? (retval->item->name ? retval->item->name : "no name") : "no item"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4178 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4179 if (retval->ack != 0xffff) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4180 switch (retval->ack) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4181 case 0x0000: { /* added successfully */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4182 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4183 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4184 case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4185 gchar *buf; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
4186 buf = g_strdup_printf(_("Unable to add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); |
15822 | 4187 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) |
24431
75545fdf8944
String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents:
24372
diff
changeset
|
4188 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4189 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4190 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4191 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4192 case 0x000e: { /* buddy requires authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4193 if ((retval->action == SNAC_SUBTYPE_FEEDBAG_ADD) && (retval->name)) |
31401
0cf50b0f7af4
Add invite message support to Oscar.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31398
diff
changeset
|
4194 oscar_auth_sendrequest(gc, retval->name, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4195 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4196 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4197 default: { /* La la la */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4198 gchar *buf; |
15822 | 4199 purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
4200 buf = g_strdup_printf(_("Unable to add the buddy %s for an unknown reason."), |
18278
c3d5b91be081
Get rid of the portion of this error message that says "The most
Mark Doliner <mark@kingant.net>
parents:
18207
diff
changeset
|
4201 (retval->name ? retval->name : _("(no name)"))); |
15822 | 4202 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) |
24431
75545fdf8944
String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents:
24372
diff
changeset
|
4203 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4204 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4205 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4206 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4207 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4208 retval = retval->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4209 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4210 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4211 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4212 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4213 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4214 static int |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4215 purple_ssi_parseaddmod(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4216 { |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4217 PurpleConnection *gc; |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4218 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4219 char *gname, *gname_utf8, *alias, *alias_utf8; |
15822 | 4220 PurpleBuddy *b; |
4221 PurpleGroup *g; | |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4222 struct aim_ssi_item *ssi_item; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4223 va_list ap; |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4224 guint16 snac_subtype, type; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4225 const char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4226 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4227 gc = od->gc; |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4228 account = purple_connection_get_account(gc); |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4229 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4230 va_start(ap, fr); |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4231 snac_subtype = (guint16)va_arg(ap, int); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4232 type = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4233 name = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4234 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4235 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4236 if ((type != 0x0000) || (name == NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4237 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4238 |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4239 gname = aim_ssi_itemlist_findparentname(&od->ssi.local, name); |
28810
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
28772
diff
changeset
|
4240 gname_utf8 = gname ? oscar_utf8_try_convert(account, od, gname) : NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4241 |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4242 alias = aim_ssi_getalias(&od->ssi.local, gname, name); |
30401
a6511abec788
A couple of refactorings related to oscar_utf8_try_convert().
ivan.komarov@soc.pidgin.im
parents:
30399
diff
changeset
|
4243 alias_utf8 = oscar_utf8_try_convert(account, od, alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4244 g_free(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4245 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4246 b = purple_find_buddy(account, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4247 if (b) { |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4248 /* |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4249 * You're logged in somewhere else and you aliased one |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4250 * of your buddies, so update our local buddy list with |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4251 * the person's new alias. |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4252 */ |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4253 purple_blist_alias_buddy(b, alias_utf8); |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4254 } else if (snac_subtype == 0x0008) { |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4255 /* |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4256 * You're logged in somewhere else and you added a buddy to |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4257 * your server list, so add them to your local buddy list. |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4258 */ |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4259 b = purple_buddy_new(account, name, alias_utf8); |
15822 | 4260 |
4261 if (!(g = purple_find_group(gname_utf8 ? gname_utf8 : _("Orphans")))) { | |
4262 g = purple_group_new(gname_utf8 ? gname_utf8 : _("Orphans")); | |
4263 purple_blist_add_group(g, NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4264 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4265 |
15822 | 4266 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4267 "ssi: adding buddy %s to group %s to local list\n", name, gname_utf8 ? gname_utf8 : _("Orphans")); |
15822 | 4268 purple_blist_add_buddy(b, NULL, g, NULL); |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4269 |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4270 /* Mobile users should always be online */ |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4271 if (name[0] == '+') { |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4272 purple_prpl_got_user_status(account, |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4273 name, OSCAR_STATUS_ID_AVAILABLE, NULL); |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4274 purple_prpl_got_user_status(account, |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4275 name, OSCAR_STATUS_ID_MOBILE, NULL); |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4276 } |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4277 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4278 } |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4279 |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4280 ssi_item = aim_ssi_itemlist_finditem(&od->ssi.local, |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4281 gname, name, AIM_SSI_TYPE_BUDDY); |
25386
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
4282 if (ssi_item == NULL) |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4283 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4284 purple_debug_error("oscar", "purple_ssi_parseaddmod: " |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4285 "Could not find ssi item for oncoming buddy %s, " |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4286 "group %s\n", name, gname); |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4287 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4288 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4289 g_free(gname_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4290 g_free(alias_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4291 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4292 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4293 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4294 |
15822 | 4295 static int purple_ssi_authgiven(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4296 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4297 va_list ap; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4298 char *bn, *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4299 gchar *dialog_msg, *nombre; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4300 struct name_data *data; |
15822 | 4301 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4302 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4303 va_start(ap, fr); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4304 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4305 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4306 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4307 |
15822 | 4308 purple_debug_info("oscar", |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4309 "ssi: %s has given you permission to add him to your buddy list\n", bn); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4310 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4311 buddy = purple_find_buddy(purple_connection_get_account(gc), bn); |
15822 | 4312 if (buddy && (purple_buddy_get_alias_only(buddy))) |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4313 nombre = g_strdup_printf("%s (%s)", bn, purple_buddy_get_alias_only(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4314 else |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4315 nombre = g_strdup(bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4316 |
22654
e970c0c8a48d
nosnilmot pointed out that this error message seemed to be wrong. I agree
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22620
diff
changeset
|
4317 dialog_msg = g_strdup_printf(_("The user %s has given you permission to add him or her to your buddy list. Do you want to add this user?"), nombre); |
16883
84e2c7cc590a
Free nombre as soon as we're done using it, for clarity
Evan Schoenberg <evan.s@dreskin.net>
parents:
16882
diff
changeset
|
4318 g_free(nombre); |
84e2c7cc590a
Free nombre as soon as we're done using it, for clarity
Evan Schoenberg <evan.s@dreskin.net>
parents:
16882
diff
changeset
|
4319 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4320 data = g_new(struct name_data, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4321 data->gc = gc; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4322 data->name = g_strdup(bn); |
16882
5ade68b6a410
Pass the screenname properly to purple_account_request_authorization(), passing the nick (if available) separately. Store the nick for use in callbacks in data->nick where possible.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16832
diff
changeset
|
4323 data->nick = (buddy ? g_strdup(purple_buddy_get_alias_only(buddy)) : NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4324 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4325 purple_request_yes_no(gc, NULL, _("Authorization Given"), dialog_msg, |
22137
6dab6629497a
Improve oscar's default actions a tad bit
Mark Doliner <mark@kingant.net>
parents:
22129
diff
changeset
|
4326 PURPLE_DEFAULT_ACTION_NONE, |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4327 purple_connection_get_account(gc), bn, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4328 data, |
15822 | 4329 G_CALLBACK(purple_icq_buddyadd), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4330 G_CALLBACK(oscar_free_name_data)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4331 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4332 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4333 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4334 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4335 |
29611
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4336 static int purple_ssi_authrequest(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4337 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4338 va_list ap; |
29611
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4339 const char *bn; |
30357
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30146
diff
changeset
|
4340 char *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4341 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4342 va_start(ap, fr); |
29611
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4343 bn = va_arg(ap, const char *); |
30357
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30146
diff
changeset
|
4344 msg = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4345 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4346 |
15822 | 4347 purple_debug_info("oscar", |
29611
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4348 "ssi: received authorization request from %s\n", bn); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4349 |
29611
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4350 if (!msg) { |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4351 purple_debug_warning("oscar", "Received auth request from %s with " |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4352 "empty message\n", bn); |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4353 } else if (!g_utf8_validate(msg, -1, NULL)) { |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4354 purple_debug_warning("oscar", "Received auth request from %s with " |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4355 "invalid UTF-8 message\n", bn); |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4356 msg = NULL; |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
29610
diff
changeset
|
4357 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4358 |
30357
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30146
diff
changeset
|
4359 aim_icq_getalias(od, bn, TRUE, msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4360 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4361 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4362 |
15822 | 4363 static int purple_ssi_authreply(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4364 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4365 va_list ap; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4366 char *bn, *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4367 gchar *dialog_msg, *nombre; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4368 guint8 reply; |
15822 | 4369 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4370 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4371 va_start(ap, fr); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4372 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4373 reply = (guint8)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4374 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4375 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4376 |
15822 | 4377 purple_debug_info("oscar", |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4378 "ssi: received authorization reply from %s. Reply is 0x%04hhx\n", bn, reply); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4379 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4380 buddy = purple_find_buddy(purple_connection_get_account(gc), bn); |
15822 | 4381 if (buddy && (purple_buddy_get_alias_only(buddy))) |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4382 nombre = g_strdup_printf("%s (%s)", bn, purple_buddy_get_alias_only(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4383 else |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4384 nombre = g_strdup(bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4385 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4386 if (reply) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4387 /* Granted */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4388 dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your buddy list."), nombre); |
15822 | 4389 purple_notify_info(gc, NULL, _("Authorization Granted"), dialog_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4390 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4391 /* Denied */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4392 dialog_msg = g_strdup_printf(_("The user %s has denied your request to add them to your buddy list for the following reason:\n%s"), nombre, msg ? msg : _("No reason given.")); |
15822 | 4393 purple_notify_info(gc, NULL, _("Authorization Denied"), dialog_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4394 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4395 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4396 g_free(nombre); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4397 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4398 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4399 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4400 |
15822 | 4401 static int purple_ssi_gotadded(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4402 PurpleConnection *gc = od->gc; | |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4403 PurpleAccount *account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4404 va_list ap; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4405 char *bn; |
15822 | 4406 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4408 va_start(ap, fr); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4409 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4410 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4411 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4412 buddy = purple_find_buddy(account, bn); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4413 purple_debug_info("oscar", "ssi: %s added you to their buddy list\n", bn); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4414 purple_account_notify_added(account, bn, NULL, |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4415 (buddy ? purple_buddy_get_alias_only(buddy) : NULL), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4416 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4417 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4418 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4419 |
15822 | 4420 GList *oscar_chat_info(PurpleConnection *gc) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4421 GList *m = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4422 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4423 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4424 pce = g_new0(struct proto_chat_entry, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4425 pce->label = _("_Room:"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4426 pce->identifier = "room"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4427 pce->required = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4428 m = g_list_append(m, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4429 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4430 pce = g_new0(struct proto_chat_entry, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4431 pce->label = _("_Exchange:"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4432 pce->identifier = "exchange"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4433 pce->required = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4434 pce->is_int = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4435 pce->min = 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4436 pce->max = 20; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4437 m = g_list_append(m, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4438 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4439 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4440 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4441 |
15822 | 4442 GHashTable *oscar_chat_info_defaults(PurpleConnection *gc, const char *chat_name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4443 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4444 GHashTable *defaults; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4445 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4446 defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4447 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4448 if (chat_name != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4449 g_hash_table_insert(defaults, "room", g_strdup(chat_name)); |
21737
80aaf91b1025
Have oscar specify a default chat room exchange of 4. Finch always
Mark Doliner <mark@kingant.net>
parents:
21736
diff
changeset
|
4450 g_hash_table_insert(defaults, "exchange", g_strdup("4")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4451 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4452 return defaults; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4453 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4454 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4455 char * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4456 oscar_get_chat_name(GHashTable *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4457 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4458 return g_strdup(g_hash_table_lookup(data, "room")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4459 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4460 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4461 void |
15822 | 4462 oscar_join_chat(PurpleConnection *gc, GHashTable *data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4463 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4464 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4465 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4466 char *name, *exchange; |
21728
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4467 int exchange_int; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4468 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4469 name = g_hash_table_lookup(data, "room"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4470 exchange = g_hash_table_lookup(data, "exchange"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4471 |
21728
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4472 g_return_if_fail(name != NULL && *name != '\0'); |
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4473 g_return_if_fail(exchange != NULL); |
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4474 |
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4475 errno = 0; |
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4476 exchange_int = strtol(exchange, NULL, 10); |
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4477 g_return_if_fail(errno == 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4478 |
15822 | 4479 purple_debug_info("oscar", "Attempting to join chat room %s.\n", name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4480 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4481 if ((conn = flap_connection_getbytype(od, SNAC_FAMILY_CHATNAV))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4482 { |
15822 | 4483 purple_debug_info("oscar", "chatnav exists, creating room\n"); |
21728
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4484 aim_chatnav_createroom(od, conn, name, exchange_int); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4485 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4486 /* this gets tricky */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4487 struct create_room *cr = g_new0(struct create_room, 1); |
15822 | 4488 purple_debug_info("oscar", "chatnav does not exist, opening chatnav\n"); |
21728
86f62b1e2a5a
g_return_if_fail() if the chat room name or exchange aren't set or
Mark Doliner <mark@kingant.net>
parents:
21723
diff
changeset
|
4489 cr->exchange = exchange_int; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4490 cr->name = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4491 od->create_rooms = g_slist_prepend(od->create_rooms, cr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4492 aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4493 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4494 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4496 void |
15822 | 4497 oscar_chat_invite(PurpleConnection *gc, int id, const char *message, const char *name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4498 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4499 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4500 struct chat_connection *ccon = find_oscar_chat(gc, id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4501 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4502 if (ccon == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4503 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4504 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4505 aim_im_sendch2_chatinvite(od, name, message ? message : "", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4506 ccon->exchange, ccon->name, 0x0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4507 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4508 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4509 void |
15822 | 4510 oscar_chat_leave(PurpleConnection *gc, int id) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4511 { |
15822 | 4512 PurpleConversation *conv; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4513 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4514 |
15822 | 4515 conv = purple_find_chat(gc, id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4516 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4517 g_return_if_fail(conv != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4518 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4519 purple_debug_info("oscar", "Leaving chat room %s\n", |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4520 purple_conversation_get_name(conv)); |
15822 | 4521 |
4522 cc = find_oscar_chat(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv))); | |
30958
a467e55ec3c7
Move the call to flap_connection_schedule_destroy from oscar_chat_kill
Mark Doliner <mark@kingant.net>
parents:
30957
diff
changeset
|
4523 flap_connection_schedule_destroy(cc->conn, OSCAR_DISCONNECT_DONE, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4524 oscar_chat_kill(gc, cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4525 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4526 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4527 int oscar_send_chat(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4528 { |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4529 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 4530 PurpleConversation *conv = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4531 struct chat_connection *c = NULL; |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4532 char *buf, *buf2, *buf3; |
30385
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
4533 guint16 charset; |
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
4534 char *charsetstr; |
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
4535 gsize len; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4536 |
15822 | 4537 if (!(conv = purple_find_chat(gc, id))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4538 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4539 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4540 if (!(c = find_oscar_chat_by_conv(gc, conv))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4541 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4542 |
15822 | 4543 buf = purple_strdup_withhtml(message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4544 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4545 if (strstr(buf, "<IMG ")) |
15822 | 4546 purple_conversation_write(conv, "", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4547 _("Your IM Image was not sent. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4548 "You cannot send IM Images in AIM chats."), |
15822 | 4549 PURPLE_MESSAGE_ERROR, time(NULL)); |
4550 | |
30394 | 4551 buf2 = oscar_encode_im(buf, &len, &charset, &charsetstr); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4552 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4553 * Evan S. suggested that maxvis really does mean "number of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4554 * visible characters" and not "number of bytes" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4555 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4556 if ((len > c->maxlen) || (len > c->maxvis)) { |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4557 /* If the length was too long, try stripping the HTML and then running it back through |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4558 * purple_strdup_withhtml() and the encoding process. The result may be shorter. */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4559 g_free(buf2); |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4560 |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4561 buf3 = purple_markup_strip_html(buf); |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4562 g_free(buf); |
17588
329ca72df5fa
Remove a pair of unneeded strlen's
Mark Doliner <mark@kingant.net>
parents:
17587
diff
changeset
|
4563 |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4564 buf = purple_strdup_withhtml(buf3); |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4565 g_free(buf3); |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4566 |
30394 | 4567 buf2 = oscar_encode_im(buf, &len, &charset, &charsetstr); |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4568 |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4569 if ((len > c->maxlen) || (len > c->maxvis)) { |
30385
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
4570 purple_debug_warning("oscar", |
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30382
diff
changeset
|
4571 "Could not send %s because (%" G_GSIZE_FORMAT " > maxlen %i) or (%" G_GSIZE_FORMAT " > maxvis %i)\n", |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4572 buf2, len, c->maxlen, len, c->maxvis); |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4573 g_free(buf); |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4574 g_free(buf2); |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4575 return -E2BIG; |
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4576 } |
17588
329ca72df5fa
Remove a pair of unneeded strlen's
Mark Doliner <mark@kingant.net>
parents:
17587
diff
changeset
|
4577 |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19642
diff
changeset
|
4578 purple_debug_info("oscar", "Sending %s as %s because the original was too long.\n", |
17588
329ca72df5fa
Remove a pair of unneeded strlen's
Mark Doliner <mark@kingant.net>
parents:
17587
diff
changeset
|
4579 message, buf2); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4580 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4581 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4582 aim_chat_send_im(od, c->conn, 0, buf2, len, charsetstr, "en"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4583 g_free(buf2); |
17586
ba1478c35cc0
If a message is known to be too long to send to a chat or IM, and it's an HTML message, strip the HTML, re-encode, and try again. The chat part is particularly useful given the short maximum message length and the fact that purple_markup_linkify() will have linkified long links to being twice the number of characters. The IM part is not triggerred in my experience because MAXMSGLEN seems to be far above the number of characters allowed; perhaps it is a number of bytes, not characters?
Evan Schoenberg <evan.s@dreskin.net>
parents:
17561
diff
changeset
|
4584 g_free(buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4585 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4586 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4587 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4588 |
29440
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29435
diff
changeset
|
4589 PurpleMood* oscar_get_purple_moods(PurpleAccount *account) |
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29435
diff
changeset
|
4590 { |
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29435
diff
changeset
|
4591 return icq_get_purple_moods(account); |
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29435
diff
changeset
|
4592 } |
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29435
diff
changeset
|
4593 |
15822 | 4594 const char *oscar_list_icon_icq(PurpleAccount *a, PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4595 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4596 const char *name = b ? purple_buddy_get_name(b) : NULL; |
31849
4c046f6564cd
Change the heuristic we use for setting od->icq. We used to set it to
Mark Doliner <mark@kingant.net>
parents:
31838
diff
changeset
|
4597 if (name && !oscar_util_valid_name_sms(name) && oscar_util_valid_name_icq(name)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4598 return "icq"; |
31849
4c046f6564cd
Change the heuristic we use for setting od->icq. We used to set it to
Mark Doliner <mark@kingant.net>
parents:
31838
diff
changeset
|
4599 |
4c046f6564cd
Change the heuristic we use for setting od->icq. We used to set it to
Mark Doliner <mark@kingant.net>
parents:
31838
diff
changeset
|
4600 return "icq"; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4601 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4602 |
15822 | 4603 const char *oscar_list_icon_aim(PurpleAccount *a, PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4604 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4605 const char *name = b ? purple_buddy_get_name(b) : NULL; |
31849
4c046f6564cd
Change the heuristic we use for setting od->icq. We used to set it to
Mark Doliner <mark@kingant.net>
parents:
31838
diff
changeset
|
4606 if (name && !oscar_util_valid_name_sms(name) && oscar_util_valid_name_icq(name)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4607 return "icq"; |
31849
4c046f6564cd
Change the heuristic we use for setting od->icq. We used to set it to
Mark Doliner <mark@kingant.net>
parents:
31838
diff
changeset
|
4608 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4609 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4610 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4611 |
23267 | 4612 const char *oscar_list_emblem(PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4613 { |
15822 | 4614 PurpleConnection *gc = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4615 OscarData *od = NULL; |
15822 | 4616 PurpleAccount *account = NULL; |
4617 PurplePresence *presence; | |
4618 PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4619 const char *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4620 aim_userinfo_t *userinfo = NULL; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4621 const char *name; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4622 |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4623 account = purple_buddy_get_account(b); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4624 name = purple_buddy_get_name(b); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4625 if (account != NULL) |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4626 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4627 if (gc != NULL) |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4628 od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4629 if (od != NULL) |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4630 userinfo = aim_locate_finduserinfo(od, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4631 |
15822 | 4632 presence = purple_buddy_get_presence(b); |
4633 status = purple_presence_get_active_status(presence); | |
4634 status_id = purple_status_get_id(status); | |
4635 | |
4636 if (purple_presence_is_online(presence) == FALSE) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4637 char *gname; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4638 if ((name) && (od) && (od->ssi.received_data) && |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4639 (gname = aim_ssi_itemlist_findparentname(&od->ssi.local, name)) && |
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4640 (aim_ssi_waitingforauth(&od->ssi.local, gname, name))) { |
15462 | 4641 return "not-authorized"; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4642 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4643 } |
23267 | 4644 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4645 if (userinfo != NULL ) { |
15462 | 4646 if (userinfo->flags & AIM_FLAG_ADMINISTRATOR) |
4647 return "admin"; | |
4648 if (userinfo->flags & AIM_FLAG_ACTIVEBUDDY) | |
4649 return "bot"; | |
4650 if (userinfo->capabilities & OSCAR_CAPABILITY_SECUREIM) | |
4651 return "secure"; | |
20582
749c35474b09
Use birthday emblem in OSCAR. Fixes #300
Sean Egan <seanegan@gmail.com>
parents:
19687
diff
changeset
|
4652 if (userinfo->icqinfo.status & AIM_ICQ_STATE_BIRTHDAY) |
749c35474b09
Use birthday emblem in OSCAR. Fixes #300
Sean Egan <seanegan@gmail.com>
parents:
19687
diff
changeset
|
4653 return "birthday"; |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4654 |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4655 /* Make the mood icon override anything below this. */ |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4656 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOOD)) |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4657 return NULL; |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4658 |
29424
2c95b7c57ebb
Fix up the X-Status code in many ways:
Richard Laager <rlaager@wiktel.com>
parents:
29420
diff
changeset
|
4659 if (userinfo->capabilities & OSCAR_CAPABILITY_HIPTOP) |
2c95b7c57ebb
Fix up the X-Status code in many ways:
Richard Laager <rlaager@wiktel.com>
parents:
29420
diff
changeset
|
4660 return "hiptop"; |
15462 | 4661 } |
4662 return NULL; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4663 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4664 |
23265
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4665 void oscar_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4666 { |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4667 PurpleConnection *gc; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4668 PurpleAccount *account; |
23265
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4669 OscarData *od; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4670 aim_userinfo_t *userinfo; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4671 |
23266
9f34726fe141
Whoops, I should have inverted this logic.
Mark Doliner <mark@kingant.net>
parents:
23265
diff
changeset
|
4672 if (!PURPLE_BUDDY_IS_ONLINE(b)) |
23265
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4673 return; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4674 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4675 account = purple_buddy_get_account(b); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4676 gc = purple_account_get_connection(account); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4677 od = purple_connection_get_protocol_data(gc); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4678 userinfo = aim_locate_finduserinfo(od, purple_buddy_get_name(b)); |
23265
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4679 |
30648
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
4680 oscar_user_info_append_status(gc, user_info, b, userinfo, /* use_html_status */ FALSE); |
23265
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4681 |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4682 if (full) |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
4683 oscar_user_info_append_extra_info(gc, user_info, b, userinfo); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4684 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4685 |
15822 | 4686 char *oscar_status_text(PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4687 { |
15822 | 4688 PurpleConnection *gc; |
4689 PurpleAccount *account; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4690 OscarData *od; |
15822 | 4691 const PurplePresence *presence; |
4692 const PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4693 const char *id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4694 const char *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4695 gchar *ret = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4696 |
15822 | 4697 gc = purple_account_get_connection(purple_buddy_get_account(b)); |
4698 account = purple_connection_get_account(gc); | |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4699 od = purple_connection_get_protocol_data(gc); |
15822 | 4700 presence = purple_buddy_get_presence(b); |
4701 status = purple_presence_get_active_status(presence); | |
4702 id = purple_status_get_id(status); | |
4703 | |
18207
d3dfcfb5755c
Fix for a crash when trying to get oscar_status_text for a buddy on an
Stu Tomlinson <stu@nosnilmot.com>
parents:
18125
diff
changeset
|
4704 if ((od != NULL) && !purple_presence_is_online(presence)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4705 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4706 const char *name = purple_buddy_get_name(b); |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4707 char *gname = aim_ssi_itemlist_findparentname(&od->ssi.local, name); |
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4708 if (aim_ssi_waitingforauth(&od->ssi.local, gname, name)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4709 ret = g_strdup(_("Not Authorized")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4710 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4711 ret = g_strdup(_("Offline")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4712 } |
25386
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
4713 else |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4714 { |
15822 | 4715 message = purple_status_get_attr_string(status, "message"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4716 if (message != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4717 { |
30648
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
4718 gchar *tmp = oscar_util_format_string(message, purple_account_get_username(account)); |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
4719 ret = purple_markup_escape_text(tmp, -1); |
1558900f47e5
Merged my changes that fix #11964 and #12593. Mark looked over them
ivan.komarov@soc.pidgin.im
parents:
30647
diff
changeset
|
4720 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4721 } |
25386
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
4722 else if (purple_status_is_available(status)) |
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
4723 { |
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
4724 /* Don't show "Available" as status message in case buddy doesn't have a status message */ |
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
4725 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4726 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4727 { |
25386
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25383
diff
changeset
|
4728 ret = g_strdup(purple_status_get_name(status)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4729 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4730 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4731 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4732 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4733 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4734 |
30376
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30373
diff
changeset
|
4735 void oscar_set_aim_permdeny(PurpleConnection *gc) { |
15822 | 4736 PurpleAccount *account = purple_connection_get_account(gc); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4737 OscarData *od = purple_connection_get_protocol_data(gc); |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4738 |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4739 /* |
30372
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
4740 * Conveniently there is a one-to-one mapping between the |
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
4741 * values of libpurple's PurplePrivacyType and the values used |
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
4742 * by the oscar protocol. |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4743 */ |
30372
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
4744 aim_ssi_setpermdeny(od, account->perm_deny); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4745 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4746 |
15822 | 4747 void oscar_add_permit(PurpleConnection *gc, const char *who) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4748 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 4749 purple_debug_info("oscar", "ssi: About to add a permit\n"); |
30372
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
4750 aim_ssi_add_to_private_list(od, who, AIM_SSI_TYPE_PERMIT); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4751 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4752 |
15822 | 4753 void oscar_add_deny(PurpleConnection *gc, const char *who) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4754 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 4755 purple_debug_info("oscar", "ssi: About to add a deny\n"); |
30372
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
4756 aim_ssi_add_to_private_list(od, who, aim_ssi_getdenyentrytype(od)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4757 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4758 |
15822 | 4759 void oscar_rem_permit(PurpleConnection *gc, const char *who) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4760 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 4761 purple_debug_info("oscar", "ssi: About to delete a permit\n"); |
30372
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
4762 aim_ssi_del_from_private_list(od, who, AIM_SSI_TYPE_PERMIT); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4763 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4764 |
15822 | 4765 void oscar_rem_deny(PurpleConnection *gc, const char *who) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4766 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 4767 purple_debug_info("oscar", "ssi: About to delete a deny\n"); |
30372
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
4768 aim_ssi_del_from_private_list(od, who, aim_ssi_getdenyentrytype(od)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4769 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4770 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4771 GList * |
15822 | 4772 oscar_status_types(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4773 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4774 gboolean is_icq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4775 GList *status_types = NULL; |
15822 | 4776 PurpleStatusType *type; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4777 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4778 g_return_val_if_fail(account != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4779 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4780 /* Used to flag some statuses as "user settable" or not */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4781 is_icq = oscar_util_valid_name_icq(purple_account_get_username(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4782 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4783 /* Common status types */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4784 /* Really the available message should only be settable for AIM accounts */ |
15822 | 4785 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4786 OSCAR_STATUS_ID_AVAILABLE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4787 NULL, TRUE, TRUE, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4788 "message", _("Message"), |
15822 | 4789 purple_value_new(PURPLE_TYPE_STRING), |
15627
2261750cf4e9
Allow setting of the iTunes Music Store URL for AIM accounts. It's
Mark Doliner <mark@kingant.net>
parents:
15624
diff
changeset
|
4790 "itmsurl", _("iTunes Music Store Link"), |
15822 | 4791 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4792 status_types = g_list_prepend(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4793 |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4794 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4795 OSCAR_STATUS_ID_FREE4CHAT, |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4796 _("Free For Chat"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4797 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4798 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4799 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4800 status_types = g_list_prepend(status_types, type); |
29610 | 4801 |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4802 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4803 OSCAR_STATUS_ID_EVIL, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4804 _("Evil"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4805 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4806 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4807 status_types = g_list_prepend(status_types, type); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4808 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4809 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4810 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4811 OSCAR_STATUS_ID_DEPRESSION, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4812 _("Depression"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4813 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4814 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4815 status_types = g_list_prepend(status_types, type); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4816 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4817 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4818 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4819 OSCAR_STATUS_ID_ATHOME, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4820 _("At home"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4821 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4822 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4823 status_types = g_list_prepend(status_types, type); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4824 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4825 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4826 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4827 OSCAR_STATUS_ID_ATWORK, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4828 _("At work"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4829 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4830 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4831 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4832 status_types = g_list_prepend(status_types, type); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4833 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4834 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4835 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4836 OSCAR_STATUS_ID_LUNCH, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4837 _("Lunch"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4838 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4839 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4840 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4841 status_types = g_list_prepend(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4842 |
15822 | 4843 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4844 OSCAR_STATUS_ID_AWAY, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4845 NULL, TRUE, TRUE, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4846 "message", _("Message"), |
15822 | 4847 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4848 status_types = g_list_prepend(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4849 |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4850 type = purple_status_type_new_with_attrs(PURPLE_STATUS_INVISIBLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4851 OSCAR_STATUS_ID_INVISIBLE, |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4852 NULL, TRUE, TRUE, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4853 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4854 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
4855 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4856 status_types = g_list_prepend(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4857 |
15822 | 4858 type = purple_status_type_new_full(PURPLE_STATUS_MOBILE, OSCAR_STATUS_ID_MOBILE, NULL, FALSE, FALSE, TRUE); |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15462
diff
changeset
|
4859 status_types = g_list_prepend(status_types, type); |
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15462
diff
changeset
|
4860 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4861 /* ICQ-specific status types */ |
15822 | 4862 type = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4863 OSCAR_STATUS_ID_OCCUPIED, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4864 _("Occupied"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4865 "message", _("Message"), |
15822 | 4866 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4867 status_types = g_list_prepend(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4868 |
16411
569eba287c84
Sean proposed changing ICQ's "do not disturb" status from being
Mark Doliner <mark@kingant.net>
parents:
16330
diff
changeset
|
4869 type = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4870 OSCAR_STATUS_ID_DND, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4871 _("Do Not Disturb"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4872 "message", _("Message"), |
15822 | 4873 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4874 status_types = g_list_prepend(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4875 |
15822 | 4876 type = purple_status_type_new_with_attrs(PURPLE_STATUS_EXTENDED_AWAY, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4877 OSCAR_STATUS_ID_NA, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4878 _("Not Available"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4879 "message", _("Message"), |
15822 | 4880 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4881 status_types = g_list_prepend(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4882 |
15822 | 4883 type = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4884 OSCAR_STATUS_ID_OFFLINE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4885 NULL, TRUE, TRUE, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4886 status_types = g_list_prepend(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4887 |
29435
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4888 type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOOD, |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4889 "mood", NULL, TRUE, is_icq, TRUE, |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4890 PURPLE_MOOD_NAME, _("Mood Name"), purple_value_new(PURPLE_TYPE_STRING), |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4891 PURPLE_MOOD_COMMENT, _("Mood Comment"), purple_value_new(PURPLE_TYPE_STRING), |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4892 NULL); |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4893 status_types = g_list_prepend(status_types, type); |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4894 |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29424
diff
changeset
|
4895 return g_list_reverse(status_types); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4896 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4897 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4898 static void oscar_ssi_editcomment(struct name_data *data, const char *text) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4899 PurpleConnection *gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4900 PurpleAccount *account; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4901 OscarData *od; |
15822 | 4902 PurpleBuddy *b; |
4903 PurpleGroup *g; | |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4904 |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4905 gc = data->gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4906 od = purple_connection_get_protocol_data(gc); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4907 account = purple_connection_get_account(gc); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4908 |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4909 b = purple_find_buddy(account, data->name); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4910 if (b == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4911 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4912 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4913 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4914 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4915 g = purple_buddy_get_group(b); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4916 if (g == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4917 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4918 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4919 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4920 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4921 aim_ssi_editcomment(od, purple_group_get_name(g), data->name, text); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4922 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4923 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4924 |
15822 | 4925 static void oscar_buddycb_edit_comment(PurpleBlistNode *node, gpointer ignore) { |
4926 | |
4927 PurpleBuddy *buddy; | |
4928 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4929 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4930 struct name_data *data; |
15822 | 4931 PurpleGroup *g; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4932 char *comment; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4933 gchar *comment_utf8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4934 gchar *title; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4935 PurpleAccount *account; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4936 const char *name; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4937 |
15822 | 4938 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
4939 | |
4940 buddy = (PurpleBuddy *) node; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4941 name = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4942 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4943 gc = purple_account_get_connection(account); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4944 od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4945 |
15822 | 4946 if (!(g = purple_buddy_get_group(buddy))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4947 return; |
24372
dd787f8d5e91
Fix a potential leak, thanks to "KuSh". Fixes #7463.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24224
diff
changeset
|
4948 |
dd787f8d5e91
Fix a potential leak, thanks to "KuSh". Fixes #7463.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24224
diff
changeset
|
4949 data = g_new(struct name_data, 1); |
dd787f8d5e91
Fix a potential leak, thanks to "KuSh". Fixes #7463.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24224
diff
changeset
|
4950 |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
4951 comment = aim_ssi_getcomment(&od->ssi.local, purple_group_get_name(g), name); |
28810
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
28772
diff
changeset
|
4952 comment_utf8 = comment ? oscar_utf8_try_convert(account, od, comment) : NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4953 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4954 data->gc = gc; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4955 data->name = g_strdup(name); |
16882
5ade68b6a410
Pass the screenname properly to purple_account_request_authorization(), passing the nick (if available) separately. Store the nick for use in callbacks in data->nick where possible.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16832
diff
changeset
|
4956 data->nick = g_strdup(purple_buddy_get_alias_only(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4957 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4958 title = g_strdup_printf(_("Buddy Comment for %s"), data->name); |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4959 purple_request_input(gc, title, _("Buddy Comment:"), NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4960 comment_utf8, TRUE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4961 _("_OK"), G_CALLBACK(oscar_ssi_editcomment), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4962 _("_Cancel"), G_CALLBACK(oscar_free_name_data), |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4963 account, data->name, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4964 data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4965 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4966 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4967 g_free(comment); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4968 g_free(comment_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4969 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4970 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4971 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4972 oscar_ask_directim_yes_cb(struct oscar_ask_directim_data *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4973 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4974 peer_connection_propose(data->od, OSCAR_CAPABILITY_DIRECTIM, data->who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4975 g_free(data->who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4976 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4977 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4978 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4979 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4980 oscar_ask_directim_no_cb(struct oscar_ask_directim_data *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4981 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4982 g_free(data->who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4983 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4984 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4985 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4986 /* This is called from right-click menu on a buddy node. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4987 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4988 oscar_ask_directim(gpointer object, gpointer ignored) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4989 { |
15822 | 4990 PurpleBlistNode *node; |
4991 PurpleBuddy *buddy; | |
4992 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4993 gchar *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4994 struct oscar_ask_directim_data *data; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4995 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4996 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4997 node = object; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4998 |
15822 | 4999 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
5000 | |
5001 buddy = (PurpleBuddy *)node; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5002 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5003 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5004 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5005 data = g_new0(struct oscar_ask_directim_data, 1); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5006 data->who = g_strdup(purple_buddy_get_name(buddy)); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5007 data->od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5008 buf = g_strdup_printf(_("You have selected to open a Direct IM connection with %s."), |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5009 data->who); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5010 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5011 purple_request_action(gc, NULL, buf, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5012 _("Because this reveals your IP address, it " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5013 "may be considered a security risk. Do you " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5014 "wish to continue?"), |
22137
6dab6629497a
Improve oscar's default actions a tad bit
Mark Doliner <mark@kingant.net>
parents:
22129
diff
changeset
|
5015 0, /* Default action is "connect" */ |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5016 account, data->who, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5017 data, 2, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5018 _("C_onnect"), G_CALLBACK(oscar_ask_directim_yes_cb), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5019 _("_Cancel"), G_CALLBACK(oscar_ask_directim_no_cb)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5020 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5021 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5022 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5023 static void |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5024 oscar_close_directim(gpointer object, gpointer ignored) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5025 { |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5026 PurpleBlistNode *node; |
15822 | 5027 PurpleBuddy *buddy; |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5028 PurpleAccount *account; |
15822 | 5029 PurpleConnection *gc; |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5030 PurpleConversation *conv; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5031 OscarData *od; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5032 PeerConnection *conn; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5033 const char *name; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5034 |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5035 node = object; |
15822 | 5036 |
5037 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); | |
5038 | |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5039 buddy = (PurpleBuddy*)node; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5040 name = purple_buddy_get_name(buddy); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5041 account = purple_buddy_get_account(buddy); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5042 gc = purple_account_get_connection(account); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5043 od = gc->proto_data; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5044 conn = peer_connection_find_by_type(od, name, OSCAR_CAPABILITY_DIRECTIM); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5045 |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5046 if (conn != NULL) |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5047 { |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5048 if (!conn->ready) |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5049 aim_im_sendch2_cancel(conn); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5050 |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5051 peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5052 |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5053 /* OSCAR_DISCONNECT_LOCAL_CLOSED doesn't write anything to the convo |
30432
1cdae196aac8
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30404
diff
changeset
|
5054 * window. Let the user know that we cancelled the Direct IM. */ |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5055 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5056 purple_conversation_write(conv, NULL, _("You closed the connection."), |
29610 | 5057 PURPLE_MESSAGE_SYSTEM, time(NULL)); |
5058 } | |
5059 } | |
5060 | |
5061 static void oscar_get_icqxstatusmsg(PurpleBlistNode *node, gpointer ignore) | |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5062 { |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5063 PurpleBuddy *buddy; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5064 PurpleConnection *gc; |
31398
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5065 OscarData *od; |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5066 PurpleAccount *account; |
31398
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5067 const char *bname; |
29610 | 5068 |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5069 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5070 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5071 buddy = (PurpleBuddy *)node; |
31398
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5072 bname = purple_buddy_get_name(buddy); |
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5073 |
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5074 account = purple_buddy_get_account(buddy); |
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5075 gc = purple_account_get_connection(account); |
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5076 od = purple_connection_get_protocol_data(gc); |
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5077 |
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5078 purple_debug_info("oscar", "Manual X-Status Get From %s to %s:\n", bname, purple_account_get_username(account)); |
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5079 |
85412e09b61b
Fix libpurple compile when PURPLE_HIDE_STRUCTS is enabled.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31315
diff
changeset
|
5080 icq_im_xstatus_request(od, bname); |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5081 } |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5082 |
29460 | 5083 static void |
5084 oscar_get_aim_info_cb(PurpleBlistNode *node, gpointer ignore) | |
5085 { | |
5086 PurpleBuddy *buddy; | |
5087 PurpleConnection *gc; | |
5088 | |
5089 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); | |
5090 | |
5091 buddy = (PurpleBuddy *)node; | |
5092 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); | |
5093 | |
5094 aim_locate_getinfoshort(purple_connection_get_protocol_data(gc), | |
5095 purple_buddy_get_name(buddy), 0x00000003); | |
5096 } | |
5097 | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5098 static GList * |
15822 | 5099 oscar_buddy_menu(PurpleBuddy *buddy) { |
5100 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5101 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5102 GList *menu; |
15822 | 5103 PurpleMenuAction *act; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5104 aim_userinfo_t *userinfo; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5105 PurpleAccount *account; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5106 const char *bname = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5107 |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5108 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5109 gc = purple_account_get_connection(account); |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5110 od = purple_connection_get_protocol_data(gc); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5111 userinfo = aim_locate_finduserinfo(od, bname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5112 menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5113 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5114 if (od->icq && oscar_util_valid_name_icq(bname)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5115 { |
15822 | 5116 act = purple_menu_action_new(_("Get AIM Info"), |
5117 PURPLE_CALLBACK(oscar_get_aim_info_cb), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5118 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5119 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5120 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5121 |
25291
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
25288
diff
changeset
|
5122 if (purple_buddy_get_group(buddy) != NULL) |
25288
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24915
diff
changeset
|
5123 { |
25291
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
25288
diff
changeset
|
5124 /* We only do this if the user is in our buddy list */ |
25288
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24915
diff
changeset
|
5125 act = purple_menu_action_new(_("Edit Buddy Comment"), |
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24915
diff
changeset
|
5126 PURPLE_CALLBACK(oscar_buddycb_edit_comment), |
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24915
diff
changeset
|
5127 NULL, NULL); |
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24915
diff
changeset
|
5128 menu = g_list_prepend(menu, act); |
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24915
diff
changeset
|
5129 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5130 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5131 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5132 { |
29418
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5133 act = purple_menu_action_new(_("Get X-Status Msg"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24372
diff
changeset
|
5134 PURPLE_CALLBACK(oscar_get_icqxstatusmsg), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5135 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5136 menu = g_list_prepend(menu, act); |
30372
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30371
diff
changeset
|
5137 menu = g_list_prepend(menu, create_visibility_menu_item(od, bname)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5138 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5139 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5140 if (userinfo && |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5141 oscar_util_name_compare(purple_account_get_username(account), bname) && |
15822 | 5142 PURPLE_BUDDY_IS_ONLINE(buddy)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5143 { |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5144 PeerConnection *conn; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5145 conn = peer_connection_find_by_type(od, bname, OSCAR_CAPABILITY_DIRECTIM); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5146 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5147 if (userinfo->capabilities & OSCAR_CAPABILITY_DIRECTIM) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5148 { |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5149 if (conn) |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5150 { |
27992
7c6591eda2f9
Per rekkanoryo, "End Direct IM Session". Refs #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27961
diff
changeset
|
5151 act = purple_menu_action_new(_("End Direct IM Session"), |
27959
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5152 PURPLE_CALLBACK(oscar_close_directim), |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5153 NULL, NULL); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5154 } |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5155 else |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5156 { |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5157 act = purple_menu_action_new(_("Direct IM"), |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5158 PURPLE_CALLBACK(oscar_ask_directim), |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5159 NULL, NULL); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27428
diff
changeset
|
5160 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5161 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5162 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5163 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5164 |
25291
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
25288
diff
changeset
|
5165 if (od->ssi.received_data && purple_buddy_get_group(buddy) != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5166 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5167 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5168 * We only do this if the user is in our buddy list and we're |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5169 * waiting for authorization. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5170 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5171 char *gname; |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
5172 gname = aim_ssi_itemlist_findparentname(&od->ssi.local, bname); |
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
5173 if (gname && aim_ssi_waitingforauth(&od->ssi.local, gname, bname)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5174 { |
15822 | 5175 act = purple_menu_action_new(_("Re-request Authorization"), |
30361
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30359
diff
changeset
|
5176 PURPLE_CALLBACK(oscar_auth_sendrequest_menu), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5177 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5178 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5179 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5180 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5181 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5182 menu = g_list_reverse(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5183 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5184 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5185 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5186 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5187 |
15822 | 5188 GList *oscar_blist_node_menu(PurpleBlistNode *node) { |
5189 if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
5190 return oscar_buddy_menu((PurpleBuddy *) node); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5191 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5192 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5193 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5194 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5195 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5196 static void |
15822 | 5197 oscar_icq_privacy_opts(PurpleConnection *gc, PurpleRequestFields *fields) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5198 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5199 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 5200 PurpleAccount *account = purple_connection_get_account(gc); |
5201 PurpleRequestField *f; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5202 gboolean auth, web_aware; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5203 |
15822 | 5204 f = purple_request_fields_get_field(fields, "authorization"); |
5205 auth = purple_request_field_bool_get_value(f); | |
5206 | |
5207 f = purple_request_fields_get_field(fields, "web_aware"); | |
5208 web_aware = purple_request_field_bool_get_value(f); | |
5209 | |
5210 purple_account_set_bool(account, "authorization", auth); | |
5211 purple_account_set_bool(account, "web_aware", web_aware); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5212 |
30368
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30367
diff
changeset
|
5213 oscar_set_extended_status(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5214 aim_icq_setsecurity(od, auth, web_aware); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5215 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5216 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5217 static void |
15822 | 5218 oscar_show_icq_privacy_opts(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5219 { |
15822 | 5220 PurpleConnection *gc = (PurpleConnection *) action->context; |
5221 PurpleAccount *account = purple_connection_get_account(gc); | |
5222 PurpleRequestFields *fields; | |
5223 PurpleRequestFieldGroup *g; | |
5224 PurpleRequestField *f; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5225 gboolean auth, web_aware; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5226 |
15822 | 5227 auth = purple_account_get_bool(account, "authorization", OSCAR_DEFAULT_AUTHORIZATION); |
5228 web_aware = purple_account_get_bool(account, "web_aware", OSCAR_DEFAULT_WEB_AWARE); | |
5229 | |
5230 fields = purple_request_fields_new(); | |
5231 | |
5232 g = purple_request_field_group_new(NULL); | |
5233 | |
5234 f = purple_request_field_bool_new("authorization", _("Require authorization"), auth); | |
5235 purple_request_field_group_add_field(g, f); | |
5236 | |
5237 f = purple_request_field_bool_new("web_aware", _("Web aware (enabling this will cause you to receive SPAM!)"), web_aware); | |
5238 purple_request_field_group_add_field(g, f); | |
5239 | |
5240 purple_request_fields_add_group(fields, g); | |
5241 | |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5242 purple_request_fields(gc, _("ICQ Privacy Options"), _("ICQ Privacy Options"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5243 NULL, fields, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5244 _("OK"), G_CALLBACK(oscar_icq_privacy_opts), |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16411
diff
changeset
|
5245 _("Cancel"), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16411
diff
changeset
|
5246 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5247 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5248 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5249 |
15822 | 5250 static void oscar_confirm_account(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5251 { |
15822 | 5252 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5253 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5254 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5255 |
15822 | 5256 gc = (PurpleConnection *)action->context; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5257 od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5258 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5259 conn = flap_connection_getbytype(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5260 if (conn != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5261 aim_admin_reqconfirm(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5262 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5263 od->conf = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5264 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5265 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5266 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5267 |
15822 | 5268 static void oscar_show_email(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5269 { |
15822 | 5270 PurpleConnection *gc = (PurpleConnection *) action->context; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5271 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5272 FlapConnection *conn = flap_connection_getbytype(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5273 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5274 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5275 aim_admin_getinfo(od, conn, 0x11); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5276 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5277 od->reqemail = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5278 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5279 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5280 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5281 |
15822 | 5282 static void oscar_change_email(PurpleConnection *gc, const char *email) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5283 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5284 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5285 FlapConnection *conn = flap_connection_getbytype(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5286 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5287 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5288 aim_admin_setemail(od, conn, email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5289 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5290 od->setemail = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5291 od->email = g_strdup(email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5292 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5293 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5294 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5295 |
15822 | 5296 static void oscar_show_change_email(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5297 { |
15822 | 5298 PurpleConnection *gc = (PurpleConnection *) action->context; |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5299 purple_request_input(gc, NULL, _("Change Address To:"), NULL, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5300 FALSE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5301 _("_OK"), G_CALLBACK(oscar_change_email), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5302 _("_Cancel"), NULL, |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16411
diff
changeset
|
5303 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5304 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5305 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5306 |
15822 | 5307 static void oscar_show_awaitingauth(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5308 { |
15822 | 5309 PurpleConnection *gc = (PurpleConnection *) action->context; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5310 OscarData *od = purple_connection_get_protocol_data(gc); |
30373
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5311 PurpleAccount *account = purple_connection_get_account(gc); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5312 GSList *buddies, *filtered_buddies, *cur; |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5313 gchar *text; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5314 |
26994
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
5315 buddies = purple_find_buddies(account, NULL); |
30373
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5316 filtered_buddies = NULL; |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5317 for (cur = buddies; cur != NULL; cur = cur->next) { |
26994
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
5318 PurpleBuddy *buddy; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
5319 const gchar *bname, *gname; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
5320 |
30373
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5321 buddy = cur->data; |
26994
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
5322 bname = purple_buddy_get_name(buddy); |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
5323 gname = purple_group_get_name(purple_buddy_get_group(buddy)); |
31836
8d6630912021
Add two hash tables to the oscar code that deals with your server stored
Mark Doliner <mark@kingant.net>
parents:
31315
diff
changeset
|
5324 if (aim_ssi_waitingforauth(&od->ssi.local, gname, bname)) { |
30373
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5325 filtered_buddies = g_slist_prepend(filtered_buddies, buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5326 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5327 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5328 |
30373
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5329 g_slist_free(buddies); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5330 |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5331 filtered_buddies = g_slist_reverse(filtered_buddies); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5332 text = oscar_format_buddies(filtered_buddies, _("you are not waiting for authorization")); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5333 g_slist_free(filtered_buddies); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5334 |
15822 | 5335 purple_notify_formatted(gc, NULL, _("You are awaiting authorization from " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5336 "the following buddies"), _("You can re-request " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5337 "authorization from these buddies by " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5338 "right-clicking on them and selecting " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5339 "\"Re-request Authorization.\""), text, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5340 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5341 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5342 |
15822 | 5343 static void search_by_email_cb(PurpleConnection *gc, const char *email) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5344 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5345 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5346 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5347 aim_search_address(od, email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5348 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5349 |
15822 | 5350 static void oscar_show_find_email(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5351 { |
15822 | 5352 PurpleConnection *gc = (PurpleConnection *) action->context; |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
5353 purple_request_input(gc, _("Find Buddy by Email"), |
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
5354 _("Search for a buddy by email address"), |
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
5355 _("Type the email address of the buddy you are " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5356 "searching for."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5357 NULL, FALSE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5358 _("_Search"), G_CALLBACK(search_by_email_cb), |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16411
diff
changeset
|
5359 _("_Cancel"), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16411
diff
changeset
|
5360 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5361 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5362 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5363 |
15822 | 5364 static void oscar_show_set_info(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5365 { |
15822 | 5366 PurpleConnection *gc = (PurpleConnection *) action->context; |
5367 purple_account_request_change_user_info(purple_connection_get_account(gc)); | |
5368 } | |
5369 | |
5370 static void oscar_show_set_info_icqurl(PurplePluginAction *action) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5371 { |
15822 | 5372 PurpleConnection *gc = (PurpleConnection *) action->context; |
5373 purple_notify_uri(gc, "http://www.icq.com/whitepages/user_details.php"); | |
5374 } | |
5375 | |
5376 static void oscar_change_pass(PurplePluginAction *action) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5377 { |
15822 | 5378 PurpleConnection *gc = (PurpleConnection *) action->context; |
5379 purple_account_request_change_password(purple_connection_get_account(gc)); | |
5380 } | |
5381 | |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5382 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5383 * Only used when connecting with the old-style BUCP login. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5384 */ |
15822 | 5385 static void oscar_show_chpassurl(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5386 { |
15822 | 5387 PurpleConnection *gc = (PurpleConnection *) action->context; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5388 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 5389 gchar *substituted = purple_strreplace(od->authinfo->chpassurl, "%s", purple_account_get_username(purple_connection_get_account(gc))); |
5390 purple_notify_uri(gc, substituted); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5391 g_free(substituted); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5392 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5393 |
15822 | 5394 static void oscar_show_imforwardingurl(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5395 { |
15822 | 5396 PurpleConnection *gc = (PurpleConnection *) action->context; |
5397 purple_notify_uri(gc, "http://mymobile.aol.com/dbreg/register?action=imf&clientID=1"); | |
5398 } | |
5399 | |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5400 void oscar_set_icon(PurpleConnection *gc, PurpleStoredImage *img) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5401 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5402 OscarData *od = purple_connection_get_protocol_data(gc); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5403 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5404 if (img == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5405 aim_ssi_delicon(od); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5406 } else { |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5407 PurpleCipherContext *context; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5408 guchar md5[16]; |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5409 gconstpointer data = purple_imgstore_get_data(img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5410 size_t len = purple_imgstore_get_size(img); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5411 |
23383
540a26a1a88d
Helper functions are cool
Mark Doliner <mark@kingant.net>
parents:
23367
diff
changeset
|
5412 context = purple_cipher_context_new_by_name("md5", NULL); |
16390
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5413 purple_cipher_context_append(context, data, len); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5414 purple_cipher_context_digest(context, 16, md5, NULL); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5415 purple_cipher_context_destroy(context); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5416 |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5417 aim_ssi_seticon(od, md5, 16); |
4fc51a87ce42
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@wiktel.com>
parents:
16386
diff
changeset
|
5418 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5419 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5420 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5421 /** |
15822 | 5422 * Called by the Purple core to determine whether or not we're |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5423 * allowed to send a file to this user. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5424 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5425 gboolean |
15822 | 5426 oscar_can_receive_file(PurpleConnection *gc, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5427 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5428 OscarData *od; |
15822 | 5429 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5430 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5431 od = purple_connection_get_protocol_data(gc); |
15822 | 5432 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5433 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5434 if (od != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5435 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5436 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5437 userinfo = aim_locate_finduserinfo(od, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5438 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5439 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5440 * Don't allowing sending a file to a user that does not support |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5441 * file transfer, and don't allow sending to ourselves. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5442 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5443 if (((userinfo == NULL) || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5444 (userinfo->capabilities & OSCAR_CAPABILITY_SENDFILE)) && |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5445 oscar_util_name_compare(who, purple_account_get_username(account))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5446 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5447 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5448 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5449 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5450 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5451 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5452 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5453 |
15822 | 5454 PurpleXfer * |
5455 oscar_new_xfer(PurpleConnection *gc, const char *who) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5456 { |
15822 | 5457 PurpleXfer *xfer; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5458 OscarData *od; |
15822 | 5459 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5460 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5461 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5462 od = purple_connection_get_protocol_data(gc); |
15822 | 5463 account = purple_connection_get_account(gc); |
5464 | |
5465 xfer = purple_xfer_new(account, PURPLE_XFER_SEND, who); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5466 if (xfer) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5467 { |
15822 | 5468 purple_xfer_ref(xfer); |
5469 purple_xfer_set_init_fnc(xfer, peer_oft_sendcb_init); | |
5470 purple_xfer_set_cancel_send_fnc(xfer, peer_oft_cb_generic_cancel); | |
5471 purple_xfer_set_request_denied_fnc(xfer, peer_oft_cb_generic_cancel); | |
5472 purple_xfer_set_ack_fnc(xfer, peer_oft_sendcb_ack); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5473 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5474 conn = peer_connection_new(od, OSCAR_CAPABILITY_SENDFILE, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5475 conn->flags |= PEER_CONNECTION_FLAG_INITIATED_BY_ME; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5476 conn->flags |= PEER_CONNECTION_FLAG_APPROVED; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5477 aim_icbm_makecookie(conn->cookie); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5478 conn->xfer = xfer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5479 xfer->data = conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5480 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5481 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5482 return xfer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5483 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5484 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5485 /* |
15822 | 5486 * Called by the Purple core when the user indicates that a |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5487 * file is to be sent to a special someone. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5488 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5489 void |
15822 | 5490 oscar_send_file(PurpleConnection *gc, const char *who, const char *file) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5491 { |
15822 | 5492 PurpleXfer *xfer; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5493 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5494 xfer = oscar_new_xfer(gc, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5496 if (file != NULL) |
15822 | 5497 purple_xfer_request_accepted(xfer, file); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5498 else |
15822 | 5499 purple_xfer_request(xfer); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5500 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5501 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5502 GList * |
15822 | 5503 oscar_actions(PurplePlugin *plugin, gpointer context) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5504 { |
15822 | 5505 PurpleConnection *gc = (PurpleConnection *) context; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5506 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5507 GList *menu = NULL; |
15822 | 5508 PurplePluginAction *act; |
5509 | |
5510 act = purple_plugin_action_new(_("Set User Info..."), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5511 oscar_show_set_info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5512 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5513 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5514 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5515 { |
22468
bc8e0c7c6419
Change these oscar protocol menu actions to use "web" instead of "URL."
Mark Doliner <mark@kingant.net>
parents:
22452
diff
changeset
|
5516 act = purple_plugin_action_new(_("Set User Info (web)..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5517 oscar_show_set_info_icqurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5518 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5519 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5520 |
15822 | 5521 act = purple_plugin_action_new(_("Change Password..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5522 oscar_change_pass); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5523 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5524 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5525 if (od->authinfo != NULL && od->authinfo->chpassurl != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5526 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5527 /* This only happens when connecting with the old-style BUCP login */ |
22468
bc8e0c7c6419
Change these oscar protocol menu actions to use "web" instead of "URL."
Mark Doliner <mark@kingant.net>
parents:
22452
diff
changeset
|
5528 act = purple_plugin_action_new(_("Change Password (web)"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5529 oscar_show_chpassurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5530 menu = g_list_prepend(menu, act); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5531 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5532 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5533 if (!od->icq) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5534 { |
22468
bc8e0c7c6419
Change these oscar protocol menu actions to use "web" instead of "URL."
Mark Doliner <mark@kingant.net>
parents:
22452
diff
changeset
|
5535 act = purple_plugin_action_new(_("Configure IM Forwarding (web)"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5536 oscar_show_imforwardingurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5537 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5538 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5539 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5540 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5541 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5542 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5543 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5544 /* ICQ actions */ |
15822 | 5545 act = purple_plugin_action_new(_("Set Privacy Options..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5546 oscar_show_icq_privacy_opts); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5547 menu = g_list_prepend(menu, act); |
30373
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5548 |
30614
001897406060
Two strings marked as translatable. You find them in the ICQ account
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
30432
diff
changeset
|
5549 act = purple_plugin_action_new(_("Show Visible List"), oscar_show_visible_list); |
30373
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5550 menu = g_list_prepend(menu, act); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5551 |
30614
001897406060
Two strings marked as translatable. You find them in the ICQ account
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
30432
diff
changeset
|
5552 act = purple_plugin_action_new(_("Show Invisible List"), oscar_show_invisible_list); |
30373
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30372
diff
changeset
|
5553 menu = g_list_prepend(menu, act); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5554 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5555 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5556 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5557 /* AIM actions */ |
15822 | 5558 act = purple_plugin_action_new(_("Confirm Account"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5559 oscar_confirm_account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5560 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5561 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
5562 act = purple_plugin_action_new(_("Display Currently Registered Email Address"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5563 oscar_show_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5564 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5565 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
5566 act = purple_plugin_action_new(_("Change Currently Registered Email Address..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5567 oscar_show_change_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5568 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5569 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5570 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5571 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5572 |
15822 | 5573 act = purple_plugin_action_new(_("Show Buddies Awaiting Authorization"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5574 oscar_show_awaitingauth); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5575 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5577 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5578 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
5579 act = purple_plugin_action_new(_("Search for Buddy by Email Address..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5580 oscar_show_find_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5581 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5582 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5583 menu = g_list_reverse(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5584 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5585 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5586 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5587 |
15822 | 5588 void oscar_change_passwd(PurpleConnection *gc, const char *old, const char *new) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5589 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5590 OscarData *od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5591 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5592 if (od->icq) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5593 aim_icq_changepasswd(od, new); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5594 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5595 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5596 conn = flap_connection_getbytype(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5597 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5598 aim_admin_changepasswd(od, conn, new, old); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5599 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5600 od->chpass = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5601 od->oldp = g_strdup(old); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5602 od->newp = g_strdup(new); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5603 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5604 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5605 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5606 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5607 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5608 void |
15822 | 5609 oscar_convo_closed(PurpleConnection *gc, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5610 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5611 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5612 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5613 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5614 od = purple_connection_get_protocol_data(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5615 conn = peer_connection_find_by_type(od, who, OSCAR_CAPABILITY_DIRECTIM); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5616 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5617 if (conn != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5618 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5619 if (!conn->ready) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5620 aim_im_sendch2_cancel(conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5621 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5622 peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5623 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5624 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5625 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5626 const char * |
15822 | 5627 oscar_normalize(const PurpleAccount *account, const char *str) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5628 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5629 static char buf[BUF_LEN]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5630 char *tmp1, *tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5631 int i, j; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5632 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5633 g_return_val_if_fail(str != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5634 |
22283
2222a596340f
A patch from oliver to speed up oscar's normalize function a little by
Mark Doliner <mark@kingant.net>
parents:
22223
diff
changeset
|
5635 /* copy str to buf and skip all blanks */ |
25536
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
5636 i = 0; |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
5637 for (j = 0; str[j]; j++) { |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
5638 if (str[j] != ' ') { |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
5639 buf[i++] = str[j]; |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
5640 if (i >= BUF_LEN - 1) |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
5641 break; |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
5642 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5643 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5644 buf[i] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5645 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5646 tmp1 = g_utf8_strdown(buf, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5647 tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT); |
31786
a48d58e0512b
Bounds check an OSCAR normalization. (EFF)
Ethan Blanton <elb@pidgin.im>
parents:
31760
diff
changeset
|
5648 if (strlen(tmp2) > sizeof(buf) - 1) { |
a48d58e0512b
Bounds check an OSCAR normalization. (EFF)
Ethan Blanton <elb@pidgin.im>
parents:
31760
diff
changeset
|
5649 purple_debug_error("oscar", "normalized string exceeds buffer length!\n"); |
a48d58e0512b
Bounds check an OSCAR normalization. (EFF)
Ethan Blanton <elb@pidgin.im>
parents:
31760
diff
changeset
|
5650 } |
a48d58e0512b
Bounds check an OSCAR normalization. (EFF)
Ethan Blanton <elb@pidgin.im>
parents:
31760
diff
changeset
|
5651 g_strlcpy(buf, tmp2, sizeof(buf)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5652 g_free(tmp2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5653 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5654 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5655 return buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5656 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5657 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5658 gboolean |
15822 | 5659 oscar_offline_message(const PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5660 { |
22408
791c9545846b
Make sure we tell stuff that oscar supports offline messages for AIM
Mark Doliner <mark@kingant.net>
parents:
22406
diff
changeset
|
5661 return TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5662 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5663 |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5664 /* TODO: Find somewhere to put this instead of including it in a bunch of places. |
15822 | 5665 * Maybe just change purple_accounts_find() to return anything for the prpl if there is no acct_id. |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5666 */ |
15822 | 5667 static PurpleAccount *find_acct(const char *prpl, const char *acct_id) |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5668 { |
15822 | 5669 PurpleAccount *acct = NULL; |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5670 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5671 /* If we have a specific acct, use it */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5672 if (acct_id) { |
15822 | 5673 acct = purple_accounts_find(acct_id, prpl); |
5674 if (acct && !purple_account_is_connected(acct)) | |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5675 acct = NULL; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5676 } else { /* Otherwise find an active account for the protocol */ |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
5677 GList *l = purple_accounts_get_all(); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5678 while (l) { |
15822 | 5679 if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) |
5680 && purple_account_is_connected(l->data)) { | |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5681 acct = l->data; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5682 break; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5683 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5684 l = l->next; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5685 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5686 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5687 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5688 return acct; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5689 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5690 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5691 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5692 static gboolean oscar_uri_handler(const char *proto, const char *cmd, GHashTable *params) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5693 { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5694 char *acct_id = g_hash_table_lookup(params, "account"); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5695 char prpl[11]; |
15822 | 5696 PurpleAccount *acct; |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5697 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5698 if (g_ascii_strcasecmp(proto, "aim") && g_ascii_strcasecmp(proto, "icq")) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5699 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5700 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5701 g_snprintf(prpl, sizeof(prpl), "prpl-%s", proto); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5702 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5703 acct = find_acct(prpl, acct_id); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5704 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5705 if (!acct) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5706 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5707 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5708 /* aim:GoIM?screenname=SCREENNAME&message=MESSAGE */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5709 if (!g_ascii_strcasecmp(cmd, "GoIM")) { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5710 char *bname = g_hash_table_lookup(params, "screenname"); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5711 if (bname) { |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5712 char *message = g_hash_table_lookup(params, "message"); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5713 |
15822 | 5714 PurpleConversation *conv = purple_find_conversation_with_account( |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5715 PURPLE_CONV_TYPE_IM, bname, acct); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5716 if (conv == NULL) |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5717 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, bname); |
15822 | 5718 purple_conversation_present(conv); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5719 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5720 if (message) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5721 /* Spaces are encoded as '+' */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5722 g_strdelimit(message, "+", ' '); |
18642
3f0204c58dfa
Don't actually send messages using the protocol handlers (open the window and pre-populate the message, but require the user to actually send the message). Fixes #1961.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18613
diff
changeset
|
5723 purple_conv_send_confirm(conv, message); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5724 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5725 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5726 /*else |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5727 **If pidgindialogs_im() was in the core, we could use it here. |
15822 | 5728 * It is all purple_request_* based, but I'm not sure it really belongs in the core |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5729 pidgindialogs_im();*/ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5730 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5731 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5732 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5733 /* aim:GoChat?roomname=CHATROOMNAME&exchange=4 */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5734 else if (!g_ascii_strcasecmp(cmd, "GoChat")) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5735 char *rname = g_hash_table_lookup(params, "roomname"); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5736 if (rname) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5737 /* This is somewhat hacky, but the params aren't useful after this command */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5738 g_hash_table_insert(params, g_strdup("exchange"), g_strdup("4")); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5739 g_hash_table_insert(params, g_strdup("room"), g_strdup(rname)); |
15822 | 5740 serv_join_chat(purple_account_get_connection(acct), params); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5741 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5742 /*else |
15822 | 5743 ** Same as above (except that this would have to be re-written using purple_request_*) |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5744 pidgin_blist_joinchat_show(); */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5745 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5746 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5747 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5748 /* aim:AddBuddy?screenname=SCREENNAME&groupname=GROUPNAME*/ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5749 else if (!g_ascii_strcasecmp(cmd, "AddBuddy")) { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5750 char *bname = g_hash_table_lookup(params, "screenname"); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5751 char *gname = g_hash_table_lookup(params, "groupname"); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5752 purple_blist_request_add_buddy(acct, bname, gname, NULL); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5753 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5754 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5755 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5756 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5757 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5758 |
30647
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
30614
diff
changeset
|
5759 void oscar_init(PurplePlugin *plugin, gboolean is_icq) |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5760 { |
28502
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28499
diff
changeset
|
5761 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); |
15822 | 5762 PurpleAccountOption *option; |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5763 static gboolean init = FALSE; |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5764 static const gchar *encryption_keys[] = { |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5765 N_("Use encryption if available"), |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5766 N_("Require encryption"), |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5767 N_("Don't use encryption"), |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5768 NULL |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5769 }; |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5770 static const gchar *encryption_values[] = { |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5771 OSCAR_OPPORTUNISTIC_ENCRYPTION, |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5772 OSCAR_REQUIRE_ENCRYPTION, |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5773 OSCAR_NO_ENCRYPTION, |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5774 NULL |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5775 }; |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5776 GList *encryption_options = NULL; |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5777 int i; |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5778 |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5779 option = purple_account_option_string_new(_("Server"), "server", get_login_server(is_icq, TRUE)); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5780 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5781 |
15822 | 5782 option = purple_account_option_int_new(_("Port"), "port", OSCAR_DEFAULT_LOGIN_PORT); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5783 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5784 |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5785 for (i = 0; encryption_keys[i]; i++) { |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5786 PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); |
30925
f71745835d15
Encryption keys were marked with the _N() translation macro
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
30918
diff
changeset
|
5787 kvp->key = g_strdup(_(encryption_keys[i])); |
30903
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5788 kvp->value = g_strdup(encryption_values[i]); |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5789 encryption_options = g_list_append(encryption_options, kvp); |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5790 } |
f8f853ab3aba
A followup commit to d849dc2a852a4ffdd345a150f0b88ab37de36e36.
ivan.komarov@soc.pidgin.im
parents:
30899
diff
changeset
|
5791 option = purple_account_option_list_new(_("Connection security"), "encryption", encryption_options); |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
5792 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
5793 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5794 option = purple_account_option_bool_new(_("Use clientLogin"), "use_clientlogin", |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5795 OSCAR_DEFAULT_USE_CLIENTLOGIN); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5796 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
5797 |
15822 | 5798 option = purple_account_option_bool_new( |
21736
4d776104ec0e
Somehow this message got changed to only say ICQ instead of AIM/ICQ in
Mark Doliner <mark@kingant.net>
parents:
21730
diff
changeset
|
5799 _("Always use AIM/ICQ proxy server for\nfile transfers and direct IM (slower,\nbut does not reveal your IP address)"), "always_use_rv_proxy", |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5800 OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5801 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5802 |
28502
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28499
diff
changeset
|
5803 if (g_str_equal(purple_plugin_get_id(plugin), "prpl-aim")) { |
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28499
diff
changeset
|
5804 option = purple_account_option_bool_new(_("Allow multiple simultaneous logins"), "allow_multiple_logins", |
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28499
diff
changeset
|
5805 OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS); |
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28499
diff
changeset
|
5806 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28499
diff
changeset
|
5807 } |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25905
diff
changeset
|
5808 |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5809 if (init) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5810 return; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5811 init = TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5812 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5813 /* Preferences */ |
15822 | 5814 purple_prefs_add_none("/plugins/prpl/oscar"); |
5815 purple_prefs_add_bool("/plugins/prpl/oscar/recent_buddies", FALSE); | |
27098
28b5fcfb7444
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <mark@kingant.net>
parents:
26994
diff
changeset
|
5816 |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5817 purple_prefs_remove("/plugins/prpl/oscar/show_idle"); |
15822 | 5818 purple_prefs_remove("/plugins/prpl/oscar/always_use_rv_proxy"); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5819 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5820 /* protocol handler */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
5821 /* TODO: figure out a good instance to use here */ |
15822 | 5822 purple_signal_connect(purple_get_core(), "uri-handler", &init, |
5823 PURPLE_CALLBACK(oscar_uri_handler), NULL); | |
5824 } | |
5825 |