Mercurial > pidgin
annotate libpurple/protocols/oscar/oscar.c @ 27595:d53d082f1641
Display an error message when we receive error code 1013 from the Yahoo! logon
process. I borrowed this string from MSN and intend to change it after the
release.
author | John Bailey <rekkanoryo@rekkanoryo.org> |
---|---|
date | Fri, 17 Jul 2009 00:37:59 +0000 |
parents | bff61dad9a6b |
children | 1f329bdc91ab de7bbdcb695b |
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" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 #include "imgstore.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "network.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 #include "notify.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "privacy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "prpl.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "proxy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 #include "request.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 #include "version.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 #include "oscarcommon.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 #include "oscar.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 #include "peer.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 #define OSCAR_STATUS_ID_INVISIBLE "invisible" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 #define OSCAR_STATUS_ID_OFFLINE "offline" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 #define OSCAR_STATUS_ID_AVAILABLE "available" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 #define OSCAR_STATUS_ID_AWAY "away" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 #define OSCAR_STATUS_ID_DND "dnd" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 #define OSCAR_STATUS_ID_NA "na" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 #define OSCAR_STATUS_ID_OCCUPIED "occupied" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 #define OSCAR_STATUS_ID_FREE4CHAT "free4chat" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 #define OSCAR_STATUS_ID_CUSTOM "custom" |
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
|
63 #define OSCAR_STATUS_ID_MOBILE "mobile" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 |
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
|
65 #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
|
66 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 #define OSCAR_CONNECT_STEPS 6 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 |
23591
da9cf296733e
Some cleanup to our capabilities definitions, and added information on
Evan Schoenberg <evan.s@dreskin.net>
parents:
23586
diff
changeset
|
69 static OscarCapability purple_caps = (OSCAR_CAPABILITY_CHAT | OSCAR_CAPABILITY_BUDDYICON | OSCAR_CAPABILITY_DIRECTIM | |
da9cf296733e
Some cleanup to our capabilities definitions, and added information on
Evan Schoenberg <evan.s@dreskin.net>
parents:
23586
diff
changeset
|
70 OSCAR_CAPABILITY_SENDFILE | OSCAR_CAPABILITY_UNICODE | OSCAR_CAPABILITY_INTEROPERATE | |
24694
e4b1ba7c351c
Advertise the same typing capability on OSCAR that ICQ 6 does, since we claim
Jaromír Karmazín <blue.beret@seznam.cz>
parents:
24667
diff
changeset
|
71 OSCAR_CAPABILITY_SHORTCAPS | OSCAR_CAPABILITY_TYPING); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 static guint8 features_aim[] = {0x01, 0x01, 0x01, 0x02}; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 static guint8 features_icq[] = {0x01, 0x06}; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 static guint8 features_icq_offline[] = {0x01}; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 static guint8 ck[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 struct create_room { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 int exchange; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 struct oscar_ask_directim_data |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 char *who; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 * Various PRPL-specific buddy info that we want to keep track of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 * Some other info is maintained by locate.c, and I'd like to move |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 * the rest of this to libfaim, mostly im.c |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 * TODO: More of this should use the status API. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 struct buddyinfo { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 gboolean typingnot; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 guint32 ipaddr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
99 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 unsigned long ico_me_len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 unsigned long ico_me_csum; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 time_t ico_me_time; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 gboolean ico_informed; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 unsigned long ico_len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 unsigned long ico_csum; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 time_t ico_time; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 gboolean ico_need; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 gboolean ico_sent; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 struct name_data { |
15822 | 113 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 gchar *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 gchar *nick; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 |
21015
787b3897ba9f
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@hxbc.us>
parents:
21014
diff
changeset
|
118 static const char * const msgerrreason[] = { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 N_("Invalid error"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 N_("Invalid SNAC"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 N_("Rate to host"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
122 N_("Rate to client"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 N_("Not logged in"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 N_("Service unavailable"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
125 N_("Service not defined"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 N_("Obsolete SNAC"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 N_("Not supported by host"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 N_("Not supported by client"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 N_("Refused by client"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 N_("Reply too big"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 N_("Responses lost"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 N_("Request denied"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 N_("Busted SNAC payload"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 N_("Insufficient rights"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 N_("In local permit/deny"), |
23350
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23338
diff
changeset
|
136 N_("Warning level too high (sender)"), |
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23338
diff
changeset
|
137 N_("Warning level too high (receiver)"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 N_("User temporarily unavailable"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 N_("No match"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 N_("List overflow"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 N_("Request ambiguous"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 N_("Queue full"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 N_("Not while on AOL") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 }; |
21015
787b3897ba9f
Patch from Andrew Gaul to constify a bunch of static variables to reduce
Ka-Hing Cheung <khc@hxbc.us>
parents:
21014
diff
changeset
|
145 static const int msgerrreasonlen = G_N_ELEMENTS(msgerrreason); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 |
15822 | 147 /* 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
|
148 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
149 /* Only used when connecting with the old-style BUCP login */ |
15822 | 150 static int purple_parse_auth_resp (OscarData *, FlapConnection *, FlapFrame *, ...); |
151 static int purple_parse_login (OscarData *, FlapConnection *, FlapFrame *, ...); | |
152 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
|
153 |
15822 | 154 static int purple_handle_redirect (OscarData *, FlapConnection *, FlapFrame *, ...); |
155 static int purple_info_change (OscarData *, FlapConnection *, FlapFrame *, ...); | |
156 static int purple_account_confirm (OscarData *, FlapConnection *, FlapFrame *, ...); | |
157 static int purple_parse_oncoming (OscarData *, FlapConnection *, FlapFrame *, ...); | |
158 static int purple_parse_offgoing (OscarData *, FlapConnection *, FlapFrame *, ...); | |
159 static int purple_parse_incoming_im(OscarData *, FlapConnection *, FlapFrame *, ...); | |
160 static int purple_parse_misses (OscarData *, FlapConnection *, FlapFrame *, ...); | |
161 static int purple_parse_clientauto (OscarData *, FlapConnection *, FlapFrame *, ...); | |
162 static int purple_parse_userinfo (OscarData *, FlapConnection *, FlapFrame *, ...); | |
163 static int purple_got_infoblock (OscarData *, FlapConnection *, FlapFrame *, ...); | |
164 static int purple_parse_motd (OscarData *, FlapConnection *, FlapFrame *, ...); | |
165 static int purple_chatnav_info (OscarData *, FlapConnection *, FlapFrame *, ...); | |
166 static int purple_conv_chat_join (OscarData *, FlapConnection *, FlapFrame *, ...); | |
167 static int purple_conv_chat_leave (OscarData *, FlapConnection *, FlapFrame *, ...); | |
168 static int purple_conv_chat_info_update (OscarData *, FlapConnection *, FlapFrame *, ...); | |
169 static int purple_conv_chat_incoming_msg(OscarData *, FlapConnection *, FlapFrame *, ...); | |
170 static int purple_email_parseupdate(OscarData *, FlapConnection *, FlapFrame *, ...); | |
171 static int purple_icon_parseicon (OscarData *, FlapConnection *, FlapFrame *, ...); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 static int oscar_icon_req (OscarData *, FlapConnection *, FlapFrame *, ...); |
15822 | 173 static int purple_parse_msgack (OscarData *, FlapConnection *, FlapFrame *, ...); |
174 static int purple_parse_ratechange (OscarData *, FlapConnection *, FlapFrame *, ...); | |
175 static int purple_parse_evilnotify (OscarData *, FlapConnection *, FlapFrame *, ...); | |
176 static int purple_parse_searcherror(OscarData *, FlapConnection *, FlapFrame *, ...); | |
177 static int purple_parse_searchreply(OscarData *, FlapConnection *, FlapFrame *, ...); | |
178 static int purple_bosrights (OscarData *, FlapConnection *, FlapFrame *, ...); | |
179 static int purple_connerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
180 static int purple_parse_msgerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
181 static int purple_parse_mtn (OscarData *, FlapConnection *, FlapFrame *, ...); | |
182 static int purple_parse_locaterights(OscarData *, FlapConnection *, FlapFrame *, ...); | |
183 static int purple_parse_buddyrights(OscarData *, FlapConnection *, FlapFrame *, ...); | |
184 static int purple_parse_locerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
185 static int purple_parse_genericerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
186 static int purple_memrequest (OscarData *, FlapConnection *, FlapFrame *, ...); | |
187 static int purple_selfinfo (OscarData *, FlapConnection *, FlapFrame *, ...); | |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
188 #ifdef OLDSTYLE_ICQ_OFFLINEMSGS |
15822 | 189 static int purple_offlinemsg (OscarData *, FlapConnection *, FlapFrame *, ...); |
190 static int purple_offlinemsgdone (OscarData *, FlapConnection *, FlapFrame *, ...); | |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
191 #endif /* OLDSTYLE_ICQ_OFFLINEMSGS */ |
15822 | 192 static int purple_icqalias (OscarData *, FlapConnection *, FlapFrame *, ...); |
193 static int purple_icqinfo (OscarData *, FlapConnection *, FlapFrame *, ...); | |
194 static int purple_popup (OscarData *, FlapConnection *, FlapFrame *, ...); | |
195 static int purple_ssi_parseerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
196 static int purple_ssi_parserights (OscarData *, FlapConnection *, FlapFrame *, ...); | |
197 static int purple_ssi_parselist (OscarData *, FlapConnection *, FlapFrame *, ...); | |
198 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
|
199 static int purple_ssi_parseaddmod (OscarData *, FlapConnection *, FlapFrame *, ...); |
15822 | 200 static int purple_ssi_authgiven (OscarData *, FlapConnection *, FlapFrame *, ...); |
201 static int purple_ssi_authrequest (OscarData *, FlapConnection *, FlapFrame *, ...); | |
202 static int purple_ssi_authreply (OscarData *, FlapConnection *, FlapFrame *, ...); | |
203 static int purple_ssi_gotadded (OscarData *, FlapConnection *, FlapFrame *, ...); | |
204 | |
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
|
205 static void purple_icons_fetch(PurpleConnection *gc); |
15822 | 206 |
207 void oscar_set_info(PurpleConnection *gc, const char *info); | |
208 static void oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, gboolean setstatus, PurpleStatus *status); | |
209 static void oscar_set_extendedstatus(PurpleConnection *gc); | |
210 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
|
211 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 static void oscar_free_name_data(struct name_data *data) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 g_free(data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 g_free(data->nick); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 g_free(data); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 #ifdef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 const char *oscar_get_locale_charset(void) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 static const char *charset = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 if (charset == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 g_get_charset(&charset); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 return charset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 * Determine how we can send this message. Per the warnings elsewhere |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 * in this file, these little checks determine the simplest encoding |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 * we can use for a given message send using it. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 static guint32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 oscar_charset_check(const char *utf8) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 int i = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 int charset = AIM_CHARSET_ASCII; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 * Can we get away with using our custom encoding? |
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 while (utf8[i]) |
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 if ((unsigned char)utf8[i] > 0x7f) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 /* not ASCII! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 charset = AIM_CHARSET_CUSTOM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 break; |
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 i++; |
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 /* |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
252 * Must we send this message as UNICODE (in the UTF-16BE encoding)? |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 while (utf8[i]) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 /* ISO-8859-1 is 0x00-0xbf in the first byte |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 * followed by 0xc0-0xc3 in the second */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 if ((unsigned char)utf8[i] < 0x80) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 i++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 } else if (((unsigned char)utf8[i] & 0xfc) == 0xc0 && |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 ((unsigned char)utf8[i + 1] & 0xc0) == 0x80) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 i += 2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 charset = AIM_CHARSET_UNICODE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 return charset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 * Take a string of the form charset="bleh" where bleh is |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 * one of us-ascii, utf-8, iso-8859-1, or unicode-2-0, and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 * return a newly allocated string containing bleh. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 gchar * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 oscar_encoding_extract(const char *encoding) |
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 gchar *ret = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 char *begin, *end; |
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 g_return_val_if_fail(encoding != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 /* Make sure encoding begins with charset= */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 if (strncmp(encoding, "text/aolrtf; charset=", 21) && |
16823
f0b4efc4a83a
If we're sent text/plain by an AIM client and it specifies a charset, we can now use that charset via oscar_encoding_extract() instead of ignoring it and therefore assuming UTF-8
Evan Schoenberg <evan.s@dreskin.net>
parents:
16805
diff
changeset
|
288 strncmp(encoding, "text/x-aolrtf; charset=", 23) && |
f0b4efc4a83a
If we're sent text/plain by an AIM client and it specifies a charset, we can now use that charset via oscar_encoding_extract() instead of ignoring it and therefore assuming UTF-8
Evan Schoenberg <evan.s@dreskin.net>
parents:
16805
diff
changeset
|
289 strncmp(encoding, "text/plain; charset=", 20)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 return NULL; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 begin = strchr(encoding, '"'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 end = strrchr(encoding, '"'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 if ((begin == NULL) || (end == NULL) || (begin >= end)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 ret = g_strndup(begin+1, (end-1) - begin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 gchar * |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
306 oscar_encoding_to_utf8(PurpleAccount *account, const char *encoding, const char *text, int textlen) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 gchar *utf8 = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 if ((encoding == NULL) || encoding[0] == '\0') { |
15822 | 311 purple_debug_info("oscar", "Empty encoding, assuming UTF-8\n"); |
17082
7ade887fd3f6
Replace strcasecmp() calls with glib equivalents.
Richard Laager <rlaager@wiktel.com>
parents:
16945
diff
changeset
|
312 } else if (!g_ascii_strcasecmp(encoding, "iso-8859-1")) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 utf8 = g_convert(text, textlen, "UTF-8", "iso-8859-1", NULL, NULL, NULL); |
17082
7ade887fd3f6
Replace strcasecmp() calls with glib equivalents.
Richard Laager <rlaager@wiktel.com>
parents:
16945
diff
changeset
|
314 } else if (!g_ascii_strcasecmp(encoding, "ISO-8859-1-Windows-3.1-Latin-1") || |
7ade887fd3f6
Replace strcasecmp() calls with glib equivalents.
Richard Laager <rlaager@wiktel.com>
parents:
16945
diff
changeset
|
315 !g_ascii_strcasecmp(encoding, "us-ascii")) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 utf8 = g_convert(text, textlen, "UTF-8", "Windows-1252", NULL, NULL, NULL); |
17082
7ade887fd3f6
Replace strcasecmp() calls with glib equivalents.
Richard Laager <rlaager@wiktel.com>
parents:
16945
diff
changeset
|
318 } else if (!g_ascii_strcasecmp(encoding, "unicode-2-0")) { |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
319 /* Some official ICQ clients are apparently total crack, |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
320 * and have been known to save a UTF-8 string converted |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
321 * from the locale character set to UTF-16 (not from UTF-8 |
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
322 * to UTF-16!) in the away message. This hack should find |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
323 * and do something (un)reasonable with that, and not |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
324 * mess up too much else. */ |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
325 const gchar *charset = purple_account_get_string(account, "encoding", NULL); |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
326 if (charset) { |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
327 gsize len; |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
328 utf8 = g_convert(text, textlen, charset, "UTF-16BE", &len, NULL, NULL); |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
329 if (!utf8 || len != textlen || !g_utf8_validate(utf8, -1, NULL)) { |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
330 g_free(utf8); |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
331 utf8 = NULL; |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
332 } else { |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
333 purple_debug_info("oscar", "Used broken ICQ fallback encoding\n"); |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
334 } |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
335 } |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
336 if (!utf8) |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
337 utf8 = g_convert(text, textlen, "UTF-8", "UTF-16BE", NULL, NULL, NULL); |
17082
7ade887fd3f6
Replace strcasecmp() calls with glib equivalents.
Richard Laager <rlaager@wiktel.com>
parents:
16945
diff
changeset
|
338 } else if (g_ascii_strcasecmp(encoding, "utf-8")) { |
15822 | 339 purple_debug_warning("oscar", "Unrecognized character encoding \"%s\", " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 "attempting to convert to UTF-8 anyway\n", encoding); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 utf8 = g_convert(text, textlen, "UTF-8", encoding, NULL, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 * If utf8 is still NULL then either the encoding is utf-8 or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 * we have been unable to convert the text to utf-8 from the encoding |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 * that was specified. So we check if the text is valid utf-8 then |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
348 * just copy it. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
350 if (utf8 == NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 if (textlen != 0 && *text != '\0' |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 && !g_utf8_validate(text, textlen, NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 utf8 = g_strdup(_("(There was an error receiving this message. The buddy you are speaking with is probably using a different encoding than expected. If you know what encoding he is using, you can specify it in the advanced account options for your AIM/ICQ account.)")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 utf8 = g_strndup(text, textlen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 return utf8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 static gchar * |
15822 | 362 oscar_utf8_try_convert(PurpleAccount *account, const gchar *msg) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
363 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
364 const char *charset = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 char *ret = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
367 if(oscar_util_valid_name_icq(purple_account_get_username(account))) |
15822 | 368 charset = purple_account_get_string(account, "encoding", NULL); |
15373
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 if(charset && *charset) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
371 ret = g_convert(msg, -1, "UTF-8", charset, NULL, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
373 if(!ret) |
15822 | 374 ret = purple_utf8_try_convert(msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
375 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 return ret; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 static gchar * |
15822 | 380 purple_plugin_oscar_convert_to_utf8(const gchar *data, gsize datalen, const char *charsetstr, gboolean fallback) |
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 gchar *ret = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
383 GError *err = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
384 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
385 if ((charsetstr == NULL) || (*charsetstr == '\0')) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 |
17082
7ade887fd3f6
Replace strcasecmp() calls with glib equivalents.
Richard Laager <rlaager@wiktel.com>
parents:
16945
diff
changeset
|
388 if (g_ascii_strcasecmp("UTF-8", charsetstr)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
389 if (fallback) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
390 ret = g_convert_with_fallback(data, datalen, "UTF-8", charsetstr, "?", NULL, NULL, &err); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
392 ret = g_convert(data, datalen, "UTF-8", charsetstr, NULL, NULL, &err); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
393 if (err != NULL) { |
15822 | 394 purple_debug_warning("oscar", "Conversion from %s failed: %s.\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 charsetstr, err->message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
396 g_error_free(err); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
397 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
398 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
399 if (g_utf8_validate(data, datalen, NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
400 ret = g_strndup(data, datalen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
401 else |
15822 | 402 purple_debug_warning("oscar", "String is not valid UTF-8.\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
403 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
404 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
405 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
406 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 * This attemps to decode an incoming IM into a UTF8 string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
410 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 * We try decoding using two different character sets. The charset |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 * specified in the IM determines the order in which we attempt to |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 * decode. We do this because there are lots of broken ICQ clients |
15822 | 414 * that don't correctly send non-ASCII messages. And if Purple isn't |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 * able to deal with that crap, then people complain like banshees. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
416 * charsetstr1 is always set to what the correct encoding should be. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 gchar * |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
419 purple_plugin_oscar_decode_im_part(PurpleAccount *account, const char *sourcebn, guint16 charset, guint16 charsubset, const gchar *data, gsize datalen) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 gchar *ret = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 const gchar *charsetstr1, *charsetstr2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 |
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
|
424 purple_debug_info("oscar", "Parsing IM part, charset=0x%04hx, charsubset=0x%04hx, datalen=%" G_GSIZE_FORMAT "\n", charset, charsubset, datalen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
426 if ((datalen == 0) || (data == NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
427 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
428 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
429 if (charset == AIM_CHARSET_UNICODE) { |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
430 charsetstr1 = "UTF-16BE"; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
431 charsetstr2 = "UTF-8"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
432 } else if (charset == AIM_CHARSET_CUSTOM) { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
433 if ((sourcebn != NULL) && oscar_util_valid_name_icq(sourcebn)) |
15822 | 434 charsetstr1 = purple_account_get_string(account, "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
435 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
436 charsetstr1 = "ISO-8859-1"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
437 charsetstr2 = "UTF-8"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 } else if (charset == AIM_CHARSET_ASCII) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
439 /* Should just be "ASCII" */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
440 charsetstr1 = "ASCII"; |
15822 | 441 charsetstr2 = purple_account_get_string(account, "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
442 } else if (charset == 0x000d) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 /* Mobile AIM client on a Nokia 3100 and an LG VX6000 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
444 charsetstr1 = "ISO-8859-1"; |
15822 | 445 charsetstr2 = purple_account_get_string(account, "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
446 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
447 /* Unknown, hope for valid UTF-8... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
448 charsetstr1 = "UTF-8"; |
15822 | 449 charsetstr2 = purple_account_get_string(account, "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); |
450 } | |
451 | |
452 ret = purple_plugin_oscar_convert_to_utf8(data, datalen, charsetstr1, FALSE); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 if (ret == NULL) |
15822 | 454 ret = purple_plugin_oscar_convert_to_utf8(data, datalen, charsetstr2, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 if (ret == NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 char *str, *salvage, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 str = g_malloc(datalen + 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
459 strncpy(str, data, datalen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 str[datalen] = '\0'; |
15822 | 461 salvage = purple_utf8_salvage(str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
462 tmp = g_strdup_printf(_("(There was an error receiving this message. Either you and %s have different encodings selected, or %s has a buggy client.)"), |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
463 sourcebn, sourcebn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
464 ret = g_strdup_printf("%s %s", salvage, tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 g_free(str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
467 g_free(salvage); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 } |
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 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
471 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 * Figure out what encoding to use when sending a given outgoing message. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 static void |
15822 | 477 purple_plugin_oscar_convert_to_best_encoding(PurpleConnection *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
|
478 const char *destbn, const gchar *from, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 gchar **msg, int *msglen_int, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 guint16 *charset, guint16 *charsubset) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
482 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 483 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
|
484 GError *err = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 aim_userinfo_t *userinfo = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 const gchar *charsetstr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
487 gsize msglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
489 /* Attempt to send as ASCII */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 if (oscar_charset_check(from) == AIM_CHARSET_ASCII) { |
19197
47942d19f301
Use -1 as length with g_convert() functions instead of strlen()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19195
diff
changeset
|
491 *msg = g_convert(from, -1, "ASCII", "UTF-8", NULL, &msglen, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 *charset = AIM_CHARSET_ASCII; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 *charsubset = 0x0000; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 *msglen_int = msglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 * If we're sending to an ICQ user, and they are in our |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 * buddy list, and they are advertising the Unicode |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 * capability, and they are online, then attempt to send |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
502 * as UTF-16BE. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
504 if ((destbn != NULL) && oscar_util_valid_name_icq(destbn)) |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
505 userinfo = aim_locate_finduserinfo(od, destbn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 if ((userinfo != NULL) && (userinfo->capabilities & OSCAR_CAPABILITY_UNICODE)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 { |
15822 | 509 PurpleBuddy *b; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
510 b = purple_find_buddy(account, destbn); |
15822 | 511 if ((b != NULL) && (PURPLE_BUDDY_IS_ONLINE(b))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 { |
24224
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
513 *msg = g_convert(from, -1, "UTF-16BE", "UTF-8", NULL, &msglen, &err); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 if (*msg != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 *charset = AIM_CHARSET_UNICODE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 *charsubset = 0x0000; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 *msglen_int = msglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 } |
24224
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
521 |
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
522 purple_debug_error("oscar", "Conversion from UTF-8 to UTF-16BE failed: %s.\n", |
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
523 err->message); |
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
524 g_error_free(err); |
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
525 err = NULL; |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 * If this is AIM then attempt to send as ISO-8859-1. If this is |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 * ICQ then attempt to send as the user specified character encoding. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
533 charsetstr = "ISO-8859-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
|
534 if ((destbn != NULL) && oscar_util_valid_name_icq(destbn)) |
15822 | 535 charsetstr = purple_account_get_string(account, "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
537 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 * XXX - We need a way to only attempt to convert if we KNOW "from" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
539 * can be converted to "charsetstr" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 */ |
24224
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
541 *msg = g_convert(from, -1, charsetstr, "UTF-8", NULL, &msglen, &err); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
542 if (*msg != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
543 *charset = AIM_CHARSET_CUSTOM; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 *charsubset = 0x0000; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
545 *msglen_int = msglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 return; |
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 |
24224
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
549 purple_debug_info("oscar", "Conversion from UTF-8 to %s failed (%s), falling back to unicode.\n", |
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
550 charsetstr, err->message); |
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
551 g_error_free(err); |
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
552 err = NULL; |
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
553 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 /* |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
555 * Nothing else worked, so send as UTF-16BE. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 */ |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
557 *msg = g_convert(from, -1, "UTF-16BE", "UTF-8", NULL, &msglen, &err); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 if (*msg != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 *charset = AIM_CHARSET_UNICODE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 *charsubset = 0x0000; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 *msglen_int = msglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 |
15822 | 565 purple_debug_error("oscar", "Error converting a Unicode message: %s\n", err->message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 g_error_free(err); |
24224
9396a2124893
Add some debug output to the oscar encoding process.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24031
diff
changeset
|
567 err = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 |
15822 | 569 purple_debug_error("oscar", "This should NEVER happen! Sending UTF-8 text flagged as ASCII.\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 *msg = g_strdup(from); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 *msglen_int = strlen(*msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 *charset = AIM_CHARSET_ASCII; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 *charsubset = 0x0000; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
574 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
575 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
577 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 * Looks for %n, %d, or %t in a string, and replaces them with the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
579 * specified name, date, and time, respectively. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 * @param str The string that may contain the special variables. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
582 * @param name The sender name. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
583 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
584 * @return A newly allocated string where the special variables are |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
585 * expanded. This should be g_free'd by the caller. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
586 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
587 static gchar * |
15822 | 588 purple_str_sub_away_formatters(const char *str, const char *name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 char *c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
591 GString *cpy; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
592 time_t t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
593 struct tm *tme; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 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
|
596 g_return_val_if_fail(name != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
597 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
598 /* Create an empty GString that is hopefully big enough for most messages */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 cpy = g_string_sized_new(1024); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
601 t = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
602 tme = localtime(&t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
604 c = (char *)str; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
605 while (*c) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
606 switch (*c) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
607 case '%': |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
608 if (*(c + 1)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
609 switch (*(c + 1)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
610 case 'n': |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 /* append name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 g_string_append(cpy, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 c++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 case 'd': |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 /* append date */ |
15822 | 617 g_string_append(cpy, purple_date_format_short(tme)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 c++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
620 case 't': |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
621 /* append time */ |
15822 | 622 g_string_append(cpy, purple_time_format(tme)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 c++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
624 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
626 g_string_append_c(cpy, *c); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
627 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
628 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
629 g_string_append_c(cpy, *c); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
630 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 g_string_append_c(cpy, *c); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
634 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 c++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 return g_string_free(cpy, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
640 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 static gchar *oscar_caps_to_string(OscarCapability caps) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
643 GString *str; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 const gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 guint bit = 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 str = g_string_new(""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 if (!caps) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
650 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 } else while (bit <= OSCAR_CAPABILITY_LAST) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 if (bit & caps) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 switch (bit) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 case OSCAR_CAPABILITY_BUDDYICON: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
655 tmp = _("Buddy Icon"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
656 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 case OSCAR_CAPABILITY_TALK: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 tmp = _("Voice"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
660 case OSCAR_CAPABILITY_DIRECTIM: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
661 tmp = _("AIM Direct IM"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 case OSCAR_CAPABILITY_CHAT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
664 tmp = _("Chat"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 case OSCAR_CAPABILITY_GETFILE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
667 tmp = _("Get File"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
669 case OSCAR_CAPABILITY_SENDFILE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 tmp = _("Send File"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 case OSCAR_CAPABILITY_GAMES: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 case OSCAR_CAPABILITY_GAMES2: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
674 tmp = _("Games"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
676 case OSCAR_CAPABILITY_ADDINS: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 tmp = _("Add-Ins"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 case OSCAR_CAPABILITY_SENDBUDDYLIST: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
680 tmp = _("Send Buddy List"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 case OSCAR_CAPABILITY_ICQ_DIRECT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
683 tmp = _("ICQ Direct Connect"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
684 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
685 case OSCAR_CAPABILITY_APINFO: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 tmp = _("AP User"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
687 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 case OSCAR_CAPABILITY_ICQRTF: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
689 tmp = _("ICQ RTF"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
691 case OSCAR_CAPABILITY_EMPTY: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
692 tmp = _("Nihilist"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
693 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
694 case OSCAR_CAPABILITY_ICQSERVERRELAY: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
695 tmp = _("ICQ Server Relay"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
697 case OSCAR_CAPABILITY_UNICODEOLD: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 tmp = _("Old ICQ UTF8"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 case OSCAR_CAPABILITY_TRILLIANCRYPT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
701 tmp = _("Trillian Encryption"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 case OSCAR_CAPABILITY_UNICODE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 tmp = _("ICQ UTF8"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 case OSCAR_CAPABILITY_HIPTOP: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 tmp = _("Hiptop"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
709 case OSCAR_CAPABILITY_SECUREIM: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 tmp = _("Security Enabled"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 case OSCAR_CAPABILITY_VIDEO: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 tmp = _("Video Chat"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
714 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 /* Not actually sure about this one... WinAIM doesn't show anything */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
716 case OSCAR_CAPABILITY_ICHATAV: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
717 tmp = _("iChat AV"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 case OSCAR_CAPABILITY_LIVEVIDEO: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 tmp = _("Live Video"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
722 case OSCAR_CAPABILITY_CAMERA: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 tmp = _("Camera"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
724 break; |
23314
b3ec26e66e26
Specified one of the OSCAR_CAPABILITY_GENERICUNKNOWN capabilities to be
Evan Schoenberg <evan.s@dreskin.net>
parents:
23312
diff
changeset
|
725 case OSCAR_CAPABILITY_ICHAT_SCREENSHARE: |
b3ec26e66e26
Specified one of the OSCAR_CAPABILITY_GENERICUNKNOWN capabilities to be
Evan Schoenberg <evan.s@dreskin.net>
parents:
23312
diff
changeset
|
726 tmp = _("Screen Sharing"); |
b3ec26e66e26
Specified one of the OSCAR_CAPABILITY_GENERICUNKNOWN capabilities to be
Evan Schoenberg <evan.s@dreskin.net>
parents:
23312
diff
changeset
|
727 break; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
728 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
729 tmp = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
731 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
732 if (tmp) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 g_string_append_printf(str, "%s%s", (*(str->str) == '\0' ? "" : ", "), tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
734 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
735 bit <<= 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
736 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
737 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
738 return g_string_free(str, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
740 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 static char *oscar_icqstatus(int state) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
742 /* 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
|
743 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
|
744 return g_strdup(_("Free For Chat")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
745 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
|
746 return g_strdup(_("Do Not Disturb")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 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
|
748 return g_strdup(_("Not Available")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 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
|
750 return g_strdup(_("Occupied")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
751 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
|
752 return g_strdup(_("Away")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 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
|
754 return g_strdup(_("Web Aware")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
755 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
|
756 return g_strdup(_("Invisible")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
757 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
|
758 return g_strdup(_("Online")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
759 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
760 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
761 static void |
15822 | 762 oscar_user_info_add_pair(PurpleNotifyUserInfo *user_info, const char *name, const char *value) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
763 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
764 if (value && value[0]) { |
15822 | 765 purple_notify_user_info_add_pair(user_info, name, value); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
766 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
767 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
768 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 static void |
15822 | 770 oscar_user_info_convert_and_add_pair(PurpleAccount *account, PurpleNotifyUserInfo *user_info, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
771 const char *name, const char *value) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
772 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
773 gchar *utf8; |
23267 | 774 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
775 if (value && value[0] && (utf8 = oscar_utf8_try_convert(account, value))) { |
15822 | 776 purple_notify_user_info_add_pair(user_info, name, utf8); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
777 g_free(utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
778 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
779 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 static void |
15822 | 782 oscar_user_info_convert_and_add(PurpleAccount *account, PurpleNotifyUserInfo *user_info, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
783 const char *name, const char *value) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
784 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 gchar *utf8; |
23267 | 786 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 if (value && value[0] && (utf8 = oscar_utf8_try_convert(account, value))) { |
21138
3ee4d335247d
This is a fix from goyko for ICQ character set conversion in user info.
Ethan Blanton <elb@pidgin.im>
parents:
21015
diff
changeset
|
788 purple_notify_user_info_add_pair(user_info, name, utf8); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
789 g_free(utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
791 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
792 |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
793 /** |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
794 * @brief Append the status information to a user_info struct |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
795 * |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
796 * The returned information is HTML-ready, appropriately escaped, as all information in a user_info struct should be HTML. |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
797 * |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
798 * @param gc The PurpleConnection |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
799 * @param user_info A PurpleNotifyUserInfo object to which status information will be added |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
800 * @param b The PurpleBuddy whose status is desired. This or the aim_userinfo_t (or both) must be passed to oscar_user_info_append_status(). |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
801 * @param userinfo The aim_userinfo_t of the buddy whose status is desired. This or the PurpleBuddy (or both) must be passed to oscar_user_info_append_status(). |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
802 * @param strip_html_tags If strip_html_tags is TRUE, tags embedded in the status message will be stripped, returning a non-formatted string. The string will still be HTML escaped. |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
803 */ |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
804 static void oscar_user_info_append_status(PurpleConnection *gc, PurpleNotifyUserInfo *user_info, PurpleBuddy *b, aim_userinfo_t *userinfo, gboolean strip_html_tags) |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
805 { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
806 PurpleAccount *account = purple_connection_get_account(gc); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
807 OscarData *od; |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
808 PurplePresence *presence = NULL; |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
809 PurpleStatus *status = NULL; |
23244
1cf1f77169e5
Avoid potentially uninitialized variables
Stu Tomlinson <stu@nosnilmot.com>
parents:
23237
diff
changeset
|
810 gchar *message = NULL, *itmsurl = NULL, *tmp; |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
811 gboolean is_away; |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
812 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
813 od = purple_connection_get_protocol_data(gc); |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
814 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
815 if (userinfo == NULL) |
25934
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
816 userinfo = aim_locate_finduserinfo(od, purple_buddy_get_name(b)); |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
817 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
818 if ((user_info == NULL) || ((b == NULL) && (userinfo == NULL))) |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
819 return; |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
820 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
821 if (b == 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
|
822 b = purple_find_buddy(purple_connection_get_account(gc), userinfo->bn); |
23267 | 823 |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
824 if (b) { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
825 presence = purple_buddy_get_presence(b); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
826 status = purple_presence_get_active_status(presence); |
23267 | 827 |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
828 message = g_strdup(purple_status_get_attr_string(status, "message")); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
829 itmsurl = g_strdup(purple_status_get_attr_string(status, "itmsurl")); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
830 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
831 } else { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
832 /* This is an OSCAR contact for whom we don't have a PurpleBuddy but do have information. */ |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
833 if ((userinfo->flags & AIM_FLAG_AWAY)) { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
834 /* Away message? */ |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
835 if ((userinfo->flags & AIM_FLAG_AWAY) && (userinfo->away_len > 0) && (userinfo->away != NULL) && (userinfo->away_encoding != NULL)) { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
836 tmp = oscar_encoding_extract(userinfo->away_encoding); |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
837 message = oscar_encoding_to_utf8(account, tmp, userinfo->away, |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
838 userinfo->away_len); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
839 g_free(tmp); |
23939
9b2c273d764d
Fix printf of a NULL string and also an invalid free. Fixes #6627
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23901
diff
changeset
|
840 } |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
841 } else { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
842 /* Available message? */ |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
843 if ((userinfo->status != NULL) && userinfo->status[0] != '\0') { |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
844 message = oscar_encoding_to_utf8(account, userinfo->status_encoding, |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
845 userinfo->status, userinfo->status_len); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
846 } |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
847 #if defined (_WIN32) || defined (__APPLE__) |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
848 if (userinfo->itmsurl && (userinfo->itmsurl[0] != '\0')) |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
849 itmsurl = oscar_encoding_to_utf8(account, userinfo->itmsurl_encoding, |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
850 userinfo->itmsurl, userinfo->itmsurl_len); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
851 #endif |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
852 } |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
853 } |
23267 | 854 |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
855 is_away = ((status && !purple_status_is_available(status)) || |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
856 (userinfo && (userinfo->flags & AIM_FLAG_AWAY))); |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
857 |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
858 if (strip_html_tags) { |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
859 /* Away messges are HTML, but available messages were originally plain text. |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
860 * We therefore need to strip away messages but not available messages if we're asked to remove HTML tags. |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
861 */ |
23337
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
862 if (is_away && message) { |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
863 gchar *tmp2; |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
864 tmp = purple_markup_strip_html(message); |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
865 g_free(message); |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
866 tmp2 = g_markup_escape_text(tmp, -1); |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
867 g_free(tmp); |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
868 message = tmp2; |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
869 } |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
870 |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
871 } else { |
23337
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
872 if (itmsurl) { |
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
873 tmp = g_strdup_printf("<a href=\"%s\">%s</a>", |
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
874 itmsurl, message); |
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
875 g_free(message); |
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
876 message = tmp; |
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
877 } |
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
878 } |
26232
1977e930ab03
Make sure we free itmsurl when showing the info window for a buddy
Mark Doliner <mark@kingant.net>
parents:
26203
diff
changeset
|
879 g_free(itmsurl); |
23337
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
880 |
96dd27f5b45b
Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23318
diff
changeset
|
881 if (is_away && message) { |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
882 tmp = purple_str_sub_away_formatters(message, purple_account_get_username(account)); |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
883 g_free(message); |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
884 message = tmp; |
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
885 } |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
886 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
887 if (b) { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
888 if (purple_presence_is_online(presence)) { |
25934
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
889 if (oscar_util_valid_name_icq(purple_buddy_get_name(b)) || is_away || !message || !(*message)) { |
23318
c200661b5c5c
As XMPP does, prefix away messages with the status name in oscar user info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23314
diff
changeset
|
890 /* Append the status name for online ICQ statuses, away AIM statuses, and for all buddies with no message. |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
891 * If the status name and the message are the same, only show one. */ |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
892 const char *status_name = purple_status_get_name(status); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
893 if (status_name && message && !strcmp(status_name, message)) |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
894 status_name = NULL; |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
895 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
896 tmp = g_strdup_printf("%s%s%s", |
23939
9b2c273d764d
Fix printf of a NULL string and also an invalid free. Fixes #6627
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23901
diff
changeset
|
897 status_name ? status_name : "", |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
898 ((status_name && message) && *message) ? ": " : "", |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
899 (message && *message) ? message : ""); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
900 g_free(message); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
901 message = tmp; |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
902 } |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
903 |
25934
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
904 } else if (aim_ssi_waitingforauth(od->ssi.local, |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
905 aim_ssi_itemlist_findparentname(od->ssi.local, purple_buddy_get_name(b)), |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
906 purple_buddy_get_name(b))) |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
907 { |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
908 /* Note if an offline buddy is not authorized */ |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
909 tmp = g_strdup_printf("%s%s%s", |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
910 _("Not Authorized"), |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
911 (message && *message) ? ": " : "", |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
912 (message && *message) ? message : ""); |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
913 g_free(message); |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
914 message = tmp; |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
915 } else { |
25934
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
916 g_free(message); |
3461bf74cbf1
Fix a crash in this branch that I introduced a few days ago. bname
Mark Doliner <mark@kingant.net>
parents:
25933
diff
changeset
|
917 message = g_strdup(_("Offline")); |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
918 } |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
919 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
920 } |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
921 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
922 purple_notify_user_info_add_pair(user_info, _("Status"), message); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
923 g_free(message); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
924 } |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
925 |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
926 static void oscar_user_info_append_extra_info(PurpleConnection *gc, PurpleNotifyUserInfo *user_info, PurpleBuddy *b, aim_userinfo_t *userinfo) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
928 OscarData *od; |
15822 | 929 PurpleAccount *account; |
930 PurplePresence *presence = NULL; | |
931 PurpleStatus *status = NULL; | |
932 PurpleGroup *g = NULL; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 struct buddyinfo *bi = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
934 char *tmp; |
26868
9612a2e8db87
Avoid an assertion failure when getting info on an AIM buddy. Thank to zac for pointing this out.
Paul Aurich <paul@darkrain42.org>
parents:
26852
diff
changeset
|
935 const char *bname = NULL, *gname = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
937 od = purple_connection_get_protocol_data(gc); |
15822 | 938 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 if ((user_info == NULL) || ((b == NULL) && (userinfo == NULL))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 if (userinfo == NULL) |
26868
9612a2e8db87
Avoid an assertion failure when getting info on an AIM buddy. Thank to zac for pointing this out.
Paul Aurich <paul@darkrain42.org>
parents:
26852
diff
changeset
|
944 userinfo = aim_locate_finduserinfo(od, purple_buddy_get_name(b)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 if (b == 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
|
947 b = purple_find_buddy(account, userinfo->bn); |
15373
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 if (b != NULL) { |
26868
9612a2e8db87
Avoid an assertion failure when getting info on an AIM buddy. Thank to zac for pointing this out.
Paul Aurich <paul@darkrain42.org>
parents:
26852
diff
changeset
|
950 bname = purple_buddy_get_name(b); |
15822 | 951 g = purple_buddy_get_group(b); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
952 gname = purple_group_get_name(g); |
15822 | 953 presence = purple_buddy_get_presence(b); |
954 status = purple_presence_get_active_status(presence); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
957 if (userinfo != 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
|
958 bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, userinfo->bn)); |
23267 | 959 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 if ((bi != NULL) && (bi->ipaddr != 0)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
961 tmp = g_strdup_printf("%hhu.%hhu.%hhu.%hhu", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
962 (bi->ipaddr & 0xff000000) >> 24, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 (bi->ipaddr & 0x00ff0000) >> 16, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
964 (bi->ipaddr & 0x0000ff00) >> 8, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
965 (bi->ipaddr & 0x000000ff)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 oscar_user_info_add_pair(user_info, _("IP Address"), tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
967 g_free(tmp); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 if ((userinfo != NULL) && (userinfo->warnlevel != 0)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
971 tmp = g_strdup_printf("%d", (int)(userinfo->warnlevel/10.0 + .5)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
972 oscar_user_info_add_pair(user_info, _("Warning Level"), tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
973 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
974 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
975 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
976 if ((b != NULL) && (bname != NULL) && (g != NULL) && (gname != NULL)) { |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
977 tmp = aim_ssi_getcomment(od->ssi.local, gname, bname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 if (tmp != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
979 char *tmp2 = g_markup_escape_text(tmp, strlen(tmp)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
980 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
981 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
982 oscar_user_info_convert_and_add_pair(account, user_info, _("Buddy Comment"), tmp2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
983 g_free(tmp2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
984 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
986 } |
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 static char *extract_name(const char *name) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
989 char *tmp, *x; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
990 int i, j; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
991 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
992 if (!name) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 return NULL; |
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 x = strchr(name, '-'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
996 if (!x) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
997 return NULL; |
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 x = strchr(x + 1, '-'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 if (!x) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1001 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1002 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1003 tmp = g_strdup(++x); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1004 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1005 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
|
1006 char hex[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1007 if (x[i] != '%') { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1008 tmp[j++] = x[i]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1009 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1011 strncpy(hex, x + ++i, 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1012 hex[2] = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1013 i++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1014 tmp[j++] = strtol(hex, NULL, 16); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 } |
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 tmp[j] = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 return tmp; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 static struct chat_connection * |
15822 | 1022 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
|
1023 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1024 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
|
1025 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1026 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1027 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 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
|
1029 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 if (cc->id == id) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1032 return cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1033 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1034 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1035 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1036 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1037 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1038 static struct chat_connection * |
15822 | 1039 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
|
1040 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1041 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
|
1042 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1043 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1044 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1045 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
|
1046 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1047 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1048 if (cc->conn == conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1049 return cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1051 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1052 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1053 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1054 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1055 static struct chat_connection * |
15822 | 1056 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
|
1057 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1058 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
|
1059 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1060 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1061 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1062 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
|
1063 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1064 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1065 if (cc->conv == conv) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1066 return cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1067 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1068 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1069 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1070 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1071 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1072 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1073 oscar_chat_destroy(struct chat_connection *cc) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1074 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1075 g_free(cc->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1076 g_free(cc->show); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1077 g_free(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1078 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1079 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1080 static void |
15822 | 1081 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
|
1082 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1083 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
|
1084 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1085 /* Notify the conversation window that we've left the chat */ |
15822 | 1086 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
|
1087 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1088 /* Destroy the chat_connection */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1089 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
|
1090 flap_connection_schedule_destroy(cc->conn, OSCAR_DISCONNECT_DONE, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1091 oscar_chat_destroy(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1092 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1093 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1094 /** |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1095 * 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
|
1096 * 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
|
1097 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1098 static void |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1099 connection_common_error_cb(FlapConnection *conn, const gchar *error_message) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1100 { |
25381
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
1101 OscarData *od; |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1102 PurpleConnection *gc; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1103 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1104 od = conn->od; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1105 gc = od->gc; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1106 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1107 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
|
1108 "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
|
1109 |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1110 if (conn->type == SNAC_FAMILY_AUTH) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1111 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1112 /* 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
|
1113 gchar *msg; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1114 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
|
1115 error_message); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1116 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1117 g_free(msg); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1118 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1119 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
|
1120 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1121 gchar *msg; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1122 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
|
1123 error_message); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1124 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1125 g_free(msg); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1126 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1127 else |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1128 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1129 /* 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
|
1130 flap_connection_schedule_destroy(conn, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1131 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
|
1132 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1133 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1134 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1135 /** |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1136 * 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
|
1137 * 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
|
1138 * 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
|
1139 */ |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1140 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1141 connection_common_established_cb(FlapConnection *conn) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1142 { |
25381
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
1143 OscarData *od; |
15822 | 1144 PurpleConnection *gc; |
1145 PurpleAccount *account; | |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1146 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1147 od = conn->od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1148 gc = od->gc; |
15822 | 1149 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 |
15822 | 1151 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
|
1152 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
|
1153 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1154 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
|
1155 flap_connection_send_version(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1157 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1158 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
|
1159 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1160 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
|
1161 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
|
1162 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
|
1163 conn, 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
|
1164 od->icq ? &icqinfo : &aiminfo); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1165 } else { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1166 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
|
1167 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
|
1168 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1169 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1170 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1171 g_free(conn->cookie); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 conn->cookie = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1173 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1175 if (conn->type == SNAC_FAMILY_AUTH) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1177 /* This only happens when connecting with the old-style BUCP login */ |
15822 | 1178 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
|
1179 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
|
1180 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
|
1181 ck[1] = 0x65; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1182 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1183 else if (conn->type == SNAC_FAMILY_LOCATE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1184 { |
15822 | 1185 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
|
1186 ck[4] = 0x61; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 else if (conn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1190 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
|
1191 conn->new_conn_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1194 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1195 static void |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1196 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
|
1197 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1198 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1199 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1200 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1201 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1202 conn->connect_data = NULL; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1203 conn->fd = source; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1204 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1205 if (source < 0) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1206 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1207 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
|
1208 return; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1209 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1210 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1211 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
|
1212 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
|
1213 connection_common_established_cb(conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1214 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1215 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1216 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1217 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
|
1218 PurpleInputCondition cond) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1219 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1220 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1221 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1222 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1223 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1224 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
|
1225 connection_common_established_cb(conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1226 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1227 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1228 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1229 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
|
1230 gpointer data) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1231 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1232 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1233 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1234 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1235 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1236 if (conn->watcher_outgoing) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1237 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1238 purple_input_remove(conn->watcher_outgoing); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1239 conn->watcher_outgoing = 0; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1240 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1241 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1242 /* sslconn frees the connection on error */ |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1243 conn->gsc = NULL; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1244 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1245 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
|
1246 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1247 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1248 static void |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 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
|
1250 { |
15822 | 1251 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 aim_srv_reqpersonalinfo(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 |
15822 | 1255 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
|
1256 aim_ssi_reqrights(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 aim_ssi_reqdata(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1258 if (od->getblisttimer > 0) |
15822 | 1259 purple_timeout_remove(od->getblisttimer); |
25576
7f552614ec8a
applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents:
25536
diff
changeset
|
1260 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
|
1261 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 aim_locate_reqrights(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 aim_buddylist_reqrights(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 aim_im_reqparams(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 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
|
1266 |
15822 | 1267 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
|
1268 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 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
|
1272 { |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
1273 aim_srv_clientready(od, conn); |
15822 | 1274 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
|
1275 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 if (od->chpass) { |
15822 | 1277 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
|
1278 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
|
1279 g_free(od->oldp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 od->oldp = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 g_free(od->newp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 od->newp = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1283 od->chpass = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 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
|
1286 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
|
1287 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
|
1288 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
|
1289 od->newformatting = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 od->setnick = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1292 if (od->conf) { |
15822 | 1293 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
|
1294 aim_admin_reqconfirm(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 od->conf = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 if (od->reqemail) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
1298 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
|
1299 aim_admin_getinfo(od, conn, 0x0011); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 od->reqemail = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1301 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 if (od->setemail) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
1303 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
|
1304 aim_admin_setemail(od, conn, od->email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 g_free(od->email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 od->email = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 od->setemail = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 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
|
1313 { |
15822 | 1314 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1315 struct chat_connection *chatcon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 static int id = 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
1318 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 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
|
1321 if (chatcon) { |
9bdc5144bd96
Fix CID 340; potential NULL deref.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20840
diff
changeset
|
1322 chatcon->id = id; |
9bdc5144bd96
Fix CID 340; potential NULL deref.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20840
diff
changeset
|
1323 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
|
1324 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 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
|
1329 { |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
1330 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1331 aim_chatnav_reqrights(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1335 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
|
1336 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 aim_email_sendcookies(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 aim_email_activate(od); |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
1339 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1340 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 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
|
1344 { |
15822 | 1345 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
1347 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 od->iconconnecting = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 |
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
|
1351 purple_icons_fetch(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 } |
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 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 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
|
1356 { |
15822 | 1357 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
|
1358 "now fully connected\n", conn->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 if (conn->type == SNAC_FAMILY_LOCATE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 flap_connection_established_bos(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 else if (conn->type == SNAC_FAMILY_ADMIN) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 flap_connection_established_admin(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 else if (conn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 flap_connection_established_chat(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 else if (conn->type == SNAC_FAMILY_CHATNAV) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 flap_connection_established_chatnav(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 else if (conn->type == SNAC_FAMILY_ALERT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 flap_connection_established_alert(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 else if (conn->type == SNAC_FAMILY_BART) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 flap_connection_established_bart(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1373 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1374 |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1375 static void |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1376 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
|
1377 gconstpointer value, gpointer data) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1378 { |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1379 PurpleConnection *gc; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1380 OscarData *od; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1381 gboolean report_idle; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1382 guint32 presence; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1383 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1384 gc = data; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1385 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
|
1386 report_idle = strcmp((const char *)value, "none") != 0; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1387 presence = aim_ssi_getpresence(od->ssi.local); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1388 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1389 if (report_idle) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1390 aim_ssi_setpresence(od, presence | 0x400); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1391 else |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1392 aim_ssi_setpresence(od, presence & ~0x400); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1393 } |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1394 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1395 /** |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1396 * 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
|
1397 * 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
|
1398 */ |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1399 static void |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1400 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
|
1401 gconstpointer value, gpointer data) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1402 { |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1403 PurpleConnection *gc; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1404 OscarData *od; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1405 guint32 presence; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1406 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1407 gc = data; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1408 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
|
1409 presence = aim_ssi_getpresence(od->ssi.local); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1410 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1411 if (value) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1412 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
|
1413 else |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1414 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
|
1415 } |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
1416 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1417 void |
15822 | 1418 oscar_login(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1419 { |
15822 | 1420 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 |
15822 | 1423 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
|
1424 od = oscar_data_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1425 od->gc = gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1426 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
|
1427 |
15822 | 1428 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
|
1429 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
|
1430 |
15822 | 1431 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0003, purple_info_change, 0); |
1432 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0005, purple_info_change, 0); | |
1433 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0007, purple_account_confirm, 0); | |
1434 oscar_data_addhandler(od, SNAC_FAMILY_ALERT, 0x0001, purple_parse_genericerr, 0); | |
1435 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
|
1436 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1437 /* These are only needed when connecting with the old-style BUCP login */ |
15822 | 1438 oscar_data_addhandler(od, SNAC_FAMILY_AUTH, 0x0003, purple_parse_auth_resp, 0); |
1439 oscar_data_addhandler(od, SNAC_FAMILY_AUTH, 0x0007, purple_parse_login, 0); | |
1440 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
|
1441 |
15822 | 1442 oscar_data_addhandler(od, SNAC_FAMILY_BART, SNAC_SUBTYPE_BART_RESPONSE, purple_icon_parseicon, 0); |
1443 oscar_data_addhandler(od, SNAC_FAMILY_BOS, 0x0001, purple_parse_genericerr, 0); | |
1444 oscar_data_addhandler(od, SNAC_FAMILY_BOS, 0x0003, purple_bosrights, 0); | |
1445 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, 0x0001, purple_parse_genericerr, 0); | |
1446 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_RIGHTSINFO, purple_parse_buddyrights, 0); | |
1447 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_ONCOMING, purple_parse_oncoming, 0); | |
1448 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_OFFGOING, purple_parse_offgoing, 0); | |
1449 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, 0x0001, purple_parse_genericerr, 0); | |
1450 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_USERJOIN, purple_conv_chat_join, 0); | |
1451 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_USERLEAVE, purple_conv_chat_leave, 0); | |
1452 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_ROOMINFOUPDATE, purple_conv_chat_info_update, 0); | |
1453 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_INCOMINGMSG, purple_conv_chat_incoming_msg, 0); | |
1454 oscar_data_addhandler(od, SNAC_FAMILY_CHATNAV, 0x0001, purple_parse_genericerr, 0); | |
1455 oscar_data_addhandler(od, SNAC_FAMILY_CHATNAV, SNAC_SUBTYPE_CHATNAV_INFO, purple_chatnav_info, 0); | |
1456 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ERROR, purple_ssi_parseerr, 0); | |
1457 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RIGHTSINFO, purple_ssi_parserights, 0); | |
1458 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_LIST, purple_ssi_parselist, 0); | |
1459 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
|
1460 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
|
1461 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_MOD, purple_ssi_parseaddmod, 0); |
15822 | 1462 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTH, purple_ssi_authgiven, 0); |
1463 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTHREQ, purple_ssi_authrequest, 0); | |
1464 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTHREP, purple_ssi_authreply, 0); | |
1465 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ADDED, purple_ssi_gotadded, 0); | |
1466 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_INCOMING, purple_parse_incoming_im, 0); | |
1467 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_MISSEDCALL, purple_parse_misses, 0); | |
1468 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_CLIENTAUTORESP, purple_parse_clientauto, 0); | |
1469 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_ERROR, purple_parse_msgerr, 0); | |
1470 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_MTN, purple_parse_mtn, 0); | |
1471 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_ACK, purple_parse_msgack, 0); | |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
1472 #ifdef OLDSTYLE_ICQ_OFFLINEMSGS |
15822 | 1473 oscar_data_addhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_OFFLINEMSG, purple_offlinemsg, 0); |
1474 oscar_data_addhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_OFFLINEMSGCOMPLETE, purple_offlinemsgdone, 0); | |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
1475 #endif /* OLDSTYLE_ICQ_OFFLINEMSGS */ |
15822 | 1476 oscar_data_addhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_ALIAS, purple_icqalias, 0); |
1477 oscar_data_addhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_INFO, purple_icqinfo, 0); | |
1478 oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_RIGHTSINFO, purple_parse_locaterights, 0); | |
1479 oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_USERINFO, purple_parse_userinfo, 0); | |
1480 oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_ERROR, purple_parse_locerr, 0); | |
1481 oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_GOTINFOBLOCK, purple_got_infoblock, 0); | |
1482 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x0001, purple_parse_genericerr, 0); | |
1483 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x000f, purple_selfinfo, 0); | |
1484 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x001f, purple_memrequest, 0); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1485 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x0021, oscar_icon_req,0); |
15822 | 1486 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, SNAC_SUBTYPE_OSERVICE_RATECHANGE, purple_parse_ratechange, 0); |
1487 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, SNAC_SUBTYPE_OSERVICE_REDIRECT, purple_handle_redirect, 0); | |
1488 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, SNAC_SUBTYPE_OSERVICE_MOTD, purple_parse_motd, 0); | |
1489 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, SNAC_SUBTYPE_OSERVICE_EVIL, purple_parse_evilnotify, 0); | |
1490 oscar_data_addhandler(od, SNAC_FAMILY_POPUP, 0x0002, purple_popup, 0); | |
1491 oscar_data_addhandler(od, SNAC_FAMILY_USERLOOKUP, SNAC_SUBTYPE_USERLOOKUP_ERROR, purple_parse_searcherror, 0); | |
1492 oscar_data_addhandler(od, SNAC_FAMILY_USERLOOKUP, 0x0003, purple_parse_searchreply, 0); | |
1493 | |
1494 purple_debug_misc("oscar", "oscar_login: gc = %p\n", gc); | |
1495 | |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1496 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
|
1497 gchar *buf; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1498 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)); |
21358 | 1499 purple_connection_error_reason(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
|
1500 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
|
1501 return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1502 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1503 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
1504 if (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
|
1505 od->icq = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1506 } else { |
15822 | 1507 gc->flags |= PURPLE_CONNECTION_HTML; |
1508 gc->flags |= PURPLE_CONNECTION_AUTO_RESP; | |
1509 } | |
1510 | |
27237
76cf0b261e25
Set od->default_port even when using the standard auth method.
Paul Aurich <paul@darkrain42.org>
parents:
27194
diff
changeset
|
1511 od->default_port = purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT); |
25246
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1512 od->use_ssl = purple_account_get_bool(account, "use_ssl", OSCAR_DEFAULT_USE_SSL); |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1513 |
15822 | 1514 /* 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
|
1515 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
|
1516 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
|
1517 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1518 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1519 * 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
|
1520 * 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
|
1521 * (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
|
1522 * authenticate. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1523 * |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1524 * 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
|
1525 * 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
|
1526 * 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
|
1527 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1528 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
|
1529 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
|
1530 } else { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1531 FlapConnection *newconn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1532 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
|
1533 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1534 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
|
1535 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1536 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
|
1537 if (!purple_ssl_is_supported()) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1538 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1539 _("SSL support unavailable")); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1540 return; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1541 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1542 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1543 server = purple_account_get_string(account, "server", 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
|
1544 |
25381
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
1545 /* |
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25332
diff
changeset
|
1546 * 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
|
1547 * 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
|
1548 * 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
|
1549 * 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
|
1550 * 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
|
1551 */ |
25246
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1552 if (!strcmp(server, OSCAR_DEFAULT_LOGIN_SERVER) || !strcmp(server, OSCAR_OLD_LOGIN_SERVER)) { |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1553 purple_debug_info("oscar", "Account uses SSL, so changing server to default SSL server\n"); |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1554 purple_account_set_string(account, "server", OSCAR_DEFAULT_SSL_LOGIN_SERVER); |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1555 server = OSCAR_DEFAULT_SSL_LOGIN_SERVER; |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1556 } |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1557 |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1558 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
|
1559 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
|
1560 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
|
1561 } else { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1562 server = purple_account_get_string(account, "server", OSCAR_DEFAULT_LOGIN_SERVER); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1563 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1564 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1565 * 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
|
1566 * 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
|
1567 * 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
|
1568 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1569 if (!strcmp(server, 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
|
1570 purple_debug_info("oscar", "Account does not use SSL, so changing server back to non-SSL\n"); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1571 purple_account_set_string(account, "server", OSCAR_DEFAULT_LOGIN_SERVER); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1572 server = OSCAR_DEFAULT_LOGIN_SERVER; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1573 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1574 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1575 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
|
1576 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
|
1577 connection_established_cb, newconn); |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
1578 } |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1579 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1580 if (newconn->gsc == NULL && newconn->connect_data == NULL) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1581 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1582 _("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
|
1583 return; |
25246
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25245
diff
changeset
|
1584 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1585 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1586 |
15822 | 1587 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
|
1588 ck[0] = 0x5a; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1591 void |
15822 | 1592 oscar_close(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1593 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1594 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1595 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
1596 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
|
1597 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1598 while (od->oscar_chats) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1599 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1600 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
|
1601 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
|
1602 oscar_chat_destroy(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1603 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1604 while (od->create_rooms) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1605 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1606 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
|
1607 g_free(cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1608 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
|
1609 g_free(cr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1610 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1611 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
|
1612 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
|
1613 |
15822 | 1614 purple_prefs_disconnect_by_handle(gc); |
1615 | |
1616 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
|
1617 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1618 |
15822 | 1619 /* 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
|
1620 struct pieceofcrap { |
15822 | 1621 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1622 unsigned long offset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1623 unsigned long len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1624 char *modname; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1625 int fd; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1626 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1627 unsigned int inpa; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1628 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1629 |
15822 | 1630 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
|
1631 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1632 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
|
1633 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
|
1634 char in = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1635 int x = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1636 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
|
1637 GString *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1638 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1639 while (read(pos->fd, &in, 1) == 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1640 if (in == '\n') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1641 x++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1642 else if (in != '\r') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1643 x = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1644 if (x == 2) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1645 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1646 in = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1647 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1648 if (in != '\n') { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1649 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
|
1650 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
|
1651 "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
|
1652 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15822 | 1653 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
|
1654 _("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
|
1655 buf); |
15822 | 1656 purple_input_remove(pos->inpa); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1657 close(pos->fd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1658 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1659 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1660 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1661 if (read(pos->fd, m, 16) != 16) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1662 { |
15822 | 1663 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
|
1664 "from " AIMHASHDATA "--that's bad.\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1665 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1666 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
|
1667 |
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
|
1668 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
|
1669 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
|
1670 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
|
1671 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
|
1672 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
|
1673 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
|
1674 |
15822 | 1675 purple_input_remove(pos->inpa); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1676 close(pos->fd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1677 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
|
1678 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1679 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1680 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1681 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1682 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
|
1683 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1684 struct pieceofcrap *pos = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1685 gchar *buf; |
22568
c65c96e231b5
Printf warning fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22486
diff
changeset
|
1686 gssize result; |
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 pos->fd = source; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1689 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1690 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
|
1691 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
|
1692 "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
|
1693 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15822 | 1694 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
|
1695 _("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
|
1696 buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1697 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1698 g_free(pos->modname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1699 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1700 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1701 } |
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 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
|
1704 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
|
1705 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
|
1706 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
|
1707 if (result < 0) |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
1708 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
|
1709 " 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
|
1710 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
|
1711 else |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
1712 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
|
1713 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
|
1714 "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
|
1715 strlen(buf), result); |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
1716 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1717 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1718 g_free(pos->modname); |
15822 | 1719 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
|
1720 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1722 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1723 /* 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
|
1724 #define AIM_MAX_FILE_SIZE 98304 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1725 |
27143
454d46e9cbb7
Make a function static and add two comments
Mark Doliner <mark@kingant.net>
parents:
27137
diff
changeset
|
1726 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
|
1727 { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1728 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1729 struct pieceofcrap *pos; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1730 guint32 offset, len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1731 char *modname; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1732 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1733 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1734 offset = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1735 len = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1736 modname = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1737 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1738 |
15822 | 1739 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
|
1740 offset, len, (modname ? modname : "aim.exe")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1741 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1742 if (len == 0) { |
15822 | 1743 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
|
1744 aim_sendmemblock(od, conn, offset, len, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 AIM_SENDMEMBLOCK_FLAG_ISREQUEST); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1746 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1748 /* uncomment this when you're convinced it's right. remember, it's been wrong before. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1749 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1750 if (offset > AIM_MAX_FILE_SIZE || len > AIM_MAX_FILE_SIZE) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1751 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 int i = 8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 if (modname) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1754 i += strlen(modname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1755 buf = g_malloc(i); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1756 i = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 if (modname) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 memcpy(buf, modname, strlen(modname)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1759 i += strlen(modname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1760 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1761 buf[i++] = offset & 0xff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1762 buf[i++] = (offset >> 8) & 0xff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1763 buf[i++] = (offset >> 16) & 0xff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 buf[i++] = (offset >> 24) & 0xff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1765 buf[i++] = len & 0xff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1766 buf[i++] = (len >> 8) & 0xff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1767 buf[i++] = (len >> 16) & 0xff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1768 buf[i++] = (len >> 24) & 0xff; |
15822 | 1769 purple_debug_misc("oscar", "len + offset is invalid, " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1770 "hashing request\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1771 aim_sendmemblock(od, command->conn, offset, i, buf, AIM_SENDMEMBLOCK_FLAG_ISREQUEST); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1772 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1773 return 1; |
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 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1776 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1777 pos = g_new0(struct pieceofcrap, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1778 pos->gc = od->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1779 pos->conn = conn; |
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 pos->offset = offset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 pos->len = len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1783 pos->modname = g_strdup(modname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1784 |
27118
a9899d234dfa
Pass the handle in here, which causes the connection attempt to be
Mark Doliner <mark@kingant.net>
parents:
27098
diff
changeset
|
1785 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
|
1786 straight_to_hell, pos) == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 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
|
1789 g_free(pos->modname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1790 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
|
1791 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 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
|
1793 "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
|
1794 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15822 | 1795 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
|
1796 _("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
|
1797 buf); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1800 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1801 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1802 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1803 int oscar_connect_to_bos(PurpleConnection *gc, OscarData *od, const char *host, guint16 port, guint8 *cookie, guint16 cookielen) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1804 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1805 FlapConnection *conn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1806 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1807 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
|
1808 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
|
1809 conn->cookie = g_memdup(cookie, cookielen); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1810 conn->connect_data = purple_proxy_connect(NULL, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1811 purple_connection_get_account(gc), host, port, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1812 connection_established_cb, conn); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1813 if (conn->connect_data == NULL) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1814 { |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1815 purple_connection_error_reason(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
|
1816 return 0; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1817 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1818 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1819 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
|
1820 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1821 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
|
1822 ck[3] = 0x64; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1823 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1824 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1825 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1826 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1827 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1828 * 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
|
1829 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1830 static int |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1831 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
|
1832 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1833 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
|
1834 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
|
1835 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
|
1836 int i; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1837 FlapConnection *newconn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1838 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
|
1839 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
|
1840 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1841 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
|
1842 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1843 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
|
1844 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
|
1845 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
|
1846 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1847 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
|
1848 "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
|
1849 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1850 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
|
1851 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
|
1852 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
|
1853 case 0x01: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1854 /* Unregistered username */ |
27278
979031db48c1
Slightly better error messages
Mark Doliner <mark@kingant.net>
parents:
27237
diff
changeset
|
1855 purple_connection_error_reason(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
|
1856 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1857 case 0x05: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1858 /* Incorrect password */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1859 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
|
1860 purple_account_set_password(account, NULL); |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1861 purple_connection_error_reason(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
|
1862 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1863 case 0x11: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1864 /* Suspended account */ |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1865 purple_connection_error_reason(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
|
1866 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1867 case 0x02: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1868 case 0x14: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1869 /* service temporarily unavailable */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1870 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("The AOL Instant Messenger service is temporarily unavailable.")); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1871 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1872 case 0x18: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1873 /* username connecting too frequently */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1874 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1875 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1876 case 0x1c: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1877 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1878 /* 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
|
1879 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
|
1880 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1881 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, buf); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1882 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1883 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1884 case 0x1d: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1885 /* IP address connecting too frequently */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1886 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("You have been connecting and disconnecting too frequently. Wait a minute and try again. If you continue to try, you will need to wait even longer.")); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1887 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1888 default: |
27278
979031db48c1
Slightly better error messages
Mark Doliner <mark@kingant.net>
parents:
27237
diff
changeset
|
1889 purple_connection_error_reason(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
|
1890 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1891 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1892 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
|
1893 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
|
1894 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1895 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1896 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1897 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
|
1898 "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
|
1899 "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
|
1900 info->regstatus, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1901 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
|
1902 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
|
1903 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
|
1904 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
|
1905 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1906 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
|
1907 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
|
1908 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
|
1909 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1910 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1911 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1912 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
|
1913 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
|
1914 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
|
1915 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
|
1916 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1917 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
|
1918 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1919 /* |
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
|
1920 * 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
|
1921 * 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
|
1922 * 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
|
1923 */ |
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
|
1924 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
|
1925 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
|
1926 "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
|
1927 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1928 else |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1929 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1930 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
|
1931 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
|
1932 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1933 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1934 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
|
1935 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
|
1936 { |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1937 purple_connection_error_reason(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
|
1938 return 0; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1939 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1940 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1941 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
|
1942 ck[3] = 0x64; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1943 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1944 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1945 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1946 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1947 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1948 * 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
|
1949 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1950 static void |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1951 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
|
1952 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1953 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
|
1954 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
|
1955 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1956 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
|
1957 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1958 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1959 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1960 * 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
|
1961 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1962 static void |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1963 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
|
1964 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1965 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
|
1966 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1967 /* Disconnect */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1968 purple_connection_error_reason(gc, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1969 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
1970 _("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
|
1971 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1972 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1973 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1974 * 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
|
1975 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1976 static int |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1977 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
|
1978 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1979 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
|
1980 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
|
1981 gchar *primary; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1982 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1983 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
|
1984 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1985 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
|
1986 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
|
1987 _("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
|
1988 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
|
1989 _("_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
|
1990 _("_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
|
1991 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
|
1992 gc); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1993 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
|
1994 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1995 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1996 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1997 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1998 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
1999 * 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
|
2000 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2001 static int |
15822 | 2002 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
|
2003 { |
15822 | 2004 PurpleConnection *gc; |
2005 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
|
2006 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
|
2007 ClientInfo icqinfo = CLIENTINFO_PURPLE_ICQ; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2008 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2009 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
|
2010 gboolean truncate_pass; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2011 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2012 gc = od->gc; |
15822 | 2013 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2014 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2015 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2016 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
|
2017 truncate_pass = va_arg(ap, int); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2018 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2019 |
15822 | 2020 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
|
2021 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
|
2022 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
|
2023 purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); |
15822 | 2024 |
2025 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
|
2026 ck[2] = 0x6c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2027 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2028 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2029 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2030 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2031 static int |
15822 | 2032 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
|
2033 { |
15822 | 2034 PurpleConnection *gc = od->gc; |
2035 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
|
2036 char *host, *separator; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2037 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2038 FlapConnection *newconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2039 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 struct aim_redirect_data *redir; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2041 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2042 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2043 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
|
2044 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2045 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
2046 port = od->default_port; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2047 separator = strchr(redir->ip, ':'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2048 if (separator != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2049 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2050 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
|
2051 port = atoi(separator + 1); |
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2054 host = g_strdup(redir->ip); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2055 |
25212
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2056 /* |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2057 * 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
|
2058 * 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
|
2059 */ |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2060 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
|
2061 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
|
2062 { |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2063 purple_debug_info("oscar", "Ignoring broken SSL for FLAP type 0x%04hx.\n", |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2064 redir->group); |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2065 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
|
2066 } |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2067 |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2068 purple_debug_info("oscar", "Connecting to FLAP server %s:%d of type 0x%04hx%s\n", |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2069 host, port, redir->group, |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2070 od->use_ssl && !redir->use_ssl ? " without SSL, despite main stream encryption" : ""); |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2071 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2072 newconn = flap_connection_new(od, redir->group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2073 newconn->cookielen = redir->cookielen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2074 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
|
2075 if (newconn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2076 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2077 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2078 cc = g_new0(struct chat_connection, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2079 cc->conn = newconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2080 cc->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2081 cc->name = g_strdup(redir->chat.room); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2082 cc->exchange = redir->chat.exchange; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 cc->instance = redir->chat.instance; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 cc->show = extract_name(redir->chat.room); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 newconn->new_conn_data = cc; |
15822 | 2086 purple_debug_info("oscar", "Connecting to chat room %s exchange %hu\n", cc->name, cc->exchange); |
2087 } | |
2088 | |
25212
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2089 |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
25211
diff
changeset
|
2090 if (redir->use_ssl) |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
2091 { |
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
|
2092 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
|
2093 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
|
2094 redir->ssl_cert_cn, newconn); |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
2095 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
2096 else |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
2097 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
2098 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
|
2099 connection_established_cb, newconn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
2100 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
2101 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
2102 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
|
2103 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2104 flap_connection_schedule_destroy(newconn, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2105 OSCAR_DISCONNECT_COULD_NOT_CONNECT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2106 _("Unable to initialize connection")); |
15822 | 2107 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
|
2108 "of type 0x%04hx\n", redir->group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2109 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 g_free(host); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2111 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2112 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2113 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2114 |
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
|
2115 |
15822 | 2116 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
|
2117 { |
15822 | 2118 PurpleConnection *gc; |
2119 PurpleAccount *account; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2120 struct buddyinfo *bi; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2121 time_t time_idle = 0, signon = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2122 int type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 gboolean buddy_is_away = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2124 const char *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2125 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2126 aim_userinfo_t *info; |
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
|
2127 char *message = NULL; |
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
|
2128 char *itmsurl = NULL; |
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
|
2129 char *tmp; |
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
|
2130 const char *tmp2; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2131 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2132 gc = od->gc; |
15822 | 2133 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2134 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2135 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2136 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2137 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2138 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2139 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
|
2140 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
|
2141 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2142 if (info->present & AIM_USERINFO_PRESENT_FLAGS) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2143 if (info->flags & AIM_FLAG_AWAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2144 buddy_is_away = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2145 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2146 if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2147 type = info->icqinfo.status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2148 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
|
2149 (info->icqinfo.status != AIM_ICQ_STATE_NORMAL)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2150 buddy_is_away = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2151 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2152 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2153 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2154 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
|
2155 if (type & AIM_ICQ_STATE_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 status_id = OSCAR_STATUS_ID_FREE4CHAT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 else if (type & AIM_ICQ_STATE_DND) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 status_id = OSCAR_STATUS_ID_DND; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2159 else if (type & AIM_ICQ_STATE_OUT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2160 status_id = OSCAR_STATUS_ID_NA; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2161 else if (type & AIM_ICQ_STATE_BUSY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2162 status_id = OSCAR_STATUS_ID_OCCUPIED; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2163 else if (type & AIM_ICQ_STATE_AWAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2164 status_id = OSCAR_STATUS_ID_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 else if (type & AIM_ICQ_STATE_INVISIBLE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 status_id = OSCAR_STATUS_ID_INVISIBLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2167 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2168 status_id = OSCAR_STATUS_ID_AVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2169 } else { |
22873
e8a66e79c49c
Show yourself as invisible in the buddylist when you're invisible
Mark Doliner <mark@kingant.net>
parents:
22866
diff
changeset
|
2170 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
|
2171 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
|
2172 else if (buddy_is_away) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2173 status_id = OSCAR_STATUS_ID_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2175 status_id = OSCAR_STATUS_ID_AVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2176 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2177 |
16794
88550837d1c9
We're told by users that Hiptop is not the same thing as mobile, and should not be treated as such.
Sean Egan <seanegan@gmail.com>
parents:
16765
diff
changeset
|
2178 if (info->flags & AIM_FLAG_WIRELESS) |
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
|
2179 { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2180 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
|
2181 } 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
|
2182 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
|
2183 } |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2184 |
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
|
2185 if (info->status != NULL && info->status[0] != '\0') |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2186 /* Grab the available 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
|
2187 message = oscar_encoding_to_utf8(account, info->status_encoding, |
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
|
2188 info->status, info->status_len); |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2189 |
27393
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27384
diff
changeset
|
2190 tmp2 = tmp = (message ? purple_markup_escape_text(message, -1) : NULL); |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2191 |
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
|
2192 if (strcmp(status_id, OSCAR_STATUS_ID_AVAILABLE) == 0) { |
22129
dd51079b3d8c
Only try to set the itmsurl attribute for the available status. I'd
Mark Doliner <mark@kingant.net>
parents:
22128
diff
changeset
|
2193 if (info->itmsurl_encoding && info->itmsurl && info->itmsurl_len) |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2194 /* Grab the iTunes Music Store URL */ |
22129
dd51079b3d8c
Only try to set the itmsurl attribute for the available status. I'd
Mark Doliner <mark@kingant.net>
parents:
22128
diff
changeset
|
2195 itmsurl = oscar_encoding_to_utf8(account, info->itmsurl_encoding, |
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
|
2196 info->itmsurl, info->itmsurl_len); |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2197 |
23939
9b2c273d764d
Fix printf of a NULL string and also an invalid free. Fixes #6627
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23901
diff
changeset
|
2198 if (tmp2 == NULL && itmsurl != NULL) |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2199 /* |
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2200 * The message can't be NULL because NULL means it was the |
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2201 * last attribute, so the itmsurl would get ignored below. |
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2202 */ |
23939
9b2c273d764d
Fix printf of a NULL string and also an invalid free. Fixes #6627
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23901
diff
changeset
|
2203 tmp2 = ""; |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2204 |
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 purple_prpl_got_user_status(account, info->bn, status_id, |
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
|
2206 "message", tmp2, "itmsurl", itmsurl, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2207 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2208 else |
25947
4b8c4870b13a
propagate from branch 'im.pidgin.pidgin.next.minor' (head 7305b29db7bd00d3261f348c71674c93aa31b327)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
2209 purple_prpl_got_user_status(account, info->bn, status_id, "message", tmp2, NULL); |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2210 |
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
|
2211 g_free(tmp); |
25391
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25386
diff
changeset
|
2212 |
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
|
2213 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
|
2214 g_free(itmsurl); |
15622 | 2215 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2216 /* Login time stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2218 signon = info->onlinesince; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2219 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
|
2220 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
|
2221 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
|
2222 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2223 /* Idle time stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2224 /* 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
|
2225 if (info->present & AIM_USERINFO_PRESENT_IDLE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2226 time_idle = time(NULL) - info->idletime * 60; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2227 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2228 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
|
2229 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
|
2230 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
|
2231 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
|
2232 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2233 /* 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
|
2234 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
|
2235 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2236 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
|
2237 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
|
2238 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2239 bi->typingnot = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2240 bi->ico_informed = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2241 bi->ipaddr = info->icqinfo.ipaddr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2242 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2243 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
|
2244 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
|
2245 char *b16 = NULL; |
15822 | 2246 PurpleBuddy *b = NULL; |
2247 | |
2248 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
|
2249 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
|
2250 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
|
2251 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
|
2252 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2253 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
|
2254 /* 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
|
2255 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
|
2256 |
408c4bb03915
Invalidate old oscar icons when someone clears their icon.
Mark Doliner <mark@kingant.net>
parents:
20632
diff
changeset
|
2257 /* 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
|
2258 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
|
2259 (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
|
2260 { |
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
|
2261 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
|
2262 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
|
2263 purple_icons_fetch(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2264 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2265 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2266 g_free(b16); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2267 } |
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 return 1; |
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 |
15822 | 2272 static void purple_check_comment(OscarData *od, const char *str) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2273 if ((str == NULL) || strcmp(str, (const char *)ck)) |
15822 | 2274 aim_locate_setcaps(od, purple_caps); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2275 else |
15822 | 2276 aim_locate_setcaps(od, purple_caps | OSCAR_CAPABILITY_SECUREIM); |
2277 } | |
2278 | |
2279 static int purple_parse_offgoing(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { | |
2280 PurpleConnection *gc = od->gc; | |
2281 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
|
2282 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2283 aim_userinfo_t *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2285 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2286 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2287 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2288 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2289 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
|
2290 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
|
2291 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
|
2292 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2293 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2294 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2295 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2296 static int incomingim_chan1(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) { |
15822 | 2297 PurpleConnection *gc = od->gc; |
2298 PurpleAccount *account = purple_connection_get_account(gc); | |
2299 PurpleMessageFlags flags = 0; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2300 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
|
2301 PurpleStoredImage *img; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2302 GString *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2303 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2304 aim_mpmsg_section_t *curpart; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2305 const char *start, *end; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2306 GData *attribs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2307 |
15822 | 2308 purple_debug_misc("oscar", "Received IM from %s with %d parts\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
|
2309 userinfo->bn, args->mpmsg.numparts); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2310 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 if (args->mpmsg.numparts == 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2312 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2313 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2314 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
|
2315 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2316 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
|
2317 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
|
2318 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2319 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2320 if (args->icbmflags & AIM_IMFLAGS_AWAY) |
15822 | 2321 flags |= PURPLE_MESSAGE_AUTO_RESP; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2322 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2323 if (args->icbmflags & AIM_IMFLAGS_TYPINGNOT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2324 bi->typingnot = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2325 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2326 bi->typingnot = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2327 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2328 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
|
2329 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
|
2330 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
|
2331 bi->ico_need = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2332 bi->ico_len = args->iconlen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2333 bi->ico_csum = args->iconsum; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2334 bi->ico_time = args->iconstamp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2336 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2337 |
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
|
2338 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
|
2339 if ((img != NULL) && |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2340 (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
|
2341 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
|
2342 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
|
2343 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
|
2344 "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
|
2345 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
|
2346 aim_im_sendch2_icon(od, userinfo->bn, data, len, |
16613
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
2347 purple_buddy_icons_get_account_icon_timestamp(account), |
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
2348 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
|
2349 } |
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
|
2350 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2352 message = g_string_new(""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2353 curpart = args->mpmsg.parts; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2354 while (curpart != 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
|
2355 tmp = purple_plugin_oscar_decode_im_part(account, userinfo->bn, curpart->charset, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2356 curpart->charsubset, curpart->data, curpart->datalen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2357 if (tmp != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2358 g_string_append(message, tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2359 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2360 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2361 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2362 curpart = curpart->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2363 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2364 tmp = g_string_free(message, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2365 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2366 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 * If the message is from an ICQ user and to an ICQ user then escape any HTML, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 * because HTML is not sent over ICQ as a means to format a message. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 * So any HTML we receive is intended to be displayed. Also, \r\n must be |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 * replaced with <br> |
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 * Note: There *may* be some clients which send messages as HTML formatted - |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2373 * they need to be special-cased somehow. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2375 if (oscar_util_valid_name_icq(purple_account_get_username(account)) && oscar_util_valid_name_icq(userinfo->bn)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2376 /* being recevied by ICQ from ICQ - escape HTML so it is displayed as sent */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2377 gchar *tmp2 = g_markup_escape_text(tmp, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2378 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2379 tmp = tmp2; |
15822 | 2380 tmp2 = purple_strreplace(tmp, "\r\n", "<br>"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2381 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 tmp = tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2383 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2385 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 * 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
|
2387 */ |
15822 | 2388 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
|
2389 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2390 const char *ichattextcolor, *ichatballooncolor; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2391 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2392 ichattextcolor = g_datalist_get_data(&attribs, "ichattextcolor"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2393 if (ichattextcolor != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2394 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2395 gchar *tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 tmp2 = g_strdup_printf("<font color=\"%s\">%s</font>", ichattextcolor, tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2398 tmp = tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2399 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2400 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 ichatballooncolor = g_datalist_get_data(&attribs, "ichatballooncolor"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2402 if (ichatballooncolor != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2404 gchar *tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2405 tmp2 = g_strdup_printf("<font back=\"%s\">%s</font>", ichatballooncolor, tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2406 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 tmp = tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2408 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2409 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2410 g_datalist_clear(&attribs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2411 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2412 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2413 serv_got_im(gc, userinfo->bn, tmp, flags, |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
2414 (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
|
2415 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2416 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2417 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2418 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2419 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2420 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2421 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
|
2422 { |
15822 | 2423 PurpleConnection *gc; |
2424 PurpleAccount *account; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2425 char *message = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2426 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2427 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
|
2428 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
|
2429 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2430 gc = od->gc; |
15822 | 2431 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
|
2432 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
|
2433 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2434 if (args == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2435 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2436 |
15822 | 2437 purple_debug_misc("oscar", "Incoming rendezvous message of type %u, " |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2438 "user %s, status %hu\n", args->type, userinfo->bn, args->status); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2439 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2440 if (args->msg != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2441 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2442 if (args->encoding != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2443 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2444 char *encoding = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2445 encoding = oscar_encoding_extract(args->encoding); |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
2446 message = oscar_encoding_to_utf8(account, encoding, args->msg, |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
2447 args->msglen); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2448 g_free(encoding); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2449 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2450 if (g_utf8_validate(args->msg, args->msglen, NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2451 message = g_strdup(args->msg); |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2454 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2455 if (args->type & OSCAR_CAPABILITY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2456 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2457 char *encoding, *utf8name, *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2458 GHashTable *components; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2459 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2460 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
|
2461 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2462 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2463 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2464 encoding = args->encoding ? oscar_encoding_extract(args->encoding) : NULL; |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
2465 utf8name = oscar_encoding_to_utf8(account, encoding, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2466 args->info.chat.roominfo.name, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2467 args->info.chat.roominfo.namelen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2468 g_free(encoding); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2470 tmp = extract_name(utf8name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2471 if (tmp != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2472 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2473 g_free(utf8name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2474 utf8name = tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2475 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2476 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2477 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
|
2478 g_free); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 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
|
2480 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
|
2481 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
|
2482 serv_got_chat_invite(gc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2483 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
|
2484 userinfo->bn, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2485 message, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2486 components); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2489 else if ((args->type & OSCAR_CAPABILITY_SENDFILE) || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2490 (args->type & OSCAR_CAPABILITY_DIRECTIM)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2491 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2492 if (args->status == AIM_RENDEZVOUS_PROPOSE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2493 { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2494 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
|
2495 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2496 else if (args->status == AIM_RENDEZVOUS_CANCEL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2497 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2498 /* The other user canceled a peer request */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2499 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2500 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2501 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
|
2502 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2503 * 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
|
2504 * 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
|
2505 * do something malicious. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2506 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2507 if (conn != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2508 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2509 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
|
2510 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2511 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2512 else if (args->status == AIM_RENDEZVOUS_CONNECTED) |
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 /* |
19687
b199a9be3e95
Start watching the listener socket immediately after it's created
Mark Doliner <mark@kingant.net>
parents:
19681
diff
changeset
|
2515 * 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
|
2516 * 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
|
2517 * 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
|
2518 */ |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2522 else if (args->type & OSCAR_CAPABILITY_GETFILE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2523 { |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2526 else if (args->type & OSCAR_CAPABILITY_TALK) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2527 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2528 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2529 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2530 else if (args->type & OSCAR_CAPABILITY_BUDDYICON) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2531 { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2532 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
|
2533 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
|
2534 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
|
2535 NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2536 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2537 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2538 else if (args->type & OSCAR_CAPABILITY_ICQSERVERRELAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2539 { |
15822 | 2540 purple_debug_error("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
|
2541 "type %d\n", args->info.rtfmsg.msgtype); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2544 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2545 { |
15822 | 2546 purple_debug_error("oscar", "Unknown request class %hu\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2547 args->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2548 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2549 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2550 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2551 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2552 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2553 } |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2556 * Authorization Functions |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2557 * Most of these are callbacks from dialogs. They're used by both |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2558 * methods of authorization (SSI and old-school channel 4 ICBM) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2559 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2560 /* When you ask other people for authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2561 static void |
15822 | 2562 purple_auth_request(struct name_data *data, char *msg) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2563 { |
15822 | 2564 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2565 OscarData *od; |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2566 PurpleAccount *account; |
15822 | 2567 PurpleBuddy *buddy; |
2568 PurpleGroup *group; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
2569 const char *bname, *gname; |
15373
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 gc = data->gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2572 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
|
2573 account = purple_connection_get_account(gc); |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2574 buddy = purple_find_buddy(account, data->name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2575 if (buddy != NULL) |
15822 | 2576 group = purple_buddy_get_group(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2577 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2578 group = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2579 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2580 if (group != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2581 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
2582 bname = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
2583 gname = purple_group_get_name(group); |
15822 | 2584 purple_debug_info("oscar", "ssi: adding buddy %s to group %s\n", |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
2585 bname, gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2586 aim_ssi_sendauthrequest(od, data->name, msg ? msg : _("Please authorize me so I can add you to my buddy list.")); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
2587 if (!aim_ssi_itemlist_finditem(od->ssi.local, gname, bname, AIM_SSI_TYPE_BUDDY)) |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2588 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
2589 aim_ssi_addbuddy(od, bname, gname, NULL, purple_buddy_get_alias_only(buddy), NULL, NULL, TRUE); |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2590 |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2591 /* 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
|
2592 if (bname[0] == '+') { |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2593 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
|
2594 purple_buddy_get_name(buddy), |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2595 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
|
2596 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
|
2597 purple_buddy_get_name(buddy), |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2598 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
|
2599 } |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
2600 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2601 } |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
2602 |
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
2603 oscar_free_name_data(data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2604 } |
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 static void |
15822 | 2607 purple_auth_sendrequest(PurpleConnection *gc, const char *name) |
15373
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 struct name_data *data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2610 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2611 data = g_new0(struct name_data, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2612 data->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2613 data->name = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2614 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
2615 purple_request_input(data->gc, NULL, _("Authorization Request Message:"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2616 NULL, _("Please authorize me!"), TRUE, FALSE, NULL, |
15822 | 2617 _("_OK"), G_CALLBACK(purple_auth_request), |
22677
3850c293ae8b
Don't remove the PurpleBuddy from our buddy list if we don't send them
Mark Doliner <mark@kingant.net>
parents:
22654
diff
changeset
|
2618 _("_Cancel"), G_CALLBACK(oscar_free_name_data), |
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
|
2619 purple_connection_get_account(gc), name, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
2620 data); |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2623 static void |
15822 | 2624 purple_auth_sendrequest_menu(PurpleBlistNode *node, gpointer ignored) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2625 { |
15822 | 2626 PurpleBuddy *buddy; |
2627 PurpleConnection *gc; | |
2628 | |
2629 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); | |
2630 | |
2631 buddy = (PurpleBuddy *) node; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
2632 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
2633 purple_auth_sendrequest(gc, purple_buddy_get_name(buddy)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2634 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2635 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2636 /* When other people ask you for authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2637 static void |
19195
1ca6c4b234ab
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19179
diff
changeset
|
2638 purple_auth_grant(gpointer cbdata) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2639 { |
19195
1ca6c4b234ab
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19179
diff
changeset
|
2640 struct name_data *data = cbdata; |
15822 | 2641 PurpleConnection *gc = data->gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2642 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
|
2643 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2644 aim_ssi_sendauthreply(od, data->name, 0x01, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2645 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2646 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2647 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2648 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2649 /* When other people ask you for authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2650 static void |
15822 | 2651 purple_auth_dontgrant(struct name_data *data, char *msg) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2652 { |
15822 | 2653 PurpleConnection *gc = data->gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
2654 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
|
2655 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2656 aim_ssi_sendauthreply(od, data->name, 0x00, msg ? msg : _("No reason given.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2657 } |
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 static void |
19195
1ca6c4b234ab
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19179
diff
changeset
|
2660 purple_auth_dontgrant_msgprompt(gpointer cbdata) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2661 { |
19195
1ca6c4b234ab
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19179
diff
changeset
|
2662 struct name_data *data = cbdata; |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
2663 purple_request_input(data->gc, NULL, _("Authorization Denied Message:"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2664 NULL, _("No reason given."), TRUE, FALSE, NULL, |
15822 | 2665 _("_OK"), G_CALLBACK(purple_auth_dontgrant), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2666 _("_Cancel"), G_CALLBACK(oscar_free_name_data), |
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
|
2667 purple_connection_get_account(data->gc), data->name, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
2668 data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2669 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2670 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2671 /* When someone sends you buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2672 static void |
15822 | 2673 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
|
2674 { |
15822 | 2675 PurpleConnection *gc = data->gc; |
2676 | |
2677 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
|
2678 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2679 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2680 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2681 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2682 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2683 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
|
2684 { |
15822 | 2685 PurpleConnection *gc = od->gc; |
2686 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
|
2687 gchar **msg1, **msg2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2688 int i, numtoks; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2689 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2690 if (!args->type || !args->msg || !args->uin) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2691 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2692 |
15822 | 2693 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2694 "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
|
2695 args->type); |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2698 * 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
|
2699 * 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
|
2700 * 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
|
2701 * 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
|
2702 * 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
|
2703 * 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
|
2704 * most 1 baby string. |
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 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
|
2707 for (numtoks=0; msg1[numtoks]; numtoks++); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2708 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
|
2709 for (i=0; msg1[i]; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2710 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
|
2711 |
15822 | 2712 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
|
2713 /* TODO: Should use an encoding other than ASCII? */ |
15822 | 2714 msg2[i] = purple_plugin_oscar_decode_im_part(account, uin, AIM_CHARSET_ASCII, 0x0000, msg1[i], strlen(msg1[i])); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2715 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2716 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2717 msg2[i] = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2718 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2719 switch (args->type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2720 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
|
2721 if (i >= 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2722 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
|
2723 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2724 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2725 /* 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
|
2726 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
|
2727 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2728 if (t) { /* This is an offline message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2729 /* 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
|
2730 #ifdef HAVE_TM_GMTOFF |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2731 time_t now; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2732 struct tm *tm; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2733 now = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2734 tm = localtime(&now); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2735 t += tm->tm_gmtoff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2736 #else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2737 # ifdef HAVE_TIMEZONE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2738 tzset(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2739 t -= timezone; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2740 # endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2741 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2742 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
|
2743 } 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
|
2744 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
|
2745 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2746 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2747 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2748 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2749 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2750 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2751 case 0x04: { /* Someone sent you a URL */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2752 if (i >= 2) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2753 if (msg2[1] != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2754 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
|
2755 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
|
2756 msg2[1], |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2757 (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
|
2758 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
|
2759 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2760 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2761 } |
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 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2764 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2765 case 0x06: { /* Someone requested authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2766 if (i >= 6) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2767 struct name_data *data = g_new(struct name_data, 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
|
2768 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
|
2769 gchar *reason = NULL; |
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 if (msg2[5] != 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
|
2772 reason = purple_plugin_oscar_decode_im_part(account, bn, AIM_CHARSET_CUSTOM, 0x0000, msg2[5], strlen(msg2[5])); |
15822 | 2773 |
2774 purple_debug_info("oscar", | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2775 "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
|
2776 args->uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2777 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
|
2778 data->name = bn; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2779 data->nick = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2780 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2781 purple_account_request_authorization(account, bn, NULL, NULL, |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
2782 reason, purple_find_buddy(account, bn) != NULL, |
19195
1ca6c4b234ab
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19179
diff
changeset
|
2783 purple_auth_grant, |
1ca6c4b234ab
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19179
diff
changeset
|
2784 purple_auth_dontgrant_msgprompt, data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2785 g_free(reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2786 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2787 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2788 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2789 case 0x07: { /* Someone has denied you authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2790 if (i >= 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2791 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 | 2792 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
|
2793 dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2794 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2795 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2796 } break; |
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 case 0x08: { /* Someone has granted you authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2799 gchar *dialog_msg = g_strdup_printf(_("The user %u has granted your request to add them to your buddy list."), args->uin); |
15822 | 2800 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
|
2801 dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2802 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2803 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2804 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2805 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
|
2806 if (i >= 5) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2807 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 | 2808 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
|
2809 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2810 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2811 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2812 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2813 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
|
2814 if (i >= 6) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2815 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 | 2816 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
|
2817 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2818 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2819 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2820 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2821 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
|
2822 if (i >= 6) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
2823 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
|
2824 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
|
2825 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2826 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2827 } break; |
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 case 0x12: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2830 /* 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
|
2831 /* Someone added you to their buddy list? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2832 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2833 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2834 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
|
2835 guint i, num; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2836 gchar **text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2837 text = g_strsplit(args->msg, "\376", 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2838 if (text) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2839 num = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2840 for (i=0; i<strlen(text[0]); i++) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2841 num = num*10 + text[0][i]-48; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2842 for (i=0; i<num; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2843 struct name_data *data = g_new(struct name_data, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2844 gchar *message = g_strdup_printf(_("ICQ user %u has sent you a buddy: %s (%s)"), args->uin, text[i*2+2], text[i*2+1]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2845 data->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2846 data->name = g_strdup(text[i*2+1]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2847 data->nick = g_strdup(text[i*2+2]); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2848 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
2849 purple_request_action(gc, NULL, message, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2850 _("Do you want to add this buddy " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2851 "to your buddy list?"), |
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
|
2852 PURPLE_DEFAULT_ACTION_NONE, |
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
|
2853 purple_connection_get_account(gc), data->name, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
2854 data, 2, |
15822 | 2855 _("_Add"), G_CALLBACK(purple_icq_buddyadd), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2856 _("_Decline"), G_CALLBACK(oscar_free_name_data)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2857 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2858 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2859 g_strfreev(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2860 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2861 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2862 |
19641
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2863 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
|
2864 ByteStream qbs; |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2865 int smstype, taglen, smslen; |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2866 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
|
2867 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
|
2868 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
|
2869 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2870 /* 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
|
2871 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
|
2872 byte_stream_advance(&qbs, 21); |
27194
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2873 /* 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
|
2874 /* 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
|
2875 smstype = byte_stream_getle16(&qbs); |
27194
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2876 if (smstype != 0) |
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2877 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
|
2878 taglen = byte_stream_getle32(&qbs); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2879 tagstr = byte_stream_getstr(&qbs, taglen); |
27194
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2880 if (tagstr == NULL) |
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27161
diff
changeset
|
2881 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
|
2882 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
|
2883 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
|
2884 smslen = byte_stream_getle32(&qbs); |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2885 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
|
2886 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2887 /* 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
|
2888 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
|
2889 { |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2890 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
|
2891 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
|
2892 { |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2893 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
|
2894 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
|
2895 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
|
2896 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2897 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
|
2898 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
|
2899 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
|
2900 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2901 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
|
2902 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
|
2903 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2904 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
|
2905 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
|
2906 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
|
2907 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2908 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2909 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
|
2910 g_free(smsmsg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2911 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2912 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2913 default: { |
15822 | 2914 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2915 "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
|
2916 "(type 0x%02hhx).\n", args->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2917 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2918 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2919 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2920 g_strfreev(msg1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2921 g_strfreev(msg2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2922 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2923 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2924 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2925 |
15822 | 2926 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
|
2927 guint16 channel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2928 int ret = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2929 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2930 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2931 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2932 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2933 channel = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2934 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2935 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2936 switch (channel) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2937 case 1: { /* standard message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2938 struct aim_incomingim_ch1_args *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2939 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
|
2940 ret = incomingim_chan1(od, conn, userinfo, args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2941 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2942 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2943 case 2: { /* rendezvous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2944 IcbmArgsCh2 *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2945 args = va_arg(ap, IcbmArgsCh2 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2946 ret = incomingim_chan2(od, conn, userinfo, args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2947 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2948 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2949 case 4: { /* ICQ */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2950 struct aim_incomingim_ch4_args *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2951 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
|
2952 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
|
2953 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2954 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2955 default: { |
15822 | 2956 purple_debug_warning("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2957 "ICBM received on unsupported channel (channel " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2958 "0x%04hx).", channel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2959 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2960 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2961 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2962 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2963 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2964 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2965 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2966 |
15822 | 2967 static int purple_parse_misses(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2968 PurpleConnection *gc = od->gc; | |
2969 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
|
2970 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2971 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2972 guint16 chan, nummissed, reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2973 aim_userinfo_t *userinfo; |
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2976 chan = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2977 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2978 nummissed = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2979 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2980 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2981 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2982 switch(reason) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2983 case 0: /* Invalid (0) */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2984 buf = g_strdup_printf( |
23267 | 2985 dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2986 "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
|
2987 "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
|
2988 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2989 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
|
2990 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2991 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2992 case 1: /* Message too large */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2993 buf = g_strdup_printf( |
23267 | 2994 dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2995 "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
|
2996 "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
|
2997 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2998 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
|
2999 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3000 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3001 case 2: /* Rate exceeded */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3002 buf = g_strdup_printf( |
23267 | 3003 dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3004 "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
|
3005 "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
|
3006 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3007 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
|
3008 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3009 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3010 case 3: /* Evil Sender */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3011 buf = g_strdup_printf( |
23267 | 3012 dngettext(PACKAGE, |
23350
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23338
diff
changeset
|
3013 "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
|
3014 "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
|
3015 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3016 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
|
3017 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3018 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3019 case 4: /* Evil Receiver */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3020 buf = g_strdup_printf( |
23267 | 3021 dngettext(PACKAGE, |
23350
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23338
diff
changeset
|
3022 "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
|
3023 "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
|
3024 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3025 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
|
3026 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3027 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3028 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3029 buf = g_strdup_printf( |
23267 | 3030 dngettext(PACKAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3031 "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
|
3032 "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
|
3033 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3034 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
|
3035 userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3036 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3037 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3038 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3039 if (!purple_conv_present_error(userinfo->bn, account, buf)) |
15822 | 3040 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
|
3041 g_free(buf); |
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 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3044 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3045 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3046 static int |
15822 | 3047 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
|
3048 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3049 if (reason == 0x0003) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3050 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3051 /* Rendezvous was refused. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3052 PeerConnection *conn; |
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 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
|
3055 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3056 if (conn == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3057 { |
15822 | 3058 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
|
3059 "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
|
3060 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3061 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3062 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3063 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
|
3064 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3065 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3066 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3067 { |
15822 | 3068 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
|
3069 "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
|
3070 } |
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 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3073 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3074 |
15822 | 3075 static int purple_parse_clientauto_ch4(OscarData *od, char *who, guint16 reason, guint32 state, char *msg) { |
3076 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3077 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3078 switch(reason) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3079 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
|
3080 char *statusmsg, **splitmsg; |
15822 | 3081 PurpleNotifyUserInfo *user_info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3082 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3083 /* Split at (carriage return/newline)'s, then rejoin later with BRs between. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3084 statusmsg = oscar_icqstatus(state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3085 splitmsg = g_strsplit(msg, "\r\n", 0); |
23267 | 3086 |
15822 | 3087 user_info = purple_notify_user_info_new(); |
23267 | 3088 |
15822 | 3089 purple_notify_user_info_add_pair(user_info, _("UIN"), who); |
3090 purple_notify_user_info_add_pair(user_info, _("Status"), statusmsg); | |
3091 purple_notify_user_info_add_section_break(user_info); | |
3092 purple_notify_user_info_add_pair(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
|
3093 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3094 g_free(statusmsg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3095 g_strfreev(splitmsg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3096 |
15822 | 3097 purple_notify_userinfo(gc, who, user_info, NULL, NULL); |
3098 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
|
3099 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3100 } break; |
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 default: { |
15822 | 3103 purple_debug_warning("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3104 "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
|
3105 "Type 0x%04hx\n", who, reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3106 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3107 } /* end of switch */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3108 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3109 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3110 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3111 |
15822 | 3112 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
|
3113 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3114 guint16 chan, reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3115 char *who; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3116 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3117 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3118 chan = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3119 who = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3120 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3121 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3122 if (chan == 0x0002) { /* File transfer declined */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3123 guchar *cookie = va_arg(ap, guchar *); |
15822 | 3124 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
|
3125 } else if (chan == 0x0004) { /* ICQ message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3126 guint32 state = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3127 char *msg = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3128 if (reason == 0x0003) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3129 state = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3130 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3131 } |
15822 | 3132 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
|
3133 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3134 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3135 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3137 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3138 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3139 |
15822 | 3140 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
|
3141 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3142 guint16 reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3143 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3144 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3145 reason = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3146 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3147 |
15822 | 3148 purple_debug_error("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3149 "snac threw error (reason 0x%04hx: %s)\n", reason, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3150 (reason < msgerrreasonlen) ? msgerrreason[reason] : "unknown"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3151 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3152 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3153 |
15822 | 3154 static int purple_parse_msgerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3155 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3156 #ifdef TODOFT |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3157 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 3158 PurpleXfer *xfer; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3159 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3160 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3161 guint16 reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3162 char *data, *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3163 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3164 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3165 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3166 data = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3167 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3168 |
15822 | 3169 purple_debug_error("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3170 "Message error with data %s and reason %hu\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3171 (data != NULL ? data : ""), reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3172 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3173 if ((data == NULL) || (*data == '\0')) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3174 /* We can't do anything if data is empty */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3175 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3176 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3177 #ifdef TODOFT |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3178 /* If this was a file transfer request, data is a cookie */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3179 if ((xfer = oscar_find_xfer_by_cookie(od->file_transfers, data))) { |
15822 | 3180 purple_xfer_cancel_remote(xfer); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3181 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3182 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3183 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3184 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3185 /* Data is assumed to be the destination bn */ |
15796
52a044731fbe
lots of translation updates. Some of these I neglected for way too long.
Luke Schierer <lschiere@pidgin.im>
parents:
15782
diff
changeset
|
3186 buf = g_strdup_printf(_("Unable to send message: %s"), (reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("Unknown reason.")); |
15822 | 3187 if (!purple_conv_present_error(data, purple_connection_get_account(gc), buf)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3188 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3189 buf = g_strdup_printf(_("Unable to send message to %s:"), data ? data : "(unknown)"); |
15822 | 3190 purple_notify_error(od->gc, NULL, buf, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3191 (reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("Unknown reason.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3192 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3193 g_free(buf); |
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 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3196 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3197 |
15822 | 3198 static int purple_parse_mtn(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3199 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3200 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3201 guint16 type1, type2; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3202 char *bn; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3203 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3204 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3205 type1 = (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
|
3206 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3207 type2 = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3208 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3209 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3210 switch (type2) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3211 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
|
3212 serv_got_typing_stopped(gc, bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3213 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3214 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3215 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
|
3216 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
|
3217 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3219 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
|
3220 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
|
3221 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3222 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3223 default: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3224 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3225 * It looks like iChat sometimes sends typing notification |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3226 * with type1=0x0001 and type2=0x000f. Not sure why. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3227 */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3228 purple_debug_info("oscar", "Received unknown typing notification message from %s. Type1 is 0x%04x and type2 is 0x%04hx.\n", bn, type1, type2); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3229 } break; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3232 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3233 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3234 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3235 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3236 * We get this error when there was an error in the locate family. This |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3237 * happens when you request info of someone who is offline. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3238 */ |
15822 | 3239 static int purple_parse_locerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3240 gchar *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3241 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3242 guint16 reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3243 char *destn; |
18125
3a1f328cc6a8
Use _notify_userinfo instead of _notify_error when there's an error
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18119
diff
changeset
|
3244 PurpleNotifyUserInfo *user_info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3245 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3246 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3247 reason = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3248 destn = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3249 va_end(ap); |
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 if (destn == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3252 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3253 |
18125
3a1f328cc6a8
Use _notify_userinfo instead of _notify_error when there's an error
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18119
diff
changeset
|
3254 user_info = purple_notify_user_info_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3255 buf = g_strdup_printf(_("User information not available: %s"), (reason < msgerrreasonlen) ? _(msgerrreason[reason]) : _("Unknown reason.")); |
18125
3a1f328cc6a8
Use _notify_userinfo instead of _notify_error when there's an error
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18119
diff
changeset
|
3256 purple_notify_user_info_add_pair(user_info, NULL, buf); |
3a1f328cc6a8
Use _notify_userinfo instead of _notify_error when there's an error
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18119
diff
changeset
|
3257 purple_notify_userinfo(od->gc, destn, user_info, NULL, NULL); |
3a1f328cc6a8
Use _notify_userinfo instead of _notify_error when there's an error
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18119
diff
changeset
|
3258 purple_notify_user_info_destroy(user_info); |
3a1f328cc6a8
Use _notify_userinfo instead of _notify_error when there's an error
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
18119
diff
changeset
|
3259 purple_conv_present_error(destn, purple_connection_get_account(od->gc), buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3260 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3261 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3262 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3263 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3264 |
15822 | 3265 static int purple_parse_userinfo(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3266 PurpleConnection *gc = od->gc; | |
3267 PurpleAccount *account = purple_connection_get_account(gc); | |
3268 PurpleNotifyUserInfo *user_info; | |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3269 gchar *tmp = NULL, *info_utf8 = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3270 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3271 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3272 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3273 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3274 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3275 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3276 |
15822 | 3277 user_info = purple_notify_user_info_new(); |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3278 |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
3279 oscar_user_info_append_status(gc, user_info, /* PurpleBuddy */ NULL, userinfo, /* strip_html_tags */ FALSE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3280 |
23595
70d39f235848
Don't show an idle time in the user info if it is 0
Evan Schoenberg <evan.s@dreskin.net>
parents:
23591
diff
changeset
|
3281 if ((userinfo->present & AIM_USERINFO_PRESENT_IDLE) && userinfo->idletime != 0) { |
15822 | 3282 tmp = purple_str_seconds_to_string(userinfo->idletime*60); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3283 oscar_user_info_add_pair(user_info, _("Idle"), tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3284 g_free(tmp); |
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 |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3287 oscar_user_info_append_extra_info(gc, user_info, NULL, userinfo); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3288 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3289 if ((userinfo->present & AIM_USERINFO_PRESENT_ONLINESINCE) && !oscar_util_valid_name_sms(userinfo->bn)) { |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3290 /* An SMS contact is always online; its Online Since valid is not useful */ |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3291 time_t t = userinfo->onlinesince; |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3292 oscar_user_info_add_pair(user_info, _("Online Since"), purple_date_format_full(localtime(&t))); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3293 } |
23267 | 3294 |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3295 if (userinfo->present & AIM_USERINFO_PRESENT_MEMBERSINCE) { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3296 time_t t = userinfo->membersince; |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3297 oscar_user_info_add_pair(user_info, _("Member Since"), purple_date_format_full(localtime(&t))); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3298 } |
23267 | 3299 |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3300 if (userinfo->capabilities != 0) { |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3301 tmp = oscar_caps_to_string(userinfo->capabilities); |
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
3302 oscar_user_info_add_pair(user_info, _("Capabilities"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3303 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3304 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3305 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3306 /* Info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3307 if ((userinfo->info_len > 0) && (userinfo->info != NULL) && (userinfo->info_encoding != NULL)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3308 tmp = oscar_encoding_extract(userinfo->info_encoding); |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
3309 info_utf8 = oscar_encoding_to_utf8(account, tmp, userinfo->info, |
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
3310 userinfo->info_len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3311 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3312 if (info_utf8 != NULL) { |
15822 | 3313 tmp = purple_str_sub_away_formatters(info_utf8, purple_account_get_username(account)); |
3314 purple_notify_user_info_add_section_break(user_info); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3315 oscar_user_info_add_pair(user_info, _("Profile"), tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3316 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3317 g_free(info_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3318 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3319 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3320 |
24667
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24453
diff
changeset
|
3321 purple_notify_user_info_add_section_break(user_info); |
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24453
diff
changeset
|
3322 tmp = g_strdup_printf("<a href=\"http://profiles.aim.com/%s\">%s</a>", |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3323 purple_normalize(account, userinfo->bn), _("View web profile")); |
24667
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24453
diff
changeset
|
3324 purple_notify_user_info_add_pair(user_info, NULL, tmp); |
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24453
diff
changeset
|
3325 g_free(tmp); |
9fc3f5bf4455
Make our profile text a little cleaner and more uniform across the protocols.
Mark Doliner <mark@kingant.net>
parents:
24453
diff
changeset
|
3326 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3327 purple_notify_userinfo(gc, userinfo->bn, user_info, NULL, NULL); |
15822 | 3328 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
|
3329 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3330 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3331 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3332 |
15822 | 3333 static int purple_got_infoblock(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3334 { |
15822 | 3335 PurpleConnection *gc = od->gc; |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
3336 PurpleAccount *account = purple_connection_get_account(gc); |
15822 | 3337 PurpleBuddy *b; |
3338 PurplePresence *presence; | |
3339 PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3340 gchar *message = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3341 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3342 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3343 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3344 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3345 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3346 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3347 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3348 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3349 b = purple_find_buddy(account, userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3350 if (b == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3351 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3352 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3353 if (!oscar_util_valid_name_icq(userinfo->bn)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3354 { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3355 if (strcmp(purple_buddy_get_name(b), userinfo->bn) != 0) |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3356 serv_got_alias(gc, purple_buddy_get_name(b), userinfo->bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3357 else |
15822 | 3358 serv_got_alias(gc, purple_buddy_get_name(b), NULL); |
3359 } | |
3360 | |
3361 presence = purple_buddy_get_presence(b); | |
3362 status = purple_presence_get_active_status(presence); | |
3363 | |
21997
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3364 if (purple_status_is_online(status) && !purple_status_is_available(status) && |
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3365 userinfo->flags & AIM_FLAG_AWAY && userinfo->away_len > 0 && |
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3366 userinfo->away != NULL && userinfo->away_encoding != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3367 { |
21997
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3368 gchar *charset = oscar_encoding_extract(userinfo->away_encoding); |
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3369 message = oscar_encoding_to_utf8(account, charset, |
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3370 userinfo->away, |
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3371 userinfo->away_len); |
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3372 g_free(charset); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3373 purple_prpl_got_user_status(account, userinfo->bn, |
21997
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3374 purple_status_get_id(status), |
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3375 "message", message, NULL); |
82297cc4bb47
Some changes intended to make oscar not emit so many
Mark Doliner <mark@kingant.net>
parents:
21993
diff
changeset
|
3376 g_free(message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3377 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3378 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3379 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3380 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3381 |
15822 | 3382 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
|
3383 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3384 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3385 guint16 id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3386 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3387 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3388 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3389 id = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3390 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3391 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3392 |
15822 | 3393 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3394 "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
|
3395 if (id < 4) |
15822 | 3396 purple_notify_warning(od->gc, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3397 _("Your AIM connection may be lost."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3398 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3399 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3400 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3401 |
15822 | 3402 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
|
3403 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3404 guint16 type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3405 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3406 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3407 type = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3408 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3409 switch(type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3410 case 0x0002: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3411 guint8 maxrooms; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3412 struct aim_chat_exchangeinfo *exchanges; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3413 int exchangecount, i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3414 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3415 maxrooms = (guint8) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3416 exchangecount = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3417 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
|
3418 |
15822 | 3419 purple_debug_misc("oscar", "chat info: Chat Rights:\n"); |
3420 purple_debug_misc("oscar", | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3421 "chat info: \tMax Concurrent Rooms: %hhd\n", maxrooms); |
15822 | 3422 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3423 "chat info: \tExchange List: (%d total)\n", exchangecount); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3424 for (i = 0; i < exchangecount; i++) |
15822 | 3425 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3426 "chat info: \t\t%hu %s\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3427 exchanges[i].number, exchanges[i].name ? exchanges[i].name : ""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3428 while (od->create_rooms) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3429 struct create_room *cr = od->create_rooms->data; |
15822 | 3430 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3431 "creating room %s\n", cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3432 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
|
3433 g_free(cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3434 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
|
3435 g_free(cr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3436 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3437 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3438 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3439 case 0x0008: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3440 char *fqcn, *name, *ck; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3441 guint16 instance, flags, maxmsglen, maxoccupancy, unknown, exchange; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3442 guint8 createperms; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3443 guint32 createtime; |
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 fqcn = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3446 instance = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3447 exchange = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3448 flags = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3449 createtime = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3450 maxmsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3451 maxoccupancy = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3452 createperms = (guint8)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3453 unknown = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3454 name = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3455 ck = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3456 |
15822 | 3457 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3458 "created room: %s %hu %hu %hu %u %hu %hu %hhu %hu %s %s\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3459 fqcn, exchange, instance, flags, createtime, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3460 maxmsglen, maxoccupancy, createperms, unknown, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3461 name, ck); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3462 aim_chat_join(od, exchange, ck, instance); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3463 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3464 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3465 default: |
15822 | 3466 purple_debug_warning("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3467 "chatnav info: unknown type (%04hx)\n", type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3468 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3469 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3470 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3471 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3472 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3473 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3474 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3475 |
15822 | 3476 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
|
3477 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3478 int count, i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3479 aim_userinfo_t *info; |
15822 | 3480 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3481 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3482 struct chat_connection *c = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3483 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3484 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3485 count = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3486 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3487 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3488 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3489 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
|
3490 if (!c) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3491 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3492 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3493 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
|
3494 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
|
3495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3496 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3497 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3498 |
15822 | 3499 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
|
3500 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3501 int count, i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3502 aim_userinfo_t *info; |
15822 | 3503 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3504 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3505 struct chat_connection *c = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3506 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3507 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3508 count = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3509 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3510 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3511 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3512 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
|
3513 if (!c) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3514 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3515 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3516 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
|
3517 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
|
3518 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3519 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3520 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3521 |
15822 | 3522 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
|
3523 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3524 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3525 struct aim_chat_roominfo *roominfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3526 char *roomname; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3527 int usercount; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3528 char *roomdesc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3529 guint16 unknown_c9, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3530 guint32 creationtime; |
15822 | 3531 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3532 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
|
3533 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3534 if (!ccon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3535 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3536 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3537 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3538 roominfo = va_arg(ap, struct aim_chat_roominfo *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3539 roomname = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3540 usercount= va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3541 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3542 roomdesc = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3543 unknown_c9 = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3544 creationtime = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3545 maxmsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3546 unknown_d2 = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3547 unknown_d5 = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3548 maxvisiblemsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3549 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3550 |
15822 | 3551 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3552 "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
|
3553 maxmsglen, maxvisiblemsglen); |
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 ccon->maxlen = maxmsglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3556 ccon->maxvis = maxvisiblemsglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3557 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3558 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3559 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3560 |
15822 | 3561 static int purple_conv_chat_incoming_msg(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3562 PurpleConnection *gc = od->gc; | |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
3563 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
|
3564 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
|
3565 gchar *utf8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3566 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3567 aim_userinfo_t *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3568 int len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3569 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3570 char *charset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3571 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3572 if (!ccon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3573 return 1; |
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3576 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3577 len = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3578 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3579 charset = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3580 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3581 |
17632
36ebcb33e2eb
This fixes a bustination of the official ICQ client in at least some
Ethan Blanton <elb@pidgin.im>
parents:
17595
diff
changeset
|
3582 utf8 = oscar_encoding_to_utf8(account, charset, msg, len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3583 if (utf8 == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3584 /* The conversion failed! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3585 utf8 = g_strdup(_("[Unable to display a message from this user because it contained invalid characters.]")); |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3586 serv_got_chat_in(gc, ccon->id, info->bn, 0, utf8, time((time_t)NULL)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3587 g_free(utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3588 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3589 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3590 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3591 |
15822 | 3592 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
|
3593 va_list ap; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3594 PurpleConnection *gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3595 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3596 struct aim_emailinfo *emailinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3597 int havenewmail; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3598 char *alertitle, *alerturl; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3599 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3600 gc = od->gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3601 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
|
3602 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3603 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3604 emailinfo = va_arg(ap, struct aim_emailinfo *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3605 havenewmail = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3606 alertitle = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3607 alerturl = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3608 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3609 |
26942
7957a5ed53bb
Re-add purple_account_get_check_mail() check to oscar.
Paul Aurich <paul@darkrain42.org>
parents:
26876
diff
changeset
|
3610 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
|
3611 emailinfo->unread && havenewmail) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3612 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
|
3613 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
|
3614 emailinfo->domain ? "@" : "", |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3615 emailinfo->domain ? emailinfo->domain : ""); |
25606
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25576
diff
changeset
|
3616 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
|
3617 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
|
3618 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
|
3619 tos, urls, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3620 g_free(to); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3621 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3622 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3623 if (alertitle) |
15822 | 3624 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
|
3625 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3626 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3627 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3628 |
15822 | 3629 static int purple_icon_parseicon(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3630 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3631 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
|
3632 char *bn; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3633 guint8 iconcsumtype, *iconcsum, *icon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3634 guint16 iconcsumlen, iconlen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3635 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3636 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
|
3637 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3638 iconcsumtype = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3639 iconcsum = va_arg(ap, guint8 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3640 iconcsumlen = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3641 icon = va_arg(ap, guint8 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3642 iconlen = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3643 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3644 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3645 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3646 * 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
|
3647 * no icon is set. Ignore these. |
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 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
|
3650 char *b16 = purple_base16_encode(iconcsum, iconcsumlen); |
15822 | 3651 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
|
3652 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
|
3653 g_free(b16); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3654 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3655 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3656 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3657 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3658 |
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
|
3659 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
|
3660 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
|
3661 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3662 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
|
3663 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3664 FlapConnection *conn; |
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 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
|
3667 if (!conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3668 if (!od->iconconnecting) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3669 aim_srv_requestnew(od, SNAC_FAMILY_BART); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3670 od->iconconnecting = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3671 } |
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
|
3672 return; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3673 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3674 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3675 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
|
3676 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
|
3677 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
|
3678 if (img == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3679 aim_ssi_delicon(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3680 } 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
|
3681 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
|
3682 "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
|
3683 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
|
3684 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
|
3685 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3686 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3687 od->set_icon = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3688 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3689 |
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
|
3690 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
|
3691 { |
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
|
3692 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
|
3693 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
|
3694 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
|
3695 |
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
|
3696 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
|
3697 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
|
3698 } |
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
|
3699 |
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
|
3700 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
|
3701 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3702 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3703 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3704 * Received in response to an IM sent with the AIM_IMFLAGS_ACK option. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3705 */ |
15822 | 3706 static int purple_parse_msgack(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3707 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3708 guint16 type; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3709 char *bn; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3710 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3711 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3712 type = (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
|
3713 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3714 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3715 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3716 purple_debug_info("oscar", "Sent message to %s.\n", bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3717 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3718 return 1; |
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 |
15822 | 3721 static int purple_parse_ratechange(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3722 static const char *codes[5] = { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3723 "invalid", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3724 "change", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3725 "warning", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3726 "limit", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3727 "limit cleared", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3728 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3729 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3730 guint16 code, rateclass; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3731 guint32 windowsize, clear, alert, limit, disconnect, currentavg, maxavg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3732 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3733 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3734 code = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3735 rateclass= (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3736 windowsize = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3737 clear = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3738 alert = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3739 limit = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3740 disconnect = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3741 currentavg = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3742 maxavg = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3743 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3744 |
15822 | 3745 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3746 "rate %s (param ID 0x%04hx): curavg = %u, maxavg = %u, alert at %u, " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3747 "clear warning at %u, limit at %u, disconnect at %u (window size = %u)\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3748 (code < 5) ? codes[code] : codes[0], |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3749 rateclass, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3750 currentavg, maxavg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3751 alert, clear, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3752 limit, disconnect, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3753 windowsize); |
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 (code == AIM_RATE_CODE_LIMIT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3756 { |
16295
bb8b24032089
Remove the OSCAR rate limiting dialog, as the only time I've ever seen it
Sean Egan <seanegan@gmail.com>
parents:
16135
diff
changeset
|
3757 purple_debug_warning("oscar", _("The last action you attempted could not be " |
23267 | 3758 "performed because you are over the rate limit. " |
3759 "Please wait 10 seconds and try again.")); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3760 } |
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 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3763 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3764 |
15822 | 3765 static int purple_parse_evilnotify(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3766 #ifdef CRAZY_WARNING |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3767 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3768 guint16 newevil; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3769 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3770 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3771 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3772 newevil = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3773 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3774 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3775 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3776 purple_prpl_got_account_warning_level(account, (userinfo && userinfo->bn) ? userinfo->bn : NULL, (newevil/10.0) + 0.5); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3777 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3778 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3779 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3780 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3781 |
15822 | 3782 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
|
3783 int warning_level; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3784 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3785 aim_userinfo_t *info; |
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3788 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3789 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3790 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3791 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
|
3792 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3793 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3794 * What's with the + 0.5? |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3795 * 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
|
3796 * 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
|
3797 * 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
|
3798 * truncated. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3799 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3800 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
|
3801 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3802 #ifdef CRAZY_WARNING |
15822 | 3803 purple_presence_set_warning_level(presence, warning_level); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3804 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3805 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3806 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3807 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3808 |
15822 | 3809 static int purple_connerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3810 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3811 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3812 guint16 code; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3813 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3814 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3815 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3816 code = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3817 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3818 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3819 |
15822 | 3820 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
|
3821 code, (msg != NULL ? msg : "")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3822 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3823 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
|
3824 |
18609
2774acdb1cff
Move a call to purple_connection_error() from oscar.c to
Mark Doliner <mark@kingant.net>
parents:
18608
diff
changeset
|
3825 if (conn->type == SNAC_FAMILY_CHAT) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3826 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
|
3827 PurpleConversation *conv = NULL; |
15373
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 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
|
3830 if (cc != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3831 { |
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
|
3832 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
|
3833 |
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
|
3834 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
|
3835 { |
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
|
3836 /* |
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
|
3837 * 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
|
3838 * 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
|
3839 * 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
|
3840 */ |
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
|
3841 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
|
3842 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
|
3843 "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
|
3844 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
|
3845 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
|
3846 } |
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
|
3847 oscar_chat_kill(gc, cc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3848 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3849 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3850 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3851 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3852 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3853 |
15822 | 3854 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
|
3855 { |
15822 | 3856 PurpleConnection *gc = od->gc; |
3857 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
|
3858 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3859 guint16 maxsiglen; |
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3862 maxsiglen = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3863 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3864 |
15822 | 3865 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3866 "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
|
3867 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3868 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
|
3869 |
15822 | 3870 aim_locate_setcaps(od, purple_caps); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3871 oscar_set_info_and_status(account, TRUE, account->user_info, TRUE, |
15822 | 3872 purple_account_get_active_status(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3873 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3874 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3875 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3876 |
15822 | 3877 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
|
3878 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3879 guint16 maxbuddies, maxwatchers; |
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3882 maxbuddies = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3883 maxwatchers = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3884 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3885 |
15822 | 3886 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3887 "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
|
3888 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3889 od->rights.maxbuddies = (guint)maxbuddies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3890 od->rights.maxwatchers = (guint)maxwatchers; |
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 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3893 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3894 |
15822 | 3895 static int purple_bosrights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3896 PurpleConnection *gc; | |
3897 PurpleAccount *account; | |
3898 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
|
3899 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
|
3900 PurplePresence *presence; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3901 const char *username, *message, *itmsurl; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3902 char *tmp; |
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 maxpermits, maxdenies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3905 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3906 gc = od->gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3907 od = purple_connection_get_protocol_data(gc); |
15822 | 3908 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3909 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3910 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3911 maxpermits = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3912 maxdenies = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3913 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3914 |
15822 | 3915 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3916 "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
|
3917 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3918 od->rights.maxpermits = (guint)maxpermits; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3919 od->rights.maxdenies = (guint)maxdenies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3920 |
15822 | 3921 purple_connection_set_state(gc, PURPLE_CONNECTED); |
3922 | |
3923 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
|
3924 |
23901
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23715
diff
changeset
|
3925 aim_srv_clientready(od, conn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3926 |
15822 | 3927 if (purple_account_get_user_info(account) != NULL) |
3928 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
|
3929 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3930 username = 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
|
3931 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
|
3932 /* |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
3933 * 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
|
3934 * 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
|
3935 */ |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
3936 oscar_format_username(gc, username); |
15679
cad32dba756b
Automatically format screenname to account->username
Sean Egan <seanegan@gmail.com>
parents:
15678
diff
changeset
|
3937 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3938 /* Set our available message based on the current status */ |
15822 | 3939 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
|
3940 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
|
3941 if (is_available) |
15822 | 3942 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
|
3943 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3944 message = NULL; |
15822 | 3945 tmp = purple_markup_strip_html(message); |
3946 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
|
3947 aim_srv_setextrainfo(od, FALSE, 0, is_available, tmp, itmsurl); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3948 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3949 |
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
|
3950 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
|
3951 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
|
3952 |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
3953 /* Request offline messages for AIM and ICQ */ |
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
3954 aim_im_reqofflinemsgs(od); |
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
3955 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3956 if (od->icq) { |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
3957 #ifdef OLDSTYLE_ICQ_OFFLINEMSGS |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3958 aim_icq_reqofflinemsgs(od); |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
3959 #endif |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3960 oscar_set_extendedstatus(gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3961 aim_icq_setsecurity(od, |
15822 | 3962 purple_account_get_bool(account, "authorization", OSCAR_DEFAULT_AUTHORIZATION), |
3963 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
|
3964 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3965 |
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
|
3966 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
|
3967 aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3968 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3969 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3970 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3971 |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
3972 #ifdef OLDSTYLE_ICQ_OFFLINEMSGS |
15822 | 3973 static int purple_offlinemsg(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3974 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3975 struct aim_icq_offlinemsg *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3976 struct aim_incomingim_ch4_args args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3977 time_t t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3978 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3979 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3980 msg = va_arg(ap, struct aim_icq_offlinemsg *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3981 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3982 |
15822 | 3983 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3984 "Received offline message. Converting to channel 4 ICBM...\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3985 args.uin = msg->sender; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3986 args.type = msg->type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3987 args.flags = msg->flags; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3988 args.msglen = msg->msglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3989 args.msg = msg->msg; |
15822 | 3990 t = purple_time_build(msg->year, msg->month, msg->day, msg->hour, msg->minute, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3991 incomingim_chan4(od, conn, NULL, &args, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3992 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3993 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3994 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3995 |
15822 | 3996 static int purple_offlinemsgdone(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3997 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3998 aim_icq_ackofflinemsgs(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3999 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4000 } |
22347
a8c025929245
Add support for offline messages for AIM, thanks to some info from
Mark Doliner <mark@kingant.net>
parents:
22283
diff
changeset
|
4001 #endif /* OLDSTYLE_ICQ_OFFLINEMSGS */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4002 |
15822 | 4003 static int purple_icqinfo(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4004 { |
15822 | 4005 PurpleConnection *gc; |
4006 PurpleAccount *account; | |
4007 PurpleBuddy *buddy; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4008 struct buddyinfo *bi; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4009 gchar who[16]; |
15822 | 4010 PurpleNotifyUserInfo *user_info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4011 gchar *utf8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4012 gchar *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4013 const gchar *alias; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4014 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4015 struct aim_icq_info *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4016 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4017 gc = od->gc; |
15822 | 4018 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4019 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4020 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4021 info = va_arg(ap, struct aim_icq_info *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4022 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4023 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4024 if (!info->uin) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4025 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4026 |
15822 | 4027 user_info = purple_notify_user_info_new(); |
23267 | 4028 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4029 g_snprintf(who, sizeof(who), "%u", info->uin); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4030 buddy = purple_find_buddy(account, who); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4031 if (buddy != NULL) |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4032 bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, purple_buddy_get_name(buddy))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4033 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4034 bi = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4035 |
15822 | 4036 purple_notify_user_info_add_pair(user_info, _("UIN"), who); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4037 oscar_user_info_convert_and_add(account, user_info, _("Nick"), info->nick); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4038 if ((bi != NULL) && (bi->ipaddr != 0)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4039 char *tstr = g_strdup_printf("%hhu.%hhu.%hhu.%hhu", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4040 (bi->ipaddr & 0xff000000) >> 24, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4041 (bi->ipaddr & 0x00ff0000) >> 16, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4042 (bi->ipaddr & 0x0000ff00) >> 8, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4043 (bi->ipaddr & 0x000000ff)); |
15822 | 4044 purple_notify_user_info_add_pair(user_info, _("IP Address"), tstr); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4045 g_free(tstr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4046 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4047 oscar_user_info_convert_and_add(account, user_info, _("First Name"), info->first); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4048 oscar_user_info_convert_and_add(account, user_info, _("Last Name"), info->last); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4049 if (info->email && info->email[0] && (utf8 = oscar_utf8_try_convert(account, info->email))) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4050 buf = g_strdup_printf("<a href=\"mailto:%s\">%s</a>", utf8, utf8); |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
4051 purple_notify_user_info_add_pair(user_info, _("Email Address"), buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4052 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4053 g_free(utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4054 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4055 if (info->numaddresses && info->email2) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4056 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4057 for (i = 0; i < info->numaddresses; i++) { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4058 if (info->email2[i] && info->email2[i][0] && (utf8 = oscar_utf8_try_convert(account, info->email2[i]))) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4059 buf = g_strdup_printf("<a href=\"mailto:%s\">%s</a>", utf8, utf8); |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
4060 purple_notify_user_info_add_pair(user_info, _("Email Address"), buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4061 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4062 g_free(utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4063 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4064 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4065 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4066 oscar_user_info_convert_and_add(account, user_info, _("Mobile Phone"), info->mobile); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4067 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4068 if (info->gender != 0) |
15822 | 4069 purple_notify_user_info_add_pair(user_info, _("Gender"), (info->gender == 1 ? _("Female") : _("Male"))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4070 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4071 if ((info->birthyear > 1900) && (info->birthmonth > 0) && (info->birthday > 0)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4072 /* Initialize the struct properly or strftime() will crash |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4073 * under some conditions (e.g. Debian sarge w/ LANG=en_HK). */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4074 time_t t = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4075 struct tm *tm = localtime(&t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4076 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4077 tm->tm_mday = (int)info->birthday; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4078 tm->tm_mon = (int)info->birthmonth - 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4079 tm->tm_year = (int)info->birthyear - 1900; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4080 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4081 /* To be 100% sure that the fields are re-normalized. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4082 * If you're sure strftime() ALWAYS does this EVERYWHERE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4083 * feel free to remove it. --rlaager */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4084 mktime(tm); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4085 |
15822 | 4086 oscar_user_info_convert_and_add(account, user_info, _("Birthday"), purple_date_format_short(tm)); |
15373
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 if ((info->age > 0) && (info->age < 255)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4089 char age[5]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4090 snprintf(age, sizeof(age), "%hhd", info->age); |
23227
a4bfb7514607
Two leak fixes for purple_icqinfo()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23226
diff
changeset
|
4091 purple_notify_user_info_add_pair(user_info, _("Age"), age); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4092 } |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4093 if (info->personalwebpage && info->personalwebpage[0] && (utf8 = oscar_utf8_try_convert(account, info->personalwebpage))) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4094 buf = g_strdup_printf("<a href=\"%s\">%s</a>", utf8, utf8); |
15822 | 4095 purple_notify_user_info_add_pair(user_info, _("Personal Web Page"), buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4096 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4097 g_free(utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4098 } |
15983
20c0ab6ea008
sf patch #1574238, from Ka-Hing Cheung
Mark Doliner <mark@kingant.net>
parents:
15866
diff
changeset
|
4099 |
23232
56b39f1a15bf
Refactored and cleaned up the addition of status information to user info /
Evan Schoenberg <evan.s@dreskin.net>
parents:
23230
diff
changeset
|
4100 if (buddy != NULL) |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
4101 oscar_user_info_append_status(gc, user_info, buddy, /* aim_userinfo_t */ NULL, /* strip_html_tags */ FALSE); |
15983
20c0ab6ea008
sf patch #1574238, from Ka-Hing Cheung
Mark Doliner <mark@kingant.net>
parents:
15866
diff
changeset
|
4102 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4103 oscar_user_info_convert_and_add(account, user_info, _("Additional Information"), info->info); |
15822 | 4104 purple_notify_user_info_add_section_break(user_info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4105 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4106 if ((info->homeaddr && (info->homeaddr[0])) || (info->homecity && info->homecity[0]) || (info->homestate && info->homestate[0]) || (info->homezip && info->homezip[0])) { |
23226
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4107 purple_notify_user_info_add_section_header(user_info, _("Home Address")); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4108 |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4109 oscar_user_info_convert_and_add(account, user_info, _("Address"), info->homeaddr); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4110 oscar_user_info_convert_and_add(account, user_info, _("City"), info->homecity); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4111 oscar_user_info_convert_and_add(account, user_info, _("State"), info->homestate); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4112 oscar_user_info_convert_and_add(account, user_info, _("Zip Code"), info->homezip); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4113 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4114 if ((info->workaddr && info->workaddr[0]) || (info->workcity && info->workcity[0]) || (info->workstate && info->workstate[0]) || (info->workzip && info->workzip[0])) { |
23226
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4115 purple_notify_user_info_add_section_header(user_info, _("Work Address")); |
23267 | 4116 |
23226
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4117 oscar_user_info_convert_and_add(account, user_info, _("Address"), info->workaddr); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4118 oscar_user_info_convert_and_add(account, user_info, _("City"), info->workcity); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4119 oscar_user_info_convert_and_add(account, user_info, _("State"), info->workstate); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4120 oscar_user_info_convert_and_add(account, user_info, _("Zip Code"), info->workzip); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4121 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4122 if ((info->workcompany && info->workcompany[0]) || (info->workdivision && info->workdivision[0]) || (info->workposition && info->workposition[0]) || (info->workwebpage && info->workwebpage[0])) { |
23226
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4123 purple_notify_user_info_add_section_header(user_info, _("Work Information")); |
23267 | 4124 |
23226
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4125 oscar_user_info_convert_and_add(account, user_info, _("Company"), info->workcompany); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4126 oscar_user_info_convert_and_add(account, user_info, _("Division"), info->workdivision); |
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4127 oscar_user_info_convert_and_add(account, user_info, _("Position"), info->workposition); |
23267 | 4128 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4129 if (info->workwebpage && info->workwebpage[0] && (utf8 = oscar_utf8_try_convert(account, info->workwebpage))) { |
23226
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4130 char *webpage = g_strdup_printf("<a href=\"%s\">%s</a>", utf8, utf8); |
23227
a4bfb7514607
Two leak fixes for purple_icqinfo()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23226
diff
changeset
|
4131 purple_notify_user_info_add_pair(user_info, _("Web Page"), webpage); |
23226
b1e219ed4e1c
Moved the remainder of ICQ's user info processing to use the notify_user_info
Evan Schoenberg <evan.s@dreskin.net>
parents:
23215
diff
changeset
|
4132 g_free(webpage); |
23227
a4bfb7514607
Two leak fixes for purple_icqinfo()
Evan Schoenberg <evan.s@dreskin.net>
parents:
23226
diff
changeset
|
4133 g_free(utf8); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4134 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4135 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4136 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4137 if (buddy != NULL) |
15822 | 4138 alias = purple_buddy_get_alias(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4139 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4140 alias = who; |
15822 | 4141 purple_notify_userinfo(gc, who, user_info, NULL, NULL); |
4142 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
|
4143 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4144 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4145 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4146 |
15822 | 4147 static int purple_icqalias(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4148 { |
15822 | 4149 PurpleConnection *gc = od->gc; |
4150 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
|
4151 gchar who[16], *utf8; |
15822 | 4152 PurpleBuddy *b; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4153 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4154 struct aim_icq_info *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4155 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4156 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4157 info = va_arg(ap, struct aim_icq_info *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4158 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4159 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4160 if (info->uin && info->nick && info->nick[0] && (utf8 = oscar_utf8_try_convert(account, info->nick))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4161 g_snprintf(who, sizeof(who), "%u", info->uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4162 serv_got_alias(gc, who, utf8); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4163 if ((b = purple_find_buddy(account, who))) { |
15822 | 4164 purple_blist_node_set_string((PurpleBlistNode*)b, "servernick", utf8); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4165 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4166 g_free(utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4167 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4168 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4169 return 1; |
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 |
15822 | 4172 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
|
4173 { |
15822 | 4174 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4175 gchar *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4176 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4177 char *msg, *url; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4178 guint16 wid, hei, delay; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4179 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4180 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4181 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4182 url = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4183 wid = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4184 hei = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4185 delay = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4186 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4187 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4188 text = g_strdup_printf("%s<br><a href=\"%s\">%s</a>", msg, url, url); |
15822 | 4189 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
|
4190 g_free(text); |
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 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4193 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4194 |
15822 | 4195 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
|
4196 { |
15822 | 4197 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
|
4198 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
|
4199 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4200 |
15822 | 4201 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
|
4202 { |
15822 | 4203 PurpleConnection *gc = od->gc; |
4204 PurpleNotifySearchResults *results; | |
4205 PurpleNotifySearchColumn *column; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4206 gchar *secondary; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4207 int i, num; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4208 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
|
4209 char *email, *usernames; |
15373
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4212 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4213 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
|
4214 usernames = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4215 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4216 |
15822 | 4217 results = purple_notify_searchresults_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4219 if (results == NULL) { |
15822 | 4220 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
|
4221 "Unable to display the search results.\n"); |
15822 | 4222 purple_notify_error(gc, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4223 _("Unable to display the search results."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4224 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4225 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4226 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4227 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4228 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
|
4229 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
|
4230 "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
|
4231 num), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4232 email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4233 |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
4234 column = purple_notify_searchresults_column_new(_("Username")); |
15822 | 4235 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
|
4236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4237 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
|
4238 GList *row; |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
4239 row = g_list_append(NULL, g_strdup(&usernames[i * (MAXSNLEN + 1)])); |
15822 | 4240 purple_notify_searchresults_row_add(results, row); |
4241 } | |
4242 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
|
4243 oscar_searchresults_add_buddy_cb); |
15822 | 4244 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
|
4245 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4246 g_free(secondary); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4247 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4248 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4249 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4250 |
15822 | 4251 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
|
4252 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4253 char *email; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4254 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4256 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4257 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4258 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4259 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
4260 buf = g_strdup_printf(_("No results found for email address %s"), email); |
15822 | 4261 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
|
4262 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4263 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4264 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4265 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4266 |
15822 | 4267 static int purple_account_confirm(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4268 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4269 guint16 status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4270 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4271 char msg[256]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4272 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4273 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4274 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
|
4275 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4276 |
15822 | 4277 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4278 "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
|
4279 status ? "unknown" : "email sent"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4280 if (!status) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
4281 g_snprintf(msg, sizeof(msg), _("You should receive an email asking to confirm %s."), |
15822 | 4282 purple_account_get_username(purple_connection_get_account(gc))); |
4283 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
|
4284 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4285 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4286 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4287 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4288 |
15822 | 4289 static int purple_info_change(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4290 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4291 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4292 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
|
4293 char *url, *bn, *email; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4294 int change; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4295 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4296 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4297 change = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4298 perms = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4299 err = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4300 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
|
4301 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4302 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4303 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4304 |
15822 | 4305 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
|
4306 "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
|
4307 change ? "change" : "request", perms, err, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4308 (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
|
4309 (bn != NULL) ? bn : "(null)", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4310 (email != NULL) ? email : "(null)"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4311 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4312 if ((err > 0) && (url != NULL)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4313 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
|
4314 |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
4315 if (err == 0x0001) |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
4316 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
|
4317 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
|
4318 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
|
4319 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
|
4320 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
|
4321 else if (err == 0x001d) |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
4322 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
|
4323 else if (err == 0x0021) |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
4324 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
|
4325 else if (err == 0x0023) |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
4326 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
|
4327 else |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
4328 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
|
4329 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
|
4330 _("Error Changing Account Info"), dialog_msg); |
15373
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 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4333 } |
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 if (email != NULL) { |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
4336 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), |
15822 | 4337 purple_account_get_username(purple_connection_get_account(gc)), email); |
4338 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
|
4339 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4340 } |
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 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4343 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4344 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4345 void |
15822 | 4346 oscar_keepalive(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4347 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4348 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4349 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4350 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4351 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
|
4352 conn = flap_connection_getbytype(od, SNAC_FAMILY_LOCATE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4353 if (conn != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4354 flap_connection_send_keepalive(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4355 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4356 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4357 unsigned int |
15822 | 4358 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
|
4359 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4360 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4361 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4362 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4363 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
|
4364 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
|
4365 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4366 if ((conn != NULL) && (conn->ready)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4367 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4368 peer_odc_send_typing(conn, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4369 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4370 else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4371 /* 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
|
4372 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
|
4373 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
|
4374 if (!list) { |
15822 | 4375 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
|
4376 if (bi && bi->typingnot) { |
15822 | 4377 if (state == PURPLE_TYPING) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4378 aim_im_sendmtn(od, 0x0001, name, 0x0002); |
15822 | 4379 else if (state == PURPLE_TYPED) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4380 aim_im_sendmtn(od, 0x0001, name, 0x0001); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4381 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4382 aim_im_sendmtn(od, 0x0001, name, 0x0000); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4383 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4384 } |
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 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4387 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4388 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4389 /* TODO: Move this into odc.c! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4390 static void |
15822 | 4391 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
|
4392 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4393 GString *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4394 GString *data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4395 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4396 int tmplen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4397 guint16 charset, charsubset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4398 GData *attribs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4399 const char *start, *end, *last; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4400 int oscar_id = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4401 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4402 msg = g_string_new("<HTML><BODY>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4403 data = g_string_new("<BINARY>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4404 last = message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4405 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4406 /* for each valid IMG tag... */ |
15822 | 4407 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
|
4408 { |
15822 | 4409 PurpleStoredImage *image = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4410 const char *id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4411 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4412 if (start - last) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4413 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
|
4414 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4416 id = g_datalist_get_data(&attribs, "id"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4417 |
15822 | 4418 /* ... 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
|
4419 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
|
4420 /* ... append the message from start to the tag ... */ |
15822 | 4421 unsigned long size = purple_imgstore_get_size(image); |
4422 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
|
4423 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
|
4424 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4425 oscar_id++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4426 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4427 /* ... 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
|
4428 if (filename) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4429 g_string_append_printf(msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4430 "<IMG SRC=\"%s\" ID=\"%d\" DATASIZE=\"%lu\">", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4431 filename, oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4432 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4433 g_string_append_printf(msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4434 "<IMG ID=\"%d\" DATASIZE=\"%lu\">", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4435 oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4436 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4437 /* ... 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
|
4438 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
|
4439 oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4440 g_string_append_len(data, imgdata, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4441 g_string_append(data, "</DATA>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4442 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4443 /* 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
|
4444 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4445 g_datalist_clear(&attribs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4446 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4447 /* continue from the end of the tag */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4448 last = end + 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4449 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4450 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4451 /* append any remaining message data */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4452 if (last && *last) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4453 g_string_append(msg, last); |
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 g_string_append(msg, "</BODY></HTML>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4456 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4457 /* Convert the message to a good encoding */ |
15822 | 4458 purple_plugin_oscar_convert_to_best_encoding(conn->od->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
|
4459 conn->bn, msg->str, &tmp, &tmplen, &charset, &charsubset); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4460 g_string_free(msg, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4461 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
|
4462 g_free(tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4463 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4464 /* 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
|
4465 if (oscar_id) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4466 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
|
4467 msg = g_string_append(msg, "</BINARY>"); |
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 g_string_free(data, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4470 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
4471 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
|
4472 imflags & PURPLE_MESSAGE_AUTO_RESP); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4473 g_string_free(msg, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4474 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4475 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4476 int |
15822 | 4477 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
|
4478 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4479 OscarData *od; |
15822 | 4480 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4481 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4482 int ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4483 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
|
4484 gboolean is_sms, is_html; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4485 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4486 od = purple_connection_get_protocol_data(gc); |
15822 | 4487 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4488 ret = 0; |
15822 | 4489 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4490 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
|
4491 |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
4492 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
|
4493 /* |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
4494 * 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
|
4495 * 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
|
4496 */ |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
4497 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
|
4498 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
|
4499 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
|
4500 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
|
4501 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
4502 |
15822 | 4503 if (imflags & PURPLE_MESSAGE_AUTO_RESP) |
4504 tmp1 = purple_str_sub_away_formatters(message, name); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4505 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4506 tmp1 = g_strdup(message); |
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 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
|
4509 if ((conn != NULL) && (conn->ready)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4510 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4511 /* If we're directly connected, send a direct IM */ |
25509
a46e527d1473
Evan's original change to the Direct IM autoreplies is on im.pidgin.pidgin,
Paul Aurich <paul@darkrain42.org>
parents:
25416
diff
changeset
|
4512 purple_debug_info("oscar", "Sending direct IM with flags %i", imflags); |
15822 | 4513 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
|
4514 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4515 struct buddyinfo *bi; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4516 struct aim_sendimext_args args; |
15822 | 4517 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
|
4518 PurpleStoredImage *img; |
22352
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
4519 PurpleBuddy *buddy; |
15822 | 4520 |
4521 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
|
4522 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4523 if (strstr(tmp1, "<IMG ")) |
15822 | 4524 purple_conversation_write(conv, "", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4525 _("Your IM Image was not sent. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4526 "You must be Direct Connected to send IM Images."), |
15822 | 4527 PURPLE_MESSAGE_ERROR, time(NULL)); |
4528 | |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4529 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
|
4530 |
15822 | 4531 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
|
4532 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4533 bi = g_new0(struct buddyinfo, 1); |
15822 | 4534 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
|
4535 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4536 |
22352
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
4537 args.flags = AIM_IMFLAGS_ACK | AIM_IMFLAGS_CUSTOMFEATURES; |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
4538 |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22347
diff
changeset
|
4539 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
|
4540 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
|
4541 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4542 if (od->icq) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4543 /* We have to present different "features" (whose meaning |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4544 is unclear and are merely a result of protocol inspection) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4545 to offline ICQ buddies. Otherwise, the official |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4546 ICQ client doesn't treat those messages as being "ANSI- |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4547 encoded" (and instead, assumes them to be UTF-8). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4548 For more details, see SF issue 1179452. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4549 */ |
15822 | 4550 if (buddy && PURPLE_BUDDY_IS_ONLINE(buddy)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4551 args.features = features_icq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4552 args.featureslen = sizeof(features_icq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4553 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4554 args.features = features_icq_offline; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4555 args.featureslen = sizeof(features_icq_offline); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4556 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4557 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4558 args.features = features_aim; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4559 args.featureslen = sizeof(features_aim); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4560 |
15822 | 4561 if (imflags & PURPLE_MESSAGE_AUTO_RESP) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4562 args.flags |= AIM_IMFLAGS_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4563 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4564 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4565 if (bi->ico_need) { |
15822 | 4566 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4567 "Sending buddy icon request with message\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4568 args.flags |= AIM_IMFLAGS_BUDDYREQ; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4569 bi->ico_need = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4570 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4571 |
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
|
4572 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
|
4573 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
|
4574 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
|
4575 args.iconlen = 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
|
4576 args.iconsum = aimutil_iconsum(data, args.iconlen); |
16613
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16475
diff
changeset
|
4577 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
|
4578 |
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
|
4579 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
|
4580 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
|
4581 bi->ico_sent = FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4582 } |
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
|
4583 |
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
|
4584 /* |
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
|
4585 * 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
|
4586 * 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
|
4587 * 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
|
4588 * 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
|
4589 * 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
|
4590 */ |
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
|
4591 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
|
4592 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
|
4593 "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
|
4594 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
|
4595 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
|
4596 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
|
4597 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
|
4598 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
|
4599 } |
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
|
4600 |
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
|
4601 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4602 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4603 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4604 args.destbn = name; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4605 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4606 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4607 * If we're IMing an SMS user or an ICQ user from an ICQ account, then strip HTML. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4608 */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4609 if (oscar_util_valid_name_sms(name)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4610 /* Messaging an SMS (mobile) user */ |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
16063
diff
changeset
|
4611 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
|
4612 is_html = FALSE; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4613 } else if (oscar_util_valid_name_icq(purple_account_get_username(account))) { |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4614 if (oscar_util_valid_name_icq(name)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4615 /* From ICQ to ICQ */ |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
16063
diff
changeset
|
4616 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
|
4617 is_html = FALSE; |
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
|
4618 } else { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4619 /* From ICQ to AIM */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4620 tmp2 = g_strdup(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
|
4621 is_html = TRUE; |
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
|
4622 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4623 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4624 /* From AIM to AIM and AIM to ICQ */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4625 tmp2 = g_strdup(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
|
4626 is_html = TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4627 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4628 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4629 tmp1 = tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4630 |
15822 | 4631 purple_plugin_oscar_convert_to_best_encoding(gc, name, tmp1, (char **)&args.msg, &args.msglen, &args.charset, &args.charsubset); |
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
|
4632 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
|
4633 /* 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
|
4634 * 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
|
4635 g_free((char *)args.msg); |
23267 | 4636 |
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
|
4637 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
|
4638 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
|
4639 |
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
4640 /* 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
|
4641 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
|
4642 g_free(tmp2); |
23267 | 4643 |
18598
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
4644 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
|
4645 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
|
4646 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
|
4647 |
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
|
4648 purple_plugin_oscar_convert_to_best_encoding(gc, name, tmp1, (char **)&args.msg, &args.msglen, &args.charset, &args.charsubset); |
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
|
4649 |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19642
diff
changeset
|
4650 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
|
4651 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
|
4652 } |
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
|
4653 |
15822 | 4654 purple_debug_info("oscar", "Sending IM, charset=0x%04hx, charsubset=0x%04hx, length=%d\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4655 args.charset, args.charsubset, args.msglen); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4656 ret = aim_im_sendch1_ext(od, &args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4657 g_free((char *)args.msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4658 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4659 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4660 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4661 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4662 if (ret >= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4663 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4664 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4665 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4666 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4667 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4668 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4669 * 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
|
4670 * 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
|
4671 * AIM users can only request AIM info. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4672 */ |
15822 | 4673 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
|
4674 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
|
4675 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4676 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
|
4677 aim_icq_getallinfo(od, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4678 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4679 aim_locate_getinfoshort(od, name, 0x00000003); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4680 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4681 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4682 #if 0 |
15822 | 4683 static void oscar_set_dir(PurpleConnection *gc, const char *first, const char *middle, const char *last, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4684 const char *maiden, const char *city, const char *state, const char *country, int web) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4685 /* XXX - some of these things are wrong, but i'm lazy */ |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4686 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
|
4687 aim_locate_setdirinfo(od, first, middle, last, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4688 maiden, NULL, NULL, city, state, NULL, 0, web); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4689 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4690 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4691 |
15822 | 4692 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
|
4693 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
|
4694 aim_srv_setidle(od, time); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4695 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4696 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4697 static |
15822 | 4698 gchar *purple_prpl_oscar_convert_to_infotext(const gchar *str, gsize *ret_len, char **encoding) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4699 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4700 int charset = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4701 char *encoded = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4702 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4703 charset = oscar_charset_check(str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4704 if (charset == AIM_CHARSET_UNICODE) { |
22435
7b4d39ffd563
Change OSCAR to use UTF-16 rather than UCS-2 conversions. Apparently
Ethan Blanton <elb@pidgin.im>
parents:
22426
diff
changeset
|
4705 encoded = g_convert(str, -1, "UTF-16BE", "UTF-8", NULL, ret_len, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4706 *encoding = "unicode-2-0"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4707 } else if (charset == AIM_CHARSET_CUSTOM) { |
19197
47942d19f301
Use -1 as length with g_convert() functions instead of strlen()
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19195
diff
changeset
|
4708 encoded = g_convert(str, -1, "ISO-8859-1", "UTF-8", NULL, ret_len, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4709 *encoding = "iso-8859-1"; |
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 encoded = g_strdup(str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4712 *ret_len = strlen(str); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4713 *encoding = "us-ascii"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4714 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4715 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4716 return encoded; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4717 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4718 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4719 void |
15822 | 4720 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
|
4721 { |
15822 | 4722 PurpleAccount *account; |
4723 PurpleStatus *status; | |
4724 | |
4725 account = purple_connection_get_account(gc); | |
4726 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
|
4727 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
|
4728 } |
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 static void |
15822 | 4731 oscar_set_extendedstatus(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4732 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4733 OscarData *od; |
15822 | 4734 PurpleAccount *account; |
4735 PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4736 const gchar *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4737 guint32 data = 0x00000000; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4738 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4739 od = purple_connection_get_protocol_data(gc); |
15822 | 4740 account = purple_connection_get_account(gc); |
4741 status = purple_account_get_active_status(account); | |
4742 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
|
4743 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4744 data |= AIM_ICQ_STATE_HIDEIP; |
15822 | 4745 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
|
4746 data |= AIM_ICQ_STATE_WEBAWARE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4747 |
17561
3bc25e19ce1c
wabz pointed out that this string comparision was being done twice. I
Mark Doliner <mark@kingant.net>
parents:
17450
diff
changeset
|
4748 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
|
4749 data |= AIM_ICQ_STATE_NORMAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4750 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
|
4751 data |= AIM_ICQ_STATE_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4752 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
|
4753 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
|
4754 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
|
4755 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
|
4756 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
|
4757 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
|
4758 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
|
4759 data |= AIM_ICQ_STATE_CHAT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4760 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
|
4761 data |= AIM_ICQ_STATE_INVISIBLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4762 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
|
4763 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
|
4764 |
15627
2261750cf4e9
Allow setting of the iTunes Music Store URL for AIM accounts. It's
Mark Doliner <mark@kingant.net>
parents:
15624
diff
changeset
|
4765 aim_srv_setextrainfo(od, TRUE, data, FALSE, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4766 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4767 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4768 static void |
15822 | 4769 oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, |
4770 gboolean setstatus, PurpleStatus *status) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4771 { |
15822 | 4772 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
|
4773 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 4774 PurpleStatusType *status_type; |
4775 PurpleStatusPrimitive primitive; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4776 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4777 char *info_encoding = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4778 char *info = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4779 gsize infolen = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4780 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4781 char *away_encoding = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4782 char *away = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4783 gsize awaylen = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4784 |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4785 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
|
4786 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
|
4787 |
15822 | 4788 status_type = purple_status_get_type(status); |
4789 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
|
4790 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4791 if (!setinfo) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4792 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4793 /* Do nothing! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4794 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4795 else if (od->rights.maxsiglen == 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4796 { |
15822 | 4797 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
|
4798 _("You have probably requested to set your " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4799 "profile before the login procedure completed. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4800 "Your profile remains unset; try setting it " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4801 "again when you are fully connected.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4802 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4803 else if (rawinfo != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4804 { |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4805 char *htmlinfo = purple_strdup_withhtml(rawinfo); |
15822 | 4806 info = purple_prpl_oscar_convert_to_infotext(htmlinfo, &infolen, &info_encoding); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4807 g_free(htmlinfo); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4808 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4809 if (infolen > od->rights.maxsiglen) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4810 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4811 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
|
4812 errstr = g_strdup_printf(dngettext(PACKAGE, "The maximum profile length of %d byte " |
16135 | 4813 "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
|
4814 "The maximum profile length of %d bytes " |
16135 | 4815 "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
|
4816 od->rights.maxsiglen), od->rights.maxsiglen); |
15822 | 4817 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
|
4818 g_free(errstr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4819 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4820 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4821 |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4822 if (setstatus) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4823 { |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4824 const char *status_html; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4825 |
15822 | 4826 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
|
4827 |
26178
37a3f30a8d80
fix a crash when changing to away without a status message
Richard Nelson <wabz@pidgin.im>
parents:
26173
diff
changeset
|
4828 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
|
4829 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4830 /* 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
|
4831 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
|
4832 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4833 else |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4834 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4835 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
|
4836 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4837 /* 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
|
4838 linkified = purple_markup_linkify(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
|
4839 away = purple_prpl_oscar_convert_to_infotext(linkified, &awaylen, &away_encoding); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4840 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
|
4841 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4842 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
|
4843 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4844 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
|
4845 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4846 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
|
4847 "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
|
4848 "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
|
4849 "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
|
4850 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
|
4851 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
|
4852 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
|
4853 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4854 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4855 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4856 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4857 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
|
4858 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
|
4859 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
|
4860 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
|
4861 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
|
4862 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4863 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
|
4864 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4865 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
|
4866 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4867 status_html = purple_status_get_attr_string(status, "message"); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4868 if (od->icq && (status_html == NULL || status_html[0] == '\0')) |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4869 status_html = purple_status_type_get_name(status_type); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4870 if (status_html != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4871 { |
15822 | 4872 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
|
4873 /* 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
|
4874 if (strlen(status_text) > MAXAVAILMSGLEN) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4875 { |
18774
88ad571744b4
Looks like AOL increased the length of available messages from 60
Mark Doliner <mark@kingant.net>
parents:
18755
diff
changeset
|
4876 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
|
4877 strcpy(tmp, "..."); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4878 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4879 } |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4880 |
15822 | 4881 itmsurl = purple_status_get_attr_string(status, "itmsurl"); |
15627
2261750cf4e9
Allow setting of the iTunes Music Store URL for AIM accounts. It's
Mark Doliner <mark@kingant.net>
parents:
15624
diff
changeset
|
4882 |
25977
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25971
diff
changeset
|
4883 /* TODO: Combine these two calls! */ |
15627
2261750cf4e9
Allow setting of the iTunes Music Store URL for AIM accounts. It's
Mark Doliner <mark@kingant.net>
parents:
15624
diff
changeset
|
4884 aim_srv_setextrainfo(od, FALSE, 0, TRUE, status_text, itmsurl); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4885 oscar_set_extendedstatus(gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4886 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
|
4887 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4888 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4889 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4890 static void |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4891 oscar_set_status_icq(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4892 { |
15822 | 4893 PurpleConnection *gc = purple_account_get_connection(account); |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4894 |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4895 /* Our permit/deny setting affects our invisibility */ |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4896 oscar_set_permit_deny(gc); |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4897 |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4898 /* |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4899 * TODO: I guess we should probably wait and do this after we get |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4900 * confirmation from the above SSI call? Right now other people |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4901 * see our status blip to "invisible" before we appear offline. |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4902 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4903 oscar_set_extendedstatus(gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4904 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4905 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4906 void |
15822 | 4907 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
|
4908 { |
15822 | 4909 purple_debug_info("oscar", "Set status to %s\n", purple_status_get_name(status)); |
4910 | |
4911 if (!purple_status_is_active(status)) | |
15373
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 |
15822 | 4914 if (!purple_account_is_connected(account)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4915 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4916 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4917 /* 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
|
4918 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
|
4919 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4920 /* Set the ICQ status for ICQ accounts only */ |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4921 if (oscar_util_valid_name_icq(purple_account_get_username(account))) |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
4922 oscar_set_status_icq(account); |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4925 #ifdef CRAZY_WARN |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4926 void |
15822 | 4927 oscar_warn(PurpleConnection *gc, const char *name, gboolean anonymous) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4928 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
|
4929 aim_im_warn(od, od->conn, name, anonymous ? AIM_WARN_ANON : 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4930 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4931 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4932 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4933 void |
15822 | 4934 oscar_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) { |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4935 OscarData *od; |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4936 PurpleAccount *account; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4937 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
|
4938 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
4939 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
|
4940 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
|
4941 bname = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4942 gname = purple_group_get_name(group); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4943 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
4944 if (!oscar_util_valid_name(bname)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4945 gchar *buf; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
4946 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
|
4947 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
|
4948 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
|
4949 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4950 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4951 /* Remove from local list */ |
15822 | 4952 purple_blist_remove_buddy(buddy); |
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 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4955 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4956 |
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
|
4957 if (od->ssi.received_data) { |
26203 | 4958 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
|
4959 purple_debug_info("oscar", |
26203 | 4960 "ssi: adding buddy %s to group %s\n", bname, gname); |
4961 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
|
4962 |
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
4963 /* Mobile users should always be online */ |
26203 | 4964 if (bname[0] == '+') { |
25983
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
4965 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
|
4966 OSCAR_STATUS_ID_AVAILABLE, NULL); |
25983
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
4967 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
|
4968 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
|
4969 } |
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24694
diff
changeset
|
4970 } else if (aim_ssi_waitingforauth(od->ssi.local, |
25983
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
4971 aim_ssi_itemlist_findparentname(od->ssi.local, bname), |
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
4972 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
|
4973 /* Not authorized -- Re-request authorization */ |
25983
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
4974 purple_auth_sendrequest(gc, bname); |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4975 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4976 } |
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 /* 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
|
4979 if (od->icq) |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4980 aim_icq_getalias(od, bname); |
15373
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 |
15822 | 4983 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
|
4984 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
|
4985 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4986 if (od->ssi.received_data) { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4987 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
|
4988 const char *bname = purple_buddy_get_name(buddy); |
15822 | 4989 purple_debug_info("oscar", |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
4990 "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
|
4991 aim_ssi_delbuddy(od, bname, gname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4992 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4993 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4994 |
15822 | 4995 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
|
4996 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
|
4997 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4998 if (od->ssi.received_data && strcmp(old_group, new_group)) { |
15822 | 4999 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5000 "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
|
5001 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
|
5002 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5003 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5004 |
15822 | 5005 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
|
5006 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
|
5007 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5008 if (od->ssi.received_data) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5009 char *gname = aim_ssi_itemlist_findparentname(od->ssi.local, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5010 if (gname) { |
15822 | 5011 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5012 "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
|
5013 aim_ssi_aliasbuddy(od, gname, name, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5014 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5015 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5016 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5017 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5018 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5019 * 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
|
5020 */ |
15822 | 5021 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
|
5022 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
|
5023 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5024 if (od->ssi.received_data) { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5025 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
|
5026 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
|
5027 GList *cur, *groups = NULL; |
15822 | 5028 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
|
5029 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5030 /* 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
|
5031 for (cur = moved_buddies; cur != NULL; cur = cur->next) { |
15822 | 5032 PurpleBlistNode *node = cur->data; |
5033 /* 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
|
5034 * 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
|
5035 groups = g_list_append(groups, |
25799
8d562557ed6f
Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25798
diff
changeset
|
5036 purple_buddy_get_group((PurpleBuddy*)node)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5037 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5038 |
15822 | 5039 purple_account_remove_buddies(account, moved_buddies, groups); |
5040 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
|
5041 g_list_free(groups); |
15822 | 5042 purple_debug_info("oscar", |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5043 "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
|
5044 } else { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5045 aim_ssi_rename_group(od, old_name, gname); |
15822 | 5046 purple_debug_info("oscar", |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5047 "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
|
5048 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5049 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5050 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5051 |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5052 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
|
5053 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5054 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
|
5055 } |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5056 |
15822 | 5057 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
|
5058 OscarData *od = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5059 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5060 aim_ssi_reqdata(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5061 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5062 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5063 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5064 |
15822 | 5065 static int purple_ssi_parseerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
5066 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5067 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5068 guint16 reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5069 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5070 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5071 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5072 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5073 |
15822 | 5074 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
|
5075 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5076 if (reason == 0x0005) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5077 if (od->getblisttimer > 0) |
15822 | 5078 purple_timeout_remove(od->getblisttimer); |
25631
d5379aad12d0
Backport the buddy list error for ICQ/AIM, since the servers seem to be having
Paul Aurich <paul@darkrain42.org>
parents:
25606
diff
changeset
|
5079 else |
d5379aad12d0
Backport the buddy list error for ICQ/AIM, since the servers seem to be having
Paul Aurich <paul@darkrain42.org>
parents:
25606
diff
changeset
|
5080 /* We only show this error the first time it happens */ |
d5379aad12d0
Backport the buddy list error for ICQ/AIM, since the servers seem to be having
Paul Aurich <paul@darkrain42.org>
parents:
25606
diff
changeset
|
5081 purple_notify_error(gc, NULL, |
d5379aad12d0
Backport the buddy list error for ICQ/AIM, since the servers seem to be having
Paul Aurich <paul@darkrain42.org>
parents:
25606
diff
changeset
|
5082 _("Unable to Retrieve Buddy List"), |
d5379aad12d0
Backport the buddy list error for ICQ/AIM, since the servers seem to be having
Paul Aurich <paul@darkrain42.org>
parents:
25606
diff
changeset
|
5083 _("The AIM servers were temporarily unable to send " |
d5379aad12d0
Backport the buddy list error for ICQ/AIM, since the servers seem to be having
Paul Aurich <paul@darkrain42.org>
parents:
25606
diff
changeset
|
5084 "your buddy list. Your buddy list is not lost, and " |
d5379aad12d0
Backport the buddy list error for ICQ/AIM, since the servers seem to be having
Paul Aurich <paul@darkrain42.org>
parents:
25606
diff
changeset
|
5085 "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
|
5086 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
|
5087 return 1; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5088 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5089 |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
5090 oscar_set_status_icq(purple_connection_get_account(gc)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5091 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5092 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5093 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5094 |
15822 | 5095 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
|
5096 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5097 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5098 int numtypes; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5099 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
|
5100 GString *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5102 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5103 numtypes = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5104 maxitems = va_arg(ap, guint16 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5105 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5106 |
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
|
5107 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
|
5108 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
|
5109 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
|
5110 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
|
5111 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
|
5112 g_string_free(msg, TRUE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5113 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5114 if (numtypes >= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5115 od->rights.maxbuddies = maxitems[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5116 if (numtypes >= 1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5117 od->rights.maxgroups = maxitems[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5118 if (numtypes >= 2) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5119 od->rights.maxpermits = maxitems[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5120 if (numtypes >= 3) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5121 od->rights.maxdenies = maxitems[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5122 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5123 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5124 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5125 |
15822 | 5126 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
|
5127 { |
15822 | 5128 PurpleConnection *gc; |
5129 PurpleAccount *account; | |
5130 PurpleGroup *g; | |
5131 PurpleBuddy *b; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5132 struct aim_ssi_item *curitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5133 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
|
5134 PurpleStoredImage *img; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5135 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5136 guint16 fmtver, numitems; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5137 guint32 timestamp; |
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 gc = od->gc; |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5140 od = purple_connection_get_protocol_data(gc); |
15822 | 5141 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5142 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5143 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5144 fmtver = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5145 numitems = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5146 timestamp = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5147 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5148 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5149 /* Don't attempt to re-request our buddy list later */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5150 if (od->getblisttimer != 0) |
15822 | 5151 purple_timeout_remove(od->getblisttimer); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5152 od->getblisttimer = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5153 |
15822 | 5154 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5155 "ssi: syncing local list and server list\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5156 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5157 /* Clean the buddy list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5158 aim_ssi_cleanlist(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5159 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5160 { /* If not in server list then prune from local list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5161 GSList *cur, *next; |
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
|
5162 GSList *buddies = purple_find_buddies(account, NULL); |
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
|
5163 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5164 /* Buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5165 cur = NULL; |
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
|
5166 |
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
|
5167 while(buddies) { |
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
|
5168 PurpleGroup *g; |
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
|
5169 const char *gname; |
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
|
5170 const char *bname; |
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
|
5171 |
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
|
5172 b = buddies->data; |
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
|
5173 g = purple_buddy_get_group(b); |
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
|
5174 gname = purple_group_get_name(g); |
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
|
5175 bname = purple_buddy_get_name(b); |
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
|
5176 |
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
|
5177 if (aim_ssi_itemlist_exists(od->ssi.local, bname)) { |
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
|
5178 /* If the buddy is an ICQ user then load his nickname */ |
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
|
5179 const char *servernick = purple_blist_node_get_string((PurpleBlistNode*)b, "servernick"); |
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
|
5180 char *alias; |
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
|
5181 const char *balias; |
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
|
5182 if (servernick) |
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
|
5183 serv_got_alias(gc, bname, servernick); |
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
|
5184 |
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
|
5185 /* Store local alias on server */ |
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
|
5186 alias = aim_ssi_getalias(od->ssi.local, gname, bname); |
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
|
5187 balias = purple_buddy_get_local_buddy_alias(b); |
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
|
5188 if (!alias && balias && *balias) |
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
|
5189 aim_ssi_aliasbuddy(od, gname, bname, balias); |
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
|
5190 g_free(alias); |
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
|
5191 } else { |
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
|
5192 purple_debug_info("oscar", |
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
|
5193 "ssi: removing buddy %s from local list\n", bname); |
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
|
5194 /* We can't actually remove now because it will screw up our looping */ |
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
|
5195 cur = g_slist_prepend(cur, b); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5196 } |
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
|
5197 buddies = g_slist_delete_link(buddies, buddies); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5198 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5200 while (cur != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5201 b = cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5202 cur = g_slist_remove(cur, b); |
15822 | 5203 purple_blist_remove_buddy(b); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5204 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5205 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5206 /* Permit list */ |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5207 if (account->permit) { |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5208 next = account->permit; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5209 while (next != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5210 cur = next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5211 next = next->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5212 if (!aim_ssi_itemlist_finditem(od->ssi.local, NULL, cur->data, AIM_SSI_TYPE_PERMIT)) { |
15822 | 5213 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5214 "ssi: removing permit %s from local list\n", (const char *)cur->data); |
15822 | 5215 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
|
5216 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5218 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5219 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5220 /* Deny list */ |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5221 if (account->deny) { |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5222 next = account->deny; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5223 while (next != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5224 cur = next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5225 next = next->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5226 if (!aim_ssi_itemlist_finditem(od->ssi.local, NULL, cur->data, AIM_SSI_TYPE_DENY)) { |
15822 | 5227 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5228 "ssi: removing deny %s from local list\n", (const char *)cur->data); |
15822 | 5229 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
|
5230 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5231 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5232 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5233 /* Presence settings (idle time visibility) */ |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5234 tmp = aim_ssi_getpresence(od->ssi.local); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5235 if (tmp != 0xFFFFFFFF) { |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5236 const char *idle_reporting_pref; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5237 gboolean report_idle; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5238 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5239 idle_reporting_pref = purple_prefs_get_string("/purple/away/idle_reporting"); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5240 report_idle = strcmp(idle_reporting_pref, "none") != 0; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5241 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5242 if (report_idle) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5243 aim_ssi_setpresence(od, tmp | 0x400); |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5244 else |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5245 aim_ssi_setpresence(od, tmp & ~0x400); |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5246 } |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5247 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5248 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5249 } /* end pruning buddies from local list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5251 /* Add from server list to local list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5252 for (curitem=od->ssi.local; curitem; curitem=curitem->next) { |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5253 if ((curitem->name == NULL) || (g_utf8_validate(curitem->name, -1, NULL))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5254 switch (curitem->type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5255 case 0x0000: { /* Buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5256 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
|
5257 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
|
5258 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
|
5259 |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
5260 groupitem = aim_ssi_itemlist_find(od->ssi.local, curitem->gid, 0x0000); |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
5261 gname = groupitem ? groupitem->name : NULL; |
22426
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5262 if (gname != NULL) { |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5263 if (g_utf8_validate(gname, -1, NULL)) |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5264 gname_utf8 = g_strdup(gname); |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5265 else |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5266 gname_utf8 = oscar_utf8_try_convert(account, gname); |
22426
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5267 } else |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5268 gname_utf8 = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5269 |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5270 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
|
5271 if (g == NULL) { |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5272 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
|
5273 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
|
5274 } |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5275 |
22426
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5276 alias = aim_ssi_getalias(od->ssi.local, gname, curitem->name); |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5277 if (alias != NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5278 if (g_utf8_validate(alias, -1, NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5279 alias_utf8 = g_strdup(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5280 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5281 alias_utf8 = oscar_utf8_try_convert(account, alias); |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5282 g_free(alias); |
22426
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5283 } else |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5284 alias_utf8 = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5285 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5286 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
|
5287 if (b) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5288 /* 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
|
5289 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
|
5290 } else { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5291 b = purple_buddy_new(account, curitem->name, alias_utf8); |
15822 | 5292 |
5293 purple_debug_info("oscar", | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5294 "ssi: adding buddy %s to group %s to local list\n", curitem->name, gname); |
15822 | 5295 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
|
5296 } |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5297 if (!oscar_util_name_compare(curitem->name, purple_account_get_username(account))) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5298 char *comment = aim_ssi_getcomment(od->ssi.local, gname, curitem->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5299 if (comment != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5300 { |
15822 | 5301 purple_check_comment(od, comment); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5302 g_free(comment); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5303 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5304 } |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
5305 |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
5306 /* 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
|
5307 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
|
5308 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
|
5309 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
|
5310 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
|
5311 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
|
5312 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
|
5313 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
|
5314 } |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
5315 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5316 g_free(gname_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5317 g_free(alias_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5318 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5319 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5320 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5321 case 0x0001: { /* Group */ |
22425
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
5322 char *gname; |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
5323 char *gname_utf8; |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
5324 |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22408
diff
changeset
|
5325 gname = curitem->name; |
22426
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5326 if (gname != NULL) { |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5327 if (g_utf8_validate(gname, -1, NULL)) |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5328 gname_utf8 = g_strdup(gname); |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5329 else |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5330 gname_utf8 = oscar_utf8_try_convert(account, gname); |
22426
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5331 } else |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5332 gname_utf8 = NULL; |
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22425
diff
changeset
|
5333 |
18788
550ec02c9135
Only try to add a group locally if it doesn't already exist. This
Mark Doliner <mark@kingant.net>
parents:
18774
diff
changeset
|
5334 if (gname_utf8 != NULL && purple_find_group(gname_utf8) == NULL) { |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5335 g = purple_group_new(gname_utf8); |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
5336 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
|
5337 } |
20932 | 5338 g_free(gname_utf8); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5339 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5340 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5341 case 0x0002: { /* Permit buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5342 if (curitem->name) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5343 /* if (!find_permdeny_by_name(gc->permit, curitem->name)) { AAA */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5344 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
|
5345 for (list=account->permit; (list && oscar_util_name_compare(curitem->name, list->data)); list=list->next); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5346 if (!list) { |
15822 | 5347 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5348 "ssi: adding permit buddy %s to local list\n", curitem->name); |
15822 | 5349 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
|
5350 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5351 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5352 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5353 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5354 case 0x0003: { /* Deny buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5355 if (curitem->name) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5356 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
|
5357 for (list=account->deny; (list && oscar_util_name_compare(curitem->name, list->data)); list=list->next); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5358 if (!list) { |
15822 | 5359 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5360 "ssi: adding deny buddy %s to local list\n", curitem->name); |
15822 | 5361 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
|
5362 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5363 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5364 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5365 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5366 case 0x0004: { /* 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
|
5367 /* |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
5368 * 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
|
5369 * 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
|
5370 * 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
|
5371 * 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
|
5372 */ |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
5373 if (!od->icq && curitem->data) { |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
5374 guint8 perm_deny = aim_ssi_getpermdeny(od->ssi.local); |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
5375 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
|
5376 { |
15822 | 5377 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
|
5378 "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
|
5379 account->perm_deny = perm_deny; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5380 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5381 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5382 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5383 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5384 case 0x0005: { /* Presence setting */ |
15822 | 5385 /* 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
|
5386 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5387 } /* End of switch on curitem->type */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5388 } /* End of for loop */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5389 |
25971
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
5390 oscar_set_status_icq(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5391 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5392 /* Activate SSI */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5393 /* 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
|
5394 /* Make sure your privacy setting/invisibility is set how you want it before this! */ |
15822 | 5395 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5396 "ssi: activating server-stored buddy list\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5397 aim_ssi_enable(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5398 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5399 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5400 * 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
|
5401 * 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
|
5402 * account was offline. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5403 */ |
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
|
5404 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
|
5405 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
|
5406 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5408 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5409 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5410 |
15822 | 5411 static int purple_ssi_parseack(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
5412 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5413 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5414 struct aim_ssi_tmp *retval; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5415 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5416 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5417 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
|
5418 va_end(ap); |
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 while (retval) { |
15822 | 5421 purple_debug_misc("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5422 "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
|
5423 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5424 if (retval->ack != 0xffff) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5425 switch (retval->ack) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5426 case 0x0000: { /* added successfully */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5427 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5428 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5429 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
|
5430 gchar *buf; |
27381
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27377
diff
changeset
|
5431 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 | 5432 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
|
5433 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
|
5434 g_free(buf); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5437 case 0x000e: { /* buddy requires authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5438 if ((retval->action == SNAC_SUBTYPE_FEEDBAG_ADD) && (retval->name)) |
15822 | 5439 purple_auth_sendrequest(gc, retval->name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5440 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5441 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5442 default: { /* La la la */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5443 gchar *buf; |
15822 | 5444 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
|
5445 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
|
5446 (retval->name ? retval->name : _("(no name)"))); |
15822 | 5447 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
|
5448 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
|
5449 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5450 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5451 } |
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 retval = retval->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5454 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5456 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5457 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5458 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5459 static int |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5460 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
|
5461 { |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5462 PurpleConnection *gc; |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5463 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5464 char *gname, *gname_utf8, *alias, *alias_utf8; |
15822 | 5465 PurpleBuddy *b; |
5466 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
|
5467 struct aim_ssi_item *ssi_item; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5468 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
|
5469 guint16 snac_subtype, type; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5470 const char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5471 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5472 gc = od->gc; |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5473 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
|
5474 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5475 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
|
5476 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
|
5477 type = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5478 name = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5479 va_end(ap); |
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 if ((type != 0x0000) || (name == NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5482 return 1; |
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 gname = aim_ssi_itemlist_findparentname(od->ssi.local, name); |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5485 gname_utf8 = gname ? oscar_utf8_try_convert(account, gname) : NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5486 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5487 alias = aim_ssi_getalias(od->ssi.local, gname, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5488 if (alias != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5489 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5490 if (g_utf8_validate(alias, -1, NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5491 alias_utf8 = g_strdup(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5492 else |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5493 alias_utf8 = oscar_utf8_try_convert(account, alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5494 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5495 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5496 alias_utf8 = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5497 g_free(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5498 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5499 b = purple_find_buddy(account, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5500 if (b) { |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5501 /* |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5502 * 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
|
5503 * 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
|
5504 * 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
|
5505 */ |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5506 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
|
5507 } 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
|
5508 /* |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5509 * 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
|
5510 * 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
|
5511 */ |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5512 b = purple_buddy_new(account, name, alias_utf8); |
15822 | 5513 |
5514 if (!(g = purple_find_group(gname_utf8 ? gname_utf8 : _("Orphans")))) { | |
5515 g = purple_group_new(gname_utf8 ? gname_utf8 : _("Orphans")); | |
5516 purple_blist_add_group(g, NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5517 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5518 |
15822 | 5519 purple_debug_info("oscar", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5520 "ssi: adding buddy %s to group %s to local list\n", name, gname_utf8 ? gname_utf8 : _("Orphans")); |
15822 | 5521 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
|
5522 |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
5523 /* 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
|
5524 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
|
5525 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
|
5526 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
|
5527 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
|
5528 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
|
5529 } |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
5530 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5531 } |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
5532 |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
5533 ssi_item = aim_ssi_itemlist_finditem(od->ssi.local, |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
5534 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
|
5535 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
|
5536 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
5537 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
|
5538 "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
|
5539 "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
|
5540 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
5541 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5542 g_free(gname_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5543 g_free(alias_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5544 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5545 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5546 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5547 |
15822 | 5548 static int purple_ssi_authgiven(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
5549 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5550 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
|
5551 char *bn, *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5552 gchar *dialog_msg, *nombre; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5553 struct name_data *data; |
15822 | 5554 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5555 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5556 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
|
5557 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5558 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5559 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5560 |
15822 | 5561 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
|
5562 "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
|
5563 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5564 buddy = purple_find_buddy(purple_connection_get_account(gc), bn); |
15822 | 5565 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
|
5566 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
|
5567 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
|
5568 nombre = g_strdup(bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5569 |
22654
e970c0c8a48d
nosnilmot pointed out that this error message seemed to be wrong. I agree
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22620
diff
changeset
|
5570 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
|
5571 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
|
5572 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5573 data = g_new(struct name_data, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5574 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
|
5575 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
|
5576 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
|
5577 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5578 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
|
5579 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
|
5580 purple_connection_get_account(gc), bn, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5581 data, |
15822 | 5582 G_CALLBACK(purple_icq_buddyadd), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5583 G_CALLBACK(oscar_free_name_data)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5584 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5585 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5586 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5587 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5588 |
15822 | 5589 static int purple_ssi_authrequest(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
5590 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5591 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
|
5592 char *bn; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5593 char *msg; |
15822 | 5594 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
|
5595 gchar *reason = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5596 struct name_data *data; |
15822 | 5597 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5598 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5599 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
|
5600 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5601 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5602 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5603 |
15822 | 5604 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
|
5605 "ssi: received authorization request from %s\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
|
5606 |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5607 buddy = purple_find_buddy(account, bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5608 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5609 if (msg != 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
|
5610 reason = purple_plugin_oscar_decode_im_part(account, bn, AIM_CHARSET_CUSTOM, 0x0000, msg, strlen(msg)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5611 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5612 data = g_new(struct name_data, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5613 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
|
5614 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
|
5615 data->nick = (buddy ? g_strdup(purple_buddy_get_alias_only(buddy)) : NULL); |
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
|
5616 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5617 purple_account_request_authorization(account, bn, NULL, |
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
|
5618 (buddy ? purple_buddy_get_alias_only(buddy) : NULL), |
19195
1ca6c4b234ab
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19179
diff
changeset
|
5619 reason, buddy != NULL, purple_auth_grant, |
1ca6c4b234ab
Warning fixes in the aftermath of resiak's authorize_cb and deny_cb type fixing.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19179
diff
changeset
|
5620 purple_auth_dontgrant_msgprompt, data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5621 g_free(reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5622 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5623 return 1; |
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 |
15822 | 5626 static int purple_ssi_authreply(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
5627 PurpleConnection *gc = od->gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5628 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
|
5629 char *bn, *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5630 gchar *dialog_msg, *nombre; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5631 guint8 reply; |
15822 | 5632 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5633 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5634 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
|
5635 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5636 reply = (guint8)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5637 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5638 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5639 |
15822 | 5640 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
|
5641 "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
|
5642 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5643 buddy = purple_find_buddy(purple_connection_get_account(gc), bn); |
15822 | 5644 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
|
5645 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
|
5646 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
|
5647 nombre = g_strdup(bn); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5648 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5649 if (reply) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5650 /* Granted */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5651 dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your buddy list."), nombre); |
15822 | 5652 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
|
5653 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5654 /* Denied */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5655 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 | 5656 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
|
5657 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5658 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5659 g_free(nombre); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5660 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5661 return 1; |
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 |
15822 | 5664 static int purple_ssi_gotadded(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
5665 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
|
5666 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
|
5667 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
|
5668 char *bn; |
15822 | 5669 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5670 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5671 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
|
5672 bn = va_arg(ap, char *); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5673 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5674 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5675 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
|
5676 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
|
5677 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
|
5678 (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
|
5679 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5680 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5681 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5682 |
15822 | 5683 GList *oscar_chat_info(PurpleConnection *gc) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5684 GList *m = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5685 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5686 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5687 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
|
5688 pce->label = _("_Room:"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5689 pce->identifier = "room"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5690 pce->required = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5691 m = g_list_append(m, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5692 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5693 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
|
5694 pce->label = _("_Exchange:"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5695 pce->identifier = "exchange"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5696 pce->required = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5697 pce->is_int = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5698 pce->min = 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5699 pce->max = 20; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5700 m = g_list_append(m, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5701 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5702 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5703 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5704 |
15822 | 5705 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
|
5706 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5707 GHashTable *defaults; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5708 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5709 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
|
5710 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5711 if (chat_name != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5712 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
|
5713 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
|
5714 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5715 return defaults; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5716 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5717 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5718 char * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5719 oscar_get_chat_name(GHashTable *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5720 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5721 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
|
5722 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5723 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5724 void |
15822 | 5725 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
|
5726 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5727 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
|
5728 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5729 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
|
5730 int exchange_int; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5731 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5732 name = g_hash_table_lookup(data, "room"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5733 exchange = g_hash_table_lookup(data, "exchange"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5734 |
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
|
5735 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
|
5736 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
|
5737 |
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
|
5738 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
|
5739 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
|
5740 g_return_if_fail(errno == 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5741 |
15822 | 5742 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
|
5743 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5744 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
|
5745 { |
15822 | 5746 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
|
5747 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
|
5748 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5749 /* this gets tricky */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5750 struct create_room *cr = g_new0(struct create_room, 1); |
15822 | 5751 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
|
5752 cr->exchange = exchange_int; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5753 cr->name = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5754 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
|
5755 aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5756 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5757 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5758 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5759 void |
15822 | 5760 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
|
5761 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5762 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
|
5763 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
|
5764 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5765 if (ccon == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5766 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5767 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5768 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
|
5769 ccon->exchange, ccon->name, 0x0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5770 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5771 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5772 void |
15822 | 5773 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
|
5774 { |
15822 | 5775 PurpleConversation *conv; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5776 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5777 |
15822 | 5778 conv = purple_find_chat(gc, id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5779 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5780 g_return_if_fail(conv != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5781 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5782 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
|
5783 purple_conversation_get_name(conv)); |
15822 | 5784 |
5785 cc = find_oscar_chat(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv))); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5786 oscar_chat_kill(gc, cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5787 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5788 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5789 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
|
5790 { |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5791 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 5792 PurpleConversation *conv = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5793 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
|
5794 char *buf, *buf2, *buf3; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5795 guint16 charset, charsubset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5796 char *charsetstr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5797 int len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5798 |
15822 | 5799 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
|
5800 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5801 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5802 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
|
5803 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5804 |
15822 | 5805 buf = purple_strdup_withhtml(message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5806 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5807 if (strstr(buf, "<IMG ")) |
15822 | 5808 purple_conversation_write(conv, "", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5809 _("Your IM Image was not sent. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5810 "You cannot send IM Images in AIM chats."), |
15822 | 5811 PURPLE_MESSAGE_ERROR, time(NULL)); |
5812 | |
5813 purple_plugin_oscar_convert_to_best_encoding(gc, NULL, buf, &buf2, &len, &charset, &charsubset); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5814 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5815 * 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
|
5816 * visible characters" and not "number of bytes" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5817 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5818 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
|
5819 /* 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
|
5820 * 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
|
5821 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
|
5822 |
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
|
5823 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
|
5824 g_free(buf); |
17588
329ca72df5fa
Remove a pair of unneeded strlen's
Mark Doliner <mark@kingant.net>
parents:
17587
diff
changeset
|
5825 |
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
|
5826 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
|
5827 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
|
5828 |
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
|
5829 purple_plugin_oscar_convert_to_best_encoding(gc, NULL, buf, &buf2, &len, &charset, &charsubset); |
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
|
5830 |
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
|
5831 if ((len > c->maxlen) || (len > c->maxvis)) { |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19642
diff
changeset
|
5832 purple_debug_warning("oscar", "Could not send %s because (%i > maxlen %i) or (%i > 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
|
5833 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
|
5834 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
|
5835 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
|
5836 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
|
5837 } |
17588
329ca72df5fa
Remove a pair of unneeded strlen's
Mark Doliner <mark@kingant.net>
parents:
17587
diff
changeset
|
5838 |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19642
diff
changeset
|
5839 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
|
5840 message, buf2); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5841 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5842 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5843 if (charset == AIM_CHARSET_ASCII) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5844 charsetstr = "us-ascii"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5845 else if (charset == AIM_CHARSET_UNICODE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5846 charsetstr = "unicode-2-0"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5847 else if (charset == AIM_CHARSET_CUSTOM) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5848 charsetstr = "iso-8859-1"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5849 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
|
5850 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
|
5851 g_free(buf); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5852 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5853 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5854 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5855 |
15822 | 5856 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
|
5857 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5858 const char *name = b ? purple_buddy_get_name(b) : 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
|
5859 if ((b == NULL) || (name == NULL) || oscar_util_valid_name_sms(name)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5860 { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5861 if (a == NULL || oscar_util_valid_name_icq(purple_account_get_username(a))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5862 return "icq"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5863 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5864 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5865 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5866 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5867 if (oscar_util_valid_name_icq(name)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5868 return "icq"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5869 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5870 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5871 |
15822 | 5872 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
|
5873 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5874 const char *name = b ? purple_buddy_get_name(b) : 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
|
5875 if ((b == NULL) || (name == NULL) || oscar_util_valid_name_sms(name)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5876 { |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5877 if (a != NULL && oscar_util_valid_name_icq(purple_account_get_username(a))) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5878 return "icq"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5879 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5880 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5881 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5882 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
5883 if (oscar_util_valid_name_icq(name)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5884 return "icq"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5885 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5886 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5887 |
23267 | 5888 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
|
5889 { |
15822 | 5890 PurpleConnection *gc = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5891 OscarData *od = NULL; |
15822 | 5892 PurpleAccount *account = NULL; |
5893 PurplePresence *presence; | |
5894 PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5895 const char *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5896 aim_userinfo_t *userinfo = NULL; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5897 const char *name; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5898 |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5899 account = purple_buddy_get_account(b); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5900 name = purple_buddy_get_name(b); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5901 if (account != NULL) |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5902 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5903 if (gc != NULL) |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
5904 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
|
5905 if (od != NULL) |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5906 userinfo = aim_locate_finduserinfo(od, name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5907 |
15822 | 5908 presence = purple_buddy_get_presence(b); |
5909 status = purple_presence_get_active_status(presence); | |
5910 status_id = purple_status_get_id(status); | |
5911 | |
5912 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
|
5913 char *gname; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5914 if ((name) && (od) && (od->ssi.received_data) && |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5915 (gname = aim_ssi_itemlist_findparentname(od->ssi.local, name)) && |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5916 (aim_ssi_waitingforauth(od->ssi.local, gname, name))) { |
15462 | 5917 return "not-authorized"; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5918 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5919 } |
23267 | 5920 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5921 if (userinfo != NULL ) { |
15462 | 5922 if (userinfo->flags & AIM_FLAG_ADMINISTRATOR) |
5923 return "admin"; | |
5924 if (userinfo->flags & AIM_FLAG_ACTIVEBUDDY) | |
5925 return "bot"; | |
16794
88550837d1c9
We're told by users that Hiptop is not the same thing as mobile, and should not be treated as such.
Sean Egan <seanegan@gmail.com>
parents:
16765
diff
changeset
|
5926 if (userinfo->capabilities & OSCAR_CAPABILITY_HIPTOP) |
88550837d1c9
We're told by users that Hiptop is not the same thing as mobile, and should not be treated as such.
Sean Egan <seanegan@gmail.com>
parents:
16765
diff
changeset
|
5927 return "hiptop"; |
15462 | 5928 if (userinfo->capabilities & OSCAR_CAPABILITY_SECUREIM) |
5929 return "secure"; | |
20582
749c35474b09
Use birthday emblem in OSCAR. Fixes #300
Sean Egan <seanegan@gmail.com>
parents:
19687
diff
changeset
|
5930 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
|
5931 return "birthday"; |
15462 | 5932 } |
5933 return NULL; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5934 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5935 |
23265
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5936 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
|
5937 { |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5938 PurpleConnection *gc; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5939 PurpleAccount *account; |
23265
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5940 OscarData *od; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5941 aim_userinfo_t *userinfo; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5942 |
23266
9f34726fe141
Whoops, I should have inverted this logic.
Mark Doliner <mark@kingant.net>
parents:
23265
diff
changeset
|
5943 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
|
5944 return; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5945 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5946 account = purple_buddy_get_account(b); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5947 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
|
5948 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
|
5949 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
|
5950 |
23270
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23268
diff
changeset
|
5951 oscar_user_info_append_status(gc, user_info, b, userinfo, /* strip_html_tags */ TRUE); |
23265
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5952 |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5953 if (full) |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23244
diff
changeset
|
5954 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
|
5955 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5956 |
15822 | 5957 char *oscar_status_text(PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5958 { |
15822 | 5959 PurpleConnection *gc; |
5960 PurpleAccount *account; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5961 OscarData *od; |
15822 | 5962 const PurplePresence *presence; |
5963 const PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5964 const char *id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5965 const char *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5966 gchar *ret = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5967 |
15822 | 5968 gc = purple_account_get_connection(purple_buddy_get_account(b)); |
5969 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
|
5970 od = purple_connection_get_protocol_data(gc); |
15822 | 5971 presence = purple_buddy_get_presence(b); |
5972 status = purple_presence_get_active_status(presence); | |
5973 id = purple_status_get_id(status); | |
5974 | |
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
|
5975 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
|
5976 { |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5977 const char *name = purple_buddy_get_name(b); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5978 char *gname = aim_ssi_itemlist_findparentname(od->ssi.local, name); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
5979 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
|
5980 ret = g_strdup(_("Not Authorized")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5981 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5982 ret = g_strdup(_("Offline")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5983 } |
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
|
5984 else |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5985 { |
15822 | 5986 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
|
5987 if (message != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5988 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5989 gchar *tmp1, *tmp2; |
15822 | 5990 tmp1 = purple_markup_strip_html(message); |
5991 purple_util_chrreplace(tmp1, '\n', ' '); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5992 tmp2 = g_markup_escape_text(tmp1, -1); |
15822 | 5993 ret = purple_str_sub_away_formatters(tmp2, purple_account_get_username(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5994 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5995 g_free(tmp2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5996 } |
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
|
5997 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
|
5998 { |
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
|
5999 /* 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
|
6000 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6001 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6002 { |
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
|
6003 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
|
6004 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6005 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6006 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6007 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6008 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6009 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6010 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6011 static int oscar_icon_req(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15822 | 6012 PurpleConnection *gc = od->gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6013 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6014 guint16 type; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6015 guint8 flags = 0, length = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6016 guchar *md5 = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6017 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6018 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6019 type = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6020 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6021 switch(type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6022 case 0x0000: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6023 case 0x0001: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6024 flags = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6025 length = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6026 md5 = va_arg(ap, guchar *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6027 |
16832
9f9c486a8aca
flags of 0x00 in oscar_icon_req() can apparently mean 'you should upload your buddy icon' just as flags of 0x41 can. I'm really unclear as to why Adium with libpurple is getting the 0x00 response while Pidgin with the same libpurple code is getting 0x41 after sending identical data (with identical md5 hashes) for a buddy icon... but that's the way it is. This may fix other conditions in which AIM people claim that their buddy icon isn't being properly set; further insight into what's going on would certainly be appreciated.
Evan Schoenberg <evan.s@dreskin.net>
parents:
16823
diff
changeset
|
6028 if ((flags == 0x00) || (flags == 0x41)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6029 if (!flap_connection_getbytype(od, SNAC_FAMILY_BART) && !od->iconconnecting) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6030 od->iconconnecting = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6031 od->set_icon = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6032 aim_srv_requestnew(od, SNAC_FAMILY_BART); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6033 } 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
|
6034 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
|
6035 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
|
6036 if (img == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6037 aim_ssi_delicon(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6038 } 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
|
6039 |
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
|
6040 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
|
6041 "Uploading icon to icon server\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
|
6042 aim_bart_upload(od, 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
|
6043 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
|
6044 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6045 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6046 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6047 } else if (flags == 0x81) { |
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
|
6048 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
|
6049 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
|
6050 if (img == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6051 aim_ssi_delicon(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6052 else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6053 aim_ssi_seticon(od, md5, length); |
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
|
6054 purple_imgstore_unref(img); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6055 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6056 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6057 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6058 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6059 case 0x0002: { /* We just set an "available" message? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6060 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6061 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6062 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6063 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6064 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6065 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6066 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6067 |
15822 | 6068 void oscar_set_permit_deny(PurpleConnection *gc) { |
6069 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
|
6070 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
|
6071 PurplePrivacyType perm_deny; |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6072 |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6073 /* |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6074 * For ICQ the permit/deny setting controls who you can see you |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6075 * online when you set your status to "invisible." If we're ICQ |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6076 * and we're invisible then we need to use one of |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6077 * PURPLE_PRIVACY_ALLOW_USERS or PURPLE_PRIVACY_ALLOW_BUDDYLIST or |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6078 * PURPLE_PRIVACY_DENY_USERS if we actually want to be invisible |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6079 * to anyone. |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6080 * |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6081 * These three permit/deny settings correspond to: |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6082 * 1. Invisible to everyone except the people on my "permit" list |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6083 * 2. Invisible to everyone except the people on my buddy list |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6084 * 3. Invisible only to the people on my "deny" list |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6085 * |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6086 * It would be nice to allow cases 2 and 3, but our UI doesn't have |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6087 * a nice way to do it. For now we just force case 1. |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6088 */ |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6089 if (od->icq && purple_account_is_status_active(account, OSCAR_STATUS_ID_INVISIBLE)) |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6090 perm_deny = PURPLE_PRIVACY_ALLOW_USERS; |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6091 else |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6092 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
|
6093 |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6094 if (od->ssi.received_data) |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6095 /* |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6096 * Conveniently there is a one-to-one mapping between the |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6097 * values of libpurple's PurplePrivacyType and the values used |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6098 * by the oscar protocol. |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6099 */ |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25964
diff
changeset
|
6100 aim_ssi_setpermdeny(od, perm_deny, 0xffffffff); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6101 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6102 |
15822 | 6103 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
|
6104 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 6105 purple_debug_info("oscar", "ssi: About to add a permit\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6106 if (od->ssi.received_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6107 aim_ssi_addpermit(od, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6108 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6109 |
15822 | 6110 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
|
6111 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 6112 purple_debug_info("oscar", "ssi: About to add a deny\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6113 if (od->ssi.received_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6114 aim_ssi_adddeny(od, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6115 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6116 |
15822 | 6117 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
|
6118 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 6119 purple_debug_info("oscar", "ssi: About to delete a permit\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6120 if (od->ssi.received_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6121 aim_ssi_delpermit(od, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6122 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6123 |
15822 | 6124 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
|
6125 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 6126 purple_debug_info("oscar", "ssi: About to delete a deny\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6127 if (od->ssi.received_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6128 aim_ssi_deldeny(od, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6129 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6130 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6131 GList * |
15822 | 6132 oscar_status_types(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6133 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6134 gboolean is_icq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6135 GList *status_types = NULL; |
15822 | 6136 PurpleStatusType *type; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6137 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6138 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
|
6139 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6140 /* 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
|
6141 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
|
6142 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6143 /* Common status types */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6144 /* Really the available message should only be settable for AIM accounts */ |
15822 | 6145 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
|
6146 OSCAR_STATUS_ID_AVAILABLE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6147 NULL, TRUE, TRUE, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6148 "message", _("Message"), |
15822 | 6149 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
|
6150 "itmsurl", _("iTunes Music Store Link"), |
15822 | 6151 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
|
6152 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
|
6153 |
15822 | 6154 type = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6155 OSCAR_STATUS_ID_FREE4CHAT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6156 _("Free For Chat"), TRUE, is_icq, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6157 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
|
6158 |
15822 | 6159 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
|
6160 OSCAR_STATUS_ID_AWAY, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6161 NULL, TRUE, TRUE, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6162 "message", _("Message"), |
15822 | 6163 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
|
6164 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
|
6165 |
15822 | 6166 type = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6167 OSCAR_STATUS_ID_INVISIBLE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6168 NULL, TRUE, TRUE, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6169 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
|
6170 |
15822 | 6171 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
|
6172 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
|
6173 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6174 /* ICQ-specific status types */ |
15822 | 6175 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
|
6176 OSCAR_STATUS_ID_OCCUPIED, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6177 _("Occupied"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6178 "message", _("Message"), |
15822 | 6179 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
|
6180 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
|
6181 |
16411
569eba287c84
Sean proposed changing ICQ's "do not disturb" status from being
Mark Doliner <mark@kingant.net>
parents:
16330
diff
changeset
|
6182 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
|
6183 OSCAR_STATUS_ID_DND, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6184 _("Do Not Disturb"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6185 "message", _("Message"), |
15822 | 6186 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
|
6187 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
|
6188 |
15822 | 6189 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
|
6190 OSCAR_STATUS_ID_NA, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6191 _("Not Available"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6192 "message", _("Message"), |
15822 | 6193 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
|
6194 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
|
6195 |
15822 | 6196 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
|
6197 OSCAR_STATUS_ID_OFFLINE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6198 NULL, TRUE, TRUE, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6199 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
|
6200 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6201 status_types = g_list_reverse(status_types); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6202 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6203 return status_types; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6204 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6205 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6206 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
|
6207 PurpleConnection *gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6208 PurpleAccount *account; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6209 OscarData *od; |
15822 | 6210 PurpleBuddy *b; |
6211 PurpleGroup *g; | |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6212 const char *username; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6213 |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6214 gc = data->gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6215 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
|
6216 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
|
6217 |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6218 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
|
6219 if (b == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6220 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6221 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6222 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6223 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6224 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
|
6225 if (g == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6226 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6227 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6228 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6229 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6230 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
|
6231 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6232 username = 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
|
6233 if (!oscar_util_name_compare(data->name, username)) |
15822 | 6234 purple_check_comment(od, text); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6235 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6236 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6237 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6238 |
15822 | 6239 static void oscar_buddycb_edit_comment(PurpleBlistNode *node, gpointer ignore) { |
6240 | |
6241 PurpleBuddy *buddy; | |
6242 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6243 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6244 struct name_data *data; |
15822 | 6245 PurpleGroup *g; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6246 char *comment; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6247 gchar *comment_utf8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6248 gchar *title; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6249 PurpleAccount *account; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6250 const char *name; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6251 |
15822 | 6252 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
6253 | |
6254 buddy = (PurpleBuddy *) node; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6255 name = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6256 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6257 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
|
6258 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
|
6259 |
15822 | 6260 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
|
6261 return; |
24372
dd787f8d5e91
Fix a potential leak, thanks to "KuSh". Fixes #7463.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24224
diff
changeset
|
6262 |
dd787f8d5e91
Fix a potential leak, thanks to "KuSh". Fixes #7463.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24224
diff
changeset
|
6263 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
|
6264 |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6265 comment = aim_ssi_getcomment(od->ssi.local, purple_group_get_name(g), name); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6266 comment_utf8 = comment ? oscar_utf8_try_convert(account, comment) : NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6267 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6268 data->gc = gc; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6269 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
|
6270 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
|
6271 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6272 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
|
6273 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
|
6274 comment_utf8, TRUE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6275 _("_OK"), G_CALLBACK(oscar_ssi_editcomment), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6276 _("_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
|
6277 account, data->name, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
6278 data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6279 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6280 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6281 g_free(comment); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6282 g_free(comment_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6283 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6285 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6286 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
|
6287 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6288 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
|
6289 g_free(data->who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6290 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6291 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6292 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6293 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6294 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
|
6295 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6296 g_free(data->who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6297 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6298 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6299 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6300 /* 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
|
6301 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6302 oscar_ask_directim(gpointer object, gpointer ignored) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6303 { |
15822 | 6304 PurpleBlistNode *node; |
6305 PurpleBuddy *buddy; | |
6306 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6307 gchar *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6308 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
|
6309 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6310 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6311 node = object; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6312 |
15822 | 6313 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
6314 | |
6315 buddy = (PurpleBuddy *)node; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6316 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6317 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6319 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
|
6320 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
|
6321 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
|
6322 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
|
6323 data->who); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6324 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
6325 purple_request_action(gc, NULL, buf, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6326 _("Because this reveals your IP address, it " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6327 "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
|
6328 "wish to continue?"), |
22137
6dab6629497a
Improve oscar's default actions a tad bit
Mark Doliner <mark@kingant.net>
parents:
22129
diff
changeset
|
6329 0, /* Default action is "connect" */ |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6330 account, data->who, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
6331 data, 2, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6332 _("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
|
6333 _("_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
|
6334 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6337 static void |
15822 | 6338 oscar_get_aim_info_cb(PurpleBlistNode *node, gpointer ignore) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6339 { |
15822 | 6340 PurpleBuddy *buddy; |
6341 PurpleConnection *gc; | |
6342 | |
6343 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); | |
6344 | |
6345 buddy = (PurpleBuddy *)node; | |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6346 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); |
15822 | 6347 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6348 aim_locate_getinfoshort(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
|
6349 purple_buddy_get_name(buddy), 0x00000003); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6350 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6352 static GList * |
15822 | 6353 oscar_buddy_menu(PurpleBuddy *buddy) { |
6354 | |
6355 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6356 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6357 GList *menu; |
15822 | 6358 PurpleMenuAction *act; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6359 aim_userinfo_t *userinfo; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6360 PurpleAccount *account; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6361 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
|
6362 |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6363 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6364 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
|
6365 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
|
6366 userinfo = aim_locate_finduserinfo(od, bname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6367 menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6368 |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
6369 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
|
6370 { |
15822 | 6371 act = purple_menu_action_new(_("Get AIM Info"), |
6372 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
|
6373 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6374 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6375 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6376 |
25291
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
25288
diff
changeset
|
6377 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
|
6378 { |
25291
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
25288
diff
changeset
|
6379 /* 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
|
6380 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
|
6381 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
|
6382 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
|
6383 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
|
6384 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6385 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6386 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6387 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6388 { |
15822 | 6389 act = purple_menu_action_new(_("Get Status Msg"), |
6390 PURPLE_CALLBACK(oscar_get_icqstatusmsg), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6391 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6392 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6393 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6394 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6395 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6396 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
|
6397 oscar_util_name_compare(purple_account_get_username(account), bname) && |
15822 | 6398 PURPLE_BUDDY_IS_ONLINE(buddy)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6399 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6400 if (userinfo->capabilities & OSCAR_CAPABILITY_DIRECTIM) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6401 { |
15822 | 6402 act = purple_menu_action_new(_("Direct IM"), |
6403 PURPLE_CALLBACK(oscar_ask_directim), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6404 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6405 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6406 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6407 #if 0 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6408 /* TODO: This menu item should be added by the core */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6409 if (userinfo->capabilities & OSCAR_CAPABILITY_GETFILE) { |
15822 | 6410 act = purple_menu_action_new(_("Get File"), |
6411 PURPLE_CALLBACK(oscar_ask_getfile), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6412 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6413 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6414 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6415 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6416 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6417 |
25291
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
25288
diff
changeset
|
6418 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
|
6419 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6420 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6421 * 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
|
6422 * 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
|
6423 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6424 char *gname; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6425 gname = aim_ssi_itemlist_findparentname(od->ssi.local, bname); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6426 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
|
6427 { |
15822 | 6428 act = purple_menu_action_new(_("Re-request Authorization"), |
6429 PURPLE_CALLBACK(purple_auth_sendrequest_menu), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6430 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6431 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6432 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6433 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6434 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6435 menu = g_list_reverse(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6436 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6437 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6438 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6439 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6440 |
15822 | 6441 GList *oscar_blist_node_menu(PurpleBlistNode *node) { |
6442 if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
6443 return oscar_buddy_menu((PurpleBuddy *) node); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6444 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6445 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6446 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6447 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6448 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6449 static void |
15822 | 6450 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
|
6451 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6452 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 6453 PurpleAccount *account = purple_connection_get_account(gc); |
6454 PurpleRequestField *f; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6455 gboolean auth, web_aware; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6456 |
15822 | 6457 f = purple_request_fields_get_field(fields, "authorization"); |
6458 auth = purple_request_field_bool_get_value(f); | |
6459 | |
6460 f = purple_request_fields_get_field(fields, "web_aware"); | |
6461 web_aware = purple_request_field_bool_get_value(f); | |
6462 | |
6463 purple_account_set_bool(account, "authorization", auth); | |
6464 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
|
6465 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6466 oscar_set_extendedstatus(gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6467 aim_icq_setsecurity(od, auth, web_aware); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6468 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6469 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6470 static void |
15822 | 6471 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
|
6472 { |
15822 | 6473 PurpleConnection *gc = (PurpleConnection *) action->context; |
6474 PurpleAccount *account = purple_connection_get_account(gc); | |
6475 PurpleRequestFields *fields; | |
6476 PurpleRequestFieldGroup *g; | |
6477 PurpleRequestField *f; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6478 gboolean auth, web_aware; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6479 |
15822 | 6480 auth = purple_account_get_bool(account, "authorization", OSCAR_DEFAULT_AUTHORIZATION); |
6481 web_aware = purple_account_get_bool(account, "web_aware", OSCAR_DEFAULT_WEB_AWARE); | |
6482 | |
6483 fields = purple_request_fields_new(); | |
6484 | |
6485 g = purple_request_field_group_new(NULL); | |
6486 | |
6487 f = purple_request_field_bool_new("authorization", _("Require authorization"), auth); | |
6488 purple_request_field_group_add_field(g, f); | |
6489 | |
6490 f = purple_request_field_bool_new("web_aware", _("Web aware (enabling this will cause you to receive SPAM!)"), web_aware); | |
6491 purple_request_field_group_add_field(g, f); | |
6492 | |
6493 purple_request_fields_add_group(fields, g); | |
6494 | |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
6495 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
|
6496 NULL, fields, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6497 _("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
|
6498 _("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
|
6499 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
6500 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6501 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6502 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6503 void oscar_format_username(PurpleConnection *gc, const char *nick) { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6504 OscarData *od = purple_connection_get_protocol_data(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
|
6505 if (!oscar_util_name_compare(purple_account_get_username(purple_connection_get_account(gc)), nick)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6506 if (!flap_connection_getbytype(od, SNAC_FAMILY_ADMIN)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6507 od->setnick = TRUE; |
25925
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25924
diff
changeset
|
6508 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
|
6509 od->newformatting = g_strdup(nick); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6510 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6511 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6512 aim_admin_setnick(od, flap_connection_getbytype(od, SNAC_FAMILY_ADMIN), nick); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6513 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6514 } else { |
15822 | 6515 purple_notify_error(gc, NULL, _("The new formatting is invalid."), |
22404
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22352
diff
changeset
|
6516 _("Username formatting can change only capitalization and whitespace.")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6517 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6518 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6519 |
15822 | 6520 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
|
6521 { |
15822 | 6522 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6523 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6524 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6525 |
15822 | 6526 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
|
6527 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
|
6528 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6529 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
|
6530 if (conn != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6531 aim_admin_reqconfirm(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6532 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6533 od->conf = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6534 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6535 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6536 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6537 |
15822 | 6538 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
|
6539 { |
15822 | 6540 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
|
6541 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
|
6542 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
|
6543 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6544 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6545 aim_admin_getinfo(od, conn, 0x11); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6546 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6547 od->reqemail = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6548 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6549 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6550 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6551 |
15822 | 6552 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
|
6553 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6554 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
|
6555 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
|
6556 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6557 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6558 aim_admin_setemail(od, conn, email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6559 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6560 od->setemail = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6561 od->email = g_strdup(email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6562 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6563 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6564 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6565 |
15822 | 6566 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
|
6567 { |
15822 | 6568 PurpleConnection *gc = (PurpleConnection *) action->context; |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
6569 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
|
6570 FALSE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6571 _("_OK"), G_CALLBACK(oscar_change_email), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6572 _("_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
|
6573 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
6574 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6575 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6576 |
15822 | 6577 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
|
6578 { |
15822 | 6579 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
|
6580 OscarData *od = purple_connection_get_protocol_data(gc); |
26994
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6581 gchar *text, *tmp; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6582 GSList *buddies; |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6583 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6584 int num=0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6585 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6586 text = g_strdup(""); |
25130
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6587 account = purple_connection_get_account(gc); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
24031
diff
changeset
|
6588 |
26994
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6589 buddies = purple_find_buddies(account, NULL); |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6590 while (buddies) { |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6591 PurpleBuddy *buddy; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6592 const gchar *bname, *gname; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6593 |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6594 buddy = buddies->data; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6595 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
|
6596 gname = purple_group_get_name(purple_buddy_get_group(buddy)); |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6597 if (aim_ssi_waitingforauth(od->ssi.local, gname, bname)) { |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6598 const gchar *alias = purple_buddy_get_alias_only(buddy); |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6599 if (alias) |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6600 tmp = g_strdup_printf("%s %s (%s)<br>", text, bname, alias); |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6601 else |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6602 tmp = g_strdup_printf("%s %s<br>", text, bname); |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6603 g_free(text); |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6604 text = tmp; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6605 |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6606 num++; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6607 } |
26994
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6608 |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
26942
diff
changeset
|
6609 buddies = g_slist_delete_link(buddies, buddies); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6610 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6611 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6612 if (!num) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6613 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6614 text = g_strdup(_("<i>you are not waiting for authorization</i>")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6615 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6616 |
15822 | 6617 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
|
6618 "the following buddies"), _("You can re-request " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6619 "authorization from these buddies by " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6620 "right-clicking on them and selecting " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6621 "\"Re-request Authorization.\""), text, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6622 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6623 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6624 |
15822 | 6625 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
|
6626 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6627 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
|
6628 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6629 aim_search_address(od, email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6630 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6631 |
15822 | 6632 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
|
6633 { |
15822 | 6634 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
|
6635 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
|
6636 _("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
|
6637 _("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
|
6638 "searching for."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6639 NULL, FALSE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6640 _("_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
|
6641 _("_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
|
6642 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
6643 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6644 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6645 |
15822 | 6646 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
|
6647 { |
15822 | 6648 PurpleConnection *gc = (PurpleConnection *) action->context; |
6649 purple_account_request_change_user_info(purple_connection_get_account(gc)); | |
6650 } | |
6651 | |
6652 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
|
6653 { |
15822 | 6654 PurpleConnection *gc = (PurpleConnection *) action->context; |
6655 purple_notify_uri(gc, "http://www.icq.com/whitepages/user_details.php"); | |
6656 } | |
6657 | |
6658 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
|
6659 { |
15822 | 6660 PurpleConnection *gc = (PurpleConnection *) action->context; |
6661 purple_account_request_change_password(purple_connection_get_account(gc)); | |
6662 } | |
6663 | |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6664 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6665 * 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
|
6666 */ |
15822 | 6667 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
|
6668 { |
15822 | 6669 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
|
6670 OscarData *od = purple_connection_get_protocol_data(gc); |
15822 | 6671 gchar *substituted = purple_strreplace(od->authinfo->chpassurl, "%s", purple_account_get_username(purple_connection_get_account(gc))); |
6672 purple_notify_uri(gc, substituted); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6673 g_free(substituted); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6674 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6675 |
15822 | 6676 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
|
6677 { |
15822 | 6678 PurpleConnection *gc = (PurpleConnection *) action->context; |
6679 purple_notify_uri(gc, "http://mymobile.aol.com/dbreg/register?action=imf&clientID=1"); | |
6680 } | |
6681 | |
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
|
6682 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
|
6683 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6684 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
|
6685 |
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
|
6686 if (img == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6687 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
|
6688 } 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
|
6689 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
|
6690 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
|
6691 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
|
6692 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
|
6693 |
23383
540a26a1a88d
Helper functions are cool
Mark Doliner <mark@kingant.net>
parents:
23367
diff
changeset
|
6694 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
|
6695 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
|
6696 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
|
6697 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
|
6698 |
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
|
6699 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
|
6700 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6701 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6702 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6703 /** |
15822 | 6704 * 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
|
6705 * 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
|
6706 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6707 gboolean |
15822 | 6708 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
|
6709 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6710 OscarData *od; |
15822 | 6711 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6712 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6713 od = purple_connection_get_protocol_data(gc); |
15822 | 6714 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6715 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6716 if (od != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6717 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6718 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6719 userinfo = aim_locate_finduserinfo(od, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6720 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6721 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6722 * 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
|
6723 * 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
|
6724 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6725 if (((userinfo == NULL) || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6726 (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
|
6727 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
|
6728 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6729 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6730 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6731 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6732 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6733 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6734 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6735 |
15822 | 6736 PurpleXfer * |
6737 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
|
6738 { |
15822 | 6739 PurpleXfer *xfer; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6740 OscarData *od; |
15822 | 6741 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6742 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6743 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6744 od = purple_connection_get_protocol_data(gc); |
15822 | 6745 account = purple_connection_get_account(gc); |
6746 | |
6747 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
|
6748 if (xfer) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6749 { |
15822 | 6750 purple_xfer_ref(xfer); |
6751 purple_xfer_set_init_fnc(xfer, peer_oft_sendcb_init); | |
6752 purple_xfer_set_cancel_send_fnc(xfer, peer_oft_cb_generic_cancel); | |
6753 purple_xfer_set_request_denied_fnc(xfer, peer_oft_cb_generic_cancel); | |
6754 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
|
6755 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6756 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
|
6757 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
|
6758 conn->flags |= PEER_CONNECTION_FLAG_APPROVED; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6759 aim_icbm_makecookie(conn->cookie); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6760 conn->xfer = xfer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6761 xfer->data = conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6762 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6763 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6764 return xfer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6765 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6766 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6767 /* |
15822 | 6768 * 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
|
6769 * 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
|
6770 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6771 void |
15822 | 6772 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
|
6773 { |
15822 | 6774 PurpleXfer *xfer; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6775 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6776 xfer = oscar_new_xfer(gc, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6777 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6778 if (file != NULL) |
15822 | 6779 purple_xfer_request_accepted(xfer, file); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6780 else |
15822 | 6781 purple_xfer_request(xfer); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6782 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6783 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6784 GList * |
15822 | 6785 oscar_actions(PurplePlugin *plugin, gpointer context) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6786 { |
15822 | 6787 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
|
6788 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
|
6789 GList *menu = NULL; |
15822 | 6790 PurplePluginAction *act; |
6791 | |
6792 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
|
6793 oscar_show_set_info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6794 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6795 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6796 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6797 { |
22468
bc8e0c7c6419
Change these oscar protocol menu actions to use "web" instead of "URL."
Mark Doliner <mark@kingant.net>
parents:
22452
diff
changeset
|
6798 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
|
6799 oscar_show_set_info_icqurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6800 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6801 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6802 |
15822 | 6803 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
|
6804 oscar_change_pass); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6805 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6806 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6807 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
|
6808 { |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6809 /* 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
|
6810 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
|
6811 oscar_show_chpassurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6812 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
|
6813 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6814 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
6815 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
|
6816 { |
22468
bc8e0c7c6419
Change these oscar protocol menu actions to use "web" instead of "URL."
Mark Doliner <mark@kingant.net>
parents:
22452
diff
changeset
|
6817 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
|
6818 oscar_show_imforwardingurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6819 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6820 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6821 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6822 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6823 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6824 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6825 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6826 /* ICQ actions */ |
15822 | 6827 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
|
6828 oscar_show_icq_privacy_opts); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6829 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6830 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6831 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6832 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6833 /* AIM actions */ |
15822 | 6834 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
|
6835 oscar_confirm_account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6836 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6837 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
6838 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
|
6839 oscar_show_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6840 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6841 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
6842 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
|
6843 oscar_show_change_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6844 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6845 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6846 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6847 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6848 |
15822 | 6849 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
|
6850 oscar_show_awaitingauth); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6851 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6852 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6853 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6854 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22873
diff
changeset
|
6855 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
|
6856 oscar_show_find_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6857 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6858 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6859 #if 0 |
15822 | 6860 act = purple_plugin_action_new(_("Search for Buddy by Information"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6861 show_find_info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6862 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6863 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6864 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6865 menu = g_list_reverse(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6866 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6867 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6868 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6869 |
15822 | 6870 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
|
6871 { |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6872 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
|
6873 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6874 if (od->icq) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6875 aim_icq_changepasswd(od, new); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6876 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6877 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6878 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
|
6879 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6880 aim_admin_changepasswd(od, conn, new, old); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6881 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6882 od->chpass = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6883 od->oldp = g_strdup(old); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6884 od->newp = g_strdup(new); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6885 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6886 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6887 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6888 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6889 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6890 void |
15822 | 6891 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
|
6892 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6893 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6894 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6895 |
25933
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25925
diff
changeset
|
6896 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
|
6897 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
|
6898 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6899 if (conn != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6900 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6901 if (!conn->ready) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6902 aim_im_sendch2_cancel(conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6903 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6904 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
|
6905 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6906 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6907 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6908 const char * |
15822 | 6909 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
|
6910 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6911 static char buf[BUF_LEN]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6912 char *tmp1, *tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6913 int i, j; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6914 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6915 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
|
6916 |
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
|
6917 /* 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
|
6918 i = 0; |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
6919 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
|
6920 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
|
6921 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
|
6922 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
|
6923 break; |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25509
diff
changeset
|
6924 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6925 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6926 buf[i] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6927 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6928 tmp1 = g_utf8_strdown(buf, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6929 tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT); |
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
|
6930 strcpy(buf, tmp2); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6931 g_free(tmp2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6932 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6933 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6934 return buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6935 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6936 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6937 gboolean |
15822 | 6938 oscar_offline_message(const PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6939 { |
22408
791c9545846b
Make sure we tell stuff that oscar supports offline messages for AIM
Mark Doliner <mark@kingant.net>
parents:
22406
diff
changeset
|
6940 return TRUE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6941 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6942 |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6943 /* TODO: Find somewhere to put this instead of including it in a bunch of places. |
15822 | 6944 * 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
|
6945 */ |
15822 | 6946 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
|
6947 { |
15822 | 6948 PurpleAccount *acct = NULL; |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6949 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6950 /* 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
|
6951 if (acct_id) { |
15822 | 6952 acct = purple_accounts_find(acct_id, prpl); |
6953 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
|
6954 acct = NULL; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6955 } else { /* Otherwise find an active account for the protocol */ |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
6956 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
|
6957 while (l) { |
15822 | 6958 if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) |
6959 && 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
|
6960 acct = l->data; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6961 break; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6962 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6963 l = l->next; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6964 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6965 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6966 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6967 return acct; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6968 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6969 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6970 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6971 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
|
6972 { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6973 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
|
6974 char prpl[11]; |
15822 | 6975 PurpleAccount *acct; |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6976 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6977 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
|
6978 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6979 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6980 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
|
6981 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6982 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
|
6983 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6984 if (!acct) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6985 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6986 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6987 /* 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
|
6988 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
|
6989 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
|
6990 if (bname) { |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6991 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
|
6992 |
15822 | 6993 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
|
6994 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
|
6995 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
|
6996 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, bname); |
15822 | 6997 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
|
6998 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
6999 if (message) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7000 /* Spaces are encoded as '+' */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7001 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
|
7002 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
|
7003 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7004 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7005 /*else |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7006 **If pidgindialogs_im() was in the core, we could use it here. |
15822 | 7007 * 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
|
7008 pidgindialogs_im();*/ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7009 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7010 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7011 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7012 /* 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
|
7013 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
|
7014 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
|
7015 if (rname) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7016 /* 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
|
7017 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
|
7018 g_hash_table_insert(params, g_strdup("room"), g_strdup(rname)); |
15822 | 7019 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
|
7020 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7021 /*else |
15822 | 7022 ** 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
|
7023 pidgin_blist_joinchat_show(); */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7024 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7025 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7026 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7027 /* 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
|
7028 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
|
7029 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
|
7030 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
|
7031 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
|
7032 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7033 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7034 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7035 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7036 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7037 |
15822 | 7038 void oscar_init(PurplePluginProtocolInfo *prpl_info) |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7039 { |
15822 | 7040 PurpleAccountOption *option; |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7041 static gboolean init = FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7042 |
15822 | 7043 option = purple_account_option_string_new(_("Server"), "server", OSCAR_DEFAULT_LOGIN_SERVER); |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7044 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
|
7045 |
15822 | 7046 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
|
7047 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
|
7048 |
25326
62a5a41c3dfd
Remove the "buggy" caveat -- I've been running it for a while
Paul Aurich <paul@darkrain42.org>
parents:
25325
diff
changeset
|
7049 option = purple_account_option_bool_new(_("Use SSL"), "use_ssl", |
25211
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
7050 OSCAR_DEFAULT_USE_SSL); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24667
diff
changeset
|
7051 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
|
7052 |
27161
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27160
diff
changeset
|
7053 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
|
7054 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
|
7055 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
|
7056 |
15822 | 7057 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
|
7058 _("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
|
7059 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
|
7060 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
|
7061 |
23312
afdbbf36499e
Added account option for oscar accounts to allow multipe simultaneous logins,
Evan Schoenberg <evan.s@dreskin.net>
parents:
23311
diff
changeset
|
7062 option = purple_account_option_bool_new(_("Allow multiple simultaneous logins"), "allow_multiple_logins", |
afdbbf36499e
Added account option for oscar accounts to allow multipe simultaneous logins,
Evan Schoenberg <evan.s@dreskin.net>
parents:
23311
diff
changeset
|
7063 OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS); |
afdbbf36499e
Added account option for oscar accounts to allow multipe simultaneous logins,
Evan Schoenberg <evan.s@dreskin.net>
parents:
23311
diff
changeset
|
7064 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
25924
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25905
diff
changeset
|
7065 |
15623
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7066 if (init) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7067 return; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7068 init = TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7069 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7070 /* Preferences */ |
15822 | 7071 purple_prefs_add_none("/plugins/prpl/oscar"); |
7072 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
|
7073 |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
7074 purple_prefs_remove("/plugins/prpl/oscar/show_idle"); |
15822 | 7075 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
|
7076 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7077 /* protocol handler */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15622
diff
changeset
|
7078 /* TODO: figure out a good instance to use here */ |
15822 | 7079 purple_signal_connect(purple_get_core(), "uri-handler", &init, |
7080 PURPLE_CALLBACK(oscar_uri_handler), NULL); | |
7081 } | |
7082 |