Mercurial > pidgin.yaz
annotate libpurple/protocols/oscar/oscar.c @ 31085:4297feb30ad1
Merged everything related to ICQ server changes.
applied changes from b6d7712e90b68610df3bd2d8cbaf46d94c8b3794
through d849dc2a852a4ffdd345a150f0b88ab37de36e36
applied changes from 7aedaac3ed815cab16d758474a829d5ec5a59e4b
through d849dc2a852a4ffdd345a150f0b88ab37de36e36
author | ivan.komarov@soc.pidgin.im |
---|---|
date | Sat, 30 Oct 2010 21:36:34 +0000 |
parents | 001897406060 |
children | 1558900f47e5 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15823 | 2 * purple |
15374
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> |
15374
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 |
15374
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 |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19653
diff
changeset
|
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
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" |
30814
a347a4cd1caf
Moved encoding-related functions to a separate file, renamed some of them,
ivan.komarov@soc.pidgin.im
parents:
30809
diff
changeset
|
40 #include "encoding.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "imgstore.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 #include "network.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "notify.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "privacy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "prpl.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 #include "proxy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 #include "request.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 #include "version.h" |
30805
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
50 #include "visibility.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 #include "oscarcommon.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 #include "oscar.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 #include "peer.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 |
15867
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:
15866
diff
changeset
|
56 #define AIMHASHDATA "http://pidgin.im/aim_data.php3" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 #define OSCAR_CONNECT_STEPS 6 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 |
30007
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
60 static guint64 purple_caps = |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
61 OSCAR_CAPABILITY_CHAT |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
62 | OSCAR_CAPABILITY_BUDDYICON |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
63 | OSCAR_CAPABILITY_DIRECTIM |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
64 | OSCAR_CAPABILITY_SENDFILE |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
65 | OSCAR_CAPABILITY_UNICODE |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
66 | OSCAR_CAPABILITY_INTEROPERATE |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
67 | OSCAR_CAPABILITY_SHORTCAPS |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
68 | OSCAR_CAPABILITY_TYPING |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
69 | OSCAR_CAPABILITY_ICQSERVERRELAY |
0d3145e6b1d6
Change the oscar capabilities variable to be a guint64 everywhere instead
Mark Doliner <mark@kingant.net>
parents:
29929
diff
changeset
|
70 | OSCAR_CAPABILITY_NEWCAPS |
30831
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
71 | OSCAR_CAPABILITY_XTRAZ |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
72 | OSCAR_CAPABILITY_HTML_MSGS; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 static guint8 features_aim[] = {0x01, 0x01, 0x01, 0x02}; |
30144
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
30143
diff
changeset
|
75 static guint8 features_icq[] = {0x01}; |
15374
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 |
15823 | 89 /* All the libfaim->purple callback functions */ |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
90 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
91 /* Only used when connecting with the old-style BUCP login */ |
15823 | 92 static int purple_parse_auth_resp (OscarData *, FlapConnection *, FlapFrame *, ...); |
93 static int purple_parse_login (OscarData *, FlapConnection *, FlapFrame *, ...); | |
94 static int purple_parse_auth_securid_request(OscarData *, FlapConnection *, FlapFrame *, ...); | |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
95 |
15823 | 96 static int purple_handle_redirect (OscarData *, FlapConnection *, FlapFrame *, ...); |
97 static int purple_info_change (OscarData *, FlapConnection *, FlapFrame *, ...); | |
98 static int purple_account_confirm (OscarData *, FlapConnection *, FlapFrame *, ...); | |
99 static int purple_parse_oncoming (OscarData *, FlapConnection *, FlapFrame *, ...); | |
100 static int purple_parse_offgoing (OscarData *, FlapConnection *, FlapFrame *, ...); | |
101 static int purple_parse_incoming_im(OscarData *, FlapConnection *, FlapFrame *, ...); | |
102 static int purple_parse_misses (OscarData *, FlapConnection *, FlapFrame *, ...); | |
103 static int purple_parse_clientauto (OscarData *, FlapConnection *, FlapFrame *, ...); | |
104 static int purple_parse_motd (OscarData *, FlapConnection *, FlapFrame *, ...); | |
105 static int purple_chatnav_info (OscarData *, FlapConnection *, FlapFrame *, ...); | |
106 static int purple_conv_chat_join (OscarData *, FlapConnection *, FlapFrame *, ...); | |
107 static int purple_conv_chat_leave (OscarData *, FlapConnection *, FlapFrame *, ...); | |
108 static int purple_conv_chat_info_update (OscarData *, FlapConnection *, FlapFrame *, ...); | |
109 static int purple_conv_chat_incoming_msg(OscarData *, FlapConnection *, FlapFrame *, ...); | |
110 static int purple_email_parseupdate(OscarData *, FlapConnection *, FlapFrame *, ...); | |
111 static int purple_icon_parseicon (OscarData *, FlapConnection *, FlapFrame *, ...); | |
112 static int purple_parse_searcherror(OscarData *, FlapConnection *, FlapFrame *, ...); | |
113 static int purple_parse_searchreply(OscarData *, FlapConnection *, FlapFrame *, ...); | |
114 static int purple_bosrights (OscarData *, FlapConnection *, FlapFrame *, ...); | |
115 static int purple_connerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
116 static int purple_parse_mtn (OscarData *, FlapConnection *, FlapFrame *, ...); | |
117 static int purple_parse_locaterights(OscarData *, FlapConnection *, FlapFrame *, ...); | |
118 static int purple_parse_buddyrights(OscarData *, FlapConnection *, FlapFrame *, ...); | |
119 static int purple_parse_genericerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
120 static int purple_memrequest (OscarData *, FlapConnection *, FlapFrame *, ...); | |
121 static int purple_selfinfo (OscarData *, FlapConnection *, FlapFrame *, ...); | |
122 static int purple_popup (OscarData *, FlapConnection *, FlapFrame *, ...); | |
123 static int purple_ssi_parseerr (OscarData *, FlapConnection *, FlapFrame *, ...); | |
124 static int purple_ssi_parserights (OscarData *, FlapConnection *, FlapFrame *, ...); | |
125 static int purple_ssi_parselist (OscarData *, FlapConnection *, FlapFrame *, ...); | |
126 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
|
127 static int purple_ssi_parseaddmod (OscarData *, FlapConnection *, FlapFrame *, ...); |
15823 | 128 static int purple_ssi_authgiven (OscarData *, FlapConnection *, FlapFrame *, ...); |
129 static int purple_ssi_authrequest (OscarData *, FlapConnection *, FlapFrame *, ...); | |
130 static int purple_ssi_authreply (OscarData *, FlapConnection *, FlapFrame *, ...); | |
131 static int purple_ssi_gotadded (OscarData *, FlapConnection *, FlapFrame *, ...); | |
132 | |
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
|
133 static void purple_icons_fetch(PurpleConnection *gc); |
15823 | 134 |
135 void oscar_set_info(PurpleConnection *gc, const char *info); | |
136 static void oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, gboolean setstatus, PurpleStatus *status); | |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
137 static void oscar_set_extended_status(PurpleConnection *gc); |
15823 | 138 static gboolean purple_ssi_rerequestdata(gpointer data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 |
30794
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30792
diff
changeset
|
140 void oscar_free_name_data(struct name_data *data) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 g_free(data->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 g_free(data->nick); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 #ifdef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 const char *oscar_get_locale_charset(void) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 static const char *charset = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 if (charset == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 g_get_charset(&charset); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 return charset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 static char *oscar_icqstatus(int state) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 /* 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
|
157 if (state & AIM_ICQ_STATE_CHAT) |
24884
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24847
diff
changeset
|
158 return g_strdup(_("Free For Chat")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 else if (state & AIM_ICQ_STATE_DND) |
24884
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24847
diff
changeset
|
160 return g_strdup(_("Do Not Disturb")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 else if (state & AIM_ICQ_STATE_OUT) |
24884
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24847
diff
changeset
|
162 return g_strdup(_("Not Available")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 else if (state & AIM_ICQ_STATE_BUSY) |
24884
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24847
diff
changeset
|
164 return g_strdup(_("Occupied")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 else if (state & AIM_ICQ_STATE_AWAY) |
24884
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24847
diff
changeset
|
166 return g_strdup(_("Away")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 else if (state & AIM_ICQ_STATE_WEBAWARE) |
24884
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24847
diff
changeset
|
168 return g_strdup(_("Web Aware")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 else if (state & AIM_ICQ_STATE_INVISIBLE) |
24884
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24847
diff
changeset
|
170 return g_strdup(_("Invisible")); |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
171 else if (state & AIM_ICQ_STATE_EVIL) |
29851
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
172 return g_strdup(_("Evil")); |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
173 else if (state & AIM_ICQ_STATE_DEPRESSION) |
29851
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
174 return g_strdup(_("Depression")); |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
175 else if (state & AIM_ICQ_STATE_ATHOME) |
29854 | 176 return g_strdup(_("At home")); |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
177 else if (state & AIM_ICQ_STATE_ATWORK) |
29851
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
178 return g_strdup(_("At work")); |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
179 else if (state & AIM_ICQ_STATE_LUNCH) |
29851
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
180 return g_strdup(_("At lunch")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 else |
24884
568b786c36f9
The remainder of a patch from fqueze to fix some incorrect *printf() function
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24847
diff
changeset
|
182 return g_strdup(_("Online")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 static char *extract_name(const char *name) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 char *tmp, *x; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 int i, j; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 if (!name) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 x = strchr(name, '-'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 if (!x) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 x = strchr(x + 1, '-'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 if (!x) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 tmp = g_strdup(++x); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 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
|
203 char hex[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 if (x[i] != '%') { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 tmp[j++] = x[i]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 strncpy(hex, x + ++i, 2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 hex[2] = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 i++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 tmp[j++] = strtol(hex, NULL, 16); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 tmp[j] = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 return tmp; |
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 static struct chat_connection * |
15823 | 219 find_oscar_chat(PurpleConnection *gc, int id) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
221 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 struct chat_connection *cc; |
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 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
|
226 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 if (cc->id == id) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 return cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 static struct chat_connection * |
15823 | 236 find_oscar_chat_by_conn(PurpleConnection *gc, FlapConnection *conn) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
238 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 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
|
243 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 if (cc->conn == conn) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 return cc; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 return NULL; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 static struct chat_connection * |
15823 | 253 find_oscar_chat_by_conv(PurpleConnection *gc, PurpleConversation *conv) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
255 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 GSList *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 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
|
260 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 cc = (struct chat_connection *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 if (cc->conv == conv) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 return cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 oscar_chat_destroy(struct chat_connection *cc) |
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 g_free(cc->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 g_free(cc->show); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 g_free(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 static void |
15823 | 278 oscar_chat_kill(PurpleConnection *gc, struct chat_connection *cc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
280 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 /* Notify the conversation window that we've left the chat */ |
15823 | 283 serv_got_chat_left(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(cc->conv))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 /* Destroy the chat_connection */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 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
|
287 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
|
288 oscar_chat_destroy(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 } |
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 /** |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
292 * This is called from the callback functions for establishing |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
293 * a TCP connection with an oscar host if an error occurred. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 static void |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
296 connection_common_error_cb(FlapConnection *conn, const gchar *error_message) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 OscarData *od; |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
299 PurpleConnection *gc; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
300 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
301 od = conn->od; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
302 gc = od->gc; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
303 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
304 purple_debug_error("oscar", "unable to connect to FLAP " |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
305 "server of type 0x%04hx\n", conn->type); |
25022
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25018
diff
changeset
|
306 |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
307 if (conn->type == SNAC_FAMILY_AUTH) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
308 { |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
309 /* This only happens when connecting with the old-style BUCP login */ |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
310 gchar *msg; |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
311 msg = g_strdup_printf(_("Unable to connect to authentication server: %s"), |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
312 error_message); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
313 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:
24615
diff
changeset
|
314 g_free(msg); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
315 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
316 else if (conn->type == SNAC_FAMILY_LOCATE) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
317 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
318 gchar *msg; |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
319 msg = g_strdup_printf(_("Unable to connect to BOS server: %s"), |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
320 error_message); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
321 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:
24615
diff
changeset
|
322 g_free(msg); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
323 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
324 else |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
325 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
326 /* Maybe we should call this for BOS connections, too? */ |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
327 flap_connection_schedule_destroy(conn, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
328 OSCAR_DISCONNECT_COULD_NOT_CONNECT, error_message); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
329 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
330 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
331 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
332 /** |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
333 * This is called from the callback functions for establishing |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
334 * 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:
24615
diff
changeset
|
335 * of host, we do a few different things here. |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
336 */ |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
337 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
338 connection_common_established_cb(FlapConnection *conn) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 { |
25022
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25018
diff
changeset
|
340 OscarData *od; |
15823 | 341 PurpleConnection *gc; |
342 PurpleAccount *account; | |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
343 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 od = conn->od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 gc = od->gc; |
15823 | 346 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 |
15823 | 348 purple_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 conn->type); |
25022
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25018
diff
changeset
|
350 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 if (conn->cookie == NULL) |
24393
a3c119fd31e3
Fix the indentation level on the code changed by the last patch.
Richard Laager <rlaager@wiktel.com>
parents:
24392
diff
changeset
|
352 flap_connection_send_version(od, conn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 { |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
355 if (purple_account_get_bool(account, "use_clientlogin", OSCAR_DEFAULT_USE_CLIENTLOGIN)) |
30364 | 356 { |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
357 ClientInfo aiminfo = CLIENTINFO_PURPLE_AIM; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
358 ClientInfo icqinfo = CLIENTINFO_PURPLE_ICQ; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
359 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:
27242
diff
changeset
|
360 conn, conn->cookielen, conn->cookie, |
28872
4575d8daba12
oscar: Fix 'Allow multiple simultaenous logins' with clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28871
diff
changeset
|
361 od->icq ? &icqinfo : &aiminfo, |
4575d8daba12
oscar: Fix 'Allow multiple simultaenous logins' with clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28871
diff
changeset
|
362 purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
363 } else { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
364 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:
27242
diff
changeset
|
365 conn->cookielen, conn->cookie); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
366 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
367 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
368 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 g_free(conn->cookie); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
370 conn->cookie = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
371 } |
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 (conn->type == SNAC_FAMILY_AUTH) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
374 { |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
375 /* This only happens when connecting with the old-style BUCP login */ |
15823 | 376 aim_request_login(od, conn, purple_account_get_username(account)); |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
377 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:
22342
diff
changeset
|
378 purple_connection_update_progress(gc, _("Username sent"), 1, OSCAR_CONNECT_STEPS); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 ck[1] = 0x65; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
380 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
381 else if (conn->type == SNAC_FAMILY_LOCATE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
382 { |
15823 | 383 purple_connection_update_progress(gc, _("Connection established, cookie sent"), 4, OSCAR_CONNECT_STEPS); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
384 ck[4] = 0x61; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
385 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 else if (conn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
388 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
|
389 conn->new_conn_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
390 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
392 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
393 static void |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
394 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:
24615
diff
changeset
|
395 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
396 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
397 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
398 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
399 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
400 conn->connect_data = NULL; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
401 conn->fd = source; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
402 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
403 if (source < 0) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
404 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
405 connection_common_error_cb(conn, error_message); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
406 return; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
407 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
408 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
409 conn->watcher_incoming = purple_input_add(conn->fd, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
410 PURPLE_INPUT_READ, flap_connection_recv_cb, conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
411 connection_common_established_cb(conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
412 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
413 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
414 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
415 ssl_connection_established_cb(gpointer data, PurpleSslConnection *gsc, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
416 PurpleInputCondition cond) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
417 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
418 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
419 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
420 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
421 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
422 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:
24615
diff
changeset
|
423 connection_common_established_cb(conn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
424 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
425 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
426 static void |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
427 ssl_connection_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
428 gpointer data) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
429 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
430 FlapConnection *conn; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
431 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
432 conn = data; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
433 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
434 if (conn->watcher_outgoing) |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
435 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
436 purple_input_remove(conn->watcher_outgoing); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
437 conn->watcher_outgoing = 0; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
438 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
439 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
440 /* sslconn frees the connection on error */ |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
441 conn->gsc = NULL; |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
442 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
443 connection_common_error_cb(conn, purple_ssl_strerror(error)); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
444 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
445 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
446 static void |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
447 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
|
448 { |
15823 | 449 PurpleConnection *gc = od->gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
451 aim_srv_reqpersonalinfo(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 |
15823 | 453 purple_debug_info("oscar", "ssi: requesting rights and list\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
454 aim_ssi_reqrights(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 aim_ssi_reqdata(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 if (od->getblisttimer > 0) |
15823 | 457 purple_timeout_remove(od->getblisttimer); |
25861
7f552614ec8a
applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents:
25166
diff
changeset
|
458 od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
459 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 aim_locate_reqrights(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
461 aim_buddylist_reqrights(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
462 aim_im_reqparams(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 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
|
464 |
15823 | 465 purple_connection_update_progress(gc, _("Finalizing connection"), 5, OSCAR_CONNECT_STEPS); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
467 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 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
|
470 { |
23839
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23777
diff
changeset
|
471 aim_srv_clientready(od, conn); |
15823 | 472 purple_debug_info("oscar", "connected to admin\n"); |
15374
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 if (od->chpass) { |
15823 | 475 purple_debug_info("oscar", "changing password\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 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
|
477 g_free(od->oldp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 od->oldp = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 g_free(od->newp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 od->newp = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 od->chpass = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
483 if (od->setnick) { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
484 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:
25415
diff
changeset
|
485 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:
25415
diff
changeset
|
486 g_free(od->newformatting); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
487 od->newformatting = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 od->setnick = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
489 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 if (od->conf) { |
15823 | 491 purple_debug_info("oscar", "confirming account\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 aim_admin_reqconfirm(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 od->conf = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 if (od->reqemail) { |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
496 purple_debug_info("oscar", "requesting email address\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 aim_admin_getinfo(od, conn, 0x0011); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 od->reqemail = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 if (od->setemail) { |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
501 purple_debug_info("oscar", "setting email address\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 aim_admin_setemail(od, conn, od->email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 g_free(od->email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 od->email = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 od->setemail = FALSE; |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 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
|
511 { |
15823 | 512 PurpleConnection *gc = od->gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 struct chat_connection *chatcon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 static int id = 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 |
23839
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23777
diff
changeset
|
516 aim_srv_clientready(od, conn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 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
|
519 if (chatcon) { |
9bdc5144bd96
Fix CID 340; potential NULL deref.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20840
diff
changeset
|
520 chatcon->id = id; |
9bdc5144bd96
Fix CID 340; potential NULL deref.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20840
diff
changeset
|
521 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
|
522 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 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
|
527 { |
23839
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23777
diff
changeset
|
528 aim_srv_clientready(od, conn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 aim_chatnav_reqrights(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
533 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
|
534 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 aim_email_sendcookies(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 aim_email_activate(od); |
23839
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23777
diff
changeset
|
537 aim_srv_clientready(od, conn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
539 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
541 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
|
542 { |
15823 | 543 PurpleConnection *gc = od->gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 |
23839
5e7a013bb75e
A little function renaming and organization
Mark Doliner <mark@kingant.net>
parents:
23777
diff
changeset
|
545 aim_srv_clientready(od, conn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 od->iconconnecting = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 |
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
|
549 purple_icons_fetch(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 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
|
554 { |
15823 | 555 purple_debug_info("oscar", "FLAP connection of type 0x%04hx is " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 "now fully connected\n", conn->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 if (conn->type == SNAC_FAMILY_LOCATE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 flap_connection_established_bos(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 else if (conn->type == SNAC_FAMILY_ADMIN) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 flap_connection_established_admin(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 else if (conn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 flap_connection_established_chat(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 else if (conn->type == SNAC_FAMILY_CHATNAV) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 flap_connection_established_chatnav(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 else if (conn->type == SNAC_FAMILY_ALERT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 flap_connection_established_alert(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
567 else if (conn->type == SNAC_FAMILY_BART) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 flap_connection_established_bart(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
573 static void |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
574 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
|
575 gconstpointer value, gpointer data) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
576 { |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
577 PurpleConnection *gc; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
578 OscarData *od; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
579 gboolean report_idle; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
580 guint32 presence; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
581 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
582 gc = data; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
583 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
|
584 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
|
585 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
|
586 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
587 if (report_idle) |
28868
c26a59000df9
oscar: Update the details of the buddy preferences based on the OSCAR docs.
Paul Aurich <paul@darkrain42.org>
parents:
28865
diff
changeset
|
588 aim_ssi_setpresence(od, presence | AIM_SSI_PRESENCE_FLAG_SHOWIDLE); |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
589 else |
28868
c26a59000df9
oscar: Update the details of the buddy preferences based on the OSCAR docs.
Paul Aurich <paul@darkrain42.org>
parents:
28865
diff
changeset
|
590 aim_ssi_setpresence(od, presence & ~AIM_SSI_PRESENCE_FLAG_SHOWIDLE); |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
591 } |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
592 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
593 /** |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
594 * 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
|
595 * 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
|
596 */ |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
597 static void |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
598 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
|
599 gconstpointer value, gpointer data) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
600 { |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
601 PurpleConnection *gc; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
602 OscarData *od; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
603 guint32 presence; |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
604 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
605 gc = data; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
606 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
|
607 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
|
608 |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
609 if (value) |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
610 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
|
611 else |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
612 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
|
613 } |
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
614 |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
615 static const gchar *login_servers[] = { |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
616 AIM_DEFAULT_LOGIN_SERVER, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
617 AIM_DEFAULT_SSL_LOGIN_SERVER, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
618 ICQ_DEFAULT_LOGIN_SERVER, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
619 ICQ_DEFAULT_SSL_LOGIN_SERVER, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
620 }; |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
621 |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
622 static const gchar *get_login_server(gboolean is_icq, gboolean use_ssl) |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
623 { |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
624 return login_servers[is_icq*2 + use_ssl]; |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
625 } |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
626 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
627 void |
15823 | 628 oscar_login(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
629 { |
15823 | 630 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 |
15823 | 633 gc = purple_account_get_connection(account); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
634 od = oscar_data_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 od->gc = gc; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
636 purple_connection_set_protocol_data(gc, od); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 |
15823 | 638 oscar_data_addhandler(od, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, purple_connerr, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 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
|
640 |
15823 | 641 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0003, purple_info_change, 0); |
642 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0005, purple_info_change, 0); | |
643 oscar_data_addhandler(od, SNAC_FAMILY_ADMIN, 0x0007, purple_account_confirm, 0); | |
644 oscar_data_addhandler(od, SNAC_FAMILY_ALERT, 0x0001, purple_parse_genericerr, 0); | |
645 oscar_data_addhandler(od, SNAC_FAMILY_ALERT, SNAC_SUBTYPE_ALERT_MAILSTATUS, purple_email_parseupdate, 0); | |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
646 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
647 /* These are only needed when connecting with the old-style BUCP login */ |
15823 | 648 oscar_data_addhandler(od, SNAC_FAMILY_AUTH, 0x0003, purple_parse_auth_resp, 0); |
649 oscar_data_addhandler(od, SNAC_FAMILY_AUTH, 0x0007, purple_parse_login, 0); | |
650 oscar_data_addhandler(od, SNAC_FAMILY_AUTH, SNAC_SUBTYPE_AUTH_SECURID_REQUEST, purple_parse_auth_securid_request, 0); | |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
651 |
15823 | 652 oscar_data_addhandler(od, SNAC_FAMILY_BART, SNAC_SUBTYPE_BART_RESPONSE, purple_icon_parseicon, 0); |
653 oscar_data_addhandler(od, SNAC_FAMILY_BOS, 0x0001, purple_parse_genericerr, 0); | |
654 oscar_data_addhandler(od, SNAC_FAMILY_BOS, 0x0003, purple_bosrights, 0); | |
655 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, 0x0001, purple_parse_genericerr, 0); | |
656 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_RIGHTSINFO, purple_parse_buddyrights, 0); | |
657 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_ONCOMING, purple_parse_oncoming, 0); | |
658 oscar_data_addhandler(od, SNAC_FAMILY_BUDDY, SNAC_SUBTYPE_BUDDY_OFFGOING, purple_parse_offgoing, 0); | |
659 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, 0x0001, purple_parse_genericerr, 0); | |
660 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_USERJOIN, purple_conv_chat_join, 0); | |
661 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_USERLEAVE, purple_conv_chat_leave, 0); | |
662 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_ROOMINFOUPDATE, purple_conv_chat_info_update, 0); | |
663 oscar_data_addhandler(od, SNAC_FAMILY_CHAT, SNAC_SUBTYPE_CHAT_INCOMINGMSG, purple_conv_chat_incoming_msg, 0); | |
664 oscar_data_addhandler(od, SNAC_FAMILY_CHATNAV, 0x0001, purple_parse_genericerr, 0); | |
665 oscar_data_addhandler(od, SNAC_FAMILY_CHATNAV, SNAC_SUBTYPE_CHATNAV_INFO, purple_chatnav_info, 0); | |
666 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ERROR, purple_ssi_parseerr, 0); | |
667 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RIGHTSINFO, purple_ssi_parserights, 0); | |
668 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_LIST, purple_ssi_parselist, 0); | |
669 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
|
670 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
|
671 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_MOD, purple_ssi_parseaddmod, 0); |
15823 | 672 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTH, purple_ssi_authgiven, 0); |
673 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTHREQ, purple_ssi_authrequest, 0); | |
674 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_RECVAUTHREP, purple_ssi_authreply, 0); | |
675 oscar_data_addhandler(od, SNAC_FAMILY_FEEDBAG, SNAC_SUBTYPE_FEEDBAG_ADDED, purple_ssi_gotadded, 0); | |
676 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_INCOMING, purple_parse_incoming_im, 0); | |
677 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_MISSEDCALL, purple_parse_misses, 0); | |
678 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_CLIENTAUTORESP, purple_parse_clientauto, 0); | |
679 oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_MTN, purple_parse_mtn, 0); | |
680 oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_RIGHTSINFO, purple_parse_locaterights, 0); | |
681 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x0001, purple_parse_genericerr, 0); | |
682 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x000f, purple_selfinfo, 0); | |
683 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x001f, purple_memrequest, 0); | |
684 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, SNAC_SUBTYPE_OSERVICE_REDIRECT, purple_handle_redirect, 0); | |
685 oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, SNAC_SUBTYPE_OSERVICE_MOTD, purple_parse_motd, 0); | |
686 oscar_data_addhandler(od, SNAC_FAMILY_POPUP, 0x0002, purple_popup, 0); | |
687 oscar_data_addhandler(od, SNAC_FAMILY_USERLOOKUP, SNAC_SUBTYPE_USERLOOKUP_ERROR, purple_parse_searcherror, 0); | |
688 oscar_data_addhandler(od, SNAC_FAMILY_USERLOOKUP, 0x0003, purple_parse_searchreply, 0); | |
689 | |
690 purple_debug_misc("oscar", "oscar_login: gc = %p\n", gc); | |
691 | |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
692 if (!oscar_util_valid_name(purple_account_get_username(account))) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
693 gchar *buf; |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
694 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 | 695 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS, buf); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 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
|
697 return; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 |
30144
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
30143
diff
changeset
|
700 gc->flags |= PURPLE_CONNECTION_HTML; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
701 if (oscar_util_valid_name_icq((purple_account_get_username(account)))) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 od->icq = TRUE; |
29929
3e5bb4e2334c
Added PurpleConnection flags to determine support for moods and mood messages.
Marcus Lundblad <ml@update.uu.se>
parents:
29923
diff
changeset
|
703 gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 } else { |
15823 | 705 gc->flags |= PURPLE_CONNECTION_AUTO_RESP; |
706 } | |
707 | |
27319
76cf0b261e25
Set od->default_port even when using the standard auth method.
Paul Aurich <paul@darkrain42.org>
parents:
27276
diff
changeset
|
708 od->default_port = purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT); |
25015
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25014
diff
changeset
|
709 od->use_ssl = purple_account_get_bool(account, "use_ssl", OSCAR_DEFAULT_USE_SSL); |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
710 |
15823 | 711 /* 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
|
712 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
|
713 purple_prefs_connect_callback(gc, "/plugins/prpl/oscar/recent_buddies", recent_buddies_pref_cb, gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
714 |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
715 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
716 * 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:
27242
diff
changeset
|
717 * 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:
27242
diff
changeset
|
718 * (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:
27242
diff
changeset
|
719 * authenticate. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
720 * |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
721 * AIM 5.9 and lower use an MD5-based login procedure called "BUCP". |
27440
46e0f65b14a1
The XOR method is disabled in family_auth.c
Paul Aurich <paul@darkrain42.org>
parents:
27360
diff
changeset
|
722 * 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:
27360
diff
changeset
|
723 * clientLogin is not enabled. |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
724 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
725 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:
27242
diff
changeset
|
726 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:
27242
diff
changeset
|
727 } else { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
728 FlapConnection *newconn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
729 const char *server; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
730 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
731 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:
27242
diff
changeset
|
732 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
733 if (od->use_ssl) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
734 if (!purple_ssl_is_supported()) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
735 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:
27242
diff
changeset
|
736 _("SSL support unavailable")); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
737 return; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
738 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
739 |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
740 server = purple_account_get_string(account, "server", get_login_server(od->icq, TRUE)); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
741 |
25022
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25018
diff
changeset
|
742 /* |
f6ef3a9534db
Shuffle a few comments around to make it look like I did something
Mark Doliner <mark@kingant.net>
parents:
25018
diff
changeset
|
743 * If the account's server is what the oscar prpl has offered as |
25015
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25014
diff
changeset
|
744 * 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:
25014
diff
changeset
|
745 * 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:
25014
diff
changeset
|
746 * 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:
25014
diff
changeset
|
747 * from under them to the SSL login server. |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
748 */ |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
749 if (!strcmp(server, get_login_server(od->icq, FALSE))) { |
25015
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25014
diff
changeset
|
750 purple_debug_info("oscar", "Account uses SSL, so changing server to default SSL server\n"); |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
751 purple_account_set_string(account, "server", get_login_server(od->icq, TRUE)); |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
752 server = get_login_server(od->icq, TRUE); |
25015
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25014
diff
changeset
|
753 } |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25014
diff
changeset
|
754 |
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25014
diff
changeset
|
755 newconn->gsc = purple_ssl_connect(account, server, |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
756 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:
24615
diff
changeset
|
757 ssl_connection_established_cb, ssl_connection_error_cb, newconn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
758 } else { |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
759 server = purple_account_get_string(account, "server", get_login_server(od->icq, FALSE)); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
760 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
761 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
762 * 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:
27242
diff
changeset
|
763 * 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:
27242
diff
changeset
|
764 * 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:
27242
diff
changeset
|
765 */ |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
766 if (!strcmp(server, get_login_server(od->icq, TRUE))) { |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
767 purple_debug_info("oscar", "Account does not use SSL, so changing server back to non-SSL\n"); |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
768 purple_account_set_string(account, "server", get_login_server(od->icq, FALSE)); |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
769 server = get_login_server(od->icq, FALSE); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
770 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
771 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
772 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:
27242
diff
changeset
|
773 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:
27242
diff
changeset
|
774 connection_established_cb, newconn); |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
775 } |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
776 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
777 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:
27242
diff
changeset
|
778 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
779 _("Unable to connect")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
780 return; |
25015
7f0321038c53
Implement a sane mechanism for switching an OSCAR account to SSL.
Paul Aurich <paul@darkrain42.org>
parents:
25014
diff
changeset
|
781 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
782 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
783 |
15823 | 784 purple_connection_update_progress(gc, _("Connecting"), 0, OSCAR_CONNECT_STEPS); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 ck[0] = 0x5a; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
786 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
788 void |
15823 | 789 oscar_close(PurpleConnection *gc) |
15374
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 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
792 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
793 od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
794 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
795 while (od->oscar_chats) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
796 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
797 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
|
798 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
|
799 oscar_chat_destroy(cc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
800 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
801 while (od->create_rooms) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
802 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
803 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
|
804 g_free(cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
805 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
|
806 g_free(cr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
807 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
808 oscar_data_destroy(od); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
809 purple_connection_set_protocol_data(gc, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
810 |
15823 | 811 purple_prefs_disconnect_by_handle(gc); |
812 | |
813 purple_debug_info("oscar", "Signed off.\n"); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
814 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
815 |
15823 | 816 /* XXX - Should use purple_util_fetch_url for the below stuff */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
817 struct pieceofcrap { |
15823 | 818 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
819 unsigned long offset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 unsigned long len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
821 char *modname; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
822 int fd; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
824 unsigned int inpa; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 |
15823 | 827 static void damn_you(gpointer data, gint source, PurpleInputCondition c) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 struct pieceofcrap *pos = data; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
830 OscarData *od = purple_connection_get_protocol_data(pos->gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
831 char in = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
832 int x = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 unsigned char m[17]; |
23777
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23776
diff
changeset
|
834 GString *msg; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
836 while (read(pos->fd, &in, 1) == 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 if (in == '\n') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 x++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 else if (in != '\r') |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 x = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 if (x == 2) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
842 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 in = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 if (in != '\n') { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 char buf[256]; |
24847
5a435e953bc6
Don't mention TOC in this error message. I think this error is too
Mark Doliner <mark@kingant.net>
parents:
24642
diff
changeset
|
847 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:
24642
diff
changeset
|
848 "If so, check %s for updates."), |
27504
4f24d5da4cb3
Create a oscar_get_ui_info_string() function that looks up a value in the
Mark Doliner <mark@kingant.net>
parents:
27475
diff
changeset
|
849 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15823 | 850 purple_notify_warning(pos->gc, NULL, |
15383
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:
15374
diff
changeset
|
851 _("Unable to get a valid AIM login hash."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 buf); |
15823 | 853 purple_input_remove(pos->inpa); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 close(pos->fd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
858 if (read(pos->fd, m, 16) != 16) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 { |
15823 | 860 purple_debug_warning("oscar", "Could not read full AIM login hash " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 "from " AIMHASHDATA "--that's bad.\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 m[16] = '\0'; |
23777
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23776
diff
changeset
|
864 |
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23776
diff
changeset
|
865 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:
23776
diff
changeset
|
866 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:
23776
diff
changeset
|
867 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:
23776
diff
changeset
|
868 g_string_append(msg, "\n"); |
24398
0320b4a33432
Backport the 'purple_debug_*(msg)' -> 'purple_debug_*("%s", msg);' fixes.
Richard Laager <rlaager@wiktel.com>
parents:
24393
diff
changeset
|
869 purple_debug_misc("oscar", "%s", msg->str); |
23777
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23776
diff
changeset
|
870 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:
23776
diff
changeset
|
871 |
15823 | 872 purple_input_remove(pos->inpa); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 close(pos->fd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 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
|
875 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
876 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 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
|
880 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
881 struct pieceofcrap *pos = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
882 gchar *buf; |
22551
c65c96e231b5
Printf warning fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22475
diff
changeset
|
883 gssize result; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 pos->fd = source; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
887 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
|
888 buf = g_strdup_printf(_("You may be disconnected shortly. " |
27459
714f9352e844
Change these two strings to match another one. total_number_of_strings--
Mark Doliner <mark@kingant.net>
parents:
27440
diff
changeset
|
889 "If so, check %s for updates."), |
27504
4f24d5da4cb3
Create a oscar_get_ui_info_string() function that looks up a value in the
Mark Doliner <mark@kingant.net>
parents:
27475
diff
changeset
|
890 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15823 | 891 purple_notify_warning(pos->gc, NULL, |
15383
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:
15374
diff
changeset
|
892 _("Unable to get a valid AIM login hash."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 g_free(pos->modname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 g_free(pos); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
897 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 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
|
901 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
|
902 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
|
903 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
|
904 if (result < 0) |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
905 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
|
906 " 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
|
907 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
|
908 else |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
909 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
|
910 G_GSIZE_FORMAT " bytes to fetch AIM hash data but " |
22551
c65c96e231b5
Printf warning fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22475
diff
changeset
|
911 "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
|
912 strlen(buf), result); |
32992e2526e4
More of ticket #1344 from o_sukhodolsky, which rlaager has been
Mark Doliner <mark@kingant.net>
parents:
22063
diff
changeset
|
913 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 g_free(pos->modname); |
15823 | 916 pos->inpa = purple_input_add(pos->fd, PURPLE_INPUT_READ, damn_you, pos); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 /* 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
|
921 #define AIM_MAX_FILE_SIZE 98304 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
922 |
27225
454d46e9cbb7
Make a function static and add two comments
Mark Doliner <mark@kingant.net>
parents:
27219
diff
changeset
|
923 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:
27219
diff
changeset
|
924 { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 struct pieceofcrap *pos; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 guint32 offset, len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
928 char *modname; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
931 offset = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 len = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 modname = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
934 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
935 |
15823 | 936 purple_debug_misc("oscar", "offset: %u, len: %u, file: %s\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 offset, len, (modname ? modname : "aim.exe")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 if (len == 0) { |
15823 | 940 purple_debug_misc("oscar", "len is 0, hashing NULL\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 aim_sendmemblock(od, conn, offset, len, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 AIM_SENDMEMBLOCK_FLAG_ISREQUEST); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 } |
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 pos = g_new0(struct pieceofcrap, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 pos->gc = od->gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 pos->conn = conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 pos->offset = offset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 pos->len = len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 pos->modname = g_strdup(modname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
953 |
27200
a9899d234dfa
Pass the handle in here, which causes the connection attempt to be
Mark Doliner <mark@kingant.net>
parents:
27180
diff
changeset
|
954 if (purple_proxy_connect(pos->gc, pos->gc->account, "pidgin.im", 80, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 straight_to_hell, pos) == NULL) |
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 char buf[256]; |
17673
3d035cdd103b
Add some notes about why Yahoo! web messenger login doesn't work
Mark Doliner <mark@kingant.net>
parents:
17446
diff
changeset
|
958 g_free(pos->modname); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 g_free(pos); |
23404
c6b29adc22d1
Added "website" and "dev_website" items to the ui_info GHashTable,
Evan Schoenberg <evan.s@dreskin.net>
parents:
23401
diff
changeset
|
960 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
961 g_snprintf(buf, sizeof(buf), _("You may be disconnected shortly. " |
27459
714f9352e844
Change these two strings to match another one. total_number_of_strings--
Mark Doliner <mark@kingant.net>
parents:
27440
diff
changeset
|
962 "If so, check %s for updates."), |
27504
4f24d5da4cb3
Create a oscar_get_ui_info_string() function that looks up a value in the
Mark Doliner <mark@kingant.net>
parents:
27475
diff
changeset
|
963 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
15823 | 964 purple_notify_warning(pos->gc, NULL, |
15383
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:
15374
diff
changeset
|
965 _("Unable to get a valid login hash."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
967 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
968 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
969 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
971 |
28884
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
972 int oscar_connect_to_bos(PurpleConnection *gc, OscarData *od, const char *host, guint16 port, guint8 *cookie, guint16 cookielen, const char *tls_certname) |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
973 { |
28884
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
974 PurpleAccount *account; |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
975 FlapConnection *conn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
976 |
28884
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
977 account = purple_connection_get_account(gc); |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
978 |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
979 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:
27242
diff
changeset
|
980 conn->cookielen = cookielen; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
981 conn->cookie = g_memdup(cookie, cookielen); |
28884
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
982 |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
983 /* |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
984 * Use SSL only if the server provided us with a tls_certname. The server might not specify a tls_certname even if we requested to use TLS, |
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
985 * and that is something we should be prepared to. |
28884
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
986 */ |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
987 if (tls_certname) |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
988 { |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
989 conn->gsc = purple_ssl_connect_with_ssl_cn(account, host, port, |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
990 ssl_connection_established_cb, ssl_connection_error_cb, |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
991 tls_certname, conn); |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
992 } |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
993 else |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
994 { |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
995 conn->connect_data = purple_proxy_connect(NULL, |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
996 account, host, port, |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
997 connection_established_cb, conn); |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
998 } |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
999 |
17617d892bc4
oscar: Properly support TLS when using clientLogin.
Paul Aurich <paul@darkrain42.org>
parents:
28881
diff
changeset
|
1000 if (conn->gsc == NULL && conn->connect_data == NULL) |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1001 { |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
1002 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1003 return 0; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1004 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1005 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1006 od->default_port = port; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1007 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1008 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:
27242
diff
changeset
|
1009 ck[3] = 0x64; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1010 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1011 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1012 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1013 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1014 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1015 * 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:
27242
diff
changeset
|
1016 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1017 static int |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1018 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:
27242
diff
changeset
|
1019 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1020 PurpleConnection *gc = od->gc; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1021 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:
27242
diff
changeset
|
1022 char *host; int port; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1023 int i; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1024 FlapConnection *newconn; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1025 va_list ap; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1026 struct aim_authresp_info *info; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1027 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1028 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:
27242
diff
changeset
|
1029 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1030 va_start(ap, fr); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1031 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:
27242
diff
changeset
|
1032 va_end(ap); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1033 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1034 purple_debug_info("oscar", |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1035 "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:
27242
diff
changeset
|
1036 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1037 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:
27242
diff
changeset
|
1038 char buf[256]; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1039 switch (info->errorcode) { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1040 case 0x01: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1041 /* Unregistered username */ |
27360
979031db48c1
Slightly better error messages
Mark Doliner <mark@kingant.net>
parents:
27319
diff
changeset
|
1042 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_INVALID_USERNAME, _("Username does not exist")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1043 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1044 case 0x05: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1045 /* Incorrect password */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1046 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:
27242
diff
changeset
|
1047 purple_account_set_password(account, NULL); |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
1048 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Incorrect password")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1049 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1050 case 0x11: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1051 /* Suspended account */ |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
1052 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Your account is currently suspended")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1053 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1054 case 0x02: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1055 case 0x14: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1056 /* service temporarily unavailable */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1057 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:
27242
diff
changeset
|
1058 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1059 case 0x18: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1060 /* username connecting too frequently */ |
28861
807c73d10f7e
oscar: Differentiate the two rate-limiting login errors.
aman@tmm1.net
parents:
28860
diff
changeset
|
1061 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Your username has been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1062 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1063 case 0x1c: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1064 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1065 /* client too old */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1066 g_snprintf(buf, sizeof(buf), _("The client version you are using is too old. Please upgrade at %s"), |
27504
4f24d5da4cb3
Create a oscar_get_ui_info_string() function that looks up a value in the
Mark Doliner <mark@kingant.net>
parents:
27475
diff
changeset
|
1067 oscar_get_ui_info_string("website", PURPLE_WEBSITE)); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1068 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:
27242
diff
changeset
|
1069 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1070 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1071 case 0x1d: |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1072 /* IP address connecting too frequently */ |
28861
807c73d10f7e
oscar: Differentiate the two rate-limiting login errors.
aman@tmm1.net
parents:
28860
diff
changeset
|
1073 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("Your IP address has been connecting and disconnecting too frequently. Wait a minute and try again. If you continue to try, you will need to wait even longer.")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1074 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1075 default: |
27360
979031db48c1
Slightly better error messages
Mark Doliner <mark@kingant.net>
parents:
27319
diff
changeset
|
1076 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Unknown reason")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1077 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1078 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1079 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:
27242
diff
changeset
|
1080 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:
27242
diff
changeset
|
1081 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1082 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1083 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1084 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:
27242
diff
changeset
|
1085 "Email: %s\n" |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1086 "BOSIP: %s\n", |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1087 info->regstatus, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1088 info->email ? info->email : "null", |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1089 info->bosip ? info->bosip : "null"); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1090 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:
27242
diff
changeset
|
1091 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:
27242
diff
changeset
|
1092 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1093 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:
27242
diff
changeset
|
1094 if (info->bosip[i] == ':') { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1095 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:
27242
diff
changeset
|
1096 break; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1097 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1098 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1099 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:
27242
diff
changeset
|
1100 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:
27242
diff
changeset
|
1101 newconn->cookielen = info->cookielen; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1102 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:
27242
diff
changeset
|
1103 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1104 if (od->use_ssl) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1105 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1106 /* |
27631
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
1107 * 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:
27505
diff
changeset
|
1108 * 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:
27505
diff
changeset
|
1109 * certificate common name. |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1110 */ |
27631
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
1111 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:
27505
diff
changeset
|
1112 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:
27505
diff
changeset
|
1113 "bos.oscar.aol.com", newconn); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1114 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1115 else |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1116 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1117 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:
27242
diff
changeset
|
1118 connection_established_cb, newconn); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1119 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1120 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1121 g_free(host); |
27631
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
1122 if (newconn->gsc == NULL && newconn->connect_data == NULL) |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1123 { |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
1124 purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, _("Unable to connect")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1125 return 0; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1126 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1127 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1128 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:
27242
diff
changeset
|
1129 ck[3] = 0x64; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1130 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1131 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1132 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1133 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1134 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1135 * 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:
27242
diff
changeset
|
1136 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1137 static void |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1138 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:
27242
diff
changeset
|
1139 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1140 PurpleConnection *gc = user_data; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1141 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:
27242
diff
changeset
|
1142 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1143 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:
27242
diff
changeset
|
1144 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1145 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1146 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1147 * 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:
27242
diff
changeset
|
1148 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1149 static void |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1150 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:
27242
diff
changeset
|
1151 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1152 PurpleConnection *gc = user_data; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1153 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1154 /* Disconnect */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1155 purple_connection_error_reason(gc, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1156 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
1157 _("The SecurID key entered is invalid")); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1158 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1159 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1160 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1161 * 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:
27242
diff
changeset
|
1162 */ |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1163 static int |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1164 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:
27242
diff
changeset
|
1165 { |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1166 PurpleConnection *gc = od->gc; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1167 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:
27242
diff
changeset
|
1168 gchar *primary; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1169 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1170 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:
27242
diff
changeset
|
1171 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1172 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:
27242
diff
changeset
|
1173 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:
27242
diff
changeset
|
1174 _("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:
27242
diff
changeset
|
1175 FALSE, FALSE, NULL, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1176 _("_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:
27242
diff
changeset
|
1177 _("_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:
27242
diff
changeset
|
1178 account, NULL, NULL, |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1179 gc); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1180 g_free(primary); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1181 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1182 return 1; |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1183 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1184 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1185 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1186 * 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:
27242
diff
changeset
|
1187 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 static int |
15823 | 1189 purple_parse_login(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1190 { |
15823 | 1191 PurpleConnection *gc; |
1192 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
|
1193 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
|
1194 ClientInfo icqinfo = CLIENTINFO_PURPLE_ICQ; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1195 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 char *key; |
17236
c72295a65f7a
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <mark@kingant.net>
parents:
17170
diff
changeset
|
1197 gboolean truncate_pass; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 gc = od->gc; |
15823 | 1200 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1202 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 key = va_arg(ap, char *); |
17236
c72295a65f7a
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <mark@kingant.net>
parents:
17170
diff
changeset
|
1204 truncate_pass = va_arg(ap, int); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 |
15823 | 1207 aim_send_login(od, conn, purple_account_get_username(account), |
17236
c72295a65f7a
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <mark@kingant.net>
parents:
17170
diff
changeset
|
1208 purple_connection_get_password(gc), truncate_pass, |
23313
f1a0258b44f4
Added paramater to aim_send_login() to allow control over whether we want
Evan Schoenberg <evan.s@dreskin.net>
parents:
23272
diff
changeset
|
1209 od->icq ? &icqinfo : &aiminfo, key, |
23961
32bab3989963
Clean up some debugging to avoid potential NULL string printf.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23866
diff
changeset
|
1210 purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); |
15823 | 1211 |
1212 purple_connection_update_progress(gc, _("Password sent"), 2, OSCAR_CONNECT_STEPS); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1213 ck[2] = 0x6c; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1214 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1215 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1217 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1218 static int |
15823 | 1219 purple_handle_redirect(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1220 { |
15823 | 1221 PurpleConnection *gc = od->gc; |
1222 PurpleAccount *account = purple_connection_get_account(gc); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1223 char *host, *separator; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1224 int port; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1225 FlapConnection *newconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1226 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1227 struct aim_redirect_data *redir; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1230 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
|
1231 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1232 |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
1233 port = od->default_port; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1234 separator = strchr(redir->ip, ':'); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 if (separator != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1236 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 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
|
1238 port = atoi(separator + 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1239 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 host = g_strdup(redir->ip); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 |
24652
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1243 /* |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1244 * 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:
24651
diff
changeset
|
1245 * 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:
24651
diff
changeset
|
1246 */ |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1247 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:
24651
diff
changeset
|
1248 redir->group == SNAC_FAMILY_BART)) |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1249 { |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1250 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:
24651
diff
changeset
|
1251 redir->group); |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1252 redir->use_ssl = 0; |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1253 } |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1254 |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1255 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:
24651
diff
changeset
|
1256 host, port, redir->group, |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1257 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:
24651
diff
changeset
|
1258 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 newconn = flap_connection_new(od, redir->group); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 newconn->cookielen = redir->cookielen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1261 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
|
1262 if (newconn->type == SNAC_FAMILY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 cc = g_new0(struct chat_connection, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 cc->conn = newconn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 cc->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 cc->name = g_strdup(redir->chat.room); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 cc->exchange = redir->chat.exchange; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 cc->instance = redir->chat.instance; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 cc->show = extract_name(redir->chat.room); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 newconn->new_conn_data = cc; |
15823 | 1273 purple_debug_info("oscar", "Connecting to chat room %s exchange %hu\n", cc->name, cc->exchange); |
1274 } | |
1275 | |
24652
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1276 |
d3f47707e260
Part 2 of the continuing effort to get OSCAR over SSL working.
Paul Aurich <paul@darkrain42.org>
parents:
24651
diff
changeset
|
1277 if (redir->use_ssl) |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
1278 { |
27631
bff61dad9a6b
Add purple_ssl_connect_with_ssl_cn, which takes a host to connect to
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
1279 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:
27505
diff
changeset
|
1280 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:
27505
diff
changeset
|
1281 redir->ssl_cert_cn, newconn); |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
1282 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
1283 else |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
1284 { |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
1285 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:
24615
diff
changeset
|
1286 connection_established_cb, newconn); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
1287 } |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
1288 |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
1289 if (newconn->gsc == NULL && newconn->connect_data == NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 flap_connection_schedule_destroy(newconn, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1292 OSCAR_DISCONNECT_COULD_NOT_CONNECT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 _("Unable to initialize connection")); |
15823 | 1294 purple_debug_error("oscar", "Unable to connect to FLAP server " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 "of type 0x%04hx\n", redir->group); |
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 g_free(host); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1298 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1299 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1301 |
23621
a73d527731ff
To decrease the odds of hitting the rate limit ceiling rapidly on a
Evan Schoenberg <evan.s@dreskin.net>
parents:
23438
diff
changeset
|
1302 |
15823 | 1303 static int purple_parse_oncoming(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 { |
15823 | 1305 PurpleConnection *gc; |
1306 PurpleAccount *account; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 struct buddyinfo *bi; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 time_t time_idle = 0, signon = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 int type = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 gboolean buddy_is_away = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 const char *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 aim_userinfo_t *info; |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
1314 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:
25024
diff
changeset
|
1315 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:
25024
diff
changeset
|
1316 char *tmp; |
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
1317 const char *tmp2; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1318 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 gc = od->gc; |
15823 | 1320 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 va_end(ap); |
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 g_return_val_if_fail(info != NULL, 1); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1327 g_return_val_if_fail(info->bn != NULL, 1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 |
28345
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1329 /* |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1330 * If this is an AIM buddy and their name has formatting, set their |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1331 * server alias. |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1332 */ |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1333 if (!oscar_util_valid_name_icq(info->bn)) { |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1334 gboolean bn_has_formatting = FALSE; |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1335 char *c; |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1336 for (c = info->bn; *c != '\0'; c++) { |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1337 if (!islower(*c)) { |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1338 bn_has_formatting = TRUE; |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1339 break; |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1340 } |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1341 } |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1342 serv_got_alias(gc, info->bn, |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1343 bn_has_formatting ? info->bn : NULL); |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1344 } |
de7bbdcb695b
Stop attempting to fetch oscar buddy info automatically for people on our
Mark Doliner <mark@kingant.net>
parents:
27631
diff
changeset
|
1345 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 if (info->present & AIM_USERINFO_PRESENT_FLAGS) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 if (info->flags & AIM_FLAG_AWAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 buddy_is_away = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 type = info->icqinfo.status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 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
|
1353 (info->icqinfo.status != AIM_ICQ_STATE_NORMAL)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 buddy_is_away = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1357 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1358 if (oscar_util_valid_name_icq(info->bn)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 if (type & AIM_ICQ_STATE_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 status_id = OSCAR_STATUS_ID_FREE4CHAT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 else if (type & AIM_ICQ_STATE_DND) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 status_id = OSCAR_STATUS_ID_DND; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 else if (type & AIM_ICQ_STATE_OUT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 status_id = OSCAR_STATUS_ID_NA; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 else if (type & AIM_ICQ_STATE_BUSY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 status_id = OSCAR_STATUS_ID_OCCUPIED; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 else if (type & AIM_ICQ_STATE_AWAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 status_id = OSCAR_STATUS_ID_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 else if (type & AIM_ICQ_STATE_INVISIBLE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 status_id = OSCAR_STATUS_ID_INVISIBLE; |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1371 else if (type & AIM_ICQ_STATE_EVIL) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1372 status_id = OSCAR_STATUS_ID_EVIL; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1373 else if (type & AIM_ICQ_STATE_DEPRESSION) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1374 status_id = OSCAR_STATUS_ID_DEPRESSION; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1375 else if (type & AIM_ICQ_STATE_ATHOME) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1376 status_id = OSCAR_STATUS_ID_ATHOME; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1377 else if (type & AIM_ICQ_STATE_ATWORK) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1378 status_id = OSCAR_STATUS_ID_ATWORK; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1379 else if (type & AIM_ICQ_STATE_LUNCH) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1380 status_id = OSCAR_STATUS_ID_LUNCH; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 status_id = OSCAR_STATUS_ID_AVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 } else { |
22846
e8a66e79c49c
Show yourself as invisible in the buddylist when you're invisible
Mark Doliner <mark@kingant.net>
parents:
22839
diff
changeset
|
1384 if (type & AIM_ICQ_STATE_INVISIBLE) |
e8a66e79c49c
Show yourself as invisible in the buddylist when you're invisible
Mark Doliner <mark@kingant.net>
parents:
22839
diff
changeset
|
1385 status_id = OSCAR_STATUS_ID_INVISIBLE; |
e8a66e79c49c
Show yourself as invisible in the buddylist when you're invisible
Mark Doliner <mark@kingant.net>
parents:
22839
diff
changeset
|
1386 else if (buddy_is_away) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1387 status_id = OSCAR_STATUS_ID_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1388 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1389 status_id = OSCAR_STATUS_ID_AVAILABLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1390 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1391 |
16805
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:
16776
diff
changeset
|
1392 if (info->flags & AIM_FLAG_WIRELESS) |
15524
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:
15463
diff
changeset
|
1393 { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1394 purple_prpl_got_user_status(account, info->bn, OSCAR_STATUS_ID_MOBILE, NULL); |
15524
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:
15463
diff
changeset
|
1395 } else { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1396 purple_prpl_got_user_status_deactive(account, info->bn, OSCAR_STATUS_ID_MOBILE); |
15524
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:
15463
diff
changeset
|
1397 } |
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:
15463
diff
changeset
|
1398 |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1399 if (info->status != NULL && info->status[0] != '\0') { |
25031
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1400 /* Grab the available message */ |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1401 message = oscar_encoding_to_utf8(info->status_encoding, info->status, info->status_len); |
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1402 } |
25031
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1403 |
27475
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27466
diff
changeset
|
1404 tmp2 = tmp = (message ? purple_markup_escape_text(message, -1) : NULL); |
25031
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1405 |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
1406 if (strcmp(status_id, OSCAR_STATUS_ID_AVAILABLE) == 0) { |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1407 if (info->itmsurl_encoding && info->itmsurl && info->itmsurl_len) { |
22129
dd51079b3d8c
Only try to set the itmsurl attribute for the available status. I'd
Mark Doliner <mark@kingant.net>
parents:
22128
diff
changeset
|
1408 /* Grab the iTunes Music Store URL */ |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1409 itmsurl = oscar_encoding_to_utf8(info->itmsurl_encoding, info->itmsurl, info->itmsurl_len); |
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1410 } |
23866
9b2c273d764d
Fix printf of a NULL string and also an invalid free. Fixes #6627
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23839
diff
changeset
|
1411 |
9b2c273d764d
Fix printf of a NULL string and also an invalid free. Fixes #6627
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23839
diff
changeset
|
1412 if (tmp2 == NULL && itmsurl != NULL) |
25031
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1413 /* |
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1414 * The message can't be NULL because NULL means it was the |
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1415 * last attribute, so the itmsurl would get ignored below. |
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1416 */ |
23866
9b2c273d764d
Fix printf of a NULL string and also an invalid free. Fixes #6627
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23839
diff
changeset
|
1417 tmp2 = ""; |
23340
c80746c7c96c
* Avoid called g_markup_escape_text() on a NULL message
Evan Schoenberg <evan.s@dreskin.net>
parents:
23339
diff
changeset
|
1418 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1419 purple_prpl_got_user_status(account, info->bn, status_id, |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
1420 "message", tmp2, "itmsurl", itmsurl, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1422 else |
25438
4b8c4870b13a
propagate from branch 'im.pidgin.pidgin.next.minor' (head 7305b29db7bd00d3261f348c71674c93aa31b327)
Elliott Sales de Andrade <qulogic@pidgin.im>
diff
changeset
|
1423 purple_prpl_got_user_status(account, info->bn, status_id, "message", tmp2, NULL); |
25031
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1424 |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
1425 g_free(tmp); |
25031
3cace6a9a28f
Minor formatting and comments
Mark Doliner <mark@kingant.net>
parents:
25028
diff
changeset
|
1426 |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
1427 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:
25024
diff
changeset
|
1428 g_free(itmsurl); |
15623 | 1429 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1430 /* Login time stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1431 if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 signon = info->onlinesince; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1433 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
|
1434 signon = time(NULL) - info->sessionlen; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1435 purple_prpl_got_user_login_time(account, info->bn, signon); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1436 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1437 /* Idle time stuff */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1438 /* 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
|
1439 if (info->present & AIM_USERINFO_PRESENT_IDLE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1440 time_idle = time(NULL) - info->idletime * 60; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1441 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1442 if (time_idle > 0) |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1443 purple_prpl_got_user_idle(account, info->bn, TRUE, time_idle); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1444 else |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1445 purple_prpl_got_user_idle(account, info->bn, FALSE, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1446 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1447 /* Server stored icon stuff */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1448 bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, info->bn)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1449 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1450 bi = g_new0(struct buddyinfo, 1); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1451 g_hash_table_insert(od->buddyinfo, g_strdup(purple_normalize(account, info->bn)), bi); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1452 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1453 bi->typingnot = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1454 bi->ico_informed = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1455 bi->ipaddr = info->icqinfo.ipaddr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1456 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1457 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
|
1458 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
|
1459 char *b16 = NULL; |
15823 | 1460 PurpleBuddy *b = NULL; |
1461 | |
1462 b16 = purple_base16_encode(info->iconcsum, info->iconcsumlen); | |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1463 b = purple_find_buddy(account, info->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1464 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
|
1465 saved_b16 = purple_buddy_icons_get_checksum_for_user(b); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1466 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1467 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
|
1468 /* Invalidate the old icon for this user */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1469 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
|
1470 |
408c4bb03915
Invalidate old oscar icons when someone clears their icon.
Mark Doliner <mark@kingant.net>
parents:
20632
diff
changeset
|
1471 /* Fetch the new icon (if we're not already doing so) */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1472 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:
25415
diff
changeset
|
1473 (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
|
1474 { |
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
|
1475 od->requesticon = g_slist_prepend(od->requesticon, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1476 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
|
1477 purple_icons_fetch(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1478 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1479 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1480 g_free(b16); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1481 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1482 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1483 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1484 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1485 |
15823 | 1486 static void purple_check_comment(OscarData *od, const char *str) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1487 if ((str == NULL) || strcmp(str, (const char *)ck)) |
15823 | 1488 aim_locate_setcaps(od, purple_caps); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1489 else |
15823 | 1490 aim_locate_setcaps(od, purple_caps | OSCAR_CAPABILITY_SECUREIM); |
1491 } | |
1492 | |
1493 static int purple_parse_offgoing(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { | |
1494 PurpleConnection *gc = od->gc; | |
1495 PurpleAccount *account = purple_connection_get_account(gc); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1496 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1497 aim_userinfo_t *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1498 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1499 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1500 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1501 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1502 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1503 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:
25415
diff
changeset
|
1504 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:
25415
diff
changeset
|
1505 g_hash_table_remove(od->buddyinfo, purple_normalize(gc->account, info->bn)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1506 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1507 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1508 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1509 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1510 static int incomingim_chan1(OscarData *od, FlapConnection *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) { |
15823 | 1511 PurpleConnection *gc = od->gc; |
1512 PurpleAccount *account = purple_connection_get_account(gc); | |
1513 PurpleMessageFlags flags = 0; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1514 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
|
1515 PurpleStoredImage *img; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1516 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1517 const char *start, *end; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1518 GData *attribs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1519 |
30824
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30823
diff
changeset
|
1520 purple_debug_misc("oscar", "Received IM from %s\n", userinfo->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1521 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1522 bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, userinfo->bn)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1523 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1524 bi = g_new0(struct buddyinfo, 1); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1525 g_hash_table_insert(od->buddyinfo, g_strdup(purple_normalize(account, userinfo->bn)), bi); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1526 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1527 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1528 if (args->icbmflags & AIM_IMFLAGS_AWAY) |
15823 | 1529 flags |= PURPLE_MESSAGE_AUTO_RESP; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1530 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1531 if (args->icbmflags & AIM_IMFLAGS_TYPINGNOT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1532 bi->typingnot = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1533 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1534 bi->typingnot = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1535 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1536 if ((args->icbmflags & AIM_IMFLAGS_HASICON) && (args->iconlen) && (args->iconsum) && (args->iconstamp)) { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1537 purple_debug_misc("oscar", "%s has an icon\n", userinfo->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1538 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
|
1539 bi->ico_need = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1540 bi->ico_len = args->iconlen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1541 bi->ico_csum = args->iconsum; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1542 bi->ico_time = args->iconstamp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1543 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1544 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1545 |
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
|
1546 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
|
1547 if ((img != NULL) && |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1548 (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
|
1549 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
|
1550 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
|
1551 purple_debug_info("oscar", |
22475
3225c99785b8
Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <mark@kingant.net>
parents:
22457
diff
changeset
|
1552 "Sending buddy icon to %s (%" G_GSIZE_FORMAT " bytes)\n", |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1553 userinfo->bn, len); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1554 aim_im_sendch2_icon(od, userinfo->bn, data, len, |
16621
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
1555 purple_buddy_icons_get_account_icon_timestamp(account), |
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
1556 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
|
1557 } |
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
|
1558 purple_imgstore_unref(img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1559 |
30824
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30823
diff
changeset
|
1560 tmp = g_strdup(args->msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1561 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1562 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1563 * 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
|
1564 */ |
15823 | 1565 if (purple_markup_find_tag("body", tmp, &start, &end, &attribs)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1566 { |
29050
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1567 int len; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1568 char *tmp2, *body; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1569 const char *ichattextcolor, *ichatballooncolor; |
29050
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1570 const char *slash_body_start, *slash_body_end = NULL; /* </body> */ |
28449
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1571 GData *unused; |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1572 |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1573 /* |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1574 * Find the ending </body> so we can strip off the outer <html/> |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1575 * and <body/> |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1576 */ |
29050
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1577 if (purple_markup_find_tag("/body", end + 1, &slash_body_start, &slash_body_end, &unused)) |
28449
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1578 { |
29050
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1579 body = g_strndup(start, slash_body_end - start + 1); |
28449
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1580 g_datalist_clear(&unused); |
7a211be81a6b
Strip off the outer <html> and <body> from iChat messages. Should Fix #9968.
Paul Aurich <paul@darkrain42.org>
parents:
28350
diff
changeset
|
1581 } |
29050
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1582 else |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1583 { |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1584 purple_debug_warning("oscar", "Broken message contains <body> but not </body>!\n"); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1585 /* Take everything after <body> */ |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1586 body = g_strdup(start); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1587 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1588 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1589 ichattextcolor = g_datalist_get_data(&attribs, "ichattextcolor"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1590 if (ichattextcolor != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1591 { |
29050
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1592 tmp2 = g_strdup_printf("<font color=\"%s\">%s</font>", ichattextcolor, body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1593 g_free(body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1594 body = tmp2; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1595 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1596 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1597 ichatballooncolor = g_datalist_get_data(&attribs, "ichatballooncolor"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1598 if (ichatballooncolor != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1599 { |
29050
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1600 tmp2 = g_strdup_printf("<font back=\"%s\">%s</font>", ichatballooncolor, body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1601 g_free(body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1602 body = tmp2; |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1605 g_datalist_clear(&attribs); |
29050
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1606 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1607 len = start - tmp; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1608 tmp2 = g_strdup_printf("%.*s%s%s", len, tmp, body, slash_body_end ? slash_body_end + 1: "</body>"); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1609 g_free(tmp); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1610 g_free(body); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1611 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1612 tmp = tmp2; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1613 } |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1614 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1615 /* |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1616 * Are there <html/> surrounding tags? If so, strip them out, too. |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1617 */ |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1618 if (purple_markup_find_tag("html", tmp, &start, &end, &attribs)) |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1619 { |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1620 gchar *tmp2; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1621 int len; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1622 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1623 g_datalist_clear(&attribs); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1624 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1625 len = start - tmp; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1626 tmp2 = g_strdup_printf("%.*s%s", len, tmp, end + 1); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1627 g_free(tmp); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1628 tmp = tmp2; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1629 } |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1630 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1631 if (purple_markup_find_tag("/html", tmp, &start, &end, &attribs)) |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1632 { |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1633 gchar *tmp2; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1634 int len; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1635 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1636 g_datalist_clear(&attribs); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1637 |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1638 len = start - tmp; |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1639 tmp2 = g_strdup_printf("%.*s%s", len, tmp, end + 1); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1640 g_free(tmp); |
ce29013a5f3a
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
Paul Aurich <paul@darkrain42.org>
parents:
29001
diff
changeset
|
1641 tmp = tmp2; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1642 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1643 |
30824
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30823
diff
changeset
|
1644 serv_got_im(gc, userinfo->bn, tmp, flags, (args->icbmflags & AIM_IMFLAGS_OFFLINE) ? args->timestamp : time(NULL)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1645 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1646 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1647 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1648 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1649 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1650 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1651 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
|
1652 { |
15823 | 1653 PurpleConnection *gc; |
1654 PurpleAccount *account; | |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1655 PurpleMessageFlags flags = 0; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1656 char *message = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1657 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1658 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
|
1659 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
|
1660 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1661 gc = od->gc; |
15823 | 1662 account = purple_connection_get_account(gc); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
1663 od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1664 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1665 if (args == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1666 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1667 |
30008
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
30007
diff
changeset
|
1668 purple_debug_misc("oscar", "Incoming rendezvous message of type %" |
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
30007
diff
changeset
|
1669 G_GUINT64_FORMAT ", user %s, status %hu\n", |
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
30007
diff
changeset
|
1670 args->type, userinfo->bn, args->status); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1671 |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1672 if (args->msg != NULL) { |
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1673 message = oscar_encoding_to_utf8(args->encoding, args->msg, args->msglen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1674 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1675 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1676 if (args->type & OSCAR_CAPABILITY_CHAT) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1677 { |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1678 char *utf8name, *tmp; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1679 GHashTable *components; |
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 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
|
1682 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1683 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1684 } |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1685 utf8name = oscar_encoding_to_utf8(args->encoding, args->info.chat.roominfo.name, args->info.chat.roominfo.namelen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1686 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1687 tmp = extract_name(utf8name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1688 if (tmp != NULL) |
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 g_free(utf8name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1691 utf8name = tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1692 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1693 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1694 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
|
1695 g_free); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1696 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
|
1697 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
|
1698 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
|
1699 serv_got_chat_invite(gc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1700 utf8name, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1701 userinfo->bn, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1702 message, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1703 components); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1704 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1705 |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1706 else if ((args->type & OSCAR_CAPABILITY_SENDFILE) || (args->type & OSCAR_CAPABILITY_DIRECTIM)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1707 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1708 if (args->status == AIM_RENDEZVOUS_PROPOSE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1709 { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1710 peer_connection_got_proposition(od, userinfo->bn, message, args); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1711 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1712 else if (args->status == AIM_RENDEZVOUS_CANCEL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1713 { |
30865
1cdae196aac8
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30837
diff
changeset
|
1714 /* The other user cancelled a peer request */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1715 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1716 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1717 conn = peer_connection_find_by_cookie(od, userinfo->bn, args->cookie); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1718 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1719 * 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
|
1720 * 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
|
1721 * do something malicious. |
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 if (conn != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1724 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1725 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
|
1726 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1727 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1728 else if (args->status == AIM_RENDEZVOUS_CONNECTED) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1729 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1730 /* |
19686
b199a9be3e95
Start watching the listener socket immediately after it's created
Mark Doliner <mark@kingant.net>
parents:
19680
diff
changeset
|
1731 * 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:
19680
diff
changeset
|
1732 * 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:
19680
diff
changeset
|
1733 * args->cookie, but we don't need to do anything here. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1734 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1735 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1736 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1737 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1738 else if (args->type & OSCAR_CAPABILITY_GETFILE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1739 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1740 } |
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 else if (args->type & OSCAR_CAPABILITY_TALK) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1743 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1744 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1746 else if (args->type & OSCAR_CAPABILITY_BUDDYICON) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1748 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
|
1749 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
|
1750 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
|
1751 NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1754 else if (args->type & OSCAR_CAPABILITY_ICQSERVERRELAY) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1755 { |
29818
2c95b7c57ebb
Fix up the X-Status code in many ways:
Richard Laager <rlaager@wiktel.com>
parents:
29814
diff
changeset
|
1756 purple_debug_info("oscar", "Got an ICQ Server Relay message of " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 "type %d\n", args->info.rtfmsg.msgtype); |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
1758 |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1759 if (args->info.rtfmsg.msgtype == 1) { |
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1760 if (args->info.rtfmsg.msg != NULL) { |
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1761 char *rtfmsg = oscar_encoding_to_utf8(args->encoding, args->info.rtfmsg.msg, strlen(args->info.rtfmsg.msg)); |
30831
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1762 char *tmp, *tmp2; |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1763 |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1764 /* Channel 2 messages are supposed to be plain-text (never mind the name "rtfmsg", even |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1765 * the official client doesn't parse them as RTF). Therefore, we should escape them before |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1766 * showing to the user. */ |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1767 tmp = g_markup_escape_text(rtfmsg, -1); |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
1768 g_free(rtfmsg); |
30831
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1769 tmp2 = purple_strreplace(tmp, "\r\n", "<br>"); |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1770 g_free(tmp); |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1771 |
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1772 serv_got_im(gc, userinfo->bn, tmp2, flags, time(NULL)); |
30832
3eb2dd8a1cc7
Miranda expects a client ack from the other side for channel 2 messages,
ivan.komarov@soc.pidgin.im
parents:
30831
diff
changeset
|
1773 aim_im_send_icq_confirmation(od, userinfo->bn, args->cookie); |
30831
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
1774 g_free(tmp2); |
29818
2c95b7c57ebb
Fix up the X-Status code in many ways:
Richard Laager <rlaager@wiktel.com>
parents:
29814
diff
changeset
|
1775 } |
30656
a47346a46cb7
*** Plucked rev 1e62e7c65758de7e0aaa5377f865d4164e4482f5 (ivan.komarov@soc.pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
30571
diff
changeset
|
1776 } else if (args->info.rtfmsg.msgtype == 26) { |
30010
80933c92c080
Move a debug message. I'm assuming it's supposed to be related to this
Mark Doliner <mark@kingant.net>
parents:
30009
diff
changeset
|
1777 purple_debug_info("oscar", "Sending X-Status Reply\n"); |
30009
8d4bed3021dc
Fix some problems in the oscar code that deals with channel 2 icbms.
Mark Doliner <mark@kingant.net>
parents:
30008
diff
changeset
|
1778 icq_relay_xstatus(od, userinfo->bn, args->cookie); |
30656
a47346a46cb7
*** Plucked rev 1e62e7c65758de7e0aaa5377f865d4164e4482f5 (ivan.komarov@soc.pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
30571
diff
changeset
|
1779 } |
15374
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 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 { |
30008
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
30007
diff
changeset
|
1783 purple_debug_error("oscar", "Unknown request class %" |
59f4012b2b94
Found a few more places that need to use 64 bit value for the capabilities
Mark Doliner <mark@kingant.net>
parents:
30007
diff
changeset
|
1784 G_GUINT64_FORMAT "\n", args->type); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1786 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1789 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1790 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1791 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 /* When someone sends you buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1793 static void |
15823 | 1794 purple_icq_buddyadd(struct name_data *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1795 { |
15823 | 1796 PurpleConnection *gc = data->gc; |
1797 | |
1798 purple_blist_request_add_buddy(purple_connection_get_account(gc), data->name, NULL, data->nick); | |
15374
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 oscar_free_name_data(data); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1803 static int |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1804 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
|
1805 { |
15823 | 1806 PurpleConnection *gc = od->gc; |
1807 PurpleAccount *account = purple_connection_get_account(gc); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1808 gchar **msg1, **msg2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1809 int i, numtoks; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1810 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1811 if (!args->type || !args->msg || !args->uin) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1812 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1813 |
15823 | 1814 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1815 "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
|
1816 args->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1817 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1818 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1819 * 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
|
1820 * 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
|
1821 * 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
|
1822 * 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
|
1823 * 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
|
1824 * 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
|
1825 * most 1 baby string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1826 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1827 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
|
1828 for (numtoks=0; msg1[numtoks]; numtoks++); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1829 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
|
1830 for (i=0; msg1[i]; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1831 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
|
1832 |
15823 | 1833 purple_str_strip_char(msg1[i], '\r'); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1834 /* TODO: Should use an encoding other than ASCII? */ |
30824
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30823
diff
changeset
|
1835 msg2[i] = oscar_decode_im(account, uin, AIM_CHARSET_ASCII, msg1[i], strlen(msg1[i])); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1836 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1837 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1838 msg2[i] = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1839 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 switch (args->type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1841 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
|
1842 if (i >= 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1843 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
|
1844 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 /* 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
|
1847 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
|
1848 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 if (t) { /* This is an offline message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 /* 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
|
1851 #ifdef HAVE_TM_GMTOFF |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1852 time_t now; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 struct tm *tm; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 now = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1855 tm = localtime(&now); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1856 t += tm->tm_gmtoff; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1857 #else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1858 # ifdef HAVE_TIMEZONE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1859 tzset(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 t -= timezone; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1861 # endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1863 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
|
1864 } 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
|
1865 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
|
1866 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1867 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1870 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1871 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1872 case 0x04: { /* Someone sent you a URL */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1873 if (i >= 2) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1874 if (msg2[1] != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1875 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
|
1876 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
|
1877 msg2[1], |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 (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
|
1879 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
|
1880 g_free(uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 g_free(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1882 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1883 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1884 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1885 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 case 0x06: { /* Someone requested authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 if (i >= 6) { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
1888 gchar *bn = g_strdup_printf("%u", args->uin); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 gchar *reason = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1890 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1891 if (msg2[5] != NULL) |
30824
5661f30d1b8e
Got rid of receiving multipart messages over channel 1, which simplified the code
ivan.komarov@soc.pidgin.im
parents:
30823
diff
changeset
|
1892 reason = oscar_decode_im(account, bn, AIM_CHARSET_LATIN_1, msg2[5], strlen(msg2[5])); |
15823 | 1893 |
1894 purple_debug_info("oscar", | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1895 "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
|
1896 args->uin); |
30790
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30571
diff
changeset
|
1897 aim_icq_getalias(od, bn, TRUE, reason); |
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30571
diff
changeset
|
1898 g_free(bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1899 g_free(reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1900 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1901 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1902 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1903 case 0x07: { /* Someone has denied you authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1904 if (i >= 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1905 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.")); |
15823 | 1906 purple_notify_info(gc, NULL, _("ICQ authorization denied."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1907 dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1908 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1909 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1910 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1911 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1912 case 0x08: { /* Someone has granted you authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1913 gchar *dialog_msg = g_strdup_printf(_("The user %u has granted your request to add them to your buddy list."), args->uin); |
15823 | 1914 purple_notify_info(gc, NULL, "ICQ authorization accepted.", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1915 dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1916 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1917 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1918 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 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
|
1920 if (i >= 5) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1921 gchar *dialog_msg = g_strdup_printf(_("You have received a special message\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); |
15823 | 1922 purple_notify_info(gc, NULL, "ICQ Server Message", dialog_msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1923 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1924 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1925 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1926 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 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
|
1928 if (i >= 6) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1929 gchar *dialog_msg = g_strdup_printf(_("You have received an ICQ page\n\nFrom: %s [%s]\n%s"), msg2[0], msg2[3], msg2[5]); |
15823 | 1930 purple_notify_info(gc, NULL, "ICQ Page", dialog_msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1931 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1932 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1933 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1934 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1935 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
|
1936 if (i >= 6) { |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
1937 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:
22846
diff
changeset
|
1938 purple_notify_info(gc, NULL, "ICQ Email", dialog_msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1939 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1940 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1941 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1943 case 0x12: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 /* 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
|
1945 /* Someone added you to their buddy list? */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1946 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1948 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
|
1949 guint i, num; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 gchar **text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1951 text = g_strsplit(args->msg, "\376", 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 if (text) { |
28764
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1953 /* Read the number of contacts that we were sent */ |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1954 errno = 0; |
28860
d4c28c18c20a
Add a null check, just for the heck of it
Mark Doliner <mark@kingant.net>
parents:
28764
diff
changeset
|
1955 num = text[0] ? strtoul(text[0], NULL, 10) : 0; |
28764
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1956 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1957 if (num > 0 && errno == 0) { |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1958 for (i=0; i<num; i++) { |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1959 struct name_data *data; |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1960 gchar *message; |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1961 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1962 if (!text[i*2 + 1] || !text[i*2 + 2]) { |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1963 /* We're missing the contact name or nickname. Bail out. */ |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1964 gchar *tmp = g_strescape(args->msg, NULL); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1965 purple_debug_error("oscar", "Unknown syntax parsing " |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1966 "ICQ buddies. args->msg=%s\n", tmp); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1967 g_free(tmp); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1968 break; |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1969 } |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1970 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1971 message = g_strdup_printf(_("ICQ user %u has sent you a buddy: %s (%s)"), args->uin, text[i*2+2], text[i*2+1]); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1972 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1973 data = g_new(struct name_data, 1); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1974 data->gc = gc; |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1975 data->name = g_strdup(text[i*2+1]); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1976 data->nick = g_strdup(text[i*2+2]); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1977 |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1978 purple_request_action(gc, NULL, message, |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1979 _("Do you want to add this buddy " |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1980 "to your buddy list?"), |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1981 PURPLE_DEFAULT_ACTION_NONE, |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1982 purple_connection_get_account(gc), data->name, NULL, |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1983 data, 2, |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1984 _("_Add"), G_CALLBACK(purple_icq_buddyadd), |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1985 _("_Decline"), G_CALLBACK(oscar_free_name_data)); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1986 g_free(message); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1987 } |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1988 } else { |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1989 gchar *tmp = g_strescape(args->msg, NULL); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1990 purple_debug_error("oscar", "Unknown syntax parsing " |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1991 "ICQ buddies. args->msg=%s\n", tmp); |
63881771e1bf
Fix a remote-crash bug in ICQ (and probably AIM). It happens when the
Mark Doliner <mark@kingant.net>
parents:
28758
diff
changeset
|
1992 g_free(tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1993 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1994 g_strfreev(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1995 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1996 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1997 |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
1998 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
|
1999 ByteStream qbs; |
30779
605155d68812
Make these unsigned, in case someone figures out how to actually send
Mark Doliner <mark@kingant.net>
parents:
30703
diff
changeset
|
2000 guint16 smstype; |
605155d68812
Make these unsigned, in case someone figures out how to actually send
Mark Doliner <mark@kingant.net>
parents:
30703
diff
changeset
|
2001 guint32 taglen, smslen; |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2002 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
|
2003 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
|
2004 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
|
2005 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2006 /* 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
|
2007 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
|
2008 byte_stream_advance(&qbs, 21); |
27276
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27243
diff
changeset
|
2009 /* 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:
27243
diff
changeset
|
2010 /* 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 ... */ |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2011 smstype = byte_stream_getle16(&qbs); |
27276
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27243
diff
changeset
|
2012 if (smstype != 0) |
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27243
diff
changeset
|
2013 break; |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2014 taglen = byte_stream_getle32(&qbs); |
30703
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2015 if (taglen > 2000) { |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2016 /* Avoid trying to allocate large amounts of memory, in |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2017 case we get something unexpected. */ |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2018 break; |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2019 } |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2020 tagstr = byte_stream_getstr(&qbs, taglen); |
27276
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27243
diff
changeset
|
2021 if (tagstr == NULL) |
7f43d6779764
Apply [9bac0a540156fb1848eedd61c8630737dee752c7] here as well. I should
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27243
diff
changeset
|
2022 break; |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2023 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
|
2024 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
|
2025 smslen = byte_stream_getle32(&qbs); |
30703
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2026 if (smslen > 2000) { |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2027 /* Avoid trying to allocate large amounts of memory, in |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2028 case we get something unexpected. */ |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2029 g_free(tagstr); |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2030 break; |
5884388dfd06
Fix a crash bug in oscar related to trying to allocate too much memory.
Mark Doliner <mark@kingant.net>
parents:
30656
diff
changeset
|
2031 } |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2032 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
|
2033 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2034 /* 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
|
2035 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
|
2036 { |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2037 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
|
2038 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
|
2039 { |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2040 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
|
2041 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
|
2042 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
|
2043 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2044 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
|
2045 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
|
2046 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
|
2047 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2048 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
|
2049 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
|
2050 |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2051 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
|
2052 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
|
2053 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
|
2054 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2055 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
2056 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
|
2057 g_free(smsmsg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2058 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2059 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2060 default: { |
15823 | 2061 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2062 "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
|
2063 "(type 0x%02hhx).\n", args->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2064 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2065 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2066 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2067 g_strfreev(msg1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2068 g_strfreev(msg2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2069 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2070 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2071 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2072 |
15823 | 2073 static int purple_parse_incoming_im(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2074 guint16 channel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2075 int ret = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2076 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2077 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2078 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2079 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2080 channel = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2081 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2082 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 switch (channel) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 case 1: { /* standard message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 struct aim_incomingim_ch1_args *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2086 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
|
2087 ret = incomingim_chan1(od, conn, userinfo, args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2088 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2089 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2090 case 2: { /* rendezvous */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2091 IcbmArgsCh2 *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2092 args = va_arg(ap, IcbmArgsCh2 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2093 ret = incomingim_chan2(od, conn, userinfo, args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2094 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2096 case 4: { /* ICQ */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2097 struct aim_incomingim_ch4_args *args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2098 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
|
2099 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
|
2100 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2102 default: { |
15823 | 2103 purple_debug_warning("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2104 "ICBM received on unsupported channel (channel " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2105 "0x%04hx).", channel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2106 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2107 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2108 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2109 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2111 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2112 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2113 |
15823 | 2114 static int purple_parse_misses(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2115 PurpleConnection *gc = od->gc; | |
2116 PurpleAccount *account = purple_connection_get_account(gc); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2117 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 guint16 chan, nummissed, reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2120 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2121 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2122 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 chan = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2124 userinfo = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2125 nummissed = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2126 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2127 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2128 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2129 switch(reason) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2130 case 0: /* Invalid (0) */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2131 buf = g_strdup_printf( |
23269 | 2132 dngettext(PACKAGE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2133 "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
|
2134 "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
|
2135 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2136 nummissed, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2137 userinfo->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2138 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2139 case 1: /* Message too large */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2140 buf = g_strdup_printf( |
23269 | 2141 dngettext(PACKAGE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2142 "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
|
2143 "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
|
2144 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2145 nummissed, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2146 userinfo->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2147 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2148 case 2: /* Rate exceeded */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2149 buf = g_strdup_printf( |
23269 | 2150 dngettext(PACKAGE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2151 "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
|
2152 "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
|
2153 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2154 nummissed, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2155 userinfo->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2156 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2157 case 3: /* Evil Sender */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2158 buf = g_strdup_printf( |
23269 | 2159 dngettext(PACKAGE, |
23352
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23340
diff
changeset
|
2160 "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:
23340
diff
changeset
|
2161 "You missed %hu messages from %s because his/her warning level is too high.", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2162 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2163 nummissed, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2164 userinfo->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2165 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 case 4: /* Evil Receiver */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2167 buf = g_strdup_printf( |
23269 | 2168 dngettext(PACKAGE, |
23352
fa904782a934
No one has any idea what evil is (in bed)
Mark Doliner <mark@kingant.net>
parents:
23340
diff
changeset
|
2169 "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:
23340
diff
changeset
|
2170 "You missed %hu messages from %s because your warning level is too high.", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2171 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2172 nummissed, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2173 userinfo->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2175 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2176 buf = g_strdup_printf( |
23269 | 2177 dngettext(PACKAGE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 "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
|
2179 "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
|
2180 nummissed), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2181 nummissed, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2182 userinfo->bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2183 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2186 if (!purple_conv_present_error(userinfo->bn, account, buf)) |
15823 | 2187 purple_notify_error(od->gc, NULL, buf, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2190 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2191 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 static int |
15823 | 2194 purple_parse_clientauto_ch2(OscarData *od, const char *who, guint16 reason, const guchar *cookie) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2195 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2196 if (reason == 0x0003) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2198 /* Rendezvous was refused. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2199 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2200 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2201 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
|
2202 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2203 if (conn == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2204 { |
15823 | 2205 purple_debug_info("oscar", "Received a rendezvous cancel message " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2206 "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
|
2207 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2208 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2209 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2210 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
|
2211 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2212 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2213 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2214 { |
15823 | 2215 purple_debug_warning("oscar", "Received an unknown rendezvous " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2216 "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
|
2217 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2218 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2219 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2220 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2221 |
15823 | 2222 static int purple_parse_clientauto_ch4(OscarData *od, char *who, guint16 reason, guint32 state, char *msg) { |
2223 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2224 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2225 switch(reason) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2226 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
|
2227 char *statusmsg, **splitmsg; |
15823 | 2228 PurpleNotifyUserInfo *user_info; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2229 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2230 /* 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
|
2231 statusmsg = oscar_icqstatus(state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2232 splitmsg = g_strsplit(msg, "\r\n", 0); |
23269 | 2233 |
15823 | 2234 user_info = purple_notify_user_info_new(); |
23269 | 2235 |
15823 | 2236 purple_notify_user_info_add_pair(user_info, _("UIN"), who); |
2237 purple_notify_user_info_add_pair(user_info, _("Status"), statusmsg); | |
2238 purple_notify_user_info_add_section_break(user_info); | |
2239 purple_notify_user_info_add_pair(user_info, NULL, g_strjoinv("<BR>", splitmsg)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2240 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2241 g_free(statusmsg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2242 g_strfreev(splitmsg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2243 |
15823 | 2244 purple_notify_userinfo(gc, who, user_info, NULL, NULL); |
2245 purple_notify_user_info_destroy(user_info); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2246 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2247 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2248 |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2249 case 0x0006: { /* Reply from an ICQ status message request */ |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2250 char *statusmsg, **splitmsg; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2251 PurpleNotifyUserInfo *user_info; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2252 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2253 /* Split at (carriage return/newline)'s, then rejoin later with BRs between. */ |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2254 statusmsg = oscar_icqstatus(state); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2255 splitmsg = g_strsplit(msg, "\r\n", 0); |
30011 | 2256 |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2257 user_info = purple_notify_user_info_new(); |
30011 | 2258 |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2259 purple_notify_user_info_add_pair(user_info, _("UIN"), who); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2260 purple_notify_user_info_add_pair(user_info, _("Status"), statusmsg); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2261 purple_notify_user_info_add_section_break(user_info); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2262 purple_notify_user_info_add_pair(user_info, NULL, g_strjoinv("<BR>", splitmsg)); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2263 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2264 g_free(statusmsg); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2265 g_strfreev(splitmsg); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2266 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2267 purple_notify_userinfo(gc, who, user_info, NULL, NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2268 purple_notify_user_info_destroy(user_info); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2269 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
2270 } break; |
29851
5391094529c6
propagate from branch 'im.pidgin.pidgin' (head a59a573e3b9b2eb42ff728ba9ff56095f5c9e0d0)
Richard Laager <rlaager@wiktel.com>
diff
changeset
|
2271 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2272 default: { |
15823 | 2273 purple_debug_warning("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2274 "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
|
2275 "Type 0x%04hx\n", who, reason); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2276 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2277 } /* end of switch */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2278 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2279 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2280 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2281 |
15823 | 2282 static int purple_parse_clientauto(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2283 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2284 guint16 chan, reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2285 char *who; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2286 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2287 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2288 chan = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2289 who = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2290 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2291 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2292 if (chan == 0x0002) { /* File transfer declined */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2293 guchar *cookie = va_arg(ap, guchar *); |
15823 | 2294 return purple_parse_clientauto_ch2(od, who, reason, cookie); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2295 } else if (chan == 0x0004) { /* ICQ message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2296 guint32 state = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2297 char *msg = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2298 if (reason == 0x0003) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2299 state = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2300 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2301 } |
15823 | 2302 return purple_parse_clientauto_ch4(od, who, reason, state, msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2303 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2304 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2305 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2306 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2307 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2308 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2309 |
15823 | 2310 static int purple_parse_genericerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2311 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2312 guint16 reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2313 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2314 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2315 reason = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2316 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2317 |
30406
f18b6eb0ed02
Cleanup, basically. Move the icbm snac error handling from oscar.c to
Mark Doliner <mark@kingant.net>
parents:
30366
diff
changeset
|
2318 purple_debug_error("oscar", "snac threw error (reason 0x%04hx: %s)\n", |
f18b6eb0ed02
Cleanup, basically. Move the icbm snac error handling from oscar.c to
Mark Doliner <mark@kingant.net>
parents:
30366
diff
changeset
|
2319 reason, oscar_get_msgerr_reason(reason)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2320 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2321 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2322 |
15823 | 2323 static int purple_parse_mtn(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2324 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2325 va_list ap; |
28588
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2326 guint16 channel, event; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2327 char *bn; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2328 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2329 va_start(ap, fr); |
28588
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2330 channel = (guint16) va_arg(ap, unsigned int); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2331 bn = va_arg(ap, char *); |
28588
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2332 event = (guint16) va_arg(ap, unsigned int); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2333 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2334 |
28588
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2335 switch (event) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2336 case 0x0000: { /* Text has been cleared */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2337 serv_got_typing_stopped(gc, bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2338 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2339 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2340 case 0x0001: { /* Paused typing */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2341 serv_got_typing(gc, bn, 0, PURPLE_TYPED); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2342 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2343 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2344 case 0x0002: { /* Typing */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2345 serv_got_typing(gc, bn, 0, PURPLE_TYPING); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2346 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2347 |
28588
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2348 case 0x000f: { /* Closed IM window */ |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2349 serv_got_typing_stopped(gc, bn); |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2350 } break; |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2351 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2352 default: { |
28588
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2353 purple_debug_info("oscar", "Received unknown typing " |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2354 "notification message from %s. Channel is 0x%04x " |
8d5380556f12
Rename two variables based on insight from
Mark Doliner <mark@kingant.net>
parents:
28587
diff
changeset
|
2355 "and event is 0x%04hx.\n", bn, channel, event); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2356 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2357 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2358 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2359 return 1; |
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 |
15823 | 2362 static int purple_parse_motd(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15374
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 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2365 guint16 id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2366 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 id = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2371 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2372 |
15823 | 2373 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 "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
|
2375 if (id < 4) |
15823 | 2376 purple_notify_warning(od->gc, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2377 _("Your AIM connection may be lost."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2378 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2379 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2380 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2381 |
15823 | 2382 static int purple_chatnav_info(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2383 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 guint16 type; |
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 type = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2388 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2389 switch(type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2390 case 0x0002: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2391 guint8 maxrooms; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2392 struct aim_chat_exchangeinfo *exchanges; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2393 int exchangecount, i; |
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 maxrooms = (guint8) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 exchangecount = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 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
|
2398 |
15823 | 2399 purple_debug_misc("oscar", "chat info: Chat Rights:\n"); |
2400 purple_debug_misc("oscar", | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 "chat info: \tMax Concurrent Rooms: %hhd\n", maxrooms); |
15823 | 2402 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 "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
|
2404 for (i = 0; i < exchangecount; i++) |
15823 | 2405 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2406 "chat info: \t\t%hu %s\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 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
|
2408 while (od->create_rooms) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2409 struct create_room *cr = od->create_rooms->data; |
15823 | 2410 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2411 "creating room %s\n", cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2412 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
|
2413 g_free(cr->name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2414 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
|
2415 g_free(cr); |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2418 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2419 case 0x0008: { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2420 char *fqcn, *name, *ck; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2421 guint16 instance, flags, maxmsglen, maxoccupancy, unknown, exchange; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2422 guint8 createperms; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2423 guint32 createtime; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2424 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2425 fqcn = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2426 instance = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2427 exchange = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2428 flags = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2429 createtime = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2430 maxmsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2431 maxoccupancy = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2432 createperms = (guint8)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2433 unknown = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2434 name = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2435 ck = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2436 |
15823 | 2437 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2438 "created room: %s %hu %hu %hu %u %hu %hu %hhu %hu %s %s\n", |
29245
49f881831eb9
*** Plucked rev f39cd1fed08fe5f5e3165a087fcc36ed984a6eee (f05c54b03e6bbfdbff38c01697fbd353a969e05e):
Daniel Atallah <daniel.atallah@gmail.com>
parents:
29130
diff
changeset
|
2439 fqcn ? fqcn : "(null)", exchange, instance, flags, createtime, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2440 maxmsglen, maxoccupancy, createperms, unknown, |
29245
49f881831eb9
*** Plucked rev f39cd1fed08fe5f5e3165a087fcc36ed984a6eee (f05c54b03e6bbfdbff38c01697fbd353a969e05e):
Daniel Atallah <daniel.atallah@gmail.com>
parents:
29130
diff
changeset
|
2441 name ? name : "(null)", ck); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2442 aim_chat_join(od, exchange, ck, instance); |
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 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2445 default: |
15823 | 2446 purple_debug_warning("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2447 "chatnav info: unknown type (%04hx)\n", type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2448 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2449 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2450 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2451 va_end(ap); |
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 return 1; |
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 |
15823 | 2456 static int purple_conv_chat_join(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2457 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2458 int count, i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2459 aim_userinfo_t *info; |
15823 | 2460 PurpleConnection *gc = od->gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2461 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2462 struct chat_connection *c = NULL; |
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2465 count = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2466 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2467 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2468 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2469 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
|
2470 if (!c) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2471 return 1; |
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 for (i = 0; i < count; i++) |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2474 purple_conv_chat_add_user(PURPLE_CONV_CHAT(c->conv), info[i].bn, NULL, PURPLE_CBFLAGS_NONE, TRUE); |
15374
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 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2477 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2478 |
15823 | 2479 static int purple_conv_chat_leave(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2480 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2481 int count, i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2482 aim_userinfo_t *info; |
15823 | 2483 PurpleConnection *gc = od->gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2484 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2485 struct chat_connection *c = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2486 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2487 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2488 count = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2489 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2490 va_end(ap); |
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 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
|
2493 if (!c) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2494 return 1; |
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 for (i = 0; i < count; i++) |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2497 purple_conv_chat_remove_user(PURPLE_CONV_CHAT(c->conv), info[i].bn, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2498 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2499 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2500 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2501 |
15823 | 2502 static int purple_conv_chat_info_update(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2503 va_list ap; |
30821
88689cda97d8
Turns out that ncc doesn't catch everything, so continue killing things mercilessly.
ivan.komarov@soc.pidgin.im
parents:
30820
diff
changeset
|
2504 guint16 maxmsglen, maxvisiblemsglen; |
15823 | 2505 PurpleConnection *gc = od->gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2506 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
|
2507 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2508 if (!ccon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2509 return 1; |
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 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2512 maxmsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2513 maxvisiblemsglen = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2514 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2515 |
15823 | 2516 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2517 "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
|
2518 maxmsglen, maxvisiblemsglen); |
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 ccon->maxlen = maxmsglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2521 ccon->maxvis = maxvisiblemsglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2522 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2523 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2524 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2525 |
15823 | 2526 static int purple_conv_chat_incoming_msg(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2527 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2528 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
|
2529 gchar *utf8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2530 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2531 aim_userinfo_t *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2532 int len; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2533 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2534 char *charset; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2535 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2536 if (!ccon) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2537 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2538 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2539 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2540 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2541 len = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2542 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2543 charset = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2544 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2545 |
30819
ca90b6c27eb8
Refactored oscar_encoding_to_utf8().
ivan.komarov@soc.pidgin.im
parents:
30818
diff
changeset
|
2546 utf8 = oscar_encoding_to_utf8(charset, msg, len); |
29923
962bc012a504
This cast is incorrect. It should be (time_t *). But it's actually not needed.
Mark Doliner <mark@kingant.net>
parents:
29872
diff
changeset
|
2547 serv_got_chat_in(gc, ccon->id, info->bn, 0, utf8, time(NULL)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2548 g_free(utf8); |
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 return 1; |
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 |
15823 | 2553 static int purple_email_parseupdate(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2554 va_list ap; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2555 PurpleConnection *gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2556 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2557 struct aim_emailinfo *emailinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2558 int havenewmail; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2559 char *alertitle, *alerturl; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2560 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2561 gc = od->gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2562 account = purple_connection_get_account(gc); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2563 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2564 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2565 emailinfo = va_arg(ap, struct aim_emailinfo *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2566 havenewmail = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2567 alertitle = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2568 alerturl = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2569 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2570 |
27024
7957a5ed53bb
Re-add purple_account_get_check_mail() check to oscar.
Paul Aurich <paul@darkrain42.org>
parents:
26958
diff
changeset
|
2571 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:
26958
diff
changeset
|
2572 emailinfo->unread && havenewmail) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2573 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:
25416
diff
changeset
|
2574 purple_account_get_username(account), |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2575 emailinfo->domain ? "@" : "", |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2576 emailinfo->domain ? emailinfo->domain : ""); |
25891
2260e5b0ca91
*** Plucked rev f9080d0b (khc@pidgin.im):
Paul Aurich <paul@darkrain42.org>
parents:
25861
diff
changeset
|
2577 const char *tos[2] = { to }; |
26934
0b97f73fa3d2
correctly NULL terminate all the arrays since that's what gtknotify assumes,
Ka-Hing Cheung <khc@hxbc.us>
parents:
26846
diff
changeset
|
2578 const char *urls[2] = { emailinfo->url }; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2579 purple_notify_emails(gc, emailinfo->nummsgs, FALSE, NULL, NULL, |
26934
0b97f73fa3d2
correctly NULL terminate all the arrays since that's what gtknotify assumes,
Ka-Hing Cheung <khc@hxbc.us>
parents:
26846
diff
changeset
|
2580 tos, urls, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2581 g_free(to); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2582 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2583 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2584 if (alertitle) |
15823 | 2585 purple_debug_misc("oscar", "Got an alert '%s' %s\n", alertitle, alerturl ? alerturl : ""); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2586 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2587 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2588 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2589 |
15823 | 2590 static int purple_icon_parseicon(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2591 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2592 va_list ap; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2593 char *bn; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2594 guint8 iconcsumtype, *iconcsum, *icon; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2595 guint16 iconcsumlen, iconlen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2596 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2597 va_start(ap, fr); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2598 bn = va_arg(ap, char *); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2599 iconcsumtype = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2600 iconcsum = va_arg(ap, guint8 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2601 iconcsumlen = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2602 icon = va_arg(ap, guint8 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2603 iconlen = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2604 va_end(ap); |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2607 * 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
|
2608 * no icon is set. Ignore these. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2609 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2610 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
|
2611 char *b16 = purple_base16_encode(iconcsum, iconcsumlen); |
15823 | 2612 purple_buddy_icons_set_for_user(purple_connection_get_account(gc), |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2613 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
|
2614 g_free(b16); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2615 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2616 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2617 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2618 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2619 |
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
|
2620 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
|
2621 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
|
2622 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2623 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2624 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2625 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2626 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2627 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
|
2628 if (!conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2629 if (!od->iconconnecting) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2630 aim_srv_requestnew(od, SNAC_FAMILY_BART); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2631 od->iconconnecting = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2632 } |
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
|
2633 return; |
15374
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 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
|
2637 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
|
2638 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
|
2639 if (img == NULL) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2640 aim_ssi_delicon(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2641 } 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
|
2642 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
|
2643 "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
|
2644 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
|
2645 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
|
2646 purple_imgstore_unref(img); |
15374
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 od->set_icon = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2649 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2650 |
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
|
2651 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
|
2652 { |
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
|
2653 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
|
2654 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
|
2655 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
|
2656 |
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
|
2657 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
|
2658 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
|
2659 } |
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
|
2660 |
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
|
2661 purple_debug_misc("oscar", "no more icons to request\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2662 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2663 |
15823 | 2664 static int purple_selfinfo(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2665 int warning_level; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2666 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2667 aim_userinfo_t *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2668 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2669 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2670 info = va_arg(ap, aim_userinfo_t *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2671 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2672 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2673 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
|
2674 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2675 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2676 * What's with the + 0.5? |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2677 * 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
|
2678 * 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
|
2679 * 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
|
2680 * truncated. |
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 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
|
2683 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2684 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2685 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2686 |
15823 | 2687 static int purple_connerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2688 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2689 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2690 guint16 code; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2691 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2692 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2693 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2694 code = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2695 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2696 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2697 |
15823 | 2698 purple_debug_info("oscar", "Disconnected. Code is 0x%04x and msg is %s\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2699 code, (msg != NULL ? msg : "")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2700 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2701 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
|
2702 |
18609
2774acdb1cff
Move a call to purple_connection_error() from oscar.c to
Mark Doliner <mark@kingant.net>
parents:
18608
diff
changeset
|
2703 if (conn->type == SNAC_FAMILY_CHAT) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2704 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
|
2705 PurpleConversation *conv = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2706 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2707 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
|
2708 if (cc != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2709 { |
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
|
2710 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
|
2711 |
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
|
2712 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
|
2713 { |
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
|
2714 /* |
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
|
2715 * 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
|
2716 * 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
|
2717 * 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
|
2718 */ |
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
|
2719 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
|
2720 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
|
2721 "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
|
2722 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
|
2723 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
|
2724 } |
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
|
2725 oscar_chat_kill(gc, cc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2726 } |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2729 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2730 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2731 |
15823 | 2732 static int purple_parse_locaterights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2733 { |
15823 | 2734 PurpleConnection *gc = od->gc; |
2735 PurpleAccount *account = purple_connection_get_account(gc); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2736 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2737 guint16 maxsiglen; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2738 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2739 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2740 maxsiglen = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2741 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2742 |
15823 | 2743 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2744 "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
|
2745 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2746 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
|
2747 |
15823 | 2748 aim_locate_setcaps(od, purple_caps); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2749 oscar_set_info_and_status(account, TRUE, account->user_info, TRUE, |
15823 | 2750 purple_account_get_active_status(account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2751 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2752 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2753 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2754 |
15823 | 2755 static int purple_parse_buddyrights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2756 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2757 guint16 maxbuddies, maxwatchers; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2758 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2759 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2760 maxbuddies = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2761 maxwatchers = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2762 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2763 |
15823 | 2764 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2765 "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
|
2766 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2767 od->rights.maxbuddies = (guint)maxbuddies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2768 od->rights.maxwatchers = (guint)maxwatchers; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2769 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2770 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2771 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2772 |
15823 | 2773 static int purple_bosrights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2774 PurpleConnection *gc; | |
2775 PurpleAccount *account; | |
2776 PurpleStatus *status; | |
27466
eb059c7d8b11
Oh, make sure we still set the itmsurl if we're available but don't have
Mark Doliner <mark@kingant.net>
parents:
27465
diff
changeset
|
2777 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
|
2778 PurplePresence *presence; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2779 const char *username, *message, *itmsurl; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2780 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2781 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2782 guint16 maxpermits, maxdenies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2783 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2784 gc = od->gc; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2785 od = purple_connection_get_protocol_data(gc); |
15823 | 2786 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2788 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2789 maxpermits = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2790 maxdenies = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2791 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2792 |
15823 | 2793 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2794 "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
|
2795 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2796 od->rights.maxpermits = (guint)maxpermits; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2797 od->rights.maxdenies = (guint)maxdenies; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2798 |
15823 | 2799 purple_debug_info("oscar", "buddy list loaded\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2800 |
15823 | 2801 if (purple_account_get_user_info(account) != NULL) |
2802 serv_set_info(gc, purple_account_get_user_info(account)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2803 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2804 username = purple_account_get_username(account); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2805 if (!od->icq && strcmp(username, purple_connection_get_display_name(gc)) != 0) |
22603
e8d35793bd71
Only call oscar_format_screenname() on connecting if we need to
Mark Doliner <mark@kingant.net>
parents:
22551
diff
changeset
|
2806 /* |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2807 * Format the username for AIM accounts if it's different |
22603
e8d35793bd71
Only call oscar_format_screenname() on connecting if we need to
Mark Doliner <mark@kingant.net>
parents:
22551
diff
changeset
|
2808 * than what's currently set. |
e8d35793bd71
Only call oscar_format_screenname() on connecting if we need to
Mark Doliner <mark@kingant.net>
parents:
22551
diff
changeset
|
2809 */ |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
2810 oscar_format_username(gc, username); |
15680
cad32dba756b
Automatically format screenname to account->username
Sean Egan <seanegan@gmail.com>
parents:
15679
diff
changeset
|
2811 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2812 /* Set our available message based on the current status */ |
15823 | 2813 status = purple_account_get_active_status(account); |
27466
eb059c7d8b11
Oh, make sure we still set the itmsurl if we're available but don't have
Mark Doliner <mark@kingant.net>
parents:
27465
diff
changeset
|
2814 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:
27465
diff
changeset
|
2815 if (is_available) |
15823 | 2816 message = purple_status_get_attr_string(status, "message"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2817 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2818 message = NULL; |
15823 | 2819 tmp = purple_markup_strip_html(message); |
2820 itmsurl = purple_status_get_attr_string(status, "itmsurl"); | |
27466
eb059c7d8b11
Oh, make sure we still set the itmsurl if we're available but don't have
Mark Doliner <mark@kingant.net>
parents:
27465
diff
changeset
|
2821 aim_srv_setextrainfo(od, FALSE, 0, is_available, tmp, itmsurl); |
30831
be056399ae5f
Fixes #12044. We send a dummy packet with DC version = 8 to make
ivan.komarov@soc.pidgin.im
parents:
30829
diff
changeset
|
2822 aim_srv_set_dc_info(od); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2823 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2824 |
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
|
2825 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
|
2826 aim_srv_setidle(od, !purple_presence_is_idle(presence) ? 0 : time(NULL) - purple_presence_get_idle_time(presence)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2827 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2828 if (od->icq) { |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
2829 oscar_set_extended_status(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2830 aim_icq_setsecurity(od, |
15823 | 2831 purple_account_get_bool(account, "authorization", OSCAR_DEFAULT_AUTHORIZATION), |
2832 purple_account_get_bool(account, "web_aware", OSCAR_DEFAULT_WEB_AWARE)); | |
15374
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 |
27242
763247959e00
It's ok to always request this connection now. It probably still doesn't
Mark Doliner <mark@kingant.net>
parents:
27225
diff
changeset
|
2835 aim_srv_requestnew(od, SNAC_FAMILY_ALERT); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2836 aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2837 |
28758
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2838 od->bos.have_rights = TRUE; |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2839 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2840 /* |
28758
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2841 * If we've already received our feedbag data then we're not waiting on |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2842 * anything else, so send the server clientready. |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2843 * |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2844 * Normally we get bos rights before we get our feedbag data, so this |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2845 * rarely (never?) happens. And I'm not sure it actually matters if we |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2846 * wait for bos rights before calling clientready. But it seems safer |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2847 * to do it this way. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2848 */ |
28758
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2849 if (od->ssi.received_data) { |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2850 aim_srv_clientready(od, conn); |
28881
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28879
diff
changeset
|
2851 |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28879
diff
changeset
|
2852 /* Request offline messages for AIM and ICQ */ |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28879
diff
changeset
|
2853 aim_im_reqofflinemsgs(od); |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28879
diff
changeset
|
2854 |
28758
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2855 purple_connection_set_state(gc, PURPLE_CONNECTED); |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
2856 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2857 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2858 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2859 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2860 |
15823 | 2861 static int purple_popup(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2862 { |
15823 | 2863 PurpleConnection *gc = od->gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2864 gchar *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2865 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2866 char *msg, *url; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2867 guint16 wid, hei, delay; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2868 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2869 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2870 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2871 url = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2872 wid = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2873 hei = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2874 delay = (guint16) va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2875 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2876 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2877 text = g_strdup_printf("%s<br><a href=\"%s\">%s</a>", msg, url, url); |
15823 | 2878 purple_notify_formatted(gc, NULL, _("Pop-Up Message"), NULL, text, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2879 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2880 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2881 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2882 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2883 |
15823 | 2884 static void oscar_searchresults_add_buddy_cb(PurpleConnection *gc, GList *row, void *user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2885 { |
15823 | 2886 purple_blist_request_add_buddy(purple_connection_get_account(gc), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2887 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
|
2888 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2889 |
15823 | 2890 static int purple_parse_searchreply(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2891 { |
15823 | 2892 PurpleConnection *gc = od->gc; |
2893 PurpleNotifySearchResults *results; | |
2894 PurpleNotifySearchColumn *column; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2895 gchar *secondary; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2896 int i, num; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2897 va_list ap; |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
2898 char *email, *usernames; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2899 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2900 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2901 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2902 num = va_arg(ap, int); |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
2903 usernames = va_arg(ap, char *); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2904 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2905 |
15823 | 2906 results = purple_notify_searchresults_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2907 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2908 if (results == NULL) { |
15823 | 2909 purple_debug_error("oscar", "purple_parse_searchreply: " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2910 "Unable to display the search results.\n"); |
15823 | 2911 purple_notify_error(gc, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2912 _("Unable to display the search results."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2913 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2914 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2915 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2916 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2917 secondary = g_strdup_printf( |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
2918 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:
22342
diff
changeset
|
2919 "The following usernames are associated with %s", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2920 num), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2921 email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2922 |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
2923 column = purple_notify_searchresults_column_new(_("Username")); |
15823 | 2924 purple_notify_searchresults_column_add(results, column); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2925 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2926 for (i = 0; i < num; i++) { |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
2927 GList *row; |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
2928 row = g_list_append(NULL, g_strdup(&usernames[i * (MAXSNLEN + 1)])); |
15823 | 2929 purple_notify_searchresults_row_add(results, row); |
2930 } | |
2931 purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_ADD, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2932 oscar_searchresults_add_buddy_cb); |
15823 | 2933 purple_notify_searchresults(gc, NULL, NULL, secondary, results, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2934 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2935 g_free(secondary); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2936 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2937 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2938 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2939 |
15823 | 2940 static int purple_parse_searcherror(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2941 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2942 char *email; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2943 char *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2945 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2946 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2947 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2948 |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
2949 buf = g_strdup_printf(_("No results found for email address %s"), email); |
15823 | 2950 purple_notify_error(od->gc, NULL, buf, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2951 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2952 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2953 return 1; |
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 |
15823 | 2956 static int purple_account_confirm(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2957 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2958 guint16 status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2959 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2960 char msg[256]; |
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_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2963 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
|
2964 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2965 |
15823 | 2966 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2967 "account confirmation returned status 0x%04x (%s)\n", status, |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
2968 status ? "unknown" : "email sent"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2969 if (!status) { |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
2970 g_snprintf(msg, sizeof(msg), _("You should receive an email asking to confirm %s."), |
15823 | 2971 purple_account_get_username(purple_connection_get_account(gc))); |
2972 purple_notify_info(gc, NULL, _("Account Confirmation Requested"), msg); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2973 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2974 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2975 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2976 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2977 |
15823 | 2978 static int purple_info_change(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
2979 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2980 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2981 guint16 perms, err; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2982 char *url, *bn, *email; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2983 int change; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2984 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2985 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2986 change = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2987 perms = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2988 err = (guint16) va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2989 url = va_arg(ap, char *); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2990 bn = va_arg(ap, char *); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2991 email = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2992 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2993 |
15823 | 2994 purple_debug_misc("oscar", |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2995 "account info: because of %s, perms=0x%04x, err=0x%04x, url=%s, bn=%s, email=%s\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2996 change ? "change" : "request", perms, err, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2997 (url != NULL) ? url : "(null)", |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
2998 (bn != NULL) ? bn : "(null)", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2999 (email != NULL) ? email : "(null)"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3000 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3001 if ((err > 0) && (url != NULL)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3002 char *dialog_msg; |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3003 |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3004 if (err == 0x0001) |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3005 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:
22342
diff
changeset
|
3006 else if (err == 0x0006) |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3007 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:
22342
diff
changeset
|
3008 else if (err == 0x00b) |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3009 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:
22342
diff
changeset
|
3010 else if (err == 0x001d) |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
3011 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because there is already a request pending for this username."), err); |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3012 else if (err == 0x0021) |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
3013 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); |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3014 else if (err == 0x0023) |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
3015 dialog_msg = g_strdup_printf(_("Error 0x%04x: Unable to change email address because the given address is invalid."), err); |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3016 else |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3017 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:
22342
diff
changeset
|
3018 purple_notify_error(gc, NULL, |
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
3019 _("Error Changing Account Info"), dialog_msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3020 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3021 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3022 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3023 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3024 if (email != NULL) { |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
3025 char *dialog_msg = g_strdup_printf(_("The email address for %s is %s"), |
15823 | 3026 purple_account_get_username(purple_connection_get_account(gc)), email); |
3027 purple_notify_info(gc, NULL, _("Account Info"), dialog_msg); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3028 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3029 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3030 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3031 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3032 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3033 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3034 void |
15823 | 3035 oscar_keepalive(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3036 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3037 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3038 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3039 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3040 od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3041 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
|
3042 if (conn != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3043 flap_connection_send_keepalive(od, conn); |
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 unsigned int |
15823 | 3047 oscar_send_typing(PurpleConnection *gc, const char *name, PurpleTypingState state) |
15374
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 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3050 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3051 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3052 od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3053 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
|
3054 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3055 if ((conn != NULL) && (conn->ready)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3056 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3057 peer_odc_send_typing(conn, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3058 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3059 else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3060 /* 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
|
3061 GSList *list; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
3062 for (list=gc->account->deny; (list && oscar_util_name_compare(name, list->data)); list=list->next); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3063 if (!list) { |
15823 | 3064 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(gc->account, name)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3065 if (bi && bi->typingnot) { |
15823 | 3066 if (state == PURPLE_TYPING) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3067 aim_im_sendmtn(od, 0x0001, name, 0x0002); |
15823 | 3068 else if (state == PURPLE_TYPED) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3069 aim_im_sendmtn(od, 0x0001, name, 0x0001); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3070 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3071 aim_im_sendmtn(od, 0x0001, name, 0x0000); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3072 } |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3075 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3076 } |
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 /* TODO: Move this into odc.c! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3079 static void |
15823 | 3080 purple_odc_send_im(PeerConnection *conn, const char *message, PurpleMessageFlags imflags) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3081 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3082 GString *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3083 GString *data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3084 gchar *tmp; |
30818
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
3085 gsize tmplen; |
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
3086 guint16 charset; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3087 GData *attribs; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3088 const char *start, *end, *last; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3089 int oscar_id = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3090 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3091 msg = g_string_new("<HTML><BODY>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3092 data = g_string_new("<BINARY>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3093 last = message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3094 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3095 /* for each valid IMG tag... */ |
15823 | 3096 while (last && *last && purple_markup_find_tag("img", last, &start, &end, &attribs)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3097 { |
15823 | 3098 PurpleStoredImage *image = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3099 const char *id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3100 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3101 if (start - last) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3102 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
|
3103 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3104 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3105 id = g_datalist_get_data(&attribs, "id"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3106 |
15823 | 3107 /* ... 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
|
3108 if (id && (image = purple_imgstore_find_by_id(atoi(id)))) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3109 /* ... append the message from start to the tag ... */ |
15823 | 3110 unsigned long size = purple_imgstore_get_size(image); |
3111 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
|
3112 gconstpointer imgdata = purple_imgstore_get_data(image); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3113 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3114 oscar_id++; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3115 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3116 /* ... 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
|
3117 if (filename) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3118 g_string_append_printf(msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3119 "<IMG SRC=\"%s\" ID=\"%d\" DATASIZE=\"%lu\">", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3120 filename, oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3121 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3122 g_string_append_printf(msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3123 "<IMG ID=\"%d\" DATASIZE=\"%lu\">", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3124 oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3125 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3126 /* ... 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
|
3127 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
|
3128 oscar_id, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3129 g_string_append_len(data, imgdata, size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3130 g_string_append(data, "</DATA>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3131 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3132 /* 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
|
3133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3134 g_datalist_clear(&attribs); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3135 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3136 /* continue from the end of the tag */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3137 last = end + 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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3140 /* append any remaining message data */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3141 if (last && *last) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3142 g_string_append(msg, last); |
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 g_string_append(msg, "</BODY></HTML>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3145 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3146 /* Convert the message to a good encoding */ |
30827 | 3147 tmp = oscar_encode_im(msg->str, &tmplen, &charset, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3148 g_string_free(msg, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3149 msg = g_string_new_len(tmp, tmplen); |
17150
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:
16956
diff
changeset
|
3150 g_free(tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3151 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3152 /* 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
|
3153 if (oscar_id) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3154 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
|
3155 msg = g_string_append(msg, "</BINARY>"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3156 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3157 g_string_free(data, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3158 |
28991
8a90bd0a3b79
Plucked d2a1d52b3bbf29baa53b9ddaa635d50b6332064f from im.pidgin.adium
Evan Schoenberg <evan.s@dreskin.net>
parents:
28884
diff
changeset
|
3159 purple_debug_info("oscar", "sending direct IM %s using charset %i", msg->str, charset); |
8a90bd0a3b79
Plucked d2a1d52b3bbf29baa53b9ddaa635d50b6332064f from im.pidgin.adium
Evan Schoenberg <evan.s@dreskin.net>
parents:
28884
diff
changeset
|
3160 |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
3161 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:
27242
diff
changeset
|
3162 imflags & PURPLE_MESSAGE_AUTO_RESP); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3163 g_string_free(msg, TRUE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3164 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3165 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3166 int |
15823 | 3167 oscar_send_im(PurpleConnection *gc, const char *name, const char *message, PurpleMessageFlags imflags) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3168 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3169 OscarData *od; |
15823 | 3170 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3171 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3172 int ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3173 char *tmp1, *tmp2; |
22342
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
3174 gboolean is_sms, is_html; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3175 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3176 od = purple_connection_get_protocol_data(gc); |
15823 | 3177 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3178 ret = 0; |
15823 | 3179 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
3180 is_sms = oscar_util_valid_name_sms(name); |
22342
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
3181 |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
3182 if (od->icq && is_sms) { |
19640
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3183 /* |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3184 * 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
|
3185 * 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
|
3186 */ |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3187 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
|
3188 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
|
3189 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
|
3190 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
|
3191 } |
eb0933e158a4
Add non-US SMS support for ICQ. This is a patch from DB42.
Mark Doliner <mark@kingant.net>
parents:
19583
diff
changeset
|
3192 |
15823 | 3193 if (imflags & PURPLE_MESSAGE_AUTO_RESP) |
30794
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30792
diff
changeset
|
3194 tmp1 = oscar_util_format_string(message, name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3195 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3196 tmp1 = g_strdup(message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3197 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3198 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
|
3199 if ((conn != NULL) && (conn->ready)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3200 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3201 /* If we're directly connected, send a direct IM */ |
29150
4cb8d0fcfd2f
oscar: Add '\n' to a debug message missing it.
Paul Aurich <paul@darkrain42.org>
parents:
29130
diff
changeset
|
3202 purple_debug_info("oscar", "Sending direct IM with flags %i\n", imflags); |
15823 | 3203 purple_odc_send_im(conn, tmp1, imflags); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3204 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3205 struct buddyinfo *bi; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3206 struct aim_sendimext_args args; |
15823 | 3207 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
|
3208 PurpleStoredImage *img; |
22342
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
3209 PurpleBuddy *buddy; |
15823 | 3210 |
3211 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, account); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3212 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3213 if (strstr(tmp1, "<IMG ")) |
15823 | 3214 purple_conversation_write(conv, "", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3215 _("Your IM Image was not sent. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3216 "You must be Direct Connected to send IM Images."), |
15823 | 3217 PURPLE_MESSAGE_ERROR, time(NULL)); |
3218 | |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3219 buddy = purple_find_buddy(account, name); |
22342
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
3220 |
15823 | 3221 bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, name)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3222 if (!bi) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3223 bi = g_new0(struct buddyinfo, 1); |
15823 | 3224 g_hash_table_insert(od->buddyinfo, g_strdup(purple_normalize(account, name)), bi); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3225 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3226 |
30818
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
3227 args.flags = 0; |
22342
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
3228 |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
3229 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:
22337
diff
changeset
|
3230 args.flags |= AIM_IMFLAGS_OFFLINE; |
03b2b21b4c42
* Don't flag outgoing oscar messages as "offline deliverable" if the
Mark Doliner <mark@kingant.net>
parents:
22337
diff
changeset
|
3231 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3232 if (od->icq) { |
30144
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
30143
diff
changeset
|
3233 args.features = features_icq; |
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
30143
diff
changeset
|
3234 args.featureslen = sizeof(features_icq); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3235 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3236 args.features = features_aim; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3237 args.featureslen = sizeof(features_aim); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3238 |
15823 | 3239 if (imflags & PURPLE_MESSAGE_AUTO_RESP) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3240 args.flags |= AIM_IMFLAGS_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3241 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3242 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3243 if (bi->ico_need) { |
15823 | 3244 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3245 "Sending buddy icon request with message\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3246 args.flags |= AIM_IMFLAGS_BUDDYREQ; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3247 bi->ico_need = FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3248 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3249 |
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
|
3250 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
|
3251 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
|
3252 gconstpointer data = purple_imgstore_get_data(img); |
30011 | 3253 args.iconlen = purple_imgstore_get_size(img); |
3254 args.iconsum = aimutil_iconsum(data, args.iconlen); | |
16621
dbd0a01a9a81
The OSCAR timestamp stuff.
Richard Laager <rlaager@wiktel.com>
parents:
16483
diff
changeset
|
3255 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
|
3256 |
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
|
3257 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
|
3258 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
|
3259 bi->ico_sent = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3260 } |
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
|
3261 |
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
|
3262 /* |
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
|
3263 * 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
|
3264 * 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
|
3265 * 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
|
3266 * 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
|
3267 * 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
|
3268 */ |
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
|
3269 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
|
3270 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
|
3271 "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
|
3272 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
|
3273 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
|
3274 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
|
3275 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
|
3276 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
|
3277 } |
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
|
3278 |
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
|
3279 purple_imgstore_unref(img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3280 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3281 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
3282 args.destbn = name; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3283 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
3284 if (oscar_util_valid_name_sms(name)) { |
30144
c66e766acb06
And allow sending HTML over ICQ, too. Only lightly tested
Mark Doliner <mark@kingant.net>
parents:
30143
diff
changeset
|
3285 /* Messaging an SMS (mobile) user--strip HTML */ |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
16063
diff
changeset
|
3286 tmp2 = purple_markup_strip_html(tmp1); |
17824
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:
17799
diff
changeset
|
3287 is_html = FALSE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3288 } else { |
30571
17d5518c5cad
Copy the third hunk from 3c30f64efedafc379b6536852bbb3b6ef5f1f6c9 to trunk
Mark Doliner <mark@kingant.net>
parents:
30406
diff
changeset
|
3289 /* ICQ 6 wants its HTML wrapped in these tags. Oblige it. */ |
17d5518c5cad
Copy the third hunk from 3c30f64efedafc379b6536852bbb3b6ef5f1f6c9 to trunk
Mark Doliner <mark@kingant.net>
parents:
30406
diff
changeset
|
3290 tmp2 = g_strdup_printf("<HTML><BODY>%s</BODY></HTML>", tmp1); |
17824
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:
17799
diff
changeset
|
3291 is_html = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3292 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3293 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3294 tmp1 = tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3295 |
30827 | 3296 args.msg = oscar_encode_im(tmp1, &args.msglen, &args.charset, NULL); |
17824
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:
17799
diff
changeset
|
3297 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:
17799
diff
changeset
|
3298 /* 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:
17799
diff
changeset
|
3299 * 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:
17799
diff
changeset
|
3300 g_free((char *)args.msg); |
23269 | 3301 |
17824
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:
17799
diff
changeset
|
3302 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:
17799
diff
changeset
|
3303 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
|
3304 |
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3305 /* 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
|
3306 tmp1 = g_markup_escape_text(tmp2, -1); |
17824
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:
17799
diff
changeset
|
3307 g_free(tmp2); |
23269 | 3308 |
18598
c7a5cd17b045
re-escapes the entities that was unescaped by purple_markup_strip_html()
Ka-Hing Cheung <khc@hxbc.us>
parents:
18280
diff
changeset
|
3309 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
|
3310 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
|
3311 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
|
3312 |
30827 | 3313 args.msg = oscar_encode_im(tmp1, &args.msglen, &args.charset, NULL); |
19653
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19641
diff
changeset
|
3314 purple_debug_info("oscar", "Sending %s as %s because the original was too long.\n", |
17824
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:
17799
diff
changeset
|
3315 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:
17799
diff
changeset
|
3316 } |
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:
17799
diff
changeset
|
3317 |
30818
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
3318 purple_debug_info("oscar", "Sending IM, charset=0x%04hx, length=%" G_GSIZE_FORMAT "\n", args.charset, args.msglen); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3319 ret = aim_im_sendch1_ext(od, &args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3320 g_free((char *)args.msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3321 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3322 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3323 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3324 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3325 if (ret >= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3326 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3327 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3328 return ret; |
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 |
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 * 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
|
3333 * 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
|
3334 * AIM users can only request AIM info. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3335 */ |
15823 | 3336 void oscar_get_info(PurpleConnection *gc, const char *name) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3337 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3338 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
3339 if (od->icq && oscar_util_valid_name_icq(name)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3340 aim_icq_getallinfo(od, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3341 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3342 aim_locate_getinfoshort(od, name, 0x00000003); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3343 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3344 |
15823 | 3345 void oscar_set_idle(PurpleConnection *gc, int time) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3346 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3347 aim_srv_setidle(od, time); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3348 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3349 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3350 void |
15823 | 3351 oscar_set_info(PurpleConnection *gc, const char *rawinfo) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3352 { |
15823 | 3353 PurpleAccount *account; |
3354 PurpleStatus *status; | |
3355 | |
3356 account = purple_connection_get_account(gc); | |
3357 status = purple_account_get_active_status(account); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3358 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
|
3359 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3360 |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3361 static guint32 |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3362 oscar_get_extended_status(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3363 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3364 OscarData *od; |
15823 | 3365 PurpleAccount *account; |
3366 PurpleStatus *status; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3367 const gchar *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3368 guint32 data = 0x00000000; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3369 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3370 od = purple_connection_get_protocol_data(gc); |
15823 | 3371 account = purple_connection_get_account(gc); |
3372 status = purple_account_get_active_status(account); | |
3373 status_id = purple_status_get_id(status); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3374 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3375 data |= AIM_ICQ_STATE_HIDEIP; |
15823 | 3376 if (purple_account_get_bool(account, "web_aware", OSCAR_DEFAULT_WEB_AWARE)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3377 data |= AIM_ICQ_STATE_WEBAWARE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3378 |
17799
3bc25e19ce1c
wabz pointed out that this string comparision was being done twice. I
Mark Doliner <mark@kingant.net>
parents:
17673
diff
changeset
|
3379 if (!strcmp(status_id, OSCAR_STATUS_ID_AVAILABLE)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3380 data |= AIM_ICQ_STATE_NORMAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3381 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
|
3382 data |= AIM_ICQ_STATE_AWAY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3383 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
|
3384 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
|
3385 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
|
3386 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
|
3387 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
|
3388 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
|
3389 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
|
3390 data |= AIM_ICQ_STATE_CHAT; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3391 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
|
3392 data |= AIM_ICQ_STATE_INVISIBLE; |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3393 else if (!strcmp(status_id, OSCAR_STATUS_ID_EVIL)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3394 data |= AIM_ICQ_STATE_EVIL; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3395 else if (!strcmp(status_id, OSCAR_STATUS_ID_DEPRESSION)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3396 data |= AIM_ICQ_STATE_DEPRESSION; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3397 else if (!strcmp(status_id, OSCAR_STATUS_ID_ATWORK)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3398 data |= AIM_ICQ_STATE_ATWORK; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3399 else if (!strcmp(status_id, OSCAR_STATUS_ID_ATHOME)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3400 data |= AIM_ICQ_STATE_ATHOME; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3401 else if (!strcmp(status_id, OSCAR_STATUS_ID_LUNCH)) |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
3402 data |= AIM_ICQ_STATE_LUNCH; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3403 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
|
3404 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
|
3405 |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3406 return data; |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3407 } |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3408 |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3409 static void |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3410 oscar_set_extended_status(PurpleConnection *gc) |
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3411 { |
30804
1a81e5b64779
Adium guys need the itmsurl stuff, which I erroneously removed
ivan.komarov@soc.pidgin.im
parents:
30803
diff
changeset
|
3412 aim_srv_setextrainfo(purple_connection_get_protocol_data(gc), TRUE, oscar_get_extended_status(gc), FALSE, NULL, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3413 } |
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 static void |
15823 | 3416 oscar_set_info_and_status(PurpleAccount *account, gboolean setinfo, const char *rawinfo, |
3417 gboolean setstatus, PurpleStatus *status) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3418 { |
15823 | 3419 PurpleConnection *gc = purple_account_get_connection(account); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3420 OscarData *od = purple_connection_get_protocol_data(gc); |
15823 | 3421 PurpleStatusType *status_type; |
3422 PurpleStatusPrimitive primitive; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3423 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3424 char *info_encoding = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3425 char *info = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3426 gsize infolen = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3427 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3428 char *away_encoding = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3429 char *away = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3430 gsize awaylen = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3431 |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3432 char *status_text = NULL; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3433 const char *itmsurl = NULL; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3434 |
15823 | 3435 status_type = purple_status_get_type(status); |
3436 primitive = purple_status_type_get_primitive(status_type); | |
15374
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 if (!setinfo) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3439 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3440 /* Do nothing! */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3441 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3442 else if (od->rights.maxsiglen == 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3443 { |
15823 | 3444 purple_notify_warning(gc, NULL, _("Unable to set AIM profile."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3445 _("You have probably requested to set your " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3446 "profile before the login procedure completed. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3447 "Your profile remains unset; try setting it " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3448 "again when you are fully connected.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3449 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3450 else if (rawinfo != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3451 { |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3452 char *htmlinfo = purple_strdup_withhtml(rawinfo); |
30827 | 3453 info = oscar_encode_im(htmlinfo, &infolen, NULL, &info_encoding); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3454 g_free(htmlinfo); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3455 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3456 if (infolen > od->rights.maxsiglen) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3457 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3458 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
|
3459 errstr = g_strdup_printf(dngettext(PACKAGE, "The maximum profile length of %d byte " |
16135 | 3460 "has been exceeded. It has been truncated for you.", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3461 "The maximum profile length of %d bytes " |
16135 | 3462 "has been exceeded. It has been truncated for you.", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3463 od->rights.maxsiglen), od->rights.maxsiglen); |
15823 | 3464 purple_notify_warning(gc, NULL, _("Profile too long."), errstr); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3465 g_free(errstr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3466 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3467 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3468 |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3469 if (setstatus) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3470 { |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3471 const char *status_html; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3472 |
15823 | 3473 status_html = purple_status_get_attr_string(status, "message"); |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3474 |
26260
37a3f30a8d80
fix a crash when changing to away without a status message
Richard Nelson <wabz@pidgin.im>
parents:
26255
diff
changeset
|
3475 if (status_html == NULL || primitive == PURPLE_STATUS_AVAILABLE || primitive == PURPLE_STATUS_INVISIBLE) |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3476 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3477 /* 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:
25459
diff
changeset
|
3478 away = g_strdup(""); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3479 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3480 else |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3481 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3482 gchar *linkified; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3483 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3484 /* 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:
25459
diff
changeset
|
3485 linkified = purple_markup_linkify(status_html); |
30827 | 3486 away = oscar_encode_im(linkified, &awaylen, NULL, &away_encoding); |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3487 g_free(linkified); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3488 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3489 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:
25459
diff
changeset
|
3490 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3491 gchar *errstr; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3492 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3493 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:
25459
diff
changeset
|
3494 "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:
25459
diff
changeset
|
3495 "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:
25459
diff
changeset
|
3496 "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:
25459
diff
changeset
|
3497 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:
25459
diff
changeset
|
3498 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:
25459
diff
changeset
|
3499 g_free(errstr); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3500 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3501 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3502 } |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3503 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3504 aim_locate_setprofile(od, |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3505 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:
25459
diff
changeset
|
3506 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:
25459
diff
changeset
|
3507 g_free(info); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3508 g_free(away); |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3509 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3510 if (setstatus) |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3511 { |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3512 const char *status_html; |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3513 |
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3514 status_html = purple_status_get_attr_string(status, "message"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3515 if (status_html != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3516 { |
15823 | 3517 status_text = purple_markup_strip_html(status_html); |
25054
8f544de62330
Patch to properly publish status messages for statuses other than Available.
Daniel Lj <dimmuxx@yahoo.se>
parents:
25031
diff
changeset
|
3518 /* 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
|
3519 if (strlen(status_text) > MAXAVAILMSGLEN) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3520 { |
18774
88ad571744b4
Looks like AOL increased the length of available messages from 60
Mark Doliner <mark@kingant.net>
parents:
18755
diff
changeset
|
3521 char *tmp = g_utf8_find_prev_char(status_text, &status_text[MAXAVAILMSGLEN - 2]); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3522 strcpy(tmp, "..."); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3523 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3524 } |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3525 |
15823 | 3526 itmsurl = purple_status_get_attr_string(status, "itmsurl"); |
30804
1a81e5b64779
Adium guys need the itmsurl stuff, which I erroneously removed
ivan.komarov@soc.pidgin.im
parents:
30803
diff
changeset
|
3527 |
1a81e5b64779
Adium guys need the itmsurl stuff, which I erroneously removed
ivan.komarov@soc.pidgin.im
parents:
30803
diff
changeset
|
3528 aim_srv_setextrainfo(od, TRUE, oscar_get_extended_status(gc), TRUE, status_text, itmsurl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3529 g_free(status_text); |
25464
0e93bbb7f5ca
Woo boy this function is a little crazy. I shuffled some things around:
Mark Doliner <mark@kingant.net>
parents:
25459
diff
changeset
|
3530 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3531 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3532 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3533 static void |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3534 oscar_set_icq_permdeny(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3535 { |
15823 | 3536 PurpleConnection *gc = purple_account_get_connection(account); |
30800
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3537 OscarData *od = purple_connection_get_protocol_data(gc); |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3538 gboolean invisible = purple_account_is_status_active(account, OSCAR_STATUS_ID_INVISIBLE); |
25459
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
3539 |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
3540 /* |
30800
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3541 * For ICQ the permit/deny setting controls who can see you |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3542 * online. Mimicking the official client's behavior, we use PURPLE_PRIVACY_ALLOW_USERS |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3543 * when our status is "invisible" and PURPLE_PRIVACY_DENY_USERS otherwise. |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3544 * In the former case, we are visible only to buddies on our "permanently visible" list. |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3545 * In the latter, we are invisible only to buddies on our "permanently invisible" list. |
25459
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
3546 */ |
30800
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3547 aim_ssi_setpermdeny(od, invisible ? PURPLE_PRIVACY_ALLOW_USERS : PURPLE_PRIVACY_DENY_USERS); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3548 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3549 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3550 void |
15823 | 3551 oscar_set_status(PurpleAccount *account, PurpleStatus *status) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3552 { |
29193
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
29154
diff
changeset
|
3553 PurpleConnection *pc; |
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
29154
diff
changeset
|
3554 OscarData *od; |
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
29154
diff
changeset
|
3555 |
15823 | 3556 purple_debug_info("oscar", "Set status to %s\n", purple_status_get_name(status)); |
3557 | |
3558 if (!purple_status_is_active(status)) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3559 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3560 |
15823 | 3561 if (!purple_account_is_connected(account)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3562 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3563 |
29854 | 3564 pc = purple_account_get_connection(account); |
3565 od = purple_connection_get_protocol_data(pc); | |
3566 | |
29829
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
3567 /* There's no need to do the stuff below for mood updates. */ |
29834
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29829
diff
changeset
|
3568 if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) { |
29854 | 3569 aim_locate_setcaps(od, purple_caps); |
29829
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
3570 return; |
29834
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29829
diff
changeset
|
3571 } |
29829
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
3572 |
30809
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
3573 if (od->icq) { |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
3574 /* Set visibility */ |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3575 oscar_set_icq_permdeny(account); |
30809
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
3576 } |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
3577 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3578 /* 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
|
3579 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
|
3580 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3581 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3582 void |
15823 | 3583 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
|
3584 OscarData *od; |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3585 PurpleAccount *account; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3586 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
|
3587 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3588 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
|
3589 account = purple_connection_get_account(gc); |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3590 bname = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3591 gname = purple_group_get_name(group); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3592 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
3593 if (!oscar_util_valid_name(bname)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3594 gchar *buf; |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
3595 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); |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3596 if (!purple_conv_present_error(bname, account, buf)) |
24374
75545fdf8944
String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents:
24315
diff
changeset
|
3597 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3598 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3599 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3600 /* Remove from local list */ |
15823 | 3601 purple_blist_remove_buddy(buddy); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3602 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3603 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3604 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3605 |
25006
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24642
diff
changeset
|
3606 if (od->ssi.received_data) { |
26285 | 3607 if (!aim_ssi_itemlist_finditem(od->ssi.local, gname, bname, AIM_SSI_TYPE_BUDDY)) { |
25006
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24642
diff
changeset
|
3608 purple_debug_info("oscar", |
26285 | 3609 "ssi: adding buddy %s to group %s\n", bname, gname); |
3610 aim_ssi_addbuddy(od, bname, gname, NULL, purple_buddy_get_alias_only(buddy), NULL, NULL, 0); | |
25006
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24642
diff
changeset
|
3611 |
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24642
diff
changeset
|
3612 /* Mobile users should always be online */ |
26285 | 3613 if (bname[0] == '+') { |
25465
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
3614 purple_prpl_got_user_status(account, bname, |
25006
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24642
diff
changeset
|
3615 OSCAR_STATUS_ID_AVAILABLE, NULL); |
25465
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
3616 purple_prpl_got_user_status(account, bname, |
25006
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24642
diff
changeset
|
3617 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:
24642
diff
changeset
|
3618 } |
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24642
diff
changeset
|
3619 } else if (aim_ssi_waitingforauth(od->ssi.local, |
25465
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
3620 aim_ssi_itemlist_findparentname(od->ssi.local, bname), |
9ea3474065dc
propagate from branch 'im.pidgin.pidgin' (head 303af74a38e7b313d4fb0be4d4054a16cb13d819)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
3621 bname)) { |
25006
032651900c32
Oscar: Re-request authorization when adding a buddy that is already on the list.
Paul Aurich <paul@darkrain42.org>
parents:
24642
diff
changeset
|
3622 /* Not authorized -- Re-request authorization */ |
30794
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30792
diff
changeset
|
3623 oscar_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
|
3624 } |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3627 /* 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
|
3628 if (od->icq) |
30790
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30571
diff
changeset
|
3629 aim_icq_getalias(od, bname, FALSE, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3630 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3631 |
15823 | 3632 void oscar_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3633 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3634 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3635 if (od->ssi.received_data) { |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3636 const char *gname = purple_group_get_name(group); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3637 const char *bname = purple_buddy_get_name(buddy); |
15823 | 3638 purple_debug_info("oscar", |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3639 "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:
23961
diff
changeset
|
3640 aim_ssi_delbuddy(od, bname, gname); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3641 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3642 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3643 |
15823 | 3644 void oscar_move_buddy(PurpleConnection *gc, const char *name, const char *old_group, const char *new_group) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3645 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:
25416
diff
changeset
|
3646 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3647 if (od->ssi.received_data && strcmp(old_group, new_group)) { |
15823 | 3648 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3649 "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
|
3650 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
|
3651 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3652 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3653 |
15823 | 3654 void oscar_alias_buddy(PurpleConnection *gc, const char *name, const char *alias) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3655 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:
25416
diff
changeset
|
3656 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3657 if (od->ssi.received_data) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3658 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
|
3659 if (gname) { |
15823 | 3660 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3661 "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
|
3662 aim_ssi_aliasbuddy(od, gname, name, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3663 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3664 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3665 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3666 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3667 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3668 * 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
|
3669 */ |
15823 | 3670 void oscar_rename_group(PurpleConnection *gc, const char *old_name, PurpleGroup *group, GList *moved_buddies) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3671 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3672 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3673 if (od->ssi.received_data) { |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3674 const char *gname = purple_group_get_name(group); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3675 if (aim_ssi_itemlist_finditem(od->ssi.local, gname, NULL, AIM_SSI_TYPE_GROUP)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3676 GList *cur, *groups = NULL; |
15823 | 3677 PurpleAccount *account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3678 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3679 /* 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
|
3680 for (cur = moved_buddies; cur != NULL; cur = cur->next) { |
15823 | 3681 PurpleBlistNode *node = cur->data; |
3682 /* node is PurpleBuddy, parent is a PurpleContact. | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3683 * 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
|
3684 groups = g_list_append(groups, |
25290
8d562557ed6f
Some more PurpleBuddy::proto_data related changes.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25289
diff
changeset
|
3685 purple_buddy_get_group((PurpleBuddy*)node)); |
15374
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 |
15823 | 3688 purple_account_remove_buddies(account, moved_buddies, groups); |
3689 purple_account_add_buddies(account, moved_buddies); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3690 g_list_free(groups); |
15823 | 3691 purple_debug_info("oscar", |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3692 "ssi: moved all buddies from group %s to %s\n", old_name, gname); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3693 } else { |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3694 aim_ssi_rename_group(od, old_name, gname); |
15823 | 3695 purple_debug_info("oscar", |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3696 "ssi: renamed group %s to %s\n", old_name, gname); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3697 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3698 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3699 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3700 |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3701 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
|
3702 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3703 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
|
3704 } |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3705 |
15823 | 3706 static gboolean purple_ssi_rerequestdata(gpointer data) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3707 OscarData *od = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3708 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3709 aim_ssi_reqdata(od); |
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 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3712 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3713 |
15823 | 3714 static int purple_ssi_parseerr(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
3715 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3716 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3717 guint16 reason; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3718 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3719 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3720 reason = (guint16)va_arg(ap, unsigned int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3721 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3722 |
15823 | 3723 purple_debug_error("oscar", "ssi: SNAC error %hu\n", reason); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3724 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3725 if (reason == 0x0005) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3726 if (od->getblisttimer > 0) |
15823 | 3727 purple_timeout_remove(od->getblisttimer); |
26255
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25464
diff
changeset
|
3728 else |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25464
diff
changeset
|
3729 /* We only show this error the first time it happens */ |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25464
diff
changeset
|
3730 purple_notify_error(gc, NULL, |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25464
diff
changeset
|
3731 _("Unable to Retrieve Buddy List"), |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25464
diff
changeset
|
3732 _("The AIM servers were temporarily unable to send " |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25464
diff
changeset
|
3733 "your buddy list. Your buddy list is not lost, and " |
53b04369fb10
Only show the oscar error "we couldn't fetch your buddy list, but
Mark Doliner <mark@kingant.net>
parents:
25464
diff
changeset
|
3734 "will probably become available in a few minutes.")); |
26612
b87843de7c6a
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
foss@abala.me
parents:
26325
diff
changeset
|
3735 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
|
3736 return 1; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3737 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3738 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3739 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3740 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3741 |
15823 | 3742 static int purple_ssi_parserights(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3743 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3744 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3745 int numtypes; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3746 guint16 *maxitems; |
23777
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23776
diff
changeset
|
3747 GString *msg; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3748 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3749 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3750 numtypes = va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3751 maxitems = va_arg(ap, guint16 *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3752 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3753 |
23777
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23776
diff
changeset
|
3754 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:
23776
diff
changeset
|
3755 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:
23776
diff
changeset
|
3756 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:
23776
diff
changeset
|
3757 g_string_append(msg, "\n"); |
24398
0320b4a33432
Backport the 'purple_debug_*(msg)' -> 'purple_debug_*("%s", msg);' fixes.
Richard Laager <rlaager@wiktel.com>
parents:
24393
diff
changeset
|
3758 purple_debug_misc("oscar", "%s", msg->str); |
23777
62fda5f78f6a
Stu reckoned that having a new block to build the debug string is ugly;
Will Thompson <will.thompson@collabora.co.uk>
parents:
23776
diff
changeset
|
3759 g_string_free(msg, TRUE); |
15374
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 if (numtypes >= 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3762 od->rights.maxbuddies = maxitems[0]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3763 if (numtypes >= 1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3764 od->rights.maxgroups = maxitems[1]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3765 if (numtypes >= 2) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3766 od->rights.maxpermits = maxitems[2]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3767 if (numtypes >= 3) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3768 od->rights.maxdenies = maxitems[3]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3769 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3770 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3771 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3772 |
15823 | 3773 static int purple_ssi_parselist(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3774 { |
15823 | 3775 PurpleConnection *gc; |
3776 PurpleAccount *account; | |
3777 PurpleGroup *g; | |
3778 PurpleBuddy *b; | |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3779 GSList *cur, *next, *buddies; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3780 struct aim_ssi_item *curitem; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3781 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
|
3782 PurpleStoredImage *img; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3783 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3784 guint16 fmtver, numitems; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3785 guint32 timestamp; |
30800
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3786 guint16 deny_entry_type = aim_ssi_getdenyentrytype(od); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3788 gc = od->gc; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3789 od = purple_connection_get_protocol_data(gc); |
15823 | 3790 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3791 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3792 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3793 fmtver = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3794 numitems = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3795 timestamp = va_arg(ap, guint32); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3796 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3797 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3798 /* Don't attempt to re-request our buddy list later */ |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3799 if (od->getblisttimer != 0) { |
15823 | 3800 purple_timeout_remove(od->getblisttimer); |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3801 od->getblisttimer = 0; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3802 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3803 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3804 purple_debug_info("oscar", "ssi: syncing local list and server list\n"); |
15374
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 /* Clean the buddy list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3807 aim_ssi_cleanlist(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3808 |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3809 /*** Begin code for pruning buddies from local list if they're not in server list ***/ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3810 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3811 /* Buddies */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3812 cur = NULL; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3813 for (buddies = purple_find_buddies(account, NULL); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3814 buddies; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3815 buddies = g_slist_delete_link(buddies, buddies)) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3816 { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3817 PurpleGroup *g; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3818 const char *gname; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3819 const char *bname; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3820 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3821 b = buddies->data; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3822 g = purple_buddy_get_group(b); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3823 gname = purple_group_get_name(g); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3824 bname = purple_buddy_get_name(b); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3825 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3826 if (aim_ssi_itemlist_exists(od->ssi.local, bname)) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3827 /* If the buddy is an ICQ user then load his nickname */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3828 const char *servernick = purple_blist_node_get_string((PurpleBlistNode*)b, "servernick"); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3829 char *alias; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3830 const char *balias; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3831 if (servernick) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3832 serv_got_alias(gc, bname, servernick); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3833 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3834 /* Store local alias on server */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3835 alias = aim_ssi_getalias(od->ssi.local, gname, bname); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3836 balias = purple_buddy_get_local_buddy_alias(b); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3837 if (!alias && balias && *balias) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3838 aim_ssi_aliasbuddy(od, gname, bname, balias); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3839 g_free(alias); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3840 } else { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3841 purple_debug_info("oscar", |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3842 "ssi: removing buddy %s from local list\n", bname); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3843 /* Queue the buddy for removal from the local list */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3844 cur = g_slist_prepend(cur, b); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3845 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3846 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3847 while (cur != NULL) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3848 purple_blist_remove_buddy(cur->data); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3849 cur = g_slist_delete_link(cur, cur); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3850 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3851 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3852 /* Permit list (ICQ doesn't have one) */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3853 if (!od->icq) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3854 next = account->permit; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3855 while (next != NULL) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3856 cur = next; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3857 next = next->next; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3858 if (!aim_ssi_itemlist_finditem(od->ssi.local, NULL, cur->data, AIM_SSI_TYPE_PERMIT)) { |
26846
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:
26612
diff
changeset
|
3859 purple_debug_info("oscar", |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3860 "ssi: removing permit %s from local list\n", (const char *)cur->data); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3861 purple_privacy_permit_remove(account, cur->data, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3862 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3863 } |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3864 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3865 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3866 /* Deny list */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3867 next = account->deny; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3868 while (next != NULL) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3869 cur = next; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3870 next = next->next; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3871 if (!aim_ssi_itemlist_finditem(od->ssi.local, NULL, cur->data, deny_entry_type)) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3872 purple_debug_info("oscar", |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3873 "ssi: removing deny %s from local list\n", (const char *)cur->data); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3874 purple_privacy_deny_remove(account, cur->data, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3875 } |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3876 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3877 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3878 /* Presence settings (idle time visibility) */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3879 tmp = aim_ssi_getpresence(od->ssi.local); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3880 if (tmp != 0xFFFFFFFF) { |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3881 const char *idle_reporting_pref; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3882 gboolean report_idle; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3883 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3884 idle_reporting_pref = purple_prefs_get_string("/purple/away/idle_reporting"); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3885 report_idle = strcmp(idle_reporting_pref, "none") != 0; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3886 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3887 if (report_idle) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3888 aim_ssi_setpresence(od, tmp | AIM_SSI_PRESENCE_FLAG_SHOWIDLE); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3889 else |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3890 aim_ssi_setpresence(od, tmp & ~AIM_SSI_PRESENCE_FLAG_SHOWIDLE); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3891 } |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3892 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3893 /*** End code for pruning buddies from local list ***/ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3894 |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3895 /*** Begin code for adding from server list to local list ***/ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3896 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3897 for (curitem=od->ssi.local; curitem; curitem=curitem->next) { |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3898 if (curitem->name && !g_utf8_validate(curitem->name, -1, NULL)) |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3899 /* Got node with invalid UTF-8 in the name. Skip it. */ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3900 break; |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3901 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3902 switch (curitem->type) { |
28862 | 3903 case AIM_SSI_TYPE_BUDDY: { /* Buddy */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3904 if (curitem->name) { |
22415
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22398
diff
changeset
|
3905 struct aim_ssi_item *groupitem; |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22398
diff
changeset
|
3906 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:
22398
diff
changeset
|
3907 |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22398
diff
changeset
|
3908 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:
22398
diff
changeset
|
3909 gname = groupitem ? groupitem->name : NULL; |
30834
a6511abec788
A couple of refactorings related to oscar_utf8_try_convert().
ivan.komarov@soc.pidgin.im
parents:
30832
diff
changeset
|
3910 gname_utf8 = oscar_utf8_try_convert(account, od, gname); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3911 |
18755
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3912 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
|
3913 if (g == NULL) { |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3914 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
|
3915 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
|
3916 } |
84d53c3c699d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <mark@kingant.net>
parents:
18642
diff
changeset
|
3917 |
22416
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22415
diff
changeset
|
3918 alias = aim_ssi_getalias(od->ssi.local, gname, curitem->name); |
30834
a6511abec788
A couple of refactorings related to oscar_utf8_try_convert().
ivan.komarov@soc.pidgin.im
parents:
30832
diff
changeset
|
3919 alias_utf8 = oscar_utf8_try_convert(account, od, alias); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3920 |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3921 b = purple_find_buddy_in_group(account, curitem->name, g); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3922 if (b) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3923 /* 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
|
3924 purple_blist_alias_buddy(b, alias_utf8); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3925 } else { |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3926 b = purple_buddy_new(account, curitem->name, alias_utf8); |
15823 | 3927 |
3928 purple_debug_info("oscar", | |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3929 "ssi: adding buddy %s to group %s to local list\n", curitem->name, gname); |
15823 | 3930 purple_blist_add_buddy(b, NULL, g, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3931 } |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
3932 if (!oscar_util_name_compare(curitem->name, purple_account_get_username(account))) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3933 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
|
3934 if (comment != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3935 { |
15823 | 3936 purple_check_comment(od, comment); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3937 g_free(comment); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3938 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3939 } |
20721
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3940 |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3941 /* Mobile users should always be online */ |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
3942 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
|
3943 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
|
3944 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
|
3945 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
|
3946 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
|
3947 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
|
3948 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
|
3949 } |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
3950 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3951 g_free(gname_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3952 g_free(alias_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3953 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3954 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3955 |
28862 | 3956 case AIM_SSI_TYPE_GROUP: { /* Group */ |
22415
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22398
diff
changeset
|
3957 char *gname; |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22398
diff
changeset
|
3958 char *gname_utf8; |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22398
diff
changeset
|
3959 |
a491ebed7f3a
I realized that I don't like initializing variables when I declare
Mark Doliner <mark@kingant.net>
parents:
22398
diff
changeset
|
3960 gname = curitem->name; |
30834
a6511abec788
A couple of refactorings related to oscar_utf8_try_convert().
ivan.komarov@soc.pidgin.im
parents:
30832
diff
changeset
|
3961 gname_utf8 = oscar_utf8_try_convert(account, od, gname); |
22416
5762dcb1909c
Patch #3874 from beret. There was a similar patch #2712 from rschnz,
Mark Doliner <mark@kingant.net>
parents:
22415
diff
changeset
|
3962 |
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
|
3963 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
|
3964 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
|
3965 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
|
3966 } |
20932 | 3967 g_free(gname_utf8); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3968 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3969 |
30800
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3970 case AIM_SSI_TYPE_PERMIT: { /* Permit buddy (unless we're on ICQ) */ |
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3971 if (!od->icq && curitem->name) { |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3972 for (cur = account->permit; (cur && oscar_util_name_compare(curitem->name, cur->data)); cur = cur->next); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3973 if (!cur) { |
15823 | 3974 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3975 "ssi: adding permit buddy %s to local list\n", curitem->name); |
15823 | 3976 purple_privacy_permit_add(account, curitem->name, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3977 } |
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 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3980 |
30800
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3981 case AIM_SSI_TYPE_ICQDENY: |
28862 | 3982 case AIM_SSI_TYPE_DENY: { /* Deny buddy */ |
30800
05c634403678
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
ivan.komarov@soc.pidgin.im
parents:
30799
diff
changeset
|
3983 if (curitem->type == deny_entry_type && curitem->name) { |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3984 for (cur = account->deny; (cur && oscar_util_name_compare(curitem->name, cur->data)); cur = cur->next); |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
3985 if (!cur) { |
15823 | 3986 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3987 "ssi: adding deny buddy %s to local list\n", curitem->name); |
15823 | 3988 purple_privacy_deny_add(account, curitem->name, TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3989 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3990 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3991 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3992 |
28862 | 3993 case AIM_SSI_TYPE_PDINFO: { /* Permit/deny setting */ |
25459
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
3994 /* |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
3995 * 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:
25452
diff
changeset
|
3996 * 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:
25452
diff
changeset
|
3997 * 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:
25452
diff
changeset
|
3998 * 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:
25452
diff
changeset
|
3999 */ |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
4000 if (!od->icq && curitem->data) { |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
4001 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:
25452
diff
changeset
|
4002 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:
25452
diff
changeset
|
4003 { |
15823 | 4004 purple_debug_info("oscar", |
25459
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
4005 "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:
25452
diff
changeset
|
4006 account->perm_deny = perm_deny; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4007 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4008 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4009 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4010 |
28862 | 4011 case AIM_SSI_TYPE_PRESENCEPREFS: { /* Presence setting */ |
15823 | 4012 /* We don't want to change Purple's setting because it applies to all accounts */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4013 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4014 } /* End of switch on curitem->type */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4015 } /* End of for loop */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4016 |
30810
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
4017 /*** End code for adding from server list to local list ***/ |
b8f47c07ca42
Cleanup some code I wrote a long time ago in a galaxy far far away.
Mark Doliner <mark@kingant.net>
parents:
30809
diff
changeset
|
4018 |
30809
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
4019 if (od->icq) { |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
4020 oscar_set_icq_permdeny(account); |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
4021 } else { |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
4022 oscar_set_aim_permdeny(gc); |
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
4023 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4024 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4025 /* Activate SSI */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4026 /* 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
|
4027 /* Make sure your privacy setting/invisibility is set how you want it before this! */ |
15823 | 4028 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4029 "ssi: activating server-stored buddy list\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4030 aim_ssi_enable(od); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4031 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4032 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4033 * 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
|
4034 * 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
|
4035 * account was offline. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4036 */ |
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
|
4037 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
|
4038 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
|
4039 purple_imgstore_unref(img); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4040 |
28758
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4041 /* |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4042 * If we've already received our bos rights then we're not waiting on |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4043 * anything else, so send the server clientready. |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4044 */ |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4045 if (od->bos.have_rights) { |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4046 aim_srv_clientready(od, conn); |
28881
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28879
diff
changeset
|
4047 |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28879
diff
changeset
|
4048 /* Request offline messages for AIM and ICQ */ |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28879
diff
changeset
|
4049 aim_im_reqofflinemsgs(od); |
30f8f2105740
I believe this change fixes offline message retrieval.
Mark Doliner <mark@kingant.net>
parents:
28879
diff
changeset
|
4050 |
28758
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4051 purple_connection_set_state(gc, PURPLE_CONNECTED); |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4052 } |
3161c687d7bc
Don't call aim_src_clientready() until we have activated our feedbag
Mark Doliner <mark@kingant.net>
parents:
28591
diff
changeset
|
4053 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4054 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4055 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4056 |
15823 | 4057 static int purple_ssi_parseack(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4058 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4059 va_list ap; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4060 struct aim_ssi_tmp *retval; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4061 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4062 va_start(ap, fr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4063 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
|
4064 va_end(ap); |
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 while (retval) { |
15823 | 4067 purple_debug_misc("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4068 "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
|
4069 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4070 if (retval->ack != 0xffff) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4071 switch (retval->ack) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4072 case 0x0000: { /* added successfully */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4073 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4074 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4075 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
|
4076 gchar *buf; |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
4077 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)"))); |
15823 | 4078 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) |
24374
75545fdf8944
String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents:
24315
diff
changeset
|
4079 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4080 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4081 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4082 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4083 case 0x000e: { /* buddy requires authorization */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4084 if ((retval->action == SNAC_SUBTYPE_FEEDBAG_ADD) && (retval->name)) |
30794
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30792
diff
changeset
|
4085 oscar_auth_sendrequest(gc, retval->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4086 } break; |
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 default: { /* La la la */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4089 gchar *buf; |
15823 | 4090 purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); |
27463
f541583e31bd
More uniformity among disconnect error messages
Mark Doliner <mark@kingant.net>
parents:
27459
diff
changeset
|
4091 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
|
4092 (retval->name ? retval->name : _("(no name)"))); |
15823 | 4093 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) |
24374
75545fdf8944
String changes. I'm kind of blindly making changes to the qq strings
Mark Doliner <mark@kingant.net>
parents:
24315
diff
changeset
|
4094 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4095 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4096 } break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4097 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4098 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4099 retval = retval->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4100 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4101 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4102 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4103 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4104 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4105 static int |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4106 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
|
4107 { |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4108 PurpleConnection *gc; |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4109 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4110 char *gname, *gname_utf8, *alias, *alias_utf8; |
15823 | 4111 PurpleBuddy *b; |
4112 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
|
4113 struct aim_ssi_item *ssi_item; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4114 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
|
4115 guint16 snac_subtype, type; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4116 const char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4117 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4118 gc = od->gc; |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4119 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
|
4120 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4121 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
|
4122 snac_subtype = (guint16)va_arg(ap, int); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4123 type = (guint16)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4124 name = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4125 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4126 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4127 if ((type != 0x0000) || (name == NULL)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4128 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4129 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4130 gname = aim_ssi_itemlist_findparentname(od->ssi.local, name); |
29193
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
29154
diff
changeset
|
4131 gname_utf8 = gname ? oscar_utf8_try_convert(account, od, gname) : NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4132 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4133 alias = aim_ssi_getalias(od->ssi.local, gname, name); |
30834
a6511abec788
A couple of refactorings related to oscar_utf8_try_convert().
ivan.komarov@soc.pidgin.im
parents:
30832
diff
changeset
|
4134 alias_utf8 = oscar_utf8_try_convert(account, od, alias); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4135 g_free(alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4136 |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4137 b = purple_find_buddy(account, name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4138 if (b) { |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4139 /* |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4140 * 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
|
4141 * 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
|
4142 * 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
|
4143 */ |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4144 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
|
4145 } 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
|
4146 /* |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4147 * 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
|
4148 * 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
|
4149 */ |
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4150 b = purple_buddy_new(account, name, alias_utf8); |
15823 | 4151 |
4152 if (!(g = purple_find_group(gname_utf8 ? gname_utf8 : _("Orphans")))) { | |
4153 g = purple_group_new(gname_utf8 ? gname_utf8 : _("Orphans")); | |
4154 purple_blist_add_group(g, NULL); | |
15374
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 |
15823 | 4157 purple_debug_info("oscar", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4158 "ssi: adding buddy %s to group %s to local list\n", name, gname_utf8 ? gname_utf8 : _("Orphans")); |
15823 | 4159 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
|
4160 |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4161 /* Mobile users should always be online */ |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4162 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
|
4163 purple_prpl_got_user_status(account, |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4164 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
|
4165 purple_prpl_got_user_status(account, |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4166 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
|
4167 } |
d579d77d4604
Make phone numbers always show up as online and mobile. AOL takes
Mark Doliner <mark@kingant.net>
parents:
20661
diff
changeset
|
4168 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4169 } |
20630
41dd71aa79d6
Another patch from Collin from ComBOTS Product GmbH. Now, if you
Mark Doliner <mark@kingant.net>
parents:
20629
diff
changeset
|
4170 |
21993
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4171 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
|
4172 gname, name, AIM_SSI_TYPE_BUDDY); |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
4173 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
|
4174 { |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4175 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
|
4176 "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
|
4177 "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
|
4178 } |
bb1190d6961c
Partial support for reading ICQ 6 status notes. The status note will
Mark Doliner <mark@kingant.net>
parents:
21737
diff
changeset
|
4179 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4180 g_free(gname_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4181 g_free(alias_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4182 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4183 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4184 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4185 |
15823 | 4186 static int purple_ssi_authgiven(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4187 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4188 va_list ap; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4189 char *bn, *msg; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4190 gchar *dialog_msg, *nombre; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4191 struct name_data *data; |
15823 | 4192 PurpleBuddy *buddy; |
15374
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 va_start(ap, fr); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4195 bn = va_arg(ap, char *); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4196 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4197 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4198 |
15823 | 4199 purple_debug_info("oscar", |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4200 "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:
25415
diff
changeset
|
4201 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4202 buddy = purple_find_buddy(purple_connection_get_account(gc), bn); |
15823 | 4203 if (buddy && (purple_buddy_get_alias_only(buddy))) |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4204 nombre = g_strdup_printf("%s (%s)", bn, purple_buddy_get_alias_only(buddy)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4205 else |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4206 nombre = g_strdup(bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4207 |
22637
e970c0c8a48d
nosnilmot pointed out that this error message seemed to be wrong. I agree
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22603
diff
changeset
|
4208 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); |
16894
84e2c7cc590a
Free nombre as soon as we're done using it, for clarity
Evan Schoenberg <evan.s@dreskin.net>
parents:
16893
diff
changeset
|
4209 g_free(nombre); |
84e2c7cc590a
Free nombre as soon as we're done using it, for clarity
Evan Schoenberg <evan.s@dreskin.net>
parents:
16893
diff
changeset
|
4210 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4211 data = g_new(struct name_data, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4212 data->gc = gc; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4213 data->name = g_strdup(bn); |
16893
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:
16843
diff
changeset
|
4214 data->nick = (buddy ? g_strdup(purple_buddy_get_alias_only(buddy)) : NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4215 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4216 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
|
4217 PURPLE_DEFAULT_ACTION_NONE, |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4218 purple_connection_get_account(gc), bn, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4219 data, |
15823 | 4220 G_CALLBACK(purple_icq_buddyadd), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4221 G_CALLBACK(oscar_free_name_data)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4222 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4223 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4224 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4225 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4226 |
30012
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4227 static int purple_ssi_authrequest(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4228 { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4229 va_list ap; |
30012
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4230 const char *bn; |
30790
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30571
diff
changeset
|
4231 char *msg; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4232 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4233 va_start(ap, fr); |
30012
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4234 bn = va_arg(ap, const char *); |
30790
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30571
diff
changeset
|
4235 msg = va_arg(ap, char *); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4236 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4237 |
15823 | 4238 purple_debug_info("oscar", |
30012
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4239 "ssi: received authorization request from %s\n", bn); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4240 |
30012
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4241 if (!msg) { |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4242 purple_debug_warning("oscar", "Received auth request from %s with " |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4243 "empty message\n", bn); |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4244 } else if (!g_utf8_validate(msg, -1, NULL)) { |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4245 purple_debug_warning("oscar", "Received auth request from %s with " |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4246 "invalid UTF-8 message\n", bn); |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4247 msg = NULL; |
a7875e67ad9c
Don't try to convert the message in incoming auth requests. The oscar
Mark Doliner <mark@kingant.net>
parents:
30011
diff
changeset
|
4248 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4249 |
30790
674a656893a3
Show authorization request sender's nickname in the "Authorize buddy?"
ivan.komarov@soc.pidgin.im
parents:
30571
diff
changeset
|
4250 aim_icq_getalias(od, bn, TRUE, msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4251 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4252 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4253 |
15823 | 4254 static int purple_ssi_authreply(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4255 PurpleConnection *gc = od->gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4256 va_list ap; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4257 char *bn, *msg; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4258 gchar *dialog_msg, *nombre; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4259 guint8 reply; |
15823 | 4260 PurpleBuddy *buddy; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4261 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4262 va_start(ap, fr); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4263 bn = va_arg(ap, char *); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4264 reply = (guint8)va_arg(ap, int); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4265 msg = va_arg(ap, char *); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4266 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4267 |
15823 | 4268 purple_debug_info("oscar", |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4269 "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:
25415
diff
changeset
|
4270 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4271 buddy = purple_find_buddy(purple_connection_get_account(gc), bn); |
15823 | 4272 if (buddy && (purple_buddy_get_alias_only(buddy))) |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4273 nombre = g_strdup_printf("%s (%s)", bn, purple_buddy_get_alias_only(buddy)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4274 else |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4275 nombre = g_strdup(bn); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4276 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4277 if (reply) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4278 /* Granted */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4279 dialog_msg = g_strdup_printf(_("The user %s has granted your request to add them to your buddy list."), nombre); |
15823 | 4280 purple_notify_info(gc, NULL, _("Authorization Granted"), dialog_msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4281 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4282 /* Denied */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4283 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.")); |
15823 | 4284 purple_notify_info(gc, NULL, _("Authorization Denied"), dialog_msg); |
15374
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 g_free(dialog_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4287 g_free(nombre); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4289 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4290 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4291 |
15823 | 4292 static int purple_ssi_gotadded(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) { |
4293 PurpleConnection *gc = od->gc; | |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4294 PurpleAccount *account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4295 va_list ap; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4296 char *bn; |
15823 | 4297 PurpleBuddy *buddy; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4298 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4299 va_start(ap, fr); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4300 bn = va_arg(ap, char *); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4301 va_end(ap); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4302 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4303 buddy = purple_find_buddy(account, bn); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4304 purple_debug_info("oscar", "ssi: %s added you to their buddy list\n", bn); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4305 purple_account_notify_added(account, bn, NULL, |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4306 (buddy ? purple_buddy_get_alias_only(buddy) : NULL), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4307 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4308 return 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4309 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4310 |
15823 | 4311 GList *oscar_chat_info(PurpleConnection *gc) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4312 GList *m = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4313 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4314 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4315 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
|
4316 pce->label = _("_Room:"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4317 pce->identifier = "room"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4318 pce->required = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4319 m = g_list_append(m, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4320 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4321 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
|
4322 pce->label = _("_Exchange:"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4323 pce->identifier = "exchange"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4324 pce->required = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4325 pce->is_int = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4326 pce->min = 4; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4327 pce->max = 20; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4328 m = g_list_append(m, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4329 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4330 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4331 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4332 |
15823 | 4333 GHashTable *oscar_chat_info_defaults(PurpleConnection *gc, const char *chat_name) |
15374
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 GHashTable *defaults; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4337 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
|
4338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4339 if (chat_name != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4340 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
|
4341 g_hash_table_insert(defaults, "exchange", g_strdup("4")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4342 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4343 return defaults; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4346 char * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4347 oscar_get_chat_name(GHashTable *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4348 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4349 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
|
4350 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4351 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4352 void |
15823 | 4353 oscar_join_chat(PurpleConnection *gc, GHashTable *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4354 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4355 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4356 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4357 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
|
4358 int exchange_int; |
15374
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 name = g_hash_table_lookup(data, "room"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4361 exchange = g_hash_table_lookup(data, "exchange"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4362 |
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
|
4363 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
|
4364 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
|
4365 |
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
|
4366 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
|
4367 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
|
4368 g_return_if_fail(errno == 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4369 |
15823 | 4370 purple_debug_info("oscar", "Attempting to join chat room %s.\n", name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4371 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4372 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
|
4373 { |
15823 | 4374 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
|
4375 aim_chatnav_createroom(od, conn, name, exchange_int); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4376 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4377 /* this gets tricky */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4378 struct create_room *cr = g_new0(struct create_room, 1); |
15823 | 4379 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
|
4380 cr->exchange = exchange_int; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4381 cr->name = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4382 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
|
4383 aim_srv_requestnew(od, SNAC_FAMILY_CHATNAV); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4387 void |
15823 | 4388 oscar_chat_invite(PurpleConnection *gc, int id, const char *message, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4389 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4390 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4391 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
|
4392 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4393 if (ccon == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4394 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4395 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4396 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
|
4397 ccon->exchange, ccon->name, 0x0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4398 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4399 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4400 void |
15823 | 4401 oscar_chat_leave(PurpleConnection *gc, int id) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4402 { |
15823 | 4403 PurpleConversation *conv; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4404 struct chat_connection *cc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4405 |
15823 | 4406 conv = purple_find_chat(gc, id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4407 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4408 g_return_if_fail(conv != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4409 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4410 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:
25416
diff
changeset
|
4411 purple_conversation_get_name(conv)); |
15823 | 4412 |
4413 cc = find_oscar_chat(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv))); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4414 oscar_chat_kill(gc, cc); |
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 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4417 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:
25416
diff
changeset
|
4418 { |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4419 OscarData *od = purple_connection_get_protocol_data(gc); |
15823 | 4420 PurpleConversation *conv = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4421 struct chat_connection *c = NULL; |
17824
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:
17799
diff
changeset
|
4422 char *buf, *buf2, *buf3; |
30818
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
4423 guint16 charset; |
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
4424 char *charsetstr; |
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
4425 gsize len; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4426 |
15823 | 4427 if (!(conv = purple_find_chat(gc, id))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4428 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4429 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4430 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
|
4431 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4432 |
15823 | 4433 buf = purple_strdup_withhtml(message); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4434 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4435 if (strstr(buf, "<IMG ")) |
15823 | 4436 purple_conversation_write(conv, "", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4437 _("Your IM Image was not sent. " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4438 "You cannot send IM Images in AIM chats."), |
15823 | 4439 PURPLE_MESSAGE_ERROR, time(NULL)); |
4440 | |
30827 | 4441 buf2 = oscar_encode_im(buf, &len, &charset, &charsetstr); |
15374
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 * 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
|
4444 * visible characters" and not "number of bytes" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4445 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4446 if ((len > c->maxlen) || (len > c->maxvis)) { |
17824
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:
17799
diff
changeset
|
4447 /* 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:
17799
diff
changeset
|
4448 * purple_strdup_withhtml() and the encoding process. The result may be shorter. */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4449 g_free(buf2); |
17824
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:
17799
diff
changeset
|
4450 |
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:
17799
diff
changeset
|
4451 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:
17799
diff
changeset
|
4452 g_free(buf); |
17826
329ca72df5fa
Remove a pair of unneeded strlen's
Mark Doliner <mark@kingant.net>
parents:
17825
diff
changeset
|
4453 |
17824
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:
17799
diff
changeset
|
4454 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:
17799
diff
changeset
|
4455 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:
17799
diff
changeset
|
4456 |
30827 | 4457 buf2 = oscar_encode_im(buf, &len, &charset, &charsetstr); |
17824
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:
17799
diff
changeset
|
4458 |
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:
17799
diff
changeset
|
4459 if ((len > c->maxlen) || (len > c->maxvis)) { |
30818
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
4460 purple_debug_warning("oscar", |
9d386bf63eab
Stop using custom encodings (and LATIN-1, for that matter) for sending
ivan.komarov@soc.pidgin.im
parents:
30815
diff
changeset
|
4461 "Could not send %s because (%" G_GSIZE_FORMAT " > maxlen %i) or (%" G_GSIZE_FORMAT " > maxvis %i)\n", |
17824
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:
17799
diff
changeset
|
4462 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:
17799
diff
changeset
|
4463 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:
17799
diff
changeset
|
4464 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:
17799
diff
changeset
|
4465 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:
17799
diff
changeset
|
4466 } |
17826
329ca72df5fa
Remove a pair of unneeded strlen's
Mark Doliner <mark@kingant.net>
parents:
17825
diff
changeset
|
4467 |
19653
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19641
diff
changeset
|
4468 purple_debug_info("oscar", "Sending %s as %s because the original was too long.\n", |
17826
329ca72df5fa
Remove a pair of unneeded strlen's
Mark Doliner <mark@kingant.net>
parents:
17825
diff
changeset
|
4469 message, buf2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4470 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4471 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4472 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
|
4473 g_free(buf2); |
17824
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:
17799
diff
changeset
|
4474 g_free(buf); |
15374
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 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4477 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4478 |
29834
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29829
diff
changeset
|
4479 PurpleMood* oscar_get_purple_moods(PurpleAccount *account) |
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29829
diff
changeset
|
4480 { |
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29829
diff
changeset
|
4481 return icq_get_purple_moods(account); |
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29829
diff
changeset
|
4482 } |
1fb503adb2ae
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@wiktel.com>
parents:
29829
diff
changeset
|
4483 |
15823 | 4484 const char *oscar_list_icon_icq(PurpleAccount *a, PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4485 { |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4486 const char *name = b ? purple_buddy_get_name(b) : NULL; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4487 if ((b == NULL) || (name == NULL) || oscar_util_valid_name_sms(name)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4488 { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4489 if (a == NULL || oscar_util_valid_name_icq(purple_account_get_username(a))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4490 return "icq"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4491 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4492 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4493 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4494 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4495 if (oscar_util_valid_name_icq(name)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4496 return "icq"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4497 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4498 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4499 |
15823 | 4500 const char *oscar_list_icon_aim(PurpleAccount *a, PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4501 { |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4502 const char *name = b ? purple_buddy_get_name(b) : NULL; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4503 if ((b == NULL) || (name == NULL) || oscar_util_valid_name_sms(name)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4504 { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4505 if (a != NULL && oscar_util_valid_name_icq(purple_account_get_username(a))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4506 return "icq"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4507 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4508 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4509 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4510 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4511 if (oscar_util_valid_name_icq(name)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4512 return "icq"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4513 return "aim"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4514 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4515 |
23269 | 4516 const char *oscar_list_emblem(PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4517 { |
15823 | 4518 PurpleConnection *gc = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4519 OscarData *od = NULL; |
15823 | 4520 PurpleAccount *account = NULL; |
4521 PurplePresence *presence; | |
4522 PurpleStatus *status; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4523 const char *status_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4524 aim_userinfo_t *userinfo = NULL; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4525 const char *name; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4526 |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4527 account = purple_buddy_get_account(b); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4528 name = purple_buddy_get_name(b); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4529 if (account != NULL) |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4530 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4531 if (gc != NULL) |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4532 od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4533 if (od != NULL) |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4534 userinfo = aim_locate_finduserinfo(od, name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4535 |
15823 | 4536 presence = purple_buddy_get_presence(b); |
4537 status = purple_presence_get_active_status(presence); | |
4538 status_id = purple_status_get_id(status); | |
4539 | |
4540 if (purple_presence_is_online(presence) == FALSE) { | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4541 char *gname; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4542 if ((name) && (od) && (od->ssi.received_data) && |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4543 (gname = aim_ssi_itemlist_findparentname(od->ssi.local, name)) && |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4544 (aim_ssi_waitingforauth(od->ssi.local, gname, name))) { |
15463 | 4545 return "not-authorized"; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4546 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4547 } |
23269 | 4548 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4549 if (userinfo != NULL ) { |
15463 | 4550 if (userinfo->flags & AIM_FLAG_ADMINISTRATOR) |
4551 return "admin"; | |
4552 if (userinfo->flags & AIM_FLAG_ACTIVEBUDDY) | |
4553 return "bot"; | |
4554 if (userinfo->capabilities & OSCAR_CAPABILITY_SECUREIM) | |
4555 return "secure"; | |
20582
749c35474b09
Use birthday emblem in OSCAR. Fixes #300
Sean Egan <seanegan@gmail.com>
parents:
19686
diff
changeset
|
4556 if (userinfo->icqinfo.status & AIM_ICQ_STATE_BIRTHDAY) |
749c35474b09
Use birthday emblem in OSCAR. Fixes #300
Sean Egan <seanegan@gmail.com>
parents:
19686
diff
changeset
|
4557 return "birthday"; |
29829
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4558 |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4559 /* Make the mood icon override anything below this. */ |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4560 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOOD)) |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4561 return NULL; |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4562 |
29818
2c95b7c57ebb
Fix up the X-Status code in many ways:
Richard Laager <rlaager@wiktel.com>
parents:
29814
diff
changeset
|
4563 if (userinfo->capabilities & OSCAR_CAPABILITY_HIPTOP) |
2c95b7c57ebb
Fix up the X-Status code in many ways:
Richard Laager <rlaager@wiktel.com>
parents:
29814
diff
changeset
|
4564 return "hiptop"; |
15463 | 4565 } |
4566 return NULL; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4567 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4568 |
23267
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4569 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:
23246
diff
changeset
|
4570 { |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4571 PurpleConnection *gc; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4572 PurpleAccount *account; |
23267
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4573 OscarData *od; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4574 aim_userinfo_t *userinfo; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4575 |
23268
9f34726fe141
Whoops, I should have inverted this logic.
Mark Doliner <mark@kingant.net>
parents:
23267
diff
changeset
|
4576 if (!PURPLE_BUDDY_IS_ONLINE(b)) |
23267
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4577 return; |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4578 |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4579 account = purple_buddy_get_account(b); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4580 gc = purple_account_get_connection(account); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4581 od = purple_connection_get_protocol_data(gc); |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4582 userinfo = aim_locate_finduserinfo(od, purple_buddy_get_name(b)); |
23267
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4583 |
23272
e9dc6fdbf257
This should fix tooltips for buddies with away messages which have embedded
Evan Schoenberg <evan.s@dreskin.net>
parents:
23270
diff
changeset
|
4584 oscar_user_info_append_status(gc, user_info, b, userinfo, /* strip_html_tags */ TRUE); |
23267
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4585 |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4586 if (full) |
043e4b0c274e
Short-circuit earlier if the buddy is offline
Mark Doliner <mark@kingant.net>
parents:
23246
diff
changeset
|
4587 oscar_user_info_append_extra_info(gc, user_info, b, userinfo); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4588 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4589 |
15823 | 4590 char *oscar_status_text(PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4591 { |
15823 | 4592 PurpleConnection *gc; |
4593 PurpleAccount *account; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4594 OscarData *od; |
15823 | 4595 const PurplePresence *presence; |
4596 const PurpleStatus *status; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4597 const char *id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4598 const char *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4599 gchar *ret = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4600 |
15823 | 4601 gc = purple_account_get_connection(purple_buddy_get_account(b)); |
4602 account = purple_connection_get_account(gc); | |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4603 od = purple_connection_get_protocol_data(gc); |
15823 | 4604 presence = purple_buddy_get_presence(b); |
4605 status = purple_presence_get_active_status(presence); | |
4606 id = purple_status_get_id(status); | |
4607 | |
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
|
4608 if ((od != NULL) && !purple_presence_is_online(presence)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4609 { |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4610 const char *name = purple_buddy_get_name(b); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4611 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:
23961
diff
changeset
|
4612 if (aim_ssi_waitingforauth(od->ssi.local, gname, name)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4613 ret = g_strdup(_("Not Authorized")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4614 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4615 ret = g_strdup(_("Offline")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4616 } |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
4617 else |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4618 { |
15823 | 4619 message = purple_status_get_attr_string(status, "message"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4620 if (message != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4621 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4622 gchar *tmp1, *tmp2; |
15823 | 4623 tmp1 = purple_markup_strip_html(message); |
4624 purple_util_chrreplace(tmp1, '\n', ' '); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4625 tmp2 = g_markup_escape_text(tmp1, -1); |
30794
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30792
diff
changeset
|
4626 ret = oscar_util_format_string(tmp2, purple_account_get_username(account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4627 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4628 g_free(tmp2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4629 } |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
4630 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:
25024
diff
changeset
|
4631 { |
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
4632 /* 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:
25024
diff
changeset
|
4633 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4634 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4635 { |
25028
2c80f3d839c7
Patch to fix retrieval of ICQ status messages from users of ICQ 6.x, Miranda,
Daniel Lj <dimmuxx@yahoo.se>
parents:
25024
diff
changeset
|
4636 ret = g_strdup(purple_status_get_name(status)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4637 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4638 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4639 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4640 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4641 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4642 |
30809
50d472b3d752
Fixed a bug I accidentally introduced in fb1ab831dedebf45ea50b6f87bfc00265a0115ef.
ivan.komarov@soc.pidgin.im
parents:
30806
diff
changeset
|
4643 void oscar_set_aim_permdeny(PurpleConnection *gc) { |
15823 | 4644 PurpleAccount *account = purple_connection_get_account(gc); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4645 OscarData *od = purple_connection_get_protocol_data(gc); |
25459
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
4646 |
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
4647 /* |
30805
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
4648 * Conveniently there is a one-to-one mapping between the |
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
4649 * values of libpurple's PurplePrivacyType and the values used |
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
4650 * by the oscar protocol. |
25459
4d758dcd5715
Change the way oscar deals with account->perm_deny a little bit.
Mark Doliner <mark@kingant.net>
parents:
25452
diff
changeset
|
4651 */ |
30805
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
4652 aim_ssi_setpermdeny(od, account->perm_deny); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4653 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4654 |
15823 | 4655 void oscar_add_permit(PurpleConnection *gc, const char *who) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4656 OscarData *od = purple_connection_get_protocol_data(gc); |
15823 | 4657 purple_debug_info("oscar", "ssi: About to add a permit\n"); |
30805
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
4658 aim_ssi_add_to_private_list(od, who, AIM_SSI_TYPE_PERMIT); |
15374
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 |
15823 | 4661 void oscar_add_deny(PurpleConnection *gc, const char *who) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4662 OscarData *od = purple_connection_get_protocol_data(gc); |
15823 | 4663 purple_debug_info("oscar", "ssi: About to add a deny\n"); |
30805
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
4664 aim_ssi_add_to_private_list(od, who, aim_ssi_getdenyentrytype(od)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4665 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4666 |
15823 | 4667 void oscar_rem_permit(PurpleConnection *gc, const char *who) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4668 OscarData *od = purple_connection_get_protocol_data(gc); |
15823 | 4669 purple_debug_info("oscar", "ssi: About to delete a permit\n"); |
30805
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
4670 aim_ssi_del_from_private_list(od, who, AIM_SSI_TYPE_PERMIT); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4671 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4672 |
15823 | 4673 void oscar_rem_deny(PurpleConnection *gc, const char *who) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4674 OscarData *od = purple_connection_get_protocol_data(gc); |
15823 | 4675 purple_debug_info("oscar", "ssi: About to delete a deny\n"); |
30805
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
4676 aim_ssi_del_from_private_list(od, who, aim_ssi_getdenyentrytype(od)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4677 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4678 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4679 GList * |
15823 | 4680 oscar_status_types(PurpleAccount *account) |
15374
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 gboolean is_icq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4683 GList *status_types = NULL; |
15823 | 4684 PurpleStatusType *type; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4685 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4686 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
|
4687 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4688 /* Used to flag some statuses as "user settable" or not */ |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
4689 is_icq = oscar_util_valid_name_icq(purple_account_get_username(account)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4690 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4691 /* Common status types */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4692 /* Really the available message should only be settable for AIM accounts */ |
15823 | 4693 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4694 OSCAR_STATUS_ID_AVAILABLE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4695 NULL, TRUE, TRUE, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4696 "message", _("Message"), |
15823 | 4697 purple_value_new(PURPLE_TYPE_STRING), |
15628
2261750cf4e9
Allow setting of the iTunes Music Store URL for AIM accounts. It's
Mark Doliner <mark@kingant.net>
parents:
15625
diff
changeset
|
4698 "itmsurl", _("iTunes Music Store Link"), |
15823 | 4699 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4700 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
|
4701 |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4702 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4703 OSCAR_STATUS_ID_FREE4CHAT, |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4704 _("Free For Chat"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4705 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4706 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4707 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4708 status_types = g_list_prepend(status_types, type); |
30011 | 4709 |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4710 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4711 OSCAR_STATUS_ID_EVIL, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4712 _("Evil"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4713 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4714 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4715 status_types = g_list_prepend(status_types, type); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4716 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4717 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4718 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4719 OSCAR_STATUS_ID_DEPRESSION, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4720 _("Depression"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4721 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4722 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4723 status_types = g_list_prepend(status_types, type); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4724 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4725 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4726 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4727 OSCAR_STATUS_ID_ATHOME, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4728 _("At home"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4729 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4730 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4731 status_types = g_list_prepend(status_types, type); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4732 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4733 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4734 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4735 OSCAR_STATUS_ID_ATWORK, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4736 _("At work"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4737 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4738 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4739 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4740 status_types = g_list_prepend(status_types, type); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4741 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4742 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4743 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4744 OSCAR_STATUS_ID_LUNCH, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4745 _("Lunch"), TRUE, is_icq, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4746 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4747 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4748 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4749 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
|
4750 |
15823 | 4751 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4752 OSCAR_STATUS_ID_AWAY, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4753 NULL, TRUE, TRUE, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4754 "message", _("Message"), |
15823 | 4755 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4756 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
|
4757 |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4758 type = purple_status_type_new_with_attrs(PURPLE_STATUS_INVISIBLE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4759 OSCAR_STATUS_ID_INVISIBLE, |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4760 NULL, TRUE, TRUE, FALSE, |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4761 "message", _("Message"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4762 purple_value_new(PURPLE_TYPE_STRING), NULL); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4763 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4764 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
|
4765 |
15823 | 4766 type = purple_status_type_new_full(PURPLE_STATUS_MOBILE, OSCAR_STATUS_ID_MOBILE, NULL, FALSE, FALSE, TRUE); |
15524
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:
15463
diff
changeset
|
4767 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:
15463
diff
changeset
|
4768 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4769 /* ICQ-specific status types */ |
15823 | 4770 type = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4771 OSCAR_STATUS_ID_OCCUPIED, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4772 _("Occupied"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4773 "message", _("Message"), |
15823 | 4774 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4775 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
|
4776 |
16412
569eba287c84
Sean proposed changing ICQ's "do not disturb" status from being
Mark Doliner <mark@kingant.net>
parents:
16330
diff
changeset
|
4777 type = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4778 OSCAR_STATUS_ID_DND, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4779 _("Do Not Disturb"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4780 "message", _("Message"), |
15823 | 4781 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4782 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
|
4783 |
15823 | 4784 type = purple_status_type_new_with_attrs(PURPLE_STATUS_EXTENDED_AWAY, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4785 OSCAR_STATUS_ID_NA, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4786 _("Not Available"), TRUE, is_icq, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4787 "message", _("Message"), |
15823 | 4788 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4789 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
|
4790 |
15823 | 4791 type = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4792 OSCAR_STATUS_ID_OFFLINE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4793 NULL, TRUE, TRUE, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4794 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
|
4795 |
29829
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4796 type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOOD, |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4797 "mood", NULL, TRUE, is_icq, TRUE, |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4798 PURPLE_MOOD_NAME, _("Mood Name"), purple_value_new(PURPLE_TYPE_STRING), |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4799 PURPLE_MOOD_COMMENT, _("Mood Comment"), purple_value_new(PURPLE_TYPE_STRING), |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4800 NULL); |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4801 status_types = g_list_prepend(status_types, type); |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4802 |
11cb7f2bb6e8
Add a PURPLE_STATUS_MOOD primitive and change ICQ to use it.
Richard Laager <rlaager@wiktel.com>
parents:
29818
diff
changeset
|
4803 return g_list_reverse(status_types); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4804 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4805 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4806 static void oscar_ssi_editcomment(struct name_data *data, const char *text) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4807 PurpleConnection *gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4808 PurpleAccount *account; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4809 OscarData *od; |
15823 | 4810 PurpleBuddy *b; |
4811 PurpleGroup *g; | |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4812 const char *username; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4813 |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4814 gc = data->gc; |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4815 od = purple_connection_get_protocol_data(gc); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4816 account = purple_connection_get_account(gc); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4817 |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4818 b = purple_find_buddy(account, data->name); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4819 if (b == NULL) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4820 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4821 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4822 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4823 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4824 g = purple_buddy_get_group(b); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4825 if (g == NULL) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4826 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4827 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4828 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4829 |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4830 aim_ssi_editcomment(od, purple_group_get_name(g), data->name, text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4831 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4832 username = purple_account_get_username(account); |
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4833 if (!oscar_util_name_compare(data->name, username)) |
15823 | 4834 purple_check_comment(od, text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4835 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4836 oscar_free_name_data(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4837 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4838 |
15823 | 4839 static void oscar_buddycb_edit_comment(PurpleBlistNode *node, gpointer ignore) { |
4840 | |
4841 PurpleBuddy *buddy; | |
4842 PurpleConnection *gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4843 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4844 struct name_data *data; |
15823 | 4845 PurpleGroup *g; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4846 char *comment; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4847 gchar *comment_utf8; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4848 gchar *title; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4849 PurpleAccount *account; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4850 const char *name; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4851 |
15823 | 4852 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
4853 | |
4854 buddy = (PurpleBuddy *) node; | |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4855 name = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4856 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4857 gc = purple_account_get_connection(account); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4858 od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4859 |
15823 | 4860 if (!(g = purple_buddy_get_group(buddy))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4861 return; |
24315
dd787f8d5e91
Fix a potential leak, thanks to "KuSh". Fixes #7463.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24163
diff
changeset
|
4862 |
dd787f8d5e91
Fix a potential leak, thanks to "KuSh". Fixes #7463.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24163
diff
changeset
|
4863 data = g_new(struct name_data, 1); |
dd787f8d5e91
Fix a potential leak, thanks to "KuSh". Fixes #7463.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24163
diff
changeset
|
4864 |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4865 comment = aim_ssi_getcomment(od->ssi.local, purple_group_get_name(g), name); |
29193
328a7ff06110
Use the od->icq boolean in a few places where we were calling
Mark Doliner <mark@kingant.net>
parents:
29154
diff
changeset
|
4866 comment_utf8 = comment ? oscar_utf8_try_convert(account, od, comment) : NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4867 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4868 data->gc = gc; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4869 data->name = g_strdup(name); |
16893
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:
16843
diff
changeset
|
4870 data->nick = g_strdup(purple_buddy_get_alias_only(buddy)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4871 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4872 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
|
4873 purple_request_input(gc, title, _("Buddy Comment:"), NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4874 comment_utf8, TRUE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4875 _("_OK"), G_CALLBACK(oscar_ssi_editcomment), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4876 _("_Cancel"), G_CALLBACK(oscar_free_name_data), |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4877 account, data->name, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4878 data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4879 g_free(title); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4880 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4881 g_free(comment); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4882 g_free(comment_utf8); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4883 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4884 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4885 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4886 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
|
4887 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4888 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
|
4889 g_free(data->who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4890 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4891 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4892 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4893 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4894 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
|
4895 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4896 g_free(data->who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4897 g_free(data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4898 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4899 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4900 /* 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
|
4901 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4902 oscar_ask_directim(gpointer object, gpointer ignored) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4903 { |
15823 | 4904 PurpleBlistNode *node; |
4905 PurpleBuddy *buddy; | |
4906 PurpleConnection *gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4907 gchar *buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4908 struct oscar_ask_directim_data *data; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4909 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4910 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4911 node = object; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4912 |
15823 | 4913 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
4914 | |
4915 buddy = (PurpleBuddy *)node; | |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4916 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4917 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4918 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4919 data = g_new0(struct oscar_ask_directim_data, 1); |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4920 data->who = g_strdup(purple_buddy_get_name(buddy)); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
4921 data->od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4922 buf = g_strdup_printf(_("You have selected to open a Direct IM connection with %s."), |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4923 data->who); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4924 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4925 purple_request_action(gc, NULL, buf, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4926 _("Because this reveals your IP address, it " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4927 "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
|
4928 "wish to continue?"), |
22137
6dab6629497a
Improve oscar's default actions a tad bit
Mark Doliner <mark@kingant.net>
parents:
22129
diff
changeset
|
4929 0, /* Default action is "connect" */ |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
4930 account, data->who, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
4931 data, 2, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4932 _("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
|
4933 _("_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
|
4934 g_free(buf); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4935 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4936 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4937 static void |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4938 oscar_close_directim(gpointer object, gpointer ignored) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4939 { |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4940 PurpleBlistNode *node; |
15823 | 4941 PurpleBuddy *buddy; |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4942 PurpleAccount *account; |
15823 | 4943 PurpleConnection *gc; |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4944 PurpleConversation *conv; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4945 OscarData *od; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4946 PeerConnection *conn; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4947 const char *name; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4948 |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4949 node = object; |
15823 | 4950 |
4951 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); | |
4952 | |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4953 buddy = (PurpleBuddy*)node; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4954 name = purple_buddy_get_name(buddy); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4955 account = purple_buddy_get_account(buddy); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4956 gc = purple_account_get_connection(account); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4957 od = gc->proto_data; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4958 conn = peer_connection_find_by_type(od, name, OSCAR_CAPABILITY_DIRECTIM); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4959 |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4960 if (conn != NULL) |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4961 { |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4962 if (!conn->ready) |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4963 aim_im_sendch2_cancel(conn); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4964 |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4965 peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4966 |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4967 /* OSCAR_DISCONNECT_LOCAL_CLOSED doesn't write anything to the convo |
30865
1cdae196aac8
Standardize on "cancelled".
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30837
diff
changeset
|
4968 * window. Let the user know that we cancelled the Direct IM. */ |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4969 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
4970 purple_conversation_write(conv, NULL, _("You closed the connection."), |
30011 | 4971 PURPLE_MESSAGE_SYSTEM, time(NULL)); |
4972 } | |
4973 } | |
4974 | |
4975 static void oscar_get_icqxstatusmsg(PurpleBlistNode *node, gpointer ignore) | |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4976 { |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4977 PurpleBuddy *buddy; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4978 PurpleConnection *gc; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4979 PurpleAccount *account; |
30011 | 4980 |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4981 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4982 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4983 buddy = (PurpleBuddy *)node; |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4984 gc = purple_account_get_connection(buddy->account); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4985 account = purple_connection_get_account(gc); |
30011 | 4986 purple_debug_info("oscar", "Manual X-Status Get From %s to %s:\n", purple_buddy_get_name(buddy), account->username); |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4987 |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4988 icq_im_xstatus_request(gc->proto_data, purple_buddy_get_name(buddy)); |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4989 } |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
4990 |
29854 | 4991 static void |
4992 oscar_get_aim_info_cb(PurpleBlistNode *node, gpointer ignore) | |
4993 { | |
4994 PurpleBuddy *buddy; | |
4995 PurpleConnection *gc; | |
4996 | |
4997 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); | |
4998 | |
4999 buddy = (PurpleBuddy *)node; | |
5000 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); | |
5001 | |
5002 aim_locate_getinfoshort(purple_connection_get_protocol_data(gc), | |
5003 purple_buddy_get_name(buddy), 0x00000003); | |
5004 } | |
5005 | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5006 static GList * |
15823 | 5007 oscar_buddy_menu(PurpleBuddy *buddy) { |
5008 PurpleConnection *gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5009 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5010 GList *menu; |
15823 | 5011 PurpleMenuAction *act; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5012 aim_userinfo_t *userinfo; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5013 PurpleAccount *account; |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5014 const char *bname = purple_buddy_get_name(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5015 |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5016 account = purple_buddy_get_account(buddy); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5017 gc = purple_account_get_connection(account); |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5018 od = purple_connection_get_protocol_data(gc); |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5019 userinfo = aim_locate_finduserinfo(od, bname); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5020 menu = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5021 |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5022 if (od->icq && oscar_util_valid_name_icq(bname)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5023 { |
15823 | 5024 act = purple_menu_action_new(_("Get AIM Info"), |
5025 PURPLE_CALLBACK(oscar_get_aim_info_cb), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5026 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5027 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5028 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5029 |
24926
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
24923
diff
changeset
|
5030 if (purple_buddy_get_group(buddy) != NULL) |
24923
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24884
diff
changeset
|
5031 { |
24926
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
24923
diff
changeset
|
5032 /* We only do this if the user is in our buddy list */ |
24923
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24884
diff
changeset
|
5033 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:
24884
diff
changeset
|
5034 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:
24884
diff
changeset
|
5035 NULL, NULL); |
8a930bc2734d
Don't show the 'Edit Buddy Comment' option for PurpleBuddys that are not
Stu Tomlinson <stu@nosnilmot.com>
parents:
24884
diff
changeset
|
5036 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:
24884
diff
changeset
|
5037 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5038 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5039 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5040 { |
29812
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
5041 act = purple_menu_action_new(_("Get X-Status Msg"), |
365b90fa23cf
This patch comes from the combined work of contributors minstrel, NightFox,
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24315
diff
changeset
|
5042 PURPLE_CALLBACK(oscar_get_icqxstatusmsg), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5043 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5044 menu = g_list_prepend(menu, act); |
30805
5bfef3338383
Added a way to add a user to the (In)Visible list via the context menu.
ivan.komarov@soc.pidgin.im
parents:
30804
diff
changeset
|
5045 menu = g_list_prepend(menu, create_visibility_menu_item(od, bname)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5046 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5047 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5048 if (userinfo && |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5049 oscar_util_name_compare(purple_account_get_username(account), bname) && |
15823 | 5050 PURPLE_BUDDY_IS_ONLINE(buddy)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5051 { |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5052 PeerConnection *conn; |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5053 conn = peer_connection_find_by_type(od, bname, OSCAR_CAPABILITY_DIRECTIM); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5054 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5055 if (userinfo->capabilities & OSCAR_CAPABILITY_DIRECTIM) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5056 { |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5057 if (conn) |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5058 { |
28342
7c6591eda2f9
Per rekkanoryo, "End Direct IM Session". Refs #2556.
Paul Aurich <paul@darkrain42.org>
parents:
28311
diff
changeset
|
5059 act = purple_menu_action_new(_("End Direct IM Session"), |
28309
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5060 PURPLE_CALLBACK(oscar_close_directim), |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5061 NULL, NULL); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5062 } |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5063 else |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5064 { |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5065 act = purple_menu_action_new(_("Direct IM"), |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5066 PURPLE_CALLBACK(oscar_ask_directim), |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5067 NULL, NULL); |
bd9df4e45904
Add a "Cancel Direct IM" buddy action when connected. Closes #2556.
Paul Aurich <paul@darkrain42.org>
parents:
27505
diff
changeset
|
5068 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5069 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5070 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5071 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5072 |
24926
6f1f809d6fa2
Use purple_buddy_get_group() instead of aim_ssi_itemlist_exists() to check
Mark Doliner <mark@kingant.net>
parents:
24923
diff
changeset
|
5073 if (od->ssi.received_data && purple_buddy_get_group(buddy) != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5074 { |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5075 /* |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5076 * 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:
27242
diff
changeset
|
5077 * waiting for authorization. |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5078 */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5079 char *gname; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5080 gname = aim_ssi_itemlist_findparentname(od->ssi.local, bname); |
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5081 if (gname && aim_ssi_waitingforauth(od->ssi.local, gname, bname)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5082 { |
15823 | 5083 act = purple_menu_action_new(_("Re-request Authorization"), |
30794
9881f18b95b1
Got rid of family_icq.c -> oscar.c callbacks. Now it will be possible
ivan.komarov@soc.pidgin.im
parents:
30792
diff
changeset
|
5084 PURPLE_CALLBACK(oscar_auth_sendrequest_menu), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5085 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5086 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5087 } |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5090 menu = g_list_reverse(menu); |
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 menu; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5095 |
15823 | 5096 GList *oscar_blist_node_menu(PurpleBlistNode *node) { |
5097 if(PURPLE_BLIST_NODE_IS_BUDDY(node)) { | |
5098 return oscar_buddy_menu((PurpleBuddy *) node); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5099 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5100 return NULL; |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5103 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5104 static void |
15823 | 5105 oscar_icq_privacy_opts(PurpleConnection *gc, PurpleRequestFields *fields) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5106 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5107 OscarData *od = purple_connection_get_protocol_data(gc); |
15823 | 5108 PurpleAccount *account = purple_connection_get_account(gc); |
5109 PurpleRequestField *f; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5110 gboolean auth, web_aware; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5111 |
15823 | 5112 f = purple_request_fields_get_field(fields, "authorization"); |
5113 auth = purple_request_field_bool_get_value(f); | |
5114 | |
5115 f = purple_request_fields_get_field(fields, "web_aware"); | |
5116 web_aware = purple_request_field_bool_get_value(f); | |
5117 | |
5118 purple_account_set_bool(account, "authorization", auth); | |
5119 purple_account_set_bool(account, "web_aware", web_aware); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5120 |
30801
3ada0cc7d2c5
"Invisibility mode" improvements.
ivan.komarov@soc.pidgin.im
parents:
30800
diff
changeset
|
5121 oscar_set_extended_status(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5122 aim_icq_setsecurity(od, auth, web_aware); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5123 } |
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 static void |
15823 | 5126 oscar_show_icq_privacy_opts(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5127 { |
15823 | 5128 PurpleConnection *gc = (PurpleConnection *) action->context; |
5129 PurpleAccount *account = purple_connection_get_account(gc); | |
5130 PurpleRequestFields *fields; | |
5131 PurpleRequestFieldGroup *g; | |
5132 PurpleRequestField *f; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5133 gboolean auth, web_aware; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5134 |
15823 | 5135 auth = purple_account_get_bool(account, "authorization", OSCAR_DEFAULT_AUTHORIZATION); |
5136 web_aware = purple_account_get_bool(account, "web_aware", OSCAR_DEFAULT_WEB_AWARE); | |
5137 | |
5138 fields = purple_request_fields_new(); | |
5139 | |
5140 g = purple_request_field_group_new(NULL); | |
5141 | |
5142 f = purple_request_field_bool_new("authorization", _("Require authorization"), auth); | |
5143 purple_request_field_group_add_field(g, f); | |
5144 | |
5145 f = purple_request_field_bool_new("web_aware", _("Web aware (enabling this will cause you to receive SPAM!)"), web_aware); | |
5146 purple_request_field_group_add_field(g, f); | |
5147 | |
5148 purple_request_fields_add_group(fields, g); | |
5149 | |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5150 purple_request_fields(gc, _("ICQ Privacy Options"), _("ICQ Privacy Options"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5151 NULL, fields, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5152 _("OK"), G_CALLBACK(oscar_icq_privacy_opts), |
16442
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:
16412
diff
changeset
|
5153 _("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:
16412
diff
changeset
|
5154 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5155 gc); |
15374
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 |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5158 void oscar_format_username(PurpleConnection *gc, const char *nick) { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5159 OscarData *od = purple_connection_get_protocol_data(gc); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5160 if (!oscar_util_name_compare(purple_account_get_username(purple_connection_get_account(gc)), nick)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5161 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
|
5162 od->setnick = TRUE; |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5163 g_free(od->newformatting); |
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5164 od->newformatting = g_strdup(nick); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5165 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5166 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5167 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
|
5168 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5169 } else { |
15823 | 5170 purple_notify_error(gc, NULL, _("The new formatting is invalid."), |
22394
3e2fe115c330
Switch to using "username" instead of "screen name." I really really
Mark Doliner <mark@kingant.net>
parents:
22342
diff
changeset
|
5171 _("Username formatting can change only capitalization and whitespace.")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5172 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5173 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5174 |
15823 | 5175 static void oscar_confirm_account(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5176 { |
15823 | 5177 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5178 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5179 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5180 |
15823 | 5181 gc = (PurpleConnection *)action->context; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5182 od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5183 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5184 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
|
5185 if (conn != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5186 aim_admin_reqconfirm(od, conn); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5187 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5188 od->conf = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5189 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5190 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5191 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5192 |
15823 | 5193 static void oscar_show_email(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5194 { |
15823 | 5195 PurpleConnection *gc = (PurpleConnection *) action->context; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5196 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5197 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
|
5198 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5199 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5200 aim_admin_getinfo(od, conn, 0x11); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5201 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5202 od->reqemail = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5203 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
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 |
15823 | 5207 static void oscar_change_email(PurpleConnection *gc, const char *email) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5208 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5209 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5210 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
|
5211 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5212 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5213 aim_admin_setemail(od, conn, email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5214 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5215 od->setemail = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5216 od->email = g_strdup(email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5217 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
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 |
15823 | 5221 static void oscar_show_change_email(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5222 { |
15823 | 5223 PurpleConnection *gc = (PurpleConnection *) action->context; |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5224 purple_request_input(gc, NULL, _("Change Address To:"), NULL, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5225 FALSE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5226 _("_OK"), G_CALLBACK(oscar_change_email), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5227 _("_Cancel"), NULL, |
16442
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:
16412
diff
changeset
|
5228 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5229 gc); |
15374
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 |
15823 | 5232 static void oscar_show_awaitingauth(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5233 { |
15823 | 5234 PurpleConnection *gc = (PurpleConnection *) action->context; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5235 OscarData *od = purple_connection_get_protocol_data(gc); |
30806
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5236 PurpleAccount *account = purple_connection_get_account(gc); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5237 GSList *buddies, *filtered_buddies, *cur; |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5238 gchar *text; |
24120
16734635febf
Start hiding blist.h internals in prpls.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23961
diff
changeset
|
5239 |
27076
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
27024
diff
changeset
|
5240 buddies = purple_find_buddies(account, NULL); |
30806
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5241 filtered_buddies = NULL; |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5242 for (cur = buddies; cur != NULL; cur = cur->next) { |
27076
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
27024
diff
changeset
|
5243 PurpleBuddy *buddy; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
27024
diff
changeset
|
5244 const gchar *bname, *gname; |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
27024
diff
changeset
|
5245 |
30806
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5246 buddy = cur->data; |
27076
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
27024
diff
changeset
|
5247 bname = purple_buddy_get_name(buddy); |
1fcd09c34fee
Use purple_find_buddies() instead of iterating the buddy list.
Paul Aurich <paul@darkrain42.org>
parents:
27024
diff
changeset
|
5248 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:
27024
diff
changeset
|
5249 if (aim_ssi_waitingforauth(od->ssi.local, gname, bname)) { |
30806
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5250 filtered_buddies = g_slist_prepend(filtered_buddies, buddy); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5251 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5252 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5253 |
30806
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5254 g_slist_free(buddies); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5255 |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5256 filtered_buddies = g_slist_reverse(filtered_buddies); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5257 text = oscar_format_buddies(filtered_buddies, _("you are not waiting for authorization")); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5258 g_slist_free(filtered_buddies); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5259 |
15823 | 5260 purple_notify_formatted(gc, NULL, _("You are awaiting authorization from " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5261 "the following buddies"), _("You can re-request " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5262 "authorization from these buddies by " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5263 "right-clicking on them and selecting " |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5264 "\"Re-request Authorization.\""), text, NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5265 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5266 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5267 |
15823 | 5268 static void search_by_email_cb(PurpleConnection *gc, const char *email) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5269 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5270 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5271 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5272 aim_search_address(od, email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5273 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5274 |
15823 | 5275 static void oscar_show_find_email(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5276 { |
15823 | 5277 PurpleConnection *gc = (PurpleConnection *) action->context; |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
5278 purple_request_input(gc, _("Find Buddy by Email"), |
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
5279 _("Search for a buddy by email address"), |
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
5280 _("Type the email address of the buddy you are " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5281 "searching for."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5282 NULL, FALSE, FALSE, NULL, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5283 _("_Search"), G_CALLBACK(search_by_email_cb), |
16442
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:
16412
diff
changeset
|
5284 _("_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:
16412
diff
changeset
|
5285 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
5286 gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5287 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5288 |
15823 | 5289 static void oscar_show_set_info(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5290 { |
15823 | 5291 PurpleConnection *gc = (PurpleConnection *) action->context; |
5292 purple_account_request_change_user_info(purple_connection_get_account(gc)); | |
5293 } | |
5294 | |
5295 static void oscar_show_set_info_icqurl(PurplePluginAction *action) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5296 { |
15823 | 5297 PurpleConnection *gc = (PurpleConnection *) action->context; |
5298 purple_notify_uri(gc, "http://www.icq.com/whitepages/user_details.php"); | |
5299 } | |
5300 | |
5301 static void oscar_change_pass(PurplePluginAction *action) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5302 { |
15823 | 5303 PurpleConnection *gc = (PurpleConnection *) action->context; |
5304 purple_account_request_change_password(purple_connection_get_account(gc)); | |
5305 } | |
5306 | |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5307 /** |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5308 * 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:
27242
diff
changeset
|
5309 */ |
15823 | 5310 static void oscar_show_chpassurl(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5311 { |
15823 | 5312 PurpleConnection *gc = (PurpleConnection *) action->context; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5313 OscarData *od = purple_connection_get_protocol_data(gc); |
15823 | 5314 gchar *substituted = purple_strreplace(od->authinfo->chpassurl, "%s", purple_account_get_username(purple_connection_get_account(gc))); |
5315 purple_notify_uri(gc, substituted); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5316 g_free(substituted); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5317 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5318 |
15823 | 5319 static void oscar_show_imforwardingurl(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5320 { |
15823 | 5321 PurpleConnection *gc = (PurpleConnection *) action->context; |
5322 purple_notify_uri(gc, "http://mymobile.aol.com/dbreg/register?action=imf&clientID=1"); | |
5323 } | |
5324 | |
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
|
5325 void oscar_set_icon(PurpleConnection *gc, PurpleStoredImage *img) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5326 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5327 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
|
5328 |
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
|
5329 if (img == NULL) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5330 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
|
5331 } 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
|
5332 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
|
5333 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
|
5334 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
|
5335 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
|
5336 |
23385
540a26a1a88d
Helper functions are cool
Mark Doliner <mark@kingant.net>
parents:
23369
diff
changeset
|
5337 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
|
5338 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
|
5339 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
|
5340 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
|
5341 |
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
|
5342 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
|
5343 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5344 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5345 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5346 /** |
15823 | 5347 * Called by the Purple core to determine whether or not we're |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5348 * 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
|
5349 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5350 gboolean |
15823 | 5351 oscar_can_receive_file(PurpleConnection *gc, const char *who) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5352 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5353 OscarData *od; |
15823 | 5354 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5355 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5356 od = purple_connection_get_protocol_data(gc); |
15823 | 5357 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5358 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5359 if (od != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5360 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5361 aim_userinfo_t *userinfo; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5362 userinfo = aim_locate_finduserinfo(od, who); |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5365 * 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
|
5366 * 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
|
5367 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5368 if (((userinfo == NULL) || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5369 (userinfo->capabilities & OSCAR_CAPABILITY_SENDFILE)) && |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5370 oscar_util_name_compare(who, purple_account_get_username(account))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5371 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5372 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5373 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5374 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5375 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5376 return FALSE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5377 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5378 |
15823 | 5379 PurpleXfer * |
5380 oscar_new_xfer(PurpleConnection *gc, const char *who) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5381 { |
15823 | 5382 PurpleXfer *xfer; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5383 OscarData *od; |
15823 | 5384 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5385 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5386 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5387 od = purple_connection_get_protocol_data(gc); |
15823 | 5388 account = purple_connection_get_account(gc); |
5389 | |
5390 xfer = purple_xfer_new(account, PURPLE_XFER_SEND, who); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5391 if (xfer) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5392 { |
15823 | 5393 purple_xfer_ref(xfer); |
5394 purple_xfer_set_init_fnc(xfer, peer_oft_sendcb_init); | |
5395 purple_xfer_set_cancel_send_fnc(xfer, peer_oft_cb_generic_cancel); | |
5396 purple_xfer_set_request_denied_fnc(xfer, peer_oft_cb_generic_cancel); | |
5397 purple_xfer_set_ack_fnc(xfer, peer_oft_sendcb_ack); | |
15374
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 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
|
5400 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
|
5401 conn->flags |= PEER_CONNECTION_FLAG_APPROVED; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5402 aim_icbm_makecookie(conn->cookie); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5403 conn->xfer = xfer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5404 xfer->data = conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5405 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5406 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5407 return xfer; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5408 } |
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 /* |
15823 | 5411 * Called by the Purple core when the user indicates that a |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5412 * 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
|
5413 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5414 void |
15823 | 5415 oscar_send_file(PurpleConnection *gc, const char *who, const char *file) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5416 { |
15823 | 5417 PurpleXfer *xfer; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5418 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5419 xfer = oscar_new_xfer(gc, who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5420 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5421 if (file != NULL) |
15823 | 5422 purple_xfer_request_accepted(xfer, file); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5423 else |
15823 | 5424 purple_xfer_request(xfer); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5425 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5426 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5427 GList * |
15823 | 5428 oscar_actions(PurplePlugin *plugin, gpointer context) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5429 { |
15823 | 5430 PurpleConnection *gc = (PurpleConnection *) context; |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5431 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5432 GList *menu = NULL; |
15823 | 5433 PurplePluginAction *act; |
5434 | |
5435 act = purple_plugin_action_new(_("Set User Info..."), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5436 oscar_show_set_info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5437 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5438 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5439 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5440 { |
22457
bc8e0c7c6419
Change these oscar protocol menu actions to use "web" instead of "URL."
Mark Doliner <mark@kingant.net>
parents:
22441
diff
changeset
|
5441 act = purple_plugin_action_new(_("Set User Info (web)..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5442 oscar_show_set_info_icqurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5443 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5444 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5445 |
15823 | 5446 act = purple_plugin_action_new(_("Change Password..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5447 oscar_change_pass); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5448 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5449 |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5450 if (od->authinfo != NULL && od->authinfo->chpassurl != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5451 { |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5452 /* This only happens when connecting with the old-style BUCP login */ |
22457
bc8e0c7c6419
Change these oscar protocol menu actions to use "web" instead of "URL."
Mark Doliner <mark@kingant.net>
parents:
22441
diff
changeset
|
5453 act = purple_plugin_action_new(_("Change Password (web)"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5454 oscar_show_chpassurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5455 menu = g_list_prepend(menu, act); |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5456 } |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5457 |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5458 if (!od->icq) |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5459 { |
22457
bc8e0c7c6419
Change these oscar protocol menu actions to use "web" instead of "URL."
Mark Doliner <mark@kingant.net>
parents:
22441
diff
changeset
|
5460 act = purple_plugin_action_new(_("Configure IM Forwarding (web)"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5461 oscar_show_imforwardingurl); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5462 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5463 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5464 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5465 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5466 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5467 if (od->icq) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5468 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5469 /* ICQ actions */ |
15823 | 5470 act = purple_plugin_action_new(_("Set Privacy Options..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5471 oscar_show_icq_privacy_opts); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5472 menu = g_list_prepend(menu, act); |
30806
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5473 |
31051
001897406060
Two strings marked as translatable. You find them in the ICQ account
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
30865
diff
changeset
|
5474 act = purple_plugin_action_new(_("Show Visible List"), oscar_show_visible_list); |
30806
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5475 menu = g_list_prepend(menu, act); |
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5476 |
31051
001897406060
Two strings marked as translatable. You find them in the ICQ account
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
30865
diff
changeset
|
5477 act = purple_plugin_action_new(_("Show Invisible List"), oscar_show_invisible_list); |
30806
4e804413b12b
Added a way to view the Visible/Invisible lists.
ivan.komarov@soc.pidgin.im
parents:
30805
diff
changeset
|
5478 menu = g_list_prepend(menu, act); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5479 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5480 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5481 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5482 /* AIM actions */ |
15823 | 5483 act = purple_plugin_action_new(_("Confirm Account"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5484 oscar_confirm_account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5485 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5486 |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
5487 act = purple_plugin_action_new(_("Display Currently Registered Email Address"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5488 oscar_show_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5489 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5490 |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
5491 act = purple_plugin_action_new(_("Change Currently Registered Email Address..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5492 oscar_show_change_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5493 menu = g_list_prepend(menu, act); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5496 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5497 |
15823 | 5498 act = purple_plugin_action_new(_("Show Buddies Awaiting Authorization"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5499 oscar_show_awaitingauth); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5500 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5501 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5502 menu = g_list_prepend(menu, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5503 |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
22846
diff
changeset
|
5504 act = purple_plugin_action_new(_("Search for Buddy by Email Address..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5505 oscar_show_find_email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5506 menu = g_list_prepend(menu, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5507 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5508 menu = g_list_reverse(menu); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5509 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5510 return menu; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5511 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5512 |
15823 | 5513 void oscar_change_passwd(PurpleConnection *gc, const char *old, const char *new) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5514 { |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5515 OscarData *od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5516 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5517 if (od->icq) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5518 aim_icq_changepasswd(od, new); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5519 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5520 FlapConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5521 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
|
5522 if (conn) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5523 aim_admin_changepasswd(od, conn, new, old); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5524 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5525 od->chpass = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5526 od->oldp = g_strdup(old); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5527 od->newp = g_strdup(new); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5528 aim_srv_requestnew(od, SNAC_FAMILY_ADMIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5529 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5530 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5531 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5532 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5533 void |
15823 | 5534 oscar_convo_closed(PurpleConnection *gc, const char *who) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5535 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5536 OscarData *od; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5537 PeerConnection *conn; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5538 |
25424
a8c86e97d4f0
Use getters and settings for a bunch of libpurple structs
Mark Doliner <mark@kingant.net>
parents:
25416
diff
changeset
|
5539 od = purple_connection_get_protocol_data(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5540 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
|
5541 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5542 if (conn != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5543 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5544 if (!conn->ready) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5545 aim_im_sendch2_cancel(conn); |
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 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
|
5548 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5549 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5550 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5551 const char * |
15823 | 5552 oscar_normalize(const PurpleAccount *account, const char *str) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5553 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5554 static char buf[BUF_LEN]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5555 char *tmp1, *tmp2; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5556 int i, j; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5557 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5558 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
|
5559 |
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
|
5560 /* copy str to buf and skip all blanks */ |
25166
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25143
diff
changeset
|
5561 i = 0; |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25143
diff
changeset
|
5562 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:
25143
diff
changeset
|
5563 if (str[j] != ' ') { |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25143
diff
changeset
|
5564 buf[i++] = str[j]; |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25143
diff
changeset
|
5565 if (i >= BUF_LEN - 1) |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25143
diff
changeset
|
5566 break; |
937d832f4d7f
Shaun Lindsay at Meebo tracked down a bug where this function reads
Mark Doliner <mark@kingant.net>
parents:
25143
diff
changeset
|
5567 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5568 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5569 buf[i] = '\0'; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5570 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5571 tmp1 = g_utf8_strdown(buf, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5572 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
|
5573 strcpy(buf, tmp2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5574 g_free(tmp2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5575 g_free(tmp1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5577 return buf; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5578 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5579 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5580 gboolean |
15823 | 5581 oscar_offline_message(const PurpleBuddy *buddy) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5582 { |
22398
791c9545846b
Make sure we tell stuff that oscar supports offline messages for AIM
Mark Doliner <mark@kingant.net>
parents:
22396
diff
changeset
|
5583 return TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5584 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5585 |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5586 /* TODO: Find somewhere to put this instead of including it in a bunch of places. |
15823 | 5587 * Maybe just change purple_accounts_find() to return anything for the prpl if there is no acct_id. |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5588 */ |
15823 | 5589 static PurpleAccount *find_acct(const char *prpl, const char *acct_id) |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5590 { |
15823 | 5591 PurpleAccount *acct = NULL; |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5592 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5593 /* 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:
15623
diff
changeset
|
5594 if (acct_id) { |
15823 | 5595 acct = purple_accounts_find(acct_id, prpl); |
5596 if (acct && !purple_account_is_connected(acct)) | |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5597 acct = NULL; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5598 } else { /* Otherwise find an active account for the protocol */ |
18063
926ccb104da0
disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents:
18058
diff
changeset
|
5599 GList *l = purple_accounts_get_all(); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5600 while (l) { |
15823 | 5601 if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) |
5602 && purple_account_is_connected(l->data)) { | |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5603 acct = l->data; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5604 break; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5605 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5606 l = l->next; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5607 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5608 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5609 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5610 return acct; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5611 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5612 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5613 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5614 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:
15623
diff
changeset
|
5615 { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5616 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:
15623
diff
changeset
|
5617 char prpl[11]; |
15823 | 5618 PurpleAccount *acct; |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5619 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5620 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:
15623
diff
changeset
|
5621 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5622 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5623 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:
15623
diff
changeset
|
5624 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5625 acct = find_acct(prpl, acct_id); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5626 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5627 if (!acct) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5628 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5629 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5630 /* aim:GoIM?screenname=SCREENNAME&message=MESSAGE */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5631 if (!g_ascii_strcasecmp(cmd, "GoIM")) { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5632 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:
25415
diff
changeset
|
5633 if (bname) { |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5634 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:
15623
diff
changeset
|
5635 |
15823 | 5636 PurpleConversation *conv = purple_find_conversation_with_account( |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5637 PURPLE_CONV_TYPE_IM, bname, acct); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5638 if (conv == NULL) |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5639 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, acct, bname); |
15823 | 5640 purple_conversation_present(conv); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5641 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5642 if (message) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5643 /* Spaces are encoded as '+' */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5644 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
|
5645 purple_conv_send_confirm(conv, message); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5646 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5647 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5648 /*else |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5649 **If pidgindialogs_im() was in the core, we could use it here. |
15823 | 5650 * It is all purple_request_* based, but I'm not sure it really belongs in the core |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5651 pidgindialogs_im();*/ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5652 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5653 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5654 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5655 /* aim:GoChat?roomname=CHATROOMNAME&exchange=4 */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5656 else if (!g_ascii_strcasecmp(cmd, "GoChat")) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5657 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:
15623
diff
changeset
|
5658 if (rname) { |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5659 /* 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:
15623
diff
changeset
|
5660 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:
15623
diff
changeset
|
5661 g_hash_table_insert(params, g_strdup("room"), g_strdup(rname)); |
15823 | 5662 serv_join_chat(purple_account_get_connection(acct), params); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5663 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5664 /*else |
15823 | 5665 ** Same as above (except that this would have to be re-written using purple_request_*) |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5666 pidgin_blist_joinchat_show(); */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5667 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5668 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5669 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5670 /* aim:AddBuddy?screenname=SCREENNAME&groupname=GROUPNAME*/ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5671 else if (!g_ascii_strcasecmp(cmd, "AddBuddy")) { |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5672 char *bname = g_hash_table_lookup(params, "screenname"); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5673 char *gname = g_hash_table_lookup(params, "groupname"); |
25416
6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <mark@kingant.net>
parents:
25415
diff
changeset
|
5674 purple_blist_request_add_buddy(acct, bname, gname, NULL); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5675 return TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5676 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5677 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5678 return FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5679 } |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5680 |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
5681 void oscar_init(PurplePlugin *plugin, gboolean is_icq) |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5682 { |
28877
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28872
diff
changeset
|
5683 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); |
15823 | 5684 PurpleAccountOption *option; |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5685 static gboolean init = FALSE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5686 |
31085
4297feb30ad1
Merged everything related to ICQ server changes.
ivan.komarov@soc.pidgin.im
parents:
31051
diff
changeset
|
5687 option = purple_account_option_string_new(_("Server"), "server", get_login_server(is_icq, FALSE)); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5688 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:
15623
diff
changeset
|
5689 |
15823 | 5690 option = purple_account_option_int_new(_("Port"), "port", OSCAR_DEFAULT_LOGIN_PORT); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5691 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:
15623
diff
changeset
|
5692 |
25017
62a5a41c3dfd
Remove the "buggy" caveat -- I've been running it for a while
Paul Aurich <paul@darkrain42.org>
parents:
25016
diff
changeset
|
5693 option = purple_account_option_bool_new(_("Use SSL"), "use_ssl", |
24651
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
5694 OSCAR_DEFAULT_USE_SSL); |
ea70a446dde4
First pass at adding SSL connections to OSCAR.
Paul Aurich <paul@darkrain42.org>
parents:
24615
diff
changeset
|
5695 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:
24615
diff
changeset
|
5696 |
27243
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5697 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:
27242
diff
changeset
|
5698 OSCAR_DEFAULT_USE_CLIENTLOGIN); |
7054f810b0f9
Check in code that connects to oscar using clientLogin. This is the
Mark Doliner <mark@kingant.net>
parents:
27242
diff
changeset
|
5699 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:
27242
diff
changeset
|
5700 |
15823 | 5701 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
|
5702 _("Always use AIM/ICQ proxy server for\nfile transfers and direct IM (slower,\nbut does not reveal your IP address)"), "always_use_rv_proxy", |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5703 OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY); |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5704 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:
15623
diff
changeset
|
5705 |
28877
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28872
diff
changeset
|
5706 if (g_str_equal(purple_plugin_get_id(plugin), "prpl-aim")) { |
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28872
diff
changeset
|
5707 option = purple_account_option_bool_new(_("Allow multiple simultaneous logins"), "allow_multiple_logins", |
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28872
diff
changeset
|
5708 OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS); |
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28872
diff
changeset
|
5709 prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option); |
a990da4540d3
oscar: Remove the simultaneous logins option from ICQ accounts.
Paul Aurich <paul@darkrain42.org>
parents:
28872
diff
changeset
|
5710 } |
25415
584063555949
Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents:
25396
diff
changeset
|
5711 |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5712 if (init) |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5713 return; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5714 init = TRUE; |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5715 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5716 /* Preferences */ |
15823 | 5717 purple_prefs_add_none("/plugins/prpl/oscar"); |
5718 purple_prefs_add_bool("/plugins/prpl/oscar/recent_buddies", FALSE); | |
27180
28b5fcfb7444
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <mark@kingant.net>
parents:
27076
diff
changeset
|
5719 |
22223
19ace070f0e5
Stop unconditionally setting oscar's server-side preference "allow
Mark Doliner <mark@kingant.net>
parents:
22140
diff
changeset
|
5720 purple_prefs_remove("/plugins/prpl/oscar/show_idle"); |
15823 | 5721 purple_prefs_remove("/plugins/prpl/oscar/always_use_rv_proxy"); |
15624
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5722 |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5723 /* protocol handler */ |
71af5b6209d5
uri-handler support for AIM/ICQ, Yahoo and MSN
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15623
diff
changeset
|
5724 /* TODO: figure out a good instance to use here */ |
15823 | 5725 purple_signal_connect(purple_get_core(), "uri-handler", &init, |
5726 PURPLE_CALLBACK(oscar_uri_handler), NULL); | |
5727 } | |
5728 |