libpurple/protocols/gg/gg.c

Wed, 19 Oct 2022 06:25:35 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Wed, 19 Oct 2022 06:25:35 -0500
changeset 41814
f8940ebd4eee
parent 41812
c3cd920261b6
child 41911
201aae92d734
permissions
-rw-r--r--

Back out the PurpleProtocol->login change that returned a PurpleConnection

This remains to be a good idea, but this implementation caused more issues than
it solved. I'm working on that better implementation, but we need to revert all
of this first, otherwise the new review request is going to be massive.

This reverts commits 3f96e2b2b03d, d567f89d6a9b, and 6ef5bb284651. These were
backed out manually due to some other commits that made automative backouts
difficult.

Testing Done:
Connected a demo, ircv3, and xmpp accounts without issue.

Reviewed at https://reviews.imfreedom.org/r/1937/

11394
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
1 /**
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
2 * @file gg.c Gadu-Gadu protocol plugin
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
3 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
4 * purple
11394
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
5 *
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
6 * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us>
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
7 *
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
8 * Some parts of the code are adapted or taken from the previous implementation
11394
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
9 * of this plugin written by Arkadiusz Miskiewicz <misiek@pld.org.pl>
27388
e72ccf802d25 Support fetching Gadu-Gadu avatars. Closes #9371.
Krzysztof Klinikowski <kkszysiu@gmail.com>
parents: 27371
diff changeset
10 * Some parts Copyright (C) 2009 Krzysztof Klinikowski <grommasher@gmail.com>
11394
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
11 *
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
12 * Thanks to Google's Summer of Code Program.
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
13 *
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
14 * This program is free software; you can redistribute it and/or modify
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
15 * it under the terms of the GNU General Public License as published by
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
16 * the Free Software Foundation; either version 2 of the License, or
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
17 * (at your option) any later version.
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
18 *
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
19 * This program is distributed in the hope that it will be useful,
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
22 * GNU General Public License for more details.
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
23 *
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
24 * You should have received a copy of the GNU General Public License
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
25 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18629
diff changeset
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
11394
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
27 */
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
28
40441
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
29 #include <glib/gi18n-lib.h>
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
30
40945
bbeb2e98ea5b Use GPLUGIN_NATIVE_PLUGIN_DECLARE for all libpurple plugins and remove PURPLE_PLUGIN_INIT
Gary Kramlich <grim@reaperworld.com>
parents: 40885
diff changeset
31 #include <gplugin.h>
bbeb2e98ea5b Use GPLUGIN_NATIVE_PLUGIN_DECLARE for all libpurple plugins and remove PURPLE_PLUGIN_INIT
Gary Kramlich <grim@reaperworld.com>
parents: 40885
diff changeset
32 #include <gplugin-native.h>
bbeb2e98ea5b Use GPLUGIN_NATIVE_PLUGIN_DECLARE for all libpurple plugins and remove PURPLE_PLUGIN_INIT
Gary Kramlich <grim@reaperworld.com>
parents: 40885
diff changeset
33
40350
72271baf92bc Split PurpleKeyValuePair out to it's own file and try to do some cleanup in the files that need to include it.
Gary Kramlich <grim@reaperworld.com>
parents: 40331
diff changeset
34 #include <purple.h>
2393
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
35
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
36 #include "gg.h"
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
37 #include "chat.h"
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
38 #include "search.h"
34710
6182323fbb0c Renamed gg's buddylist.[ch] to blist.[ch]
Ankit Vani <a@nevitus.org>
parents: 34706
diff changeset
39 #include "blist.h"
33299
b3c4ab3aeb7f Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
40 #include "utils.h"
33291
b70ab10887a7 New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33287
diff changeset
41 #include "resolver-purple.h"
33306
b1bef9a92b4c Gadu-Gadu: rename purple.(c|h) to purplew.(c|h) - purple wrappers
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33305
diff changeset
42 #include "purplew.h"
33313
5a0c6582d5b1 Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33311
diff changeset
43 #include "libgadu-events.h"
33334
734fc6da6179 Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33333
diff changeset
44 #include "multilogon.h"
33336
7c97b5dd3bf4 Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33334
diff changeset
45 #include "status.h"
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
46 #include "servconn.h"
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34429
diff changeset
47 #include "tcpsocket.h"
33345
740174b22496 Gadu-Gadu: retrieve buddy public alias after adding to blist. Fixes #2188
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33344
diff changeset
48 #include "pubdir-prpl.h"
34356
5d59fd4d5b2d Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34353
diff changeset
49 #include "message-prpl.h"
34359
7cf367cc1141 Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34357
diff changeset
50 #include "html.h"
34408
ee5663c0ffe8 Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34406
diff changeset
51 #include "libgaduw.h"
31550
909496097dcf Gadu-Gadu: Allow showing your status only to people on your buddy list.
Mateusz Piękos <mateuszpiekos@gmail.com>
parents: 31386
diff changeset
52
40865
82e45cd837fa Migrate gg, novel, null, sametime, silc, and zephyr to using G_DECLARE_FINAL_TYPE for their protocol objects
Gary Kramlich <grim@reaperworld.com>
parents: 40819
diff changeset
53 struct _GGPProtocol {
82e45cd837fa Migrate gg, novel, null, sametime, silc, and zephyr to using G_DECLARE_FINAL_TYPE for their protocol objects
Gary Kramlich <grim@reaperworld.com>
parents: 40819
diff changeset
54 PurpleProtocol parent;
82e45cd837fa Migrate gg, novel, null, sametime, silc, and zephyr to using G_DECLARE_FINAL_TYPE for their protocol objects
Gary Kramlich <grim@reaperworld.com>
parents: 40819
diff changeset
55 };
82e45cd837fa Migrate gg, novel, null, sametime, silc, and zephyr to using G_DECLARE_FINAL_TYPE for their protocol objects
Gary Kramlich <grim@reaperworld.com>
parents: 40819
diff changeset
56
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
57 /* ---------------------------------------------------------------------- */
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
58 static PurpleProtocol *my_protocol = NULL;
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
59
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
60 /* ---------------------------------------------------------------------- */
9950
ac8bc7606554 [gaim-migrate @ 10846]
Tim Ringenbach <marv@pidgin.im>
parents: 9944
diff changeset
61
33340
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
62 ggp_buddy_data * ggp_buddy_get_data(PurpleBuddy *buddy)
34474
f0210174619a Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34303
diff changeset
63 {
33340
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
64 ggp_buddy_data *buddy_data = purple_buddy_get_protocol_data(buddy);
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
65 if (buddy_data)
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
66 return buddy_data;
34474
f0210174619a Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34303
diff changeset
67
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
68 buddy_data = g_new0(ggp_buddy_data, 1); /* TODO: leak */
33340
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
69 purple_buddy_set_protocol_data(buddy, buddy_data);
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
70 return buddy_data;
34474
f0210174619a Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34303
diff changeset
71 }
f0210174619a Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34303
diff changeset
72
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
73 static void
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
74 ggp_buddy_free(PurpleProtocolClient *client, PurpleBuddy *buddy)
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
75 {
33340
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
76 ggp_buddy_data *buddy_data = purple_buddy_get_protocol_data(buddy);
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
77
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
78 if (!buddy_data) {
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
79 return;
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
80 }
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
81
33340
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
82 g_free(buddy_data);
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
83 purple_buddy_set_protocol_data(buddy, NULL);
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
84 }
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
85
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
86 const gchar * ggp_get_imtoken(PurpleConnection *gc)
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
87 {
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
88 GGPInfo *accdata = purple_connection_get_protocol_data(gc);
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
89
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
90 if (accdata->imtoken)
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
91 return accdata->imtoken;
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
92
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
93 if (accdata->imtoken_warned)
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
94 return NULL;
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
95 accdata->imtoken_warned = TRUE;
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
96
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
97 purple_notify_error(gc, _("Authentication failed"),
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
98 _("IMToken value has not been received."),
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
99 _("Some features will be disabled. "
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
100 "You may try again after a while."),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
101 purple_request_cpar_from_connection(gc));
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
102 return NULL;
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
103 }
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
104
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
105 uin_t ggp_own_uin(PurpleConnection *gc)
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
106 {
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
107 return ggp_str_to_uin(purple_account_get_username(
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
108 purple_connection_get_account(gc)));
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
109 }
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
110
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
111 /* ---------------------------------------------------------------------- */
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
112 /* buddy list import/export from/to file */
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
113
21496
32972bf7cd4e Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <resiak@pidgin.im>
parents: 21485
diff changeset
114 static void ggp_callback_buddylist_save_ok(PurpleConnection *gc, const char *filename)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
115 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
116 PurpleAccount *account = purple_connection_get_account(gc);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
117
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
118 char *buddylist = ggp_buddylist_dump(account);
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
119
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
120 purple_debug_info("gg", "Saving...\n");
21496
32972bf7cd4e Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <resiak@pidgin.im>
parents: 21485
diff changeset
121 purple_debug_info("gg", "file = %s\n", filename);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
122
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
123 if (buddylist == NULL) {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
124 purple_notify_info(account, _("Save Buddylist..."), _("Your "
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
125 "buddylist is empty, nothing was written to the file."),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
126 NULL, purple_request_cpar_from_connection(gc));
2792
f40db99e87c7 [gaim-migrate @ 2805]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2791
diff changeset
127 return;
f40db99e87c7 [gaim-migrate @ 2805]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2791
diff changeset
128 }
2393
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
129
40650
94e777c03e4a Deprecate purple_util_write_data_to_file_absolute and use g_file_set_contents in place of it
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
130 if (g_file_set_contents(filename, buddylist, -1, NULL)) {
21496
32972bf7cd4e Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <resiak@pidgin.im>
parents: 21485
diff changeset
131 purple_notify_info(account, _("Save Buddylist..."),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
132 _("Buddylist saved successfully!"), NULL,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
133 purple_request_cpar_from_connection(gc));
21496
32972bf7cd4e Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <resiak@pidgin.im>
parents: 21485
diff changeset
134 } else {
32972bf7cd4e Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <resiak@pidgin.im>
parents: 21485
diff changeset
135 gchar *primary = g_strdup_printf(
32972bf7cd4e Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <resiak@pidgin.im>
parents: 21485
diff changeset
136 _("Couldn't write buddy list for %s to %s"),
32972bf7cd4e Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <resiak@pidgin.im>
parents: 21485
diff changeset
137 purple_account_get_username(account), filename);
21497
8187406f2043 May as well use an existing string as the title for the error notification.
Will Thompson <resiak@pidgin.im>
parents: 21496
diff changeset
138 purple_notify_error(account, _("Save Buddylist..."),
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
139 primary, NULL, purple_request_cpar_from_connection(gc));
21496
32972bf7cd4e Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <resiak@pidgin.im>
parents: 21485
diff changeset
140 g_free(primary);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
141 }
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
142
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
143 g_free(buddylist);
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
144 }
2806
1576edefc75a [gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2792
diff changeset
145
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
146 static void ggp_callback_buddylist_load_ok(PurpleConnection *gc, gchar *file)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
147 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
148 PurpleAccount *account = purple_connection_get_account(gc);
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
149 GError *error = NULL;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
150 char *buddylist = NULL;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
151 gsize length;
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
152
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
153 purple_debug_info("gg", "file_name = %s\n", file);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
154
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
155 if (!g_file_get_contents(file, &buddylist, &length, &error)) {
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
156 purple_notify_error(account, _("Couldn't load buddylist"),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
157 _("Couldn't load buddylist"), error->message,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
158 purple_request_cpar_from_connection(gc));
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
159
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
160 purple_debug_error("gg",
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
161 "Couldn't load buddylist. file = %s; error = %s\n",
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
162 file, error->message);
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
163
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
164 g_error_free(error);
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
165
2806
1576edefc75a [gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2792
diff changeset
166 return;
1576edefc75a [gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2792
diff changeset
167 }
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
168
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
169 ggp_buddylist_load(gc, buddylist);
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
170 g_free(buddylist);
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
171
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
172 purple_notify_info(account, _("Load Buddylist..."),
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
173 _("Buddylist loaded successfully!"), NULL,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34448
diff changeset
174 purple_request_cpar_from_connection(gc));
2806
1576edefc75a [gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2792
diff changeset
175 }
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
176 /* }}} */
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
177
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
178 static void
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
179 ggp_action_buddylist_save(G_GNUC_UNUSED GSimpleAction *action,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
180 GVariant *parameter,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
181 G_GNUC_UNUSED gpointer data)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
182 {
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
183 const gchar *account_id = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
184 PurpleAccountManager *manager = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
185 PurpleAccount *account = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
186 PurpleConnection *connection = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
187
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
188 if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
189 g_critical("GG save buddylist action parameter is of incorrect type %s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
190 g_variant_get_type_string(parameter));
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
191 }
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
192
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
193 account_id = g_variant_get_string(parameter, NULL);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
194 manager = purple_account_manager_get_default();
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
195 account = purple_account_manager_find_by_id(manager, account_id);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
196 connection = purple_account_get_connection(account);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
197
21175
c6d76b49c206 disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents: 21174
diff changeset
198 purple_request_file(action, _("Save buddylist..."), NULL, TRUE,
34333
b92698241603 Request API refactoring: switch purple_request_file to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34332
diff changeset
199 G_CALLBACK(ggp_callback_buddylist_save_ok), NULL,
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
200 purple_request_cpar_from_connection(connection), connection);
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
201 }
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
202
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
203 static void
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
204 ggp_action_buddylist_load(G_GNUC_UNUSED GSimpleAction *action,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
205 GVariant *parameter,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
206 G_GNUC_UNUSED gpointer data)
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
207 {
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
208 const gchar *account_id = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
209 PurpleAccountManager *manager = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
210 PurpleAccount *account = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
211 PurpleConnection *connection = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
212
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
213 if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
214 g_critical("GG load buddylist action parameter is of incorrect type %s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
215 g_variant_get_type_string(parameter));
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
216 }
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
217
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
218 account_id = g_variant_get_string(parameter, NULL);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
219 manager = purple_account_manager_get_default();
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
220 account = purple_account_manager_find_by_id(manager, account_id);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
221 connection = purple_account_get_connection(account);
31550
909496097dcf Gadu-Gadu: Allow showing your status only to people on your buddy list.
Mateusz Piękos <mateuszpiekos@gmail.com>
parents: 31386
diff changeset
222
23379
536450c4f7f9 Mark a string as translatable in prpl-gg. References #5693.
Will Thompson <resiak@pidgin.im>
parents: 23325
diff changeset
223 purple_request_file(action, _("Load buddylist from file..."), NULL,
34333
b92698241603 Request API refactoring: switch purple_request_file to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34332
diff changeset
224 FALSE, G_CALLBACK(ggp_callback_buddylist_load_ok), NULL,
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
225 purple_request_cpar_from_connection(connection), connection);
11394
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
226 }
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
227
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
228 /* ----- BLOCK BUDDIES -------------------------------------------------- */
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
229
40521
c4269b37a13a Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents: 40507
diff changeset
230 static void ggp_add_deny(PurpleProtocolPrivacy *privacy, PurpleConnection *gc,
c4269b37a13a Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents: 40507
diff changeset
231 const char *who)
11410
08212b2e6083 [gaim-migrate @ 13647]
Bartosz Oler <bartosz@pidgin.im>
parents: 11397
diff changeset
232 {
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
233 GGPInfo *info = purple_connection_get_protocol_data(gc);
31938
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
234 uin_t uin = ggp_str_to_uin(who);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
235
31938
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
236 purple_debug_info("gg", "ggp_add_deny: %u\n", uin);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
237
31938
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
238 gg_remove_notify_ex(info->session, uin, GG_USER_NORMAL);
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
239 gg_add_notify_ex(info->session, uin, GG_USER_BLOCKED);
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
240 }
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
241
40521
c4269b37a13a Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents: 40507
diff changeset
242 static void ggp_remove_deny(PurpleProtocolPrivacy *privacy,
c4269b37a13a Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents: 40507
diff changeset
243 PurpleConnection *gc, const char *who)
31938
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
244 {
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
245 GGPInfo *info = purple_connection_get_protocol_data(gc);
31938
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
246 uin_t uin = ggp_str_to_uin(who);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
247
31938
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
248 purple_debug_info("gg", "ggp_rem_deny: %u\n", uin);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
249
31938
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
250 gg_remove_notify_ex(info->session, uin, GG_USER_BLOCKED);
13c568701e8a Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31892
diff changeset
251 gg_add_notify_ex(info->session, uin, GG_USER_NORMAL);
11410
08212b2e6083 [gaim-migrate @ 13647]
Bartosz Oler <bartosz@pidgin.im>
parents: 11397
diff changeset
252 }
08212b2e6083 [gaim-migrate @ 13647]
Bartosz Oler <bartosz@pidgin.im>
parents: 11397
diff changeset
253
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
254 /* ---------------------------------------------------------------------- */
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
255 /* ----- INTERNAL CALLBACKS --------------------------------------------- */
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
256 /* ---------------------------------------------------------------------- */
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
257
31630
47b2ee63a797 Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents: 31628
diff changeset
258 static void ggp_typing_notification_handler(PurpleConnection *gc, uin_t uin, int length) {
31795
ee01a0566a86 Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31739
diff changeset
259 gchar *from;
ee01a0566a86 Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31739
diff changeset
260
ee01a0566a86 Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31739
diff changeset
261 from = g_strdup_printf("%u", uin);
ee01a0566a86 Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31739
diff changeset
262 if (length)
35499
c4c5e0a670b1 Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents: 35360
diff changeset
263 purple_serv_got_typing(gc, from, 0, PURPLE_IM_TYPING);
31795
ee01a0566a86 Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31739
diff changeset
264 else
35501
602747bb4af9 Fix duplicate prefixes
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
265 purple_serv_got_typing_stopped(gc, from);
31795
ee01a0566a86 Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31739
diff changeset
266 g_free(from);
31630
47b2ee63a797 Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents: 31628
diff changeset
267 }
47b2ee63a797 Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents: 31628
diff changeset
268
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
269 /**
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
270 * Handling of XML events.
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
271 *
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
272 * @param gc PurpleConnection.
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
273 * @param data Raw XML contents.
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
274 *
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
275 * @see http://toxygen.net/libgadu/protocol/#ch1.13
33313
5a0c6582d5b1 Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33311
diff changeset
276 * @todo: this may not be necessary anymore
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
277 */
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
278 static void ggp_xml_event_handler(PurpleConnection *gc, char *data)
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
279 {
34935
686fa55b0deb Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents: 34904
diff changeset
280 PurpleXmlNode *xml = NULL;
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
281 PurpleXmlNode *xmlnode_next_event;
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
282
34935
686fa55b0deb Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents: 34904
diff changeset
283 xml = purple_xmlnode_from_str(data, -1);
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
284 if (xml == NULL) {
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
285 purple_debug_error("gg", "ggp_xml_event_handler: "
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
286 "invalid xml: [%s]\n", data);
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
287 goto out;
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
288 }
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
289
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
290 xmlnode_next_event = purple_xmlnode_get_child(xml, "event");
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
291 while (xmlnode_next_event != NULL) {
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
292 PurpleXmlNode *xmlnode_current_event = xmlnode_next_event;
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
293
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
294 PurpleXmlNode *xmlnode_type;
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
295 char *event_type_raw;
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
296 int event_type = 0;
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
297
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
298 PurpleXmlNode *xmlnode_sender;
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
299 char *event_sender_raw;
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
300 uin_t event_sender = 0;
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
301
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
302 xmlnode_next_event = purple_xmlnode_get_next_twin(xmlnode_next_event);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
303
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
304 xmlnode_type = purple_xmlnode_get_child(xmlnode_current_event, "type");
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
305 if (xmlnode_type == NULL)
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
306 continue;
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
307 event_type_raw = purple_xmlnode_get_data(xmlnode_type);
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
308 if (event_type_raw != NULL)
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
309 event_type = atoi(event_type_raw);
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
310 g_free(event_type_raw);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
311
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
312 xmlnode_sender = purple_xmlnode_get_child(xmlnode_current_event, "sender");
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
313 if (xmlnode_sender != NULL) {
34946
76aa2e0f8701 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 34940 34437
diff changeset
314 event_sender_raw = purple_xmlnode_get_data(xmlnode_sender);
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
315 if (event_sender_raw != NULL)
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
316 event_sender = ggp_str_to_uin(event_sender_raw);
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
317 g_free(event_sender_raw);
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
318 }
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
319
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
320 switch (event_type)
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
321 {
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
322 case 28: /* avatar update */
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
323 purple_debug_info("gg",
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
324 "ggp_xml_event_handler: avatar updated (uid: %u)\n",
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
325 event_sender);
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
326 break;
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
327 default:
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
328 purple_debug_error("gg",
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
329 "ggp_xml_event_handler: unsupported event type=%d from=%u\n",
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
330 event_type, event_sender);
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
331 }
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
332 }
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
333
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
334 out:
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
335 if (xml)
34935
686fa55b0deb Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents: 34904
diff changeset
336 purple_xmlnode_free(xml);
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
337 }
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
338
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
339 static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond)
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
340 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
341 PurpleConnection *gc = _gc;
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
342 GGPInfo *info = purple_connection_get_protocol_data(gc);
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
343 struct gg_event *ev;
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
344
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
345 if (!(ev = gg_watch_fd(info->session))) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
346 purple_debug_error("gg",
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
347 "ggp_callback_recv: gg_watch_fd failed -- CRITICAL!\n");
32157
39ba2e2492ee Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <markdoliner@pidgin.im>
parents: 32147
diff changeset
348 purple_connection_error (gc,
21279
40685e1f50ca Rename:
Will Thompson <resiak@pidgin.im>
parents: 20437
diff changeset
349 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
27626
62fbae50be08 Connection error message changes for gg, and a few other strings changes.
Mark Doliner <markdoliner@pidgin.im>
parents: 27388
diff changeset
350 _("Unable to read from socket"));
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
351 return;
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
352 }
31661
2a8aceaee628 Don't update last_received when receiving data on gg. Fixes #13699.
Jan Zachorowski <quantifier666@gmail.com>
parents: 31649
diff changeset
353
34473
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34454
diff changeset
354 if (purple_debug_is_verbose()) {
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34454
diff changeset
355 purple_debug_misc("gg", "ggp_callback_recv: got event %s",
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34454
diff changeset
356 gg_debug_event(ev->type));
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34454
diff changeset
357 }
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34454
diff changeset
358
41762
5c21747ff7dc Replace purple_input_remove by g_source_remove
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41709
diff changeset
359 g_source_remove(info->inpa);
34473
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34454
diff changeset
360 info->inpa = purple_input_add(info->session->fd,
34474
f0210174619a Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34303
diff changeset
361 ggp_tcpsocket_inputcond_gg_to_purple(info->session->check),
f0210174619a Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34303
diff changeset
362 ggp_callback_recv, gc);
f0210174619a Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34303
diff changeset
363
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
364 switch (ev->type) {
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
365 case GG_EVENT_NONE:
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
366 /* Nothing happened. */
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
367 break;
34361
ddcc82637afa Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34359
diff changeset
368 case GG_EVENT_CONN_FAILED:
ddcc82637afa Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34359
diff changeset
369 purple_connection_error (gc,
ddcc82637afa Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34359
diff changeset
370 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
ddcc82637afa Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34359
diff changeset
371 _("Server disconnected"));
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
372 break;
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
373 case GG_EVENT_MSG:
34356
5d59fd4d5b2d Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34353
diff changeset
374 ggp_message_got(gc, &ev->event.msg);
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
375 break;
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
376 case GG_EVENT_ACK:
34406
46f06ef265e3 Gadu-Gadu: update for the newest devel libgadu
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34394
diff changeset
377 case GG_EVENT_ACK110:
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
378 break;
24745
511df62cb366 Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents: 24683
diff changeset
379 case GG_EVENT_IMAGE_REPLY:
33298
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33296
diff changeset
380 ggp_image_recv(gc, &ev->event.image_reply);
24745
511df62cb366 Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents: 24683
diff changeset
381 break;
511df62cb366 Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents: 24683
diff changeset
382 case GG_EVENT_IMAGE_REQUEST:
33301
3f18ba8aed0f Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33299
diff changeset
383 ggp_image_send(gc, &ev->event.image_request);
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
384 break;
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
385 case GG_EVENT_NOTIFY60:
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
386 case GG_EVENT_STATUS60:
33340
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
387 ggp_status_got_others(gc, ev);
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
388 break;
31630
47b2ee63a797 Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents: 31628
diff changeset
389 case GG_EVENT_TYPING_NOTIFICATION:
47b2ee63a797 Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents: 31628
diff changeset
390 ggp_typing_notification_handler(gc, ev->event.typing_notification.uin,
47b2ee63a797 Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents: 31628
diff changeset
391 ev->event.typing_notification.length);
47b2ee63a797 Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents: 31628
diff changeset
392 break;
31665
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
393 case GG_EVENT_XML_EVENT:
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
394 purple_debug_info("gg", "GG_EVENT_XML_EVENT\n");
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
395 ggp_xml_event_handler(gc, ev->event.xml_event.data);
1854b313a9bb Recently I found out a small issue: if another user changes it's avatar, we
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31663
diff changeset
396 break;
33296
33a9adb52028 Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33295
diff changeset
397 case GG_EVENT_USER_DATA:
33313
5a0c6582d5b1 Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33311
diff changeset
398 ggp_events_user_data(gc, &ev->event.user_data);
33296
33a9adb52028 Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33295
diff changeset
399 break;
34383
4b1a106bbf1d Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34380
diff changeset
400 case GG_EVENT_JSON_EVENT:
4b1a106bbf1d Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34380
diff changeset
401 ggp_events_json(gc, &ev->event.json_event);
4b1a106bbf1d Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34380
diff changeset
402 break;
33314
57013b9e1a8e Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
403 case GG_EVENT_USERLIST100_VERSION:
33315
42bbe5b85df8 Gadu-Gadu: roster - uploading/synchronization - part1
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33314
diff changeset
404 ggp_roster_version(gc, &ev->event.userlist100_version);
33314
57013b9e1a8e Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
405 break;
57013b9e1a8e Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
406 case GG_EVENT_USERLIST100_REPLY:
57013b9e1a8e Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
407 ggp_roster_reply(gc, &ev->event.userlist100_reply);
57013b9e1a8e Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
408 break;
33334
734fc6da6179 Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33333
diff changeset
409 case GG_EVENT_MULTILOGON_MSG:
34356
5d59fd4d5b2d Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34353
diff changeset
410 ggp_message_got_multilogon(gc, &ev->event.multilogon_msg);
33334
734fc6da6179 Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33333
diff changeset
411 break;
734fc6da6179 Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33333
diff changeset
412 case GG_EVENT_MULTILOGON_INFO:
734fc6da6179 Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33333
diff changeset
413 ggp_multilogon_info(gc, &ev->event.multilogon_info);
734fc6da6179 Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33333
diff changeset
414 break;
34348
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
415 case GG_EVENT_IMTOKEN:
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
416 purple_debug_info("gg", "gg11: got IMTOKEN\n");
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
417 g_free(info->imtoken);
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
418 info->imtoken = g_strdup(ev->event.imtoken.imtoken);
34348
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
419 break;
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
420 case GG_EVENT_PONG110:
35139
c30787ce6256 Use external libgadu for win32 build and update some dependencies. Refs #343
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35079
diff changeset
421 purple_debug_info("gg", "gg11: got PONG110 %lu\n",
c30787ce6256 Use external libgadu for win32 build and update some dependencies. Refs #343
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35079
diff changeset
422 (long unsigned)ev->event.pong110.time);
34348
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
423 break;
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
424 case GG_EVENT_CHAT_INFO:
34353
300c246402ac Gadu-Gadu: delayed chat joining
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34352
diff changeset
425 case GG_EVENT_CHAT_INFO_GOT_ALL:
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
426 case GG_EVENT_CHAT_INFO_UPDATE:
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
427 case GG_EVENT_CHAT_CREATED:
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
428 case GG_EVENT_CHAT_INVITE_ACK:
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
429 ggp_chat_got_event(gc, ev);
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
430 break;
35145
01ef7274b440 Gadu-Gadu: handle apropriate event when getting remotely disconnected from other session
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35144
diff changeset
431 case GG_EVENT_DISCONNECT:
01ef7274b440 Gadu-Gadu: handle apropriate event when getting remotely disconnected from other session
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35144
diff changeset
432 ggp_servconn_remote_disconnect(gc);
01ef7274b440 Gadu-Gadu: handle apropriate event when getting remotely disconnected from other session
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35144
diff changeset
433 break;
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
434 default:
34348
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
435 purple_debug_warning("gg",
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
436 "unsupported event type=%d\n", ev->type);
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
437 break;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
438 }
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
439
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
440 gg_free_event(ev);
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
441 }
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
442
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34429
diff changeset
443 void ggp_async_login_handler(gpointer _gc, gint fd, PurpleInputCondition cond)
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
444 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
445 PurpleConnection *gc = _gc;
15419
c8f83c72739d [gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents: 15294
diff changeset
446 GGPInfo *info;
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
447 struct gg_event *ev;
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
448
36068
e9b9320a985a Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36055
diff changeset
449 PURPLE_ASSERT_CONNECTION_IS_VALID(gc);
15419
c8f83c72739d [gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents: 15294
diff changeset
450
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
451 info = purple_connection_get_protocol_data(gc);
15419
c8f83c72739d [gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents: 15294
diff changeset
452
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
453 purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n",
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
454 info->session->check, info->session->state);
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
455
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
456 switch (info->session->state) {
34442
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
457 case GG_STATE_ERROR:
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
458 purple_debug_info("gg", "GG_STATE_ERROR\n");
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
459 break;
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
460 case GG_STATE_RESOLVING:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
461 purple_debug_info("gg", "GG_STATE_RESOLVING\n");
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
462 break;
31685
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
463 case GG_STATE_RESOLVING_GG:
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
464 purple_debug_info("gg", "GG_STATE_RESOLVING_GG\n");
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
465 break;
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
466 case GG_STATE_CONNECTING_HUB:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
467 purple_debug_info("gg", "GG_STATE_CONNECTING_HUB\n");
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
468 break;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
469 case GG_STATE_READING_DATA:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
470 purple_debug_info("gg", "GG_STATE_READING_DATA\n");
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
471 break;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
472 case GG_STATE_CONNECTING_GG:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
473 purple_debug_info("gg", "GG_STATE_CONNECTING_GG\n");
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
474 break;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
475 case GG_STATE_READING_KEY:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
476 purple_debug_info("gg", "GG_STATE_READING_KEY\n");
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
477 break;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
478 case GG_STATE_READING_REPLY:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
479 purple_debug_info("gg", "GG_STATE_READING_REPLY\n");
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
480 break;
31685
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
481 case GG_STATE_TLS_NEGOTIATION:
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
482 purple_debug_info("gg", "GG_STATE_TLS_NEGOTIATION\n");
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
483 break;
34348
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
484 case GG_STATE_RESOLVING_HUB:
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
485 purple_debug_info("gg", "GG_STATE_RESOLVING_HUB\n");
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
486 break;
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
487 case GG_STATE_READING_HUB:
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
488 purple_debug_info("gg", "GG_STATE_READING_HUB\n");
15361867e114 Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33363
diff changeset
489 break;
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
490 default:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
491 purple_debug_error("gg", "unknown state = %d\n",
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
492 info->session->state);
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
493 break;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
494 }
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
495
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
496 if (!(ev = gg_watch_fd(info->session))) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
497 purple_debug_error("gg", "login_handler: gg_watch_fd failed!\n");
32157
39ba2e2492ee Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <markdoliner@pidgin.im>
parents: 32147
diff changeset
498 purple_connection_error (gc,
21279
40685e1f50ca Rename:
Will Thompson <resiak@pidgin.im>
parents: 20437
diff changeset
499 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
27626
62fbae50be08 Connection error message changes for gg, and a few other strings changes.
Mark Doliner <markdoliner@pidgin.im>
parents: 27388
diff changeset
500 _("Unable to read from socket"));
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
501 return;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
502 }
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
503 purple_debug_info("gg", "login_handler: session->fd = %d\n", info->session->fd);
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
504 purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n",
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
505 info->session->check, info->session->state);
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
506
41762
5c21747ff7dc Replace purple_input_remove by g_source_remove
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41709
diff changeset
507 g_source_remove(info->inpa);
32685
140518f18665 GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents: 32678
diff changeset
508 info->inpa = 0;
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
509
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
510 /** XXX I think that this shouldn't be done if ev->type is GG_EVENT_CONN_FAILED or GG_EVENT_CONN_SUCCESS -datallah */
31685
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
511 if (info->session->fd >= 0)
32685
140518f18665 GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents: 32678
diff changeset
512 info->inpa = purple_input_add(info->session->fd,
31685
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
513 (info->session->check == 1) ? PURPLE_INPUT_WRITE :
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
514 PURPLE_INPUT_READ,
166a2f589d32 gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31665
diff changeset
515 ggp_async_login_handler, gc);
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
516
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
517 switch (ev->type) {
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
518 case GG_EVENT_NONE:
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
519 /* Nothing happened. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
520 purple_debug_info("gg", "GG_EVENT_NONE\n");
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
521 break;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
522 case GG_EVENT_CONN_SUCCESS:
12964
3b3d00bb141b [gaim-migrate @ 15317]
Bartosz Oler <bartosz@pidgin.im>
parents: 12961
diff changeset
523 {
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
524 purple_debug_info("gg", "GG_EVENT_CONN_SUCCESS:"
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
525 " successfully connected to %s\n",
34427
2ba83d5d5417 Gadu-Gadu: store server's hostname, instead of IP address, fix memory leak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34425
diff changeset
526 info->session->connect_host);
2ba83d5d5417 Gadu-Gadu: store server's hostname, instead of IP address, fix memory leak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34425
diff changeset
527 ggp_servconn_add_server(info->session->
2ba83d5d5417 Gadu-Gadu: store server's hostname, instead of IP address, fix memory leak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34425
diff changeset
528 connect_host);
41762
5c21747ff7dc Replace purple_input_remove by g_source_remove
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41709
diff changeset
529 g_source_remove(info->inpa);
32685
140518f18665 GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents: 32678
diff changeset
530 info->inpa = purple_input_add(info->session->fd,
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
531 PURPLE_INPUT_READ,
34474
f0210174619a Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34303
diff changeset
532 ggp_callback_recv, gc);
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 30163
diff changeset
533
41812
c3cd920261b6 Fix the namespace of the PurpleConnectionState enum constants
Gary Kramlich <grim@reaperworld.com>
parents: 41799
diff changeset
534 purple_connection_set_state(gc, PURPLE_CONNECTION_STATE_CONNECTED);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
535
27642
6ae79601ad84 Patch from kkszysiu to make the GG prpl support
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 27626
diff changeset
536 ggp_buddylist_send(gc);
33318
636bfc28f2cf Gadu-Gadu: roster - finally working
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33316
diff changeset
537 ggp_roster_request_update(gc);
12964
3b3d00bb141b [gaim-migrate @ 15317]
Bartosz Oler <bartosz@pidgin.im>
parents: 12961
diff changeset
538 }
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
539 break;
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
540 case GG_EVENT_CONN_FAILED:
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
541 if (info->inpa > 0) {
41762
5c21747ff7dc Replace purple_input_remove by g_source_remove
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41709
diff changeset
542 g_source_remove(info->inpa);
33363
52cc04429e2c Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33347
diff changeset
543 info->inpa = 0;
52cc04429e2c Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33347
diff changeset
544 }
32646
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
545 purple_debug_info("gg", "Connection failure: %d\n",
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
546 ev->event.failure);
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
547 switch (ev->event.failure) {
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
548 case GG_FAILURE_RESOLVING:
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
549 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
550 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
551 _("Unable to resolve "
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
552 "hostname"));
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
553 break;
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
554 case GG_FAILURE_PASSWORD:
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
555 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
556 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
557 _("Incorrect password"));
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
558 break;
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
559 case GG_FAILURE_TLS:
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
560 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
561 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
562 _("SSL Connection Failed"));
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
563 break;
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
564 case GG_FAILURE_INTRUDER:
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
565 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
566 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
567 _("Your account has been "
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
568 "disabled because too many "
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
569 "incorrect passwords were "
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
570 "entered"));
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
571 break;
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
572 case GG_FAILURE_UNAVAILABLE:
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
573 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
574 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
575 _("Service temporarily "
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
576 "unavailable"));
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
577 break;
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
578 case GG_FAILURE_PROXY:
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
579 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
580 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
581 _("Error connecting to proxy "
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
582 "server"));
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
583 break;
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
584 case GG_FAILURE_HUB:
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
585 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
586 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
587 _("Error connecting to master "
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
588 "server"));
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
589 break;
34442
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
590 case GG_FAILURE_INTERNAL:
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
591 purple_connection_error(gc,
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
592 PURPLE_CONNECTION_ERROR_OTHER_ERROR,
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
593 _("Internal error"));
4534c27446e8 Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
594 break;
32646
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
595 default:
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
596 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
597 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
598 _("Connection failed"));
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
599 }
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
600 break;
31874
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
601 case GG_EVENT_MSG:
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
602 if (ev->event.msg.sender == 0) {
32647
a8e9b3781df1 Gadu-Gadu: check for NULL pointer before logging system messages.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32646
diff changeset
603 if (ev->event.msg.message == NULL)
a8e9b3781df1 Gadu-Gadu: check for NULL pointer before logging system messages.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32646
diff changeset
604 break;
a8e9b3781df1 Gadu-Gadu: check for NULL pointer before logging system messages.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32646
diff changeset
605
31874
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
606 /* system messages are mostly ads */
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
607 purple_debug_info("gg", "System message:\n%s\n",
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
608 ev->event.msg.message);
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
609 } else {
31874
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
610 purple_debug_warning("gg", "GG_EVENT_MSG: message from user %u "
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
611 "unexpected while connecting:\n%s\n",
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
612 ev->event.msg.sender,
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
613 ev->event.msg.message);
35360
29d788c72350 Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35358
diff changeset
614 }
31874
6ddbbcd38154 No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31795
diff changeset
615 break;
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
616 default:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
617 purple_debug_error("gg", "strange event: %d\n", ev->type);
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
618 break;
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
619 }
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
620
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
621 gg_free_event(ev);
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
622 }
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
623
41641
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
624 static gboolean
39833
cd90938cd6f7 Silence various discarded const warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
625 gg_uri_handler_find_account(PurpleAccount *account,
cd90938cd6f7 Silence various discarded const warnings.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
626 G_GNUC_UNUSED gconstpointer data)
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
627 {
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
628 const gchar *protocol_id;
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
629
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
630 protocol_id = purple_account_get_protocol_id(account);
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
631
41641
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
632 return (purple_strequal(protocol_id, "prpl-gg") &&
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
633 purple_account_is_connected(account));
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
634 }
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
635
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
636 static gboolean
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
637 gg_uri_handler(const gchar *scheme, const gchar *screenname,
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
638 GHashTable *params)
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
639 {
41206
afcae29ce67e Port libpurple plugins and protocols to the AccountManager API
Gary Kramlich <grim@reaperworld.com>
parents: 41159
diff changeset
640 PurpleAccountManager *manager = NULL;
41641
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
641 PurpleAccount *account;
40885
87f6241da196 Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents: 40865
diff changeset
642 PurpleConversation *im;
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
643
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
644 g_return_val_if_fail(screenname != NULL, FALSE);
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
645
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
646 if (!purple_strequal(scheme, "gg")) {
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
647 return FALSE;
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
648 }
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
649
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
650 if (screenname[0] == '\0') {
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
651 purple_debug_warning("gg", "Invalid empty screenname in URI");
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
652 return FALSE;
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
653 }
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
654
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
655 /* Find online Gadu-Gadu account */
41206
afcae29ce67e Port libpurple plugins and protocols to the AccountManager API
Gary Kramlich <grim@reaperworld.com>
parents: 41159
diff changeset
656 manager = purple_account_manager_get_default();
41641
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
657 account = purple_account_manager_find_custom(manager,
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
658 (GEqualFunc)gg_uri_handler_find_account,
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
659 NULL);
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
660
41641
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
661 if (account == NULL) {
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
662 return FALSE;
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
663 }
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
664
41641
ff6dff2228e1 Add a custom find to account manager
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41472
diff changeset
665 im = purple_im_conversation_new(account, screenname);
40885
87f6241da196 Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents: 40865
diff changeset
666 purple_conversation_present(im);
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
667
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
668 return TRUE;
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
669 }
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
670
11414
10b74079ef15 [gaim-migrate @ 13651]
Bartosz Oler <bartosz@pidgin.im>
parents: 11410
diff changeset
671 /* ---------------------------------------------------------------------- */
36544
1bf8b6ef5aea Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents: 36536
diff changeset
672 /* ----- PurpleProtocol ----------------------------------------- */
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
673 /* ---------------------------------------------------------------------- */
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
674
40813
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
675 static PurpleBuddyIconSpec *
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
676 ggp_protocol_get_buddy_icon_spec(PurpleProtocol *protocol) {
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
677 return purple_buddy_icon_spec_new("png",
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
678 1, 1, 200, 200, 0,
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
679 PURPLE_ICON_SCALE_DISPLAY |
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
680 PURPLE_ICON_SCALE_SEND);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
681 }
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
682
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
683 static GList *
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
684 ggp_protocol_get_account_options(PurpleProtocol *protocol) {
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
685 PurpleAccountOption *option = NULL;
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
686 PurpleKeyValuePair *kvp = NULL;
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
687 GList *encryption_options = NULL;
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
688 GList *protocol_version = NULL;
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
689 GList *opts = NULL;
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
690
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
691 option = purple_account_option_string_new(_("GG server"), "gg_server", "");
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
692 opts = g_list_append(opts, option);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
693
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
694 /* setup encryption options */
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
695 kvp = purple_key_value_pair_new(_("Use encryption if available"),
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
696 "opportunistic_tls");
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
697 encryption_options = g_list_append(encryption_options, kvp);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
698
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
699 kvp = purple_key_value_pair_new(_("Require encryption"), "require_tls");
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
700 encryption_options = g_list_append(encryption_options, kvp);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
701
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
702 kvp = purple_key_value_pair_new(_("Don't use encryption"), "none");
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
703 encryption_options = g_list_append(encryption_options, kvp);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
704
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
705 option = purple_account_option_list_new(_("Connection security"),
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
706 "encryption", encryption_options);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
707 opts = g_list_append(opts, option);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
708
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
709 /* setup the protocol version */
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
710 kvp = purple_key_value_pair_new(_("Default"), "default");
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
711 protocol_version = g_list_append(protocol_version, kvp);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
712
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
713 kvp = purple_key_value_pair_new("GG 10", "gg10");
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
714 protocol_version = g_list_append(protocol_version, kvp);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
715
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
716 kvp = purple_key_value_pair_new("GG 11", "gg11");
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
717 protocol_version = g_list_append(protocol_version, kvp);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
718
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
719 option = purple_account_option_list_new(_("Protocol version"),
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
720 "protocol_version",
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
721 protocol_version);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
722 opts = g_list_append(opts, option);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
723
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
724 option = purple_account_option_bool_new(_("Show links from strangers"),
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
725 "show_links_from_strangers", 1);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
726 opts = g_list_append(opts, option);
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
727
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
728 return opts;
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
729 }
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
730
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
731 static const char *
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
732 ggp_normalize(PurpleProtocolClient *client, PurpleAccount *account,
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
733 const char *who)
2846
4f0435806f95 [gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2835
diff changeset
734 {
32652
9cf860cf65f2 Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32651
diff changeset
735 static char normalized[21]; /* maximum unsigned long long int size */
2846
4f0435806f95 [gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2835
diff changeset
736
32652
9cf860cf65f2 Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32651
diff changeset
737 uin_t uin = ggp_str_to_uin(who);
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
738 if(uin <= 0) {
31892
3368a7044a4a Better status message handling in Gadu-Gadu. Fixes #14314
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31879
diff changeset
739 return NULL;
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
740 }
31892
3368a7044a4a Better status message handling in Gadu-Gadu. Fixes #14314
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31879
diff changeset
741
32652
9cf860cf65f2 Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32651
diff changeset
742 g_snprintf(normalized, sizeof(normalized), "%u", uin);
31892
3368a7044a4a Better status message handling in Gadu-Gadu. Fixes #14314
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 31879
diff changeset
743
32652
9cf860cf65f2 Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32651
diff changeset
744 return normalized;
2846
4f0435806f95 [gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2835
diff changeset
745 }
4f0435806f95 [gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents: 2835
diff changeset
746
34409
198c6f5c19ca Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34408
diff changeset
747 /* TODO:
198c6f5c19ca Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34408
diff changeset
748 * - move to status.c ?
198c6f5c19ca Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34408
diff changeset
749 * - add information about not adding to his buddy list (not_a_friend)
198c6f5c19ca Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34408
diff changeset
750 */
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
751 static void
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
752 ggp_tooltip_text(PurpleProtocolClient *client, PurpleBuddy *b,
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
753 PurpleNotifyUserInfo *user_info, gboolean full)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
754 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
755 PurpleStatus *status;
32188
cb9cad610bc6 I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents: 32157
diff changeset
756 char *tmp;
33342
26ba5e4e8c24 Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33341
diff changeset
757 const char *name, *alias;
26ba5e4e8c24 Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33341
diff changeset
758 gchar *msg;
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
759
15005
4b4af389b71c [gaim-migrate @ 17715]
Bartosz Oler <bartosz@pidgin.im>
parents: 14754
diff changeset
760 g_return_if_fail(b != NULL);
4b4af389b71c [gaim-migrate @ 17715]
Bartosz Oler <bartosz@pidgin.im>
parents: 14754
diff changeset
761
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
762 status = purple_presence_get_active_status(purple_buddy_get_presence(b));
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
763 name = purple_status_get_name(status);
24745
511df62cb366 Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents: 24683
diff changeset
764 alias = purple_buddy_get_alias(b);
33342
26ba5e4e8c24 Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33341
diff changeset
765 ggp_status_from_purplestatus(status, &msg);
24745
511df62cb366 Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents: 24683
diff changeset
766
32188
cb9cad610bc6 I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents: 32157
diff changeset
767 purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), alias);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
768
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
769 if (msg != NULL) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
770 if (PURPLE_BUDDY_IS_ONLINE(b)) {
32188
cb9cad610bc6 I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents: 32157
diff changeset
771 tmp = g_strdup_printf("%s: %s", name, msg);
cb9cad610bc6 I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents: 32157
diff changeset
772 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), tmp);
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 15196
diff changeset
773 g_free(tmp);
15196
1663f0333c05 [gaim-migrate @ 17920]
Bartosz Oler <bartosz@pidgin.im>
parents: 15185
diff changeset
774 } else {
32188
cb9cad610bc6 I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents: 32157
diff changeset
775 purple_notify_user_info_add_pair_plaintext(user_info, _("Message"), msg);
15196
1663f0333c05 [gaim-migrate @ 17920]
Bartosz Oler <bartosz@pidgin.im>
parents: 15185
diff changeset
776 }
33342
26ba5e4e8c24 Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33341
diff changeset
777 g_free(msg);
15227
a3327ea6d1b7 [gaim-migrate @ 17951]
Bartosz Oler <bartosz@pidgin.im>
parents: 15205
diff changeset
778 /* We don't want to duplicate 'Status: Offline'. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
779 } else if (PURPLE_BUDDY_IS_ONLINE(b)) {
32188
cb9cad610bc6 I went through all our calls to purple_notify_user_info_add_pair() and
Mark Doliner <markdoliner@pidgin.im>
parents: 32157
diff changeset
780 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), name);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
781 }
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
782 }
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
783
41814
f8940ebd4eee Back out the PurpleProtocol->login change that returned a PurpleConnection
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
784 static void
f8940ebd4eee Back out the PurpleProtocol->login change that returned a PurpleConnection
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
785 ggp_login(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleAccount *account) {
f8940ebd4eee Back out the PurpleProtocol->login change that returned a PurpleConnection
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
786 PurpleConnection *gc = purple_account_get_connection(account);
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
787 struct gg_login_params *glp;
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
788 GGPInfo *info;
27255
d2284774cfed Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents: 27197
diff changeset
789 const char *address;
34424
70fb82cea2a7 Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34415
diff changeset
790 const gchar *encryption_type, *protocol_version;
40019
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
791 GProxyResolver *resolver;
41159
2b4446ccebc9 Make sure our GError variables are initialized to NULL
Gary Kramlich <grim@reaperworld.com>
parents: 41078
diff changeset
792 GError *error = NULL;
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
793
36069
f99249837123 Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
794 purple_connection_set_flags(gc,
f99249837123 Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
795 PURPLE_CONNECTION_FLAG_HTML |
f99249837123 Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36068
diff changeset
796 PURPLE_CONNECTION_FLAG_NO_URLDESC);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
797
40019
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
798 resolver = purple_proxy_get_proxy_resolver(account, &error);
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
799 if (resolver == NULL) {
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
800 purple_debug_error("gg", "Unable to get account proxy resolver: %s",
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
801 error->message);
40618
4726bf0ff977 Fix some GError leaks.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40521
diff changeset
802 purple_connection_take_error(gc, error);
41814
f8940ebd4eee Back out the PurpleProtocol->login change that returned a PurpleConnection
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
803 return;
40019
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
804 }
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
805
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
806 glp = g_new0(struct gg_login_params, 1);
34427
2ba83d5d5417 Gadu-Gadu: store server's hostname, instead of IP address, fix memory leak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34425
diff changeset
807 glp->struct_size = sizeof(struct gg_login_params);
13515
0cea461e904c [gaim-migrate @ 15890]
Bartosz Oler <bartosz@pidgin.im>
parents: 13466
diff changeset
808 info = g_new0(GGPInfo, 1);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
809
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
810 purple_connection_set_protocol_data(gc, info);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
811
40819
54b2a95ac176 Cleanup deprecated libsoup usage
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40813
diff changeset
812 info->http = soup_session_new_with_options("proxy-resolver", resolver,
54b2a95ac176 Cleanup deprecated libsoup usage
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40813
diff changeset
813 NULL);
40019
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
814
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34429
diff changeset
815 ggp_tcpsocket_setup(gc, glp);
33298
519acf37d16e Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33296
diff changeset
816 ggp_image_setup(gc);
33313
5a0c6582d5b1 Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33311
diff changeset
817 ggp_avatar_setup(gc);
33314
57013b9e1a8e Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
818 ggp_roster_setup(gc);
33334
734fc6da6179 Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33333
diff changeset
819 ggp_multilogon_setup(gc);
33336
7c97b5dd3bf4 Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33334
diff changeset
820 ggp_status_setup(gc);
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
821 ggp_chat_setup(gc);
34361
ddcc82637afa Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34359
diff changeset
822 ggp_message_setup(gc);
40025
7668af6d772c Convert GG file transfers to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40019
diff changeset
823 ggp_edisc_setup(gc, resolver);
7668af6d772c Convert GG file transfers to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40019
diff changeset
824 g_object_unref(resolver);
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 30163
diff changeset
825
33299
b3c4ab3aeb7f Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
826 glp->uin = ggp_str_to_uin(purple_account_get_username(account));
34145
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34115
diff changeset
827 glp->password =
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34115
diff changeset
828 ggp_convert_to_cp1250(purple_connection_get_password(gc));
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
829
32646
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
830 if (glp->uin == 0) {
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
831 purple_connection_error(gc,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
832 PURPLE_CONNECTION_ERROR_INVALID_USERNAME,
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
833 _("The username specified is invalid."));
34428
f52357f34177 Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34427
diff changeset
834 purple_str_wipe(glp->password);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
835 g_free(glp);
41814
f8940ebd4eee Back out the PurpleProtocol->login change that returned a PurpleConnection
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
836 return;
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
837 }
32646
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
838
24745
511df62cb366 Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents: 24683
diff changeset
839 glp->image_size = 255;
32651
cc247c37281e Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32650
diff changeset
840 glp->status_flags = GG_STATUS_FLAG_UNKNOWN;
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
841
32651
cc247c37281e Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32650
diff changeset
842 if (purple_account_get_bool(account, "show_links_from_strangers", 1))
cc247c37281e Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32650
diff changeset
843 glp->status_flags |= GG_STATUS_FLAG_SPAM;
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
844
29824
9878119b5d78 Finish making libgadu compile on Windows. Fixes #10542 finally!
Krzysztof Klinikowski <kkszysiu@gmail.com>
parents: 29404
diff changeset
845 glp->encoding = GG_ENCODING_UTF8;
33296
33a9adb52028 Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33295
diff changeset
846 glp->protocol_features = (GG_FEATURE_DND_FFC |
33a9adb52028 Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33295
diff changeset
847 GG_FEATURE_TYPING_NOTIFICATION | GG_FEATURE_MULTILOGON |
33a9adb52028 Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33295
diff changeset
848 GG_FEATURE_USER_DATA);
35976
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
849
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
850 glp->async = 1;
35976
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
851
32643
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
852 encryption_type = purple_account_get_string(account, "encryption",
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
853 "opportunistic_tls");
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
854 purple_debug_info("gg", "Requested encryption type: %s\n",
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
855 encryption_type);
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37163 38259
diff changeset
856 if (purple_strequal(encryption_type, "opportunistic_tls"))
32643
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
857 glp->tls = GG_SSL_ENABLED;
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37163 38259
diff changeset
858 else if (purple_strequal(encryption_type, "require_tls")) {
32643
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
859 if (gg_libgadu_check_feature(GG_LIBGADU_FEATURE_SSL))
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
860 glp->tls = GG_SSL_REQUIRED;
32646
d1e3538b0c5f Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32645
diff changeset
861 else {
32643
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
862 purple_connection_error(gc,
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
863 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
864 _("SSL support unavailable"));
34428
f52357f34177 Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34427
diff changeset
865 purple_str_wipe(glp->password);
32643
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
866 g_free(glp);
41814
f8940ebd4eee Back out the PurpleProtocol->login change that returned a PurpleConnection
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
867 return;
35976
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
868 }
32643
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
869 }
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
870 else /* encryption_type == "none" */
c7ba76b54779 Gadu-Gadu: possibility to require encryption; use encryption when available is default option now
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 32617
diff changeset
871 glp->tls = GG_SSL_DISABLED;
34424
70fb82cea2a7 Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34415
diff changeset
872 purple_debug_misc("gg", "TLS mode: %d\n", glp->tls);
35976
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
873
34424
70fb82cea2a7 Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34415
diff changeset
874 protocol_version = purple_account_get_string(account,
70fb82cea2a7 Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34415
diff changeset
875 "protocol_version", "default");
70fb82cea2a7 Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34415
diff changeset
876 purple_debug_info("gg", "Requested protocol version: %s\n",
70fb82cea2a7 Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34415
diff changeset
877 protocol_version);
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37163 38259
diff changeset
878 if (purple_strequal(protocol_version, "gg10"))
34424
70fb82cea2a7 Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34415
diff changeset
879 glp->protocol_version = GG_PROTOCOL_VERSION_100;
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37163 38259
diff changeset
880 else if (purple_strequal(protocol_version, "gg11"))
34424
70fb82cea2a7 Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34415
diff changeset
881 glp->protocol_version = GG_PROTOCOL_VERSION_110;
34473
fb04c75906e0 Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34454
diff changeset
882 glp->compatibility = GG_COMPAT_1_12_0;
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
883
33336
7c97b5dd3bf4 Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33334
diff changeset
884 ggp_status_set_initial(gc, glp);
35976
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
885
27255
d2284774cfed Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents: 27197
diff changeset
886 address = purple_account_get_string(account, "gg_server", "");
33292
0ad1dc71f5c7 Makefile cleanup, fix building with external libgadu, little synchronization of internal libgadu with upstream. Refs #343
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33291
diff changeset
887 if (address && *address)
34427
2ba83d5d5417 Gadu-Gadu: store server's hostname, instead of IP address, fix memory leak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34425
diff changeset
888 glp->connect_host = g_strdup(address);
27255
d2284774cfed Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents: 27197
diff changeset
889
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
890 info->session = gg_login(glp);
34427
2ba83d5d5417 Gadu-Gadu: store server's hostname, instead of IP address, fix memory leak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34425
diff changeset
891 g_free(glp->connect_host);
34428
f52357f34177 Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34427
diff changeset
892 purple_str_wipe(glp->password);
34427
2ba83d5d5417 Gadu-Gadu: store server's hostname, instead of IP address, fix memory leak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34425
diff changeset
893 g_free(glp);
2ba83d5d5417 Gadu-Gadu: store server's hostname, instead of IP address, fix memory leak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34425
diff changeset
894
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
895 if (info->session == NULL) {
32157
39ba2e2492ee Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <markdoliner@pidgin.im>
parents: 32147
diff changeset
896 purple_connection_error (gc,
21279
40685e1f50ca Rename:
Will Thompson <resiak@pidgin.im>
parents: 20437
diff changeset
897 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
27626
62fbae50be08 Connection error message changes for gg, and a few other strings changes.
Mark Doliner <markdoliner@pidgin.im>
parents: 27388
diff changeset
898 _("Connection failed"));
41814
f8940ebd4eee Back out the PurpleProtocol->login change that returned a PurpleConnection
Gary Kramlich <grim@reaperworld.com>
parents: 41812
diff changeset
899 return;
35976
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
900 }
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
901
34433
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34429
diff changeset
902 if (info->session->fd > 0) {
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34429
diff changeset
903 info->inpa = purple_input_add(info->session->fd,
fa2313e5f320 Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34429
diff changeset
904 PURPLE_INPUT_READ, ggp_async_login_handler, gc);
35976
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
905 }
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
906 }
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
907
41775
82c861678f39 Pass the PurpleProtocol objects to all methods of the class
Gary Kramlich <grim@reaperworld.com>
parents: 41762
diff changeset
908 static void
82c861678f39 Pass the PurpleProtocol objects to all methods of the class
Gary Kramlich <grim@reaperworld.com>
parents: 41762
diff changeset
909 ggp_close(G_GNUC_UNUSED PurpleProtocol *protocol, PurpleConnection *gc) {
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
910 PurpleAccount *account;
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
911 GGPInfo *info;;
8997
a30b6b11674a [gaim-migrate @ 9772]
Luke Schierer <lschiere@pidgin.im>
parents: 8996
diff changeset
912
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
913 g_return_if_fail(gc != NULL);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
914
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
915 account = purple_connection_get_account(gc);
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
916 info = purple_connection_get_protocol_data(gc);
12964
3b3d00bb141b [gaim-migrate @ 15317]
Bartosz Oler <bartosz@pidgin.im>
parents: 12961
diff changeset
917
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
918 purple_notify_close_with_handle(gc);
35976
3f076483405f Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35251
diff changeset
919
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
920 if (info) {
11538
d87f3717d5a5 [gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents: 11522
diff changeset
921 if (info->session != NULL) {
33340
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
922 ggp_status_set_disconnected(account);
11538
d87f3717d5a5 [gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents: 11522
diff changeset
923 gg_logoff(info->session);
d87f3717d5a5 [gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents: 11522
diff changeset
924 gg_free_session(info->session);
d87f3717d5a5 [gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents: 11522
diff changeset
925 }
13641
1173f8ca3fbf [gaim-migrate @ 16038]
Bartosz Oler <bartosz@pidgin.im>
parents: 13627
diff changeset
926
33313
5a0c6582d5b1 Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33311
diff changeset
927 ggp_image_cleanup(gc);
5a0c6582d5b1 Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33311
diff changeset
928 ggp_avatar_cleanup(gc);
33314
57013b9e1a8e Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33313
diff changeset
929 ggp_roster_cleanup(gc);
33334
734fc6da6179 Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33333
diff changeset
930 ggp_multilogon_cleanup(gc);
33336
7c97b5dd3bf4 Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33334
diff changeset
931 ggp_status_cleanup(gc);
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34348
diff changeset
932 ggp_chat_cleanup(gc);
34361
ddcc82637afa Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34359
diff changeset
933 ggp_message_cleanup(gc);
34380
2179667660bc Edisc authentication, file transfer implementation started
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34378
diff changeset
934 ggp_edisc_cleanup(gc);
14060
e1a87aabd80c [gaim-migrate @ 16583]
Evan Schoenberg <evands@pidgin.im>
parents: 13645
diff changeset
935
32685
140518f18665 GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents: 32678
diff changeset
936 if (info->inpa > 0)
41762
5c21747ff7dc Replace purple_input_remove by g_source_remove
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41709
diff changeset
937 g_source_remove(info->inpa);
34373
169db6aa5e08 Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34361
diff changeset
938 g_free(info->imtoken);
32685
140518f18665 GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents: 32678
diff changeset
939
40019
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
940 if (info->http) {
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
941 soup_session_abort(info->http);
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
942 g_object_unref(info->http);
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
943 }
5bf1b06ebd65 Convert GG avatar fetching to libsoup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39970
diff changeset
944
32685
140518f18665 GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents: 32678
diff changeset
945 purple_connection_set_protocol_data(gc, NULL);
11545
df2f9bb3fd6e [gaim-migrate @ 13800]
Daniel Atallah <datallah@pidgin.im>
parents: 11544
diff changeset
946 g_free(info);
11538
d87f3717d5a5 [gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents: 11522
diff changeset
947 }
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
948
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
949 purple_debug_info("gg", "Connection closed.\n");
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
950 }
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
951
40507
77d7bc9e5151 Make PurpleProtocolIM a proper interface
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
952 static unsigned int ggp_send_typing(PurpleProtocolIM *im, PurpleConnection *gc, const char *name, PurpleIMTypingState state)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
953 {
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
954 GGPInfo *info = purple_connection_get_protocol_data(gc);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
955 int dummy_length; /* we don't send real length of typed message */
24745
511df62cb366 Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents: 24683
diff changeset
956
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
957 if (state == PURPLE_IM_TYPED) /* not supported */
31648
03cb811f6382 This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 31630
diff changeset
958 return 1;
31628
339576876d0b Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 31611
diff changeset
959
34670
9bd5bd903dc7 Renamed chat buddies to chat users, and IM conversation typing state to IM typing state.
Ankit Vani <a@nevitus.org>
parents: 34632
diff changeset
960 if (state == PURPLE_IM_TYPING)
31648
03cb811f6382 This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 31630
diff changeset
961 dummy_length = (int)g_random_int();
37063
a84be725efad Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37038 35358
diff changeset
962 else /* PURPLE_IM_NOT_TYPING */
31648
03cb811f6382 This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 31630
diff changeset
963 dummy_length = 0;
24745
511df62cb366 Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents: 24683
diff changeset
964
31648
03cb811f6382 This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 31630
diff changeset
965 gg_typing_notification(
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
966 info->session,
31648
03cb811f6382 This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 31630
diff changeset
967 ggp_str_to_uin(name),
35358
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35356
diff changeset
968 dummy_length);
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 30163
diff changeset
969
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
970 return 1; /* wait 1 second before another notification */
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
971 }
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
972
40708
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
973 static void
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
974 ggp_add_buddy(PurpleProtocolServer *protocol_server, PurpleConnection *gc,
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
975 PurpleBuddy *buddy, PurpleGroup *group, const gchar *message)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
976 {
33299
b3c4ab3aeb7f Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33298
diff changeset
977 PurpleAccount *account = purple_connection_get_account(gc);
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
978 GGPInfo *info = purple_connection_get_protocol_data(gc);
24939
d25fdf62ae92 moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents: 24043
diff changeset
979 const gchar *name = purple_buddy_get_name(buddy);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
980
24939
d25fdf62ae92 moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents: 24043
diff changeset
981 gg_add_notify(info->session, ggp_str_to_uin(name));
20289
5c844288fbec applied changes from 32f31e981f0618a4167aa98bcc22c2dab13d1550
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 20288
diff changeset
982
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
983 /* gg server won't tell us our status here */
38358
30ba44276e74 Merge release-2.x.y into default
dx <dx@dxzone.com.ar>
parents: 37163 38259
diff changeset
984 if (purple_strequal(purple_account_get_username(account), name))
33337
458d578d553d Gadu-Gadu: status refactoring - fix bug with long status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33336
diff changeset
985 ggp_status_fake_to_self(gc);
35354
aa1f0e988567 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35305
diff changeset
986
40708
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
987 ggp_roster_add_buddy(protocol_server, gc, buddy, group, message);
33345
740174b22496 Gadu-Gadu: retrieve buddy public alias after adding to blist. Fixes #2188
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33344
diff changeset
988 ggp_pubdir_request_buddy_alias(gc, buddy);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
989 }
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
990
40708
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
991 static void
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
992 ggp_remove_buddy(PurpleProtocolServer *protocol_server, PurpleConnection *gc,
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
993 PurpleBuddy *buddy, PurpleGroup *group)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
994 {
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
995 GGPInfo *info = purple_connection_get_protocol_data(gc);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
996
24939
d25fdf62ae92 moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents: 24043
diff changeset
997 gg_remove_notify(info->session, ggp_str_to_uin(purple_buddy_get_name(buddy)));
40708
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
998 ggp_roster_remove_buddy(protocol_server, gc, buddy, group);
11394
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
999 }
044b3779f027 [gaim-migrate @ 13625]
Bartosz Oler <bartosz@pidgin.im>
parents: 11360
diff changeset
1000
40708
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
1001 static void
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40650
diff changeset
1002 ggp_keepalive(PurpleProtocolServer *protocol_server, PurpleConnection *gc) {
32261
bd956558346e Convert gg prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
Andrew Victor <andrew.victor@mxit.com>
parents: 32191
diff changeset
1003 GGPInfo *info = purple_connection_get_protocol_data(gc);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1004
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1005 /* purple_debug_info("gg", "Keeping connection alive....\n"); */
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1006
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1007 if (gg_ping(info->session) < 0) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15524
diff changeset
1008 purple_debug_info("gg", "Not connected to the server "
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1009 "or gg_session is not correct\n");
32157
39ba2e2492ee Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <markdoliner@pidgin.im>
parents: 32147
diff changeset
1010 purple_connection_error (gc,
21279
40685e1f50ca Rename:
Will Thompson <resiak@pidgin.im>
parents: 20437
diff changeset
1011 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
27626
62fbae50be08 Connection error message changes for gg, and a few other strings changes.
Mark Doliner <markdoliner@pidgin.im>
parents: 27388
diff changeset
1012 _("Not connected to the server"));
4916
11b8fd3f8ffc [gaim-migrate @ 5250]
Sean Egan <seanegan@pidgin.im>
parents: 4793
diff changeset
1013 }
2393
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1014 }
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1015
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1016 static void
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1017 ggp_action_multilogon(G_GNUC_UNUSED GSimpleAction *action,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1018 GVariant *parameter,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1019 G_GNUC_UNUSED gpointer data)
35144
3590ceb242b5 Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35139
diff changeset
1020 {
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1021 const gchar *account_id = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1022 PurpleAccountManager *manager = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1023 PurpleAccount *account = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1024 PurpleConnection *connection = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1025
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1026 if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1027 g_critical("GG multilogin action parameter is of incorrect type %s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1028 g_variant_get_type_string(parameter));
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1029 }
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1030
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1031 account_id = g_variant_get_string(parameter, NULL);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1032 manager = purple_account_manager_get_default();
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1033 account = purple_account_manager_find_by_id(manager, account_id);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1034 connection = purple_account_get_connection(account);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1035
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1036 ggp_multilogon_dialog(connection);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1037 }
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1038
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1039 static void
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1040 ggp_action_status_broadcasting(G_GNUC_UNUSED GSimpleAction *action,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1041 GVariant *parameter,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1042 G_GNUC_UNUSED gpointer data)
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1043 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1044 const gchar *account_id = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1045 PurpleAccountManager *manager = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1046 PurpleAccount *account = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1047 PurpleConnection *connection = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1048
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1049 if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1050 g_critical("GG broadcast action parameter is of incorrect type %s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1051 g_variant_get_type_string(parameter));
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1052 }
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1053
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1054 account_id = g_variant_get_string(parameter, NULL);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1055 manager = purple_account_manager_get_default();
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1056 account = purple_account_manager_find_by_id(manager, account_id);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1057 connection = purple_account_get_connection(account);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1058
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1059 ggp_status_broadcasting_dialog(connection);
35144
3590ceb242b5 Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35139
diff changeset
1060 }
3590ceb242b5 Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35139
diff changeset
1061
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1062 static void
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1063 ggp_action_search(G_GNUC_UNUSED GSimpleAction *action,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1064 GVariant *parameter,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1065 G_GNUC_UNUSED gpointer data)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1066 {
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1067 const gchar *account_id = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1068 PurpleAccountManager *manager = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1069 PurpleAccount *account = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1070 PurpleConnection *connection = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1071
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1072 if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1073 g_critical("GG search action parameter is of incorrect type %s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1074 g_variant_get_type_string(parameter));
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1075 }
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1076
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1077 account_id = g_variant_get_string(parameter, NULL);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1078 manager = purple_account_manager_get_default();
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1079 account = purple_account_manager_find_by_id(manager, account_id);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1080 connection = purple_account_get_connection(account);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1081
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1082 ggp_pubdir_search(connection, NULL);
2393
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1083 }
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1084
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1085 static void
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1086 ggp_action_set_info(G_GNUC_UNUSED GSimpleAction *action,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1087 GVariant *parameter,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1088 G_GNUC_UNUSED gpointer data)
33343
09f740724036 Gadu-Gadu: extended OAuth support, initial support for gg10.5 public directory
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33342
diff changeset
1089 {
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1090 const gchar *account_id = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1091 PurpleAccountManager *manager = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1092 PurpleAccount *account = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1093 PurpleConnection *connection = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1094
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1095 if(!g_variant_is_of_type(parameter, G_VARIANT_TYPE_STRING)) {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1096 g_critical("GG set info action parameter is of incorrect type %s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1097 g_variant_get_type_string(parameter));
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1098 }
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1099
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1100 account_id = g_variant_get_string(parameter, NULL);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1101 manager = purple_account_manager_get_default();
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1102 account = purple_account_manager_find_by_id(manager, account_id);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1103 connection = purple_account_get_connection(account);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1104
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1105 ggp_pubdir_set_info(connection);
33343
09f740724036 Gadu-Gadu: extended OAuth support, initial support for gg10.5 public directory
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33342
diff changeset
1106 }
09f740724036 Gadu-Gadu: extended OAuth support, initial support for gg10.5 public directory
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33342
diff changeset
1107
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1108 static const gchar *
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1109 ggp_protocol_actions_get_prefix(PurpleProtocolActions *actions) {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1110 return "prpl-gg";
2393
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1111 }
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1112
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1113 static GActionGroup *
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1114 ggp_protocol_actions_get_action_group(PurpleProtocolActions *actions,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1115 G_GNUC_UNUSED PurpleConnection *connection)
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1116 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1117 GSimpleActionGroup *group = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1118 GActionEntry entries[] = {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1119 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1120 .name = "multilogon",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1121 .activate = ggp_action_multilogon,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1122 .parameter_type = "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1123 },
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1124 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1125 .name = "broadcasting",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1126 .activate = ggp_action_status_broadcasting,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1127 .parameter_type = "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1128 },
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1129 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1130 .name = "search",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1131 .activate = ggp_action_search,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1132 .parameter_type = "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1133 },
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1134 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1135 .name = "set-info",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1136 .activate = ggp_action_set_info,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1137 .parameter_type = "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1138 },
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1139 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1140 .name = "save-buddylist",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1141 .activate = ggp_action_buddylist_save,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1142 .parameter_type = "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1143 },
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1144 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1145 .name = "load-buddylist",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1146 .activate = ggp_action_buddylist_load,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1147 .parameter_type = "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1148 },
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1149 };
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1150 gsize nentries = G_N_ELEMENTS(entries);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1151
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1152 group = g_simple_action_group_new();
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1153 g_action_map_add_action_entries(G_ACTION_MAP(group), entries, nentries,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1154 NULL);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1155
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1156 return G_ACTION_GROUP(group);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1157 }
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1158
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1159 static GMenu *
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1160 ggp_protocol_actions_get_menu(PurpleProtocolActions *actions) {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1161 GMenu *menu = NULL, *submenu = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1162 GMenuItem *item = NULL;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1163
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1164 menu = g_menu_new();
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1165
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1166 item = g_menu_item_new(_("Show other sessions"), "prpl-gg.multilogon");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1167 g_menu_item_set_attribute(item, PURPLE_MENU_ATTRIBUTE_DYNAMIC_TARGET, "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1168 "account");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1169 g_menu_append_item(menu, item);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1170 g_object_unref(item);
8775
6cb5dddaad4f [gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents: 8749
diff changeset
1171
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1172 item = g_menu_item_new(_("Show status only for buddies"),
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1173 "prpl-gg.broadcasting");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1174 g_menu_item_set_attribute(item, PURPLE_MENU_ATTRIBUTE_DYNAMIC_TARGET, "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1175 "account");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1176 g_menu_append_item(menu, item);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1177 g_object_unref(item);
8775
6cb5dddaad4f [gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents: 8749
diff changeset
1178
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1179 item = g_menu_item_new(_("Find buddies..."), "prpl-gg.search");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1180 g_menu_item_set_attribute(item, PURPLE_MENU_ATTRIBUTE_DYNAMIC_TARGET, "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1181 "account");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1182 g_menu_append_item(menu, item);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1183 g_object_unref(item);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1184
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1185 item = g_menu_item_new(_("Set User Info"), "prpl-gg.set-info");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1186 g_menu_item_set_attribute(item, PURPLE_MENU_ATTRIBUTE_DYNAMIC_TARGET, "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1187 "account");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1188 g_menu_append_item(menu, item);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1189 g_object_unref(item);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1190
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1191 /* Buddy list management. */
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1192 submenu = g_menu_new();
8775
6cb5dddaad4f [gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents: 8749
diff changeset
1193
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1194 item = g_menu_item_new(_("Save to file..."), "prpl-gg.save-buddylist");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1195 g_menu_item_set_attribute(item, PURPLE_MENU_ATTRIBUTE_DYNAMIC_TARGET, "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1196 "account");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1197 g_menu_append_item(menu, item);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1198 g_object_unref(item);
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1199
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1200 item = g_menu_item_new(_("Load from file..."), "prpl-gg.load-buddylist");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1201 g_menu_item_set_attribute(item, PURPLE_MENU_ATTRIBUTE_DYNAMIC_TARGET, "s",
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1202 "account");
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1203 g_menu_append_item(menu, item);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1204 g_object_unref(item);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1205
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1206 g_menu_append_submenu(menu, _("Buddy list"), G_MENU_MODEL(submenu));
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1207 g_object_unref(submenu);
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1208
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1209 return menu;
8775
6cb5dddaad4f [gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents: 8749
diff changeset
1210 }
6cb5dddaad4f [gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents: 8749
diff changeset
1211
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1212 static const char *
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1213 ggp_list_emblem(PurpleProtocolClient *client, PurpleBuddy *buddy) {
33340
5f00ed891179 Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33339
diff changeset
1214 ggp_buddy_data *buddy_data = ggp_buddy_get_data(buddy);
33327
4e6e895f161b Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33318
diff changeset
1215
4e6e895f161b Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33318
diff changeset
1216 if (buddy_data->blocked)
4e6e895f161b Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33318
diff changeset
1217 return "not-authorized";
34409
198c6f5c19ca Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34408
diff changeset
1218 if (buddy_data->not_a_friend)
198c6f5c19ca Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34408
diff changeset
1219 return "unavailable";
33327
4e6e895f161b Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33318
diff changeset
1220
4e6e895f161b Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33318
diff changeset
1221 return NULL;
4e6e895f161b Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33318
diff changeset
1222 }
4e6e895f161b Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33318
diff changeset
1223
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1224 static gboolean
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1225 ggp_offline_message(PurpleProtocolClient *client, PurpleBuddy *buddy) {
13298
7a41e676010b [gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents: 13297
diff changeset
1226 return TRUE;
7a41e676010b [gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents: 13297
diff changeset
1227 }
7a41e676010b [gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents: 13297
diff changeset
1228
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1229 static GHashTable *
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1230 ggp_get_account_text_table(PurpleProtocolClient *client,
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1231 PurpleAccount *account)
36118
f1c54a78d896 Better check for libgadu GPL compliance, some tidying up
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35976
diff changeset
1232 {
33311
3ba9260b0e74 Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33310
diff changeset
1233 GHashTable *table;
3ba9260b0e74 Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33310
diff changeset
1234 table = g_hash_table_new(g_str_hash, g_str_equal);
3ba9260b0e74 Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33310
diff changeset
1235 g_hash_table_insert(table, "login_label", (gpointer)_("GG number..."));
3ba9260b0e74 Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33310
diff changeset
1236 return table;
36118
f1c54a78d896 Better check for libgadu GPL compliance, some tidying up
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35976
diff changeset
1237 }
f1c54a78d896 Better check for libgadu GPL compliance, some tidying up
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35976
diff changeset
1238
34321
f60fcab02bd4 Reconsidered characters count callback for prpl API: make it per-conversation and distinguish infinite from undefined
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34312
diff changeset
1239 static gssize
40634
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1240 ggp_get_max_message_size(PurpleProtocolClient *client,
4d3018b00ad4 Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40618
diff changeset
1241 PurpleConversation *conv)
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
1242 {
34321
f60fcab02bd4 Reconsidered characters count callback for prpl API: make it per-conversation and distinguish infinite from undefined
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34312
diff changeset
1243 /* TODO: it may depend on protocol version or other factors */
34448
e15d91a77cb3 Request API: PURPLE_REQUEST_WAIT with progress bar
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34442
diff changeset
1244 return 1200; /* no more than 1232 */
36118
f1c54a78d896 Better check for libgadu GPL compliance, some tidying up
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35976
diff changeset
1245 }
5205
242b8aa81328 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 5136
diff changeset
1246
36283
e7949b2aa31a Gadu-Gadu: fix log printing for win32
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36274
diff changeset
1247 static void
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1248 ggp_protocol_init(GGPProtocol *self)
2393
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1249 {
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1250 }
11541
b1468184879c [gaim-migrate @ 13796]
Daniel Atallah <datallah@pidgin.im>
parents: 11538
diff changeset
1251
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1252 static void
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1253 ggp_protocol_class_init(GGPProtocolClass *klass)
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
1254 {
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1255 PurpleProtocolClass *protocol_class = PURPLE_PROTOCOL_CLASS(klass);
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1256
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1257 protocol_class->login = ggp_login;
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1258 protocol_class->close = ggp_close;
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1259 protocol_class->status_types = ggp_status_types;
40813
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1260
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1261 protocol_class->get_account_options = ggp_protocol_get_account_options;
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1262 protocol_class->get_buddy_icon_spec = ggp_protocol_get_buddy_icon_spec;
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1263 }
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1264
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1265 static void
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1266 ggp_protocol_class_finalize(G_GNUC_UNUSED GGPProtocolClass *klass)
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1267 {
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
1268 }
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
1269
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
1270 static void
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1271 ggp_protocol_actions_iface_init(PurpleProtocolActionsInterface *iface)
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1272 {
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1273 iface->get_prefix = ggp_protocol_actions_get_prefix;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1274 iface->get_action_group = ggp_protocol_actions_get_action_group;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1275 iface->get_menu = ggp_protocol_actions_get_menu;
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1276 }
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1277
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1278 static void
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39669
diff changeset
1279 ggp_protocol_client_iface_init(PurpleProtocolClientInterface *client_iface)
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1280 {
36729
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
1281 client_iface->list_emblem = ggp_list_emblem;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
1282 client_iface->status_text = ggp_status_buddy_text;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
1283 client_iface->tooltip_text = ggp_tooltip_text;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
1284 client_iface->buddy_free = ggp_buddy_free;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
1285 client_iface->normalize = ggp_normalize;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
1286 client_iface->offline_message = ggp_offline_message;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
1287 client_iface->get_account_text_table = ggp_get_account_text_table;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
1288 client_iface->get_max_message_size = ggp_get_max_message_size;
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1289 }
11541
b1468184879c [gaim-migrate @ 13796]
Daniel Atallah <datallah@pidgin.im>
parents: 11538
diff changeset
1290
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1291 static void
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39669
diff changeset
1292 ggp_protocol_server_iface_init(PurpleProtocolServerInterface *server_iface)
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1293 {
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1294 server_iface->get_info = ggp_pubdir_get_info_protocol;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1295 server_iface->set_status = ggp_status_set_purplestatus;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1296 server_iface->add_buddy = ggp_add_buddy;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1297 server_iface->remove_buddy = ggp_remove_buddy;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1298 server_iface->keepalive = ggp_keepalive;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1299 server_iface->alias_buddy = ggp_roster_alias_buddy;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1300 server_iface->group_buddy = ggp_roster_group_buddy;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1301 server_iface->rename_group = ggp_roster_rename_group;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1302 server_iface->set_buddy_icon = ggp_avatar_own_set;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1303 }
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1304
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1305 static void
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39669
diff changeset
1306 ggp_protocol_im_iface_init(PurpleProtocolIMInterface *im_iface)
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1307 {
36744
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1308 im_iface->send = ggp_message_send_im;
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1309 im_iface->send_typing = ggp_send_typing;
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1310 }
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1311
36744
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1312 static void
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39669
diff changeset
1313 ggp_protocol_chat_iface_init(PurpleProtocolChatInterface *chat_iface)
36744
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1314 {
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1315 chat_iface->info = ggp_chat_info;
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1316 chat_iface->info_defaults = ggp_chat_info_defaults;
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1317 chat_iface->join = ggp_chat_join;
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1318 chat_iface->get_name = ggp_chat_get_name;
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1319 chat_iface->invite = ggp_chat_invite;
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1320 chat_iface->leave = ggp_chat_leave;
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1321 chat_iface->send = ggp_chat_send;
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1322
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1323 chat_iface->reject = NULL; /* TODO */
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1324 }
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1325
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1326 static void
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39669
diff changeset
1327 ggp_protocol_roomlist_iface_init(PurpleProtocolRoomlistInterface *roomlist_iface)
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1328 {
36744
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1329 roomlist_iface->get_list = ggp_chat_roomlist_get_list;
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1330 }
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1331
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1332 static void
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39669
diff changeset
1333 ggp_protocol_privacy_iface_init(PurpleProtocolPrivacyInterface *privacy_iface)
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1334 {
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1335 privacy_iface->add_deny = ggp_add_deny;
40521
c4269b37a13a Make PurpleProtocolPrivacy a proper GInterface and move it to it's own file
Gary Kramlich <grim@reaperworld.com>
parents: 40507
diff changeset
1336 privacy_iface->remove_deny = ggp_remove_deny;
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1337 }
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1338
36744
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1339 static void
38837
153c0c3bcced finish fixing up gg for the xfer move
Gary Kramlich <grim@reaperworld.com>
parents: 38358
diff changeset
1340 ggp_protocol_xfer_iface_init(PurpleProtocolXferInterface *xfer_iface)
36744
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1341 {
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1342 xfer_iface->can_receive = ggp_edisc_xfer_can_receive_file;
39005
6a56e1366809 xfer: Rename PurpleProtocolXferInterface.send() to send_file()
Mike Ruprecht <cmaiku@gmail.com>
parents: 38837
diff changeset
1343 xfer_iface->send_file = ggp_edisc_xfer_send_file;
36744
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1344 xfer_iface->new_xfer = ggp_edisc_xfer_send_new;
2393
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1345 }
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1346
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1347 G_DEFINE_DYNAMIC_TYPE_EXTENDED(
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1348 GGPProtocol, ggp_protocol, PURPLE_TYPE_PROTOCOL, 0,
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1349
41464
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1350 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_ACTIONS,
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1351 ggp_protocol_actions_iface_init)
979c8cc3413a Convert GaduGadu to new actions interface
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41348
diff changeset
1352
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1353 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_CLIENT,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1354 ggp_protocol_client_iface_init)
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1355
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1356 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_SERVER,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1357 ggp_protocol_server_iface_init)
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1358
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1359 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_IM,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1360 ggp_protocol_im_iface_init)
37155
1aee6d5eefba Merged default branch
Ankit Vani <a@nevitus.org>
parents: 37154 36124
diff changeset
1361
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1362 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_CHAT,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1363 ggp_protocol_chat_iface_init)
36730
66018273528a Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
1364
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1365 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_ROOMLIST,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1366 ggp_protocol_roomlist_iface_init)
37155
1aee6d5eefba Merged default branch
Ankit Vani <a@nevitus.org>
parents: 37154 36124
diff changeset
1367
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1368 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_PRIVACY,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1369 ggp_protocol_privacy_iface_init)
36744
a7c26ee6e466 Merged soc.2013.gobjectification branch
Ankit Vani <a@nevitus.org>
parents: 36733 34946
diff changeset
1370
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1371 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_XFER,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1372 ggp_protocol_xfer_iface_init));
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36701
diff changeset
1373
40813
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1374 static PurpleProtocol *
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1375 ggp_protocol_new(void) {
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1376 return PURPLE_PROTOCOL(g_object_new(
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1377 GGP_TYPE_PROTOCOL,
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1378 "id", "prpl-gg",
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1379 "name", "Gadu-Gadu",
41348
74b1a5db343b Mark the protocol descriptions for translation and tweak them a bit.
Gary Kramlich <grim@reaperworld.com>
parents: 41314
diff changeset
1380 "description", _("Gadu-Gadu is a Polish instant messaging network."),
41071
f4f7d9f816f9 move the gadu-gadu protocol plugins icons to a resource in the plugin
Gary Kramlich <grim@reaperworld.com>
parents: 40985
diff changeset
1381 "icon-name", "im-gadu-gadu",
f4f7d9f816f9 move the gadu-gadu protocol plugins icons to a resource in the plugin
Gary Kramlich <grim@reaperworld.com>
parents: 40985
diff changeset
1382 "icon-resource-path", "/im/pidgin/libpurple/gg/icons",
40813
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1383 NULL));
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1384 }
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1385
40945
bbeb2e98ea5b Use GPLUGIN_NATIVE_PLUGIN_DECLARE for all libpurple plugins and remove PURPLE_PLUGIN_INIT
Gary Kramlich <grim@reaperworld.com>
parents: 40885
diff changeset
1386 static GPluginPluginInfo *
bbeb2e98ea5b Use GPLUGIN_NATIVE_PLUGIN_DECLARE for all libpurple plugins and remove PURPLE_PLUGIN_INIT
Gary Kramlich <grim@reaperworld.com>
parents: 40885
diff changeset
1387 gg_query(GError **error)
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1388 {
41472
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1389 GPluginPluginInfo *info = NULL;
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1390 gchar *description = NULL;
36642
b8ba53daa445 Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents: 36638
diff changeset
1391 const gchar * const authors[] = {
b8ba53daa445 Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents: 36638
diff changeset
1392 "boler@sourceforge.net",
b8ba53daa445 Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents: 36638
diff changeset
1393 NULL
b8ba53daa445 Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents: 36638
diff changeset
1394 };
b8ba53daa445 Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents: 36638
diff changeset
1395
41472
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1396 description = g_strdup_printf(N_("Polish popular IM\nlibgadu version %s"),
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1397 gg_libgadu_version());
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1398
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1399 info = purple_plugin_info_new(
36985
9faafe43603e Rename protocol plugin IDs to prpl-*
Ankit Vani <a@nevitus.org>
parents: 36984
diff changeset
1400 "id", "prpl-gg",
36638
5f6dcd83e8c1 Seperate plugin and protocol IDs. Protocol ID example: "msn". Plugin ID example: "protocol-msn".
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
1401 "name", "Gadu-Gadu Protocol",
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1402 "version", DISPLAY_VERSION,
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1403 "category", N_("Protocol"),
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1404 "summary", N_("Gadu-Gadu Protocol Plugin"),
41472
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1405 "description", description,
36642
b8ba53daa445 Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents: 36638
diff changeset
1406 "authors", authors,
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1407 "website", PURPLE_WEBSITE,
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1408 "abi-version", PURPLE_ABI_VERSION,
36653
4084c34c051d Override gplugin info's "flags" property. Added PURPLE_PLUGIN_INFO_FLAGS_INTERNAL and PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD.
Ankit Vani <a@nevitus.org>
parents: 36642
diff changeset
1409 "flags", PURPLE_PLUGIN_INFO_FLAGS_INTERNAL |
4084c34c051d Override gplugin info's "flags" property. Added PURPLE_PLUGIN_INFO_FLAGS_INTERNAL and PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD.
Ankit Vani <a@nevitus.org>
parents: 36642
diff changeset
1410 PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD,
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1411 NULL
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1412 );
41472
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1413
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1414 g_free(description);
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1415
0b3b172cd50e Remove the extra-cb property from PurplePluginInfo
Gary Kramlich <grim@reaperworld.com>
parents: 41464
diff changeset
1416 return info;
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1417 }
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1418
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1419 static gboolean
40945
bbeb2e98ea5b Use GPLUGIN_NATIVE_PLUGIN_DECLARE for all libpurple plugins and remove PURPLE_PLUGIN_INIT
Gary Kramlich <grim@reaperworld.com>
parents: 40885
diff changeset
1420 gg_load(GPluginPlugin *plugin, GError **error)
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1421 {
40800
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1422 PurpleProtocolManager *manager = purple_protocol_manager_get_default();
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1423
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
1424 ggp_protocol_register_type(G_TYPE_MODULE(plugin));
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36701
diff changeset
1425
39669
bab07ecb9330 Make PurpleXfer a derivable type and create subclasses in all the protocols that support file transfers
Gary Kramlich <grim@reaperworld.com>
parents: 39480
diff changeset
1426 ggp_xfer_register(G_TYPE_MODULE(plugin));
bab07ecb9330 Make PurpleXfer a derivable type and create subclasses in all the protocols that support file transfers
Gary Kramlich <grim@reaperworld.com>
parents: 39480
diff changeset
1427
40813
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1428 my_protocol = ggp_protocol_new();
40800
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1429 if(!purple_protocol_manager_register(manager, my_protocol, error)) {
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1430 g_clear_object(&my_protocol);
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1431
36578
219de60342be Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36555
diff changeset
1432 return FALSE;
40800
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1433 }
36518
78f27f38b9ad Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 36367
diff changeset
1434
36984
1768a56dbcf4 Re-revert pref renames
Ankit Vani <a@nevitus.org>
parents: 36982
diff changeset
1435 purple_prefs_add_none("/plugins/prpl/gg");
11541
b1468184879c [gaim-migrate @ 13796]
Daniel Atallah <datallah@pidgin.im>
parents: 11538
diff changeset
1436
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1437 purple_debug_info("gg", "Loading Gadu-Gadu protocol plugin with "
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1438 "libgadu %s...\n", gg_libgadu_version());
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1439
34408
ee5663c0ffe8 Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34406
diff changeset
1440 ggp_libgaduw_setup();
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1441 ggp_resolver_purple_setup();
40813
71305a7d7423 Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40800
diff changeset
1442 ggp_servconn_setup(NULL);
34359
7cf367cc1141 Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34357
diff changeset
1443 ggp_html_setup();
7cf367cc1141 Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34357
diff changeset
1444 ggp_message_setup_global();
7cf367cc1141 Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34357
diff changeset
1445
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
1446 purple_signal_connect(purple_get_core(), "uri-handler", plugin,
41314
0dc72eacd8bf Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41206
diff changeset
1447 G_CALLBACK(gg_uri_handler), NULL);
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
1448
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1449 return TRUE;
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1450 }
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1451
36518
78f27f38b9ad Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 36367
diff changeset
1452 static gboolean
41078
84e48180ef67 Update to gplugin 0.35.0
Gary Kramlich <grim@reaperworld.com>
parents: 41071
diff changeset
1453 gg_unload(GPluginPlugin *plugin, gboolean shutdown, GError **error)
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1454 {
40800
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1455 PurpleProtocolManager *manager = purple_protocol_manager_get_default();
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1456
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1457 if(!purple_protocol_manager_unregister(manager, my_protocol, error)) {
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1458 return FALSE;
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1459 }
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1460
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
1461 purple_signal_disconnect(purple_get_core(), "uri-handler", plugin,
41314
0dc72eacd8bf Replace PURPLE_CALLBACK by G_CALLBACK
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41206
diff changeset
1462 G_CALLBACK(gg_uri_handler));
39328
4a49d2904542 gg: Implement URI handler
Mike Ruprecht <cmaiku@gmail.com>
parents: 39005
diff changeset
1463
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1464 ggp_servconn_cleanup();
34359
7cf367cc1141 Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34357
diff changeset
1465 ggp_html_cleanup();
7cf367cc1141 Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34357
diff changeset
1466 ggp_message_cleanup_global();
34408
ee5663c0ffe8 Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34406
diff changeset
1467 ggp_libgaduw_cleanup();
34359
7cf367cc1141 Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34357
diff changeset
1468
40800
be00e9c87cb7 Convert all of the protocols to use the new protocol_manager_ api
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
1469 g_clear_object(&my_protocol);
36518
78f27f38b9ad Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 36367
diff changeset
1470
33339
02ee2834030c Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33337
diff changeset
1471 return TRUE;
2393
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1472 }
cfef0212506b [gaim-migrate @ 2406]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1473
40945
bbeb2e98ea5b Use GPLUGIN_NATIVE_PLUGIN_DECLARE for all libpurple plugins and remove PURPLE_PLUGIN_INIT
Gary Kramlich <grim@reaperworld.com>
parents: 40885
diff changeset
1474 GPLUGIN_NATIVE_PLUGIN_DECLARE(gg)
11360
b77fd5a8959a [gaim-migrate @ 13582]
Bartosz Oler <bartosz@pidgin.im>
parents: 11257
diff changeset
1475
12007
bf1190509b70 [gaim-migrate @ 14300]
Bartosz Oler <bartosz@pidgin.im>
parents: 11920
diff changeset
1476 /* vim: set ts=8 sts=0 sw=8 noet: */

mercurial