Sun, 29 Sep 2013 16:53:02 +0530
Merged soc.2013.gobjectification branch
| 11394 | 1 | /** |
| 2 | * @file gg.c Gadu-Gadu protocol plugin | |
| 3 | * | |
| 15884 | 4 | * purple |
| 11394 | 5 | * |
| 6 | * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us> | |
| 7 | * | |
| 12007 | 8 | * Some parts of the code are adapted or taken from the previous implementation |
| 11394 | 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 | 11 | * |
| 12 | * Thanks to Google's Summer of Code Program. | |
| 13 | * | |
| 14 | * This program is free software; you can redistribute it and/or modify | |
| 15 | * it under the terms of the GNU General Public License as published by | |
| 16 | * the Free Software Foundation; either version 2 of the License, or | |
| 17 | * (at your option) any later version. | |
| 18 | * | |
| 19 | * This program is distributed in the hope that it will be useful, | |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 22 | * GNU General Public License for more details. | |
| 23 | * | |
| 24 | * You should have received a copy of the GNU General Public License | |
| 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 | 27 | */ |
| 28 | ||
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
29 | #include <internal.h> |
| 2393 | 30 | |
|
36367
891eea799578
Renamed plugin.[ch] to plugins.[ch], since we (will) no longer have a PurplePlugin structure.
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
31 | #include "plugins.h" |
| 11360 | 32 | #include "version.h" |
| 33 | #include "notify.h" | |
|
34706
02cb08146888
Renamed blist.[ch] to buddylist.[ch]
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
34 | #include "buddylist.h" |
| 11360 | 35 | #include "accountopt.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
36 | #include "debug.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
37 | #include "util.h" |
| 11360 | 38 | #include "request.h" |
|
27388
e72ccf802d25
Support fetching Gadu-Gadu avatars. Closes #9371.
Krzysztof Klinikowski <kkszysiu@gmail.com>
parents:
27371
diff
changeset
|
39 | #include "xmlnode.h" |
| 2393 | 40 | |
| 11414 | 41 | #include "gg.h" |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
42 | #include "chat.h" |
| 11414 | 43 | #include "search.h" |
|
34710
6182323fbb0c
Renamed gg's buddylist.[ch] to blist.[ch]
Ankit Vani <a@nevitus.org>
parents:
34706
diff
changeset
|
44 | #include "blist.h" |
|
33299
b3c4ab3aeb7f
Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
45 | #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
|
46 | #include "resolver-purple.h" |
|
33303
50f7a92eeb90
Gadu-Gadu: code refactoring - token request, proxy setup (deprecated)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33302
diff
changeset
|
47 | #include "account.h" |
|
50f7a92eeb90
Gadu-Gadu: code refactoring - token request, proxy setup (deprecated)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33302
diff
changeset
|
48 | #include "deprecated.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
|
49 | #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
|
50 | #include "libgadu-events.h" |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
51 | #include "multilogon.h" |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
52 | #include "status.h" |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
53 | #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
|
54 | #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
|
55 | #include "pubdir-prpl.h" |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34353
diff
changeset
|
56 | #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
|
57 | #include "html.h" |
|
34408
ee5663c0ffe8
Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34406
diff
changeset
|
58 | #include "libgaduw.h" |
| 12007 | 59 | |
| 60 | /* ---------------------------------------------------------------------- */ | |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
61 | static PurpleProtocol *my_protocol = NULL; |
|
36677
081733748bbc
Only initialize/finalize protocol class data in *_base_init/finalize for protocols.
Ankit Vani <a@nevitus.org>
parents:
36660
diff
changeset
|
62 | static PurpleAccountOption *ggp_server_option; |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
63 | |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
64 | /* ---------------------------------------------------------------------- */ |
| 12007 | 65 | |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
66 | ggp_buddy_data * ggp_buddy_get_data(PurpleBuddy *buddy) |
| 11360 | 67 | { |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
68 | 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
|
69 | if (buddy_data) |
|
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
70 | return buddy_data; |
|
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
71 | |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
72 | 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
|
73 | purple_buddy_set_protocol_data(buddy, buddy_data); |
|
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
74 | return buddy_data; |
| 11360 | 75 | } |
| 76 | ||
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
77 | static void ggp_buddy_free(PurpleBuddy *buddy) |
| 11360 | 78 | { |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
79 | ggp_buddy_data *buddy_data = purple_buddy_get_protocol_data(buddy); |
| 11360 | 80 | |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
81 | if (!buddy_data) |
| 11360 | 82 | return; |
| 83 | ||
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
84 | g_free(buddy_data); |
|
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
85 | purple_buddy_set_protocol_data(buddy, NULL); |
| 11360 | 86 | } |
| 87 | ||
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
88 | const gchar * ggp_get_imtoken(PurpleConnection *gc) |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
89 | { |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
90 | GGPInfo *accdata = purple_connection_get_protocol_data(gc); |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
91 | |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
92 | if (accdata->imtoken) |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
93 | return accdata->imtoken; |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
94 | |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
95 | if (accdata->imtoken_warned) |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
96 | return NULL; |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
97 | accdata->imtoken_warned = TRUE; |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
98 | |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
99 | purple_notify_error(gc, _("Authentication failed"), |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
100 | _("IMToken value has not been received."), |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
101 | _("Some features will be disabled. " |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
102 | "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
|
103 | 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
|
104 | return NULL; |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
105 | } |
|
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 | 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
|
108 | { |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
109 | 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
|
110 | purple_connection_get_account(gc))); |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
111 | } |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
112 | |
| 11360 | 113 | /* ---------------------------------------------------------------------- */ |
|
33316
f4ae8440063a
Gadu-Gadu: roster - cleanups
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33315
diff
changeset
|
114 | // buddy list import/export from/to file |
| 11360 | 115 | |
|
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
|
116 | static void ggp_callback_buddylist_save_ok(PurpleConnection *gc, const char *filename) |
| 11360 | 117 | { |
| 15884 | 118 | PurpleAccount *account = purple_connection_get_account(gc); |
| 11360 | 119 | |
| 120 | char *buddylist = ggp_buddylist_dump(account); | |
| 121 | ||
| 15884 | 122 | 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
|
123 | purple_debug_info("gg", "file = %s\n", filename); |
| 11360 | 124 | |
| 125 | if (buddylist == NULL) { | |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
126 | 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
|
127 | "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
|
128 | NULL, purple_request_cpar_from_connection(gc)); |
|
2792
f40db99e87c7
[gaim-migrate @ 2805]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2791
diff
changeset
|
129 | return; |
|
f40db99e87c7
[gaim-migrate @ 2805]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2791
diff
changeset
|
130 | } |
| 2393 | 131 | |
|
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
|
132 | if(purple_util_write_data_to_file_absolute(filename, buddylist, -1)) { |
|
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
|
133 | 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
|
134 | _("Buddylist saved successfully!"), NULL, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
135 | 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
|
136 | } 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
|
137 | 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
|
138 | _("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
|
139 | 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
|
140 | 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
|
141 | 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
|
142 | g_free(primary); |
| 11360 | 143 | } |
| 144 | ||
| 145 | g_free(buddylist); | |
| 146 | } | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
147 | |
| 15884 | 148 | static void ggp_callback_buddylist_load_ok(PurpleConnection *gc, gchar *file) |
| 11360 | 149 | { |
| 15884 | 150 | PurpleAccount *account = purple_connection_get_account(gc); |
| 12007 | 151 | GError *error = NULL; |
| 152 | char *buddylist = NULL; | |
| 153 | gsize length; | |
| 11360 | 154 | |
| 15884 | 155 | purple_debug_info("gg", "file_name = %s\n", file); |
| 11360 | 156 | |
| 12007 | 157 | 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
|
158 | 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
|
159 | _("Couldn't load buddylist"), error->message, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
160 | purple_request_cpar_from_connection(gc)); |
| 12007 | 161 | |
| 15884 | 162 | purple_debug_error("gg", |
| 12007 | 163 | "Couldn't load buddylist. file = %s; error = %s\n", |
| 164 | file, error->message); | |
| 165 | ||
| 166 | g_error_free(error); | |
| 167 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
168 | return; |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
169 | } |
| 11360 | 170 | |
| 171 | ggp_buddylist_load(gc, buddylist); | |
| 172 | g_free(buddylist); | |
| 173 | ||
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
174 | purple_notify_info(account, _("Load Buddylist..."), |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
175 | _("Buddylist loaded successfully!"), NULL, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
176 | purple_request_cpar_from_connection(gc)); |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
177 | } |
| 11360 | 178 | /* }}} */ |
| 179 | ||
| 180 | /* | |
| 181 | */ | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
182 | /* static void ggp_action_buddylist_save(PurpleProtocolAction *action) {{{ */ |
|
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
183 | static void ggp_action_buddylist_save(PurpleProtocolAction *action) |
| 11360 | 184 | { |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
185 | PurpleConnection *gc = action->connection; |
| 11360 | 186 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
187 | 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
|
188 | G_CALLBACK(ggp_callback_buddylist_save_ok), NULL, |
|
b92698241603
Request API refactoring: switch purple_request_file to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
189 | purple_request_cpar_from_connection(gc), gc); |
| 11360 | 190 | } |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
191 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
192 | static void ggp_action_buddylist_load(PurpleProtocolAction *action) |
| 11360 | 193 | { |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
194 | PurpleConnection *gc = action->connection; |
| 11360 | 195 | |
|
23379
536450c4f7f9
Mark a string as translatable in prpl-gg. References #5693.
Will Thompson <resiak@pidgin.im>
parents:
23325
diff
changeset
|
196 | 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
|
197 | FALSE, G_CALLBACK(ggp_callback_buddylist_load_ok), NULL, |
|
b92698241603
Request API refactoring: switch purple_request_file to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
198 | purple_request_cpar_from_connection(gc), gc); |
| 11360 | 199 | } |
| 200 | ||
| 11414 | 201 | /* ----- BLOCK BUDDIES -------------------------------------------------- */ |
| 202 | ||
|
31938
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
203 | static void ggp_add_deny(PurpleConnection *gc, const char *who) |
| 11410 | 204 | { |
|
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
|
205 | 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
|
206 | uin_t uin = ggp_str_to_uin(who); |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
207 | |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
208 | purple_debug_info("gg", "ggp_add_deny: %u\n", uin); |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
209 | |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
210 | 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
|
211 | 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
|
212 | } |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
213 | |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
214 | static void ggp_rem_deny(PurpleConnection *gc, const char *who) |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
215 | { |
|
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
|
216 | 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
|
217 | uin_t uin = ggp_str_to_uin(who); |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
218 | |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
219 | purple_debug_info("gg", "ggp_rem_deny: %u\n", uin); |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
220 | |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
221 | 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
|
222 | gg_add_notify_ex(info->session, uin, GG_USER_NORMAL); |
| 11410 | 223 | } |
| 224 | ||
| 11360 | 225 | /* ---------------------------------------------------------------------- */ |
| 11414 | 226 | /* ----- INTERNAL CALLBACKS --------------------------------------------- */ |
| 227 | /* ---------------------------------------------------------------------- */ | |
| 228 | ||
|
31630
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
229 | 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
|
230 | gchar *from; |
|
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
231 | |
|
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
232 | from = g_strdup_printf("%u", uin); |
|
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
233 | if (length) |
|
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
|
234 | 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
|
235 | else |
|
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
236 | serv_got_typing_stopped(gc, from); |
|
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
237 | g_free(from); |
|
31630
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
238 | } |
|
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
239 | |
|
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
|
240 | /** |
|
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
|
241 | * 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
|
242 | * |
|
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
|
243 | * @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
|
244 | * @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
|
245 | * |
|
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
|
246 | * @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
|
247 | * @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
|
248 | */ |
|
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
|
249 | 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
|
250 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34904
diff
changeset
|
251 | PurpleXmlNode *xml = NULL; |
| 34946 | 252 | 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
|
253 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34904
diff
changeset
|
254 | xml = purple_xmlnode_from_str(data, -1); |
|
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
|
255 | if (xml == NULL) |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
256 | { |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
257 | 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
|
258 | "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
|
259 | goto out; |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
260 | } |
|
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
|
261 | |
| 34946 | 262 | xmlnode_next_event = purple_xmlnode_get_child(xml, "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
|
263 | while (xmlnode_next_event != 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
|
264 | { |
| 34946 | 265 | PurpleXmlNode *xmlnode_current_event = 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
|
266 | |
| 34946 | 267 | 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
|
268 | 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
|
269 | int event_type = 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
|
270 | |
| 34946 | 271 | 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
|
272 | 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
|
273 | 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
|
274 | |
| 34946 | 275 | xmlnode_next_event = purple_xmlnode_get_next_twin(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
|
276 | |
| 34946 | 277 | 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
|
278 | 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
|
279 | continue; |
| 34946 | 280 | 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
|
281 | 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
|
282 | 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
|
283 | g_free(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
|
284 | |
| 34946 | 285 | xmlnode_sender = purple_xmlnode_get_child(xmlnode_current_event, "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
|
286 | if (xmlnode_sender != 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
|
287 | { |
| 34946 | 288 | 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
|
289 | 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
|
290 | 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
|
291 | 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
|
292 | } |
|
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
|
293 | |
|
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
|
294 | 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
|
295 | { |
|
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 | 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
|
297 | 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
|
298 | "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
|
299 | 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
|
300 | 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
|
301 | 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
|
302 | 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
|
303 | "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
|
304 | 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
|
305 | } |
|
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 | } |
|
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
|
307 | |
|
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 | 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
|
309 | if (xml) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34904
diff
changeset
|
310 | 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
|
311 | } |
|
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
|
312 | |
| 15884 | 313 | static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond) |
| 11414 | 314 | { |
| 15884 | 315 | 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
|
316 | GGPInfo *info = purple_connection_get_protocol_data(gc); |
| 11414 | 317 | struct gg_event *ev; |
| 318 | ||
| 319 | if (!(ev = gg_watch_fd(info->session))) { | |
| 15884 | 320 | purple_debug_error("gg", |
| 12007 | 321 | "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
|
322 | purple_connection_error (gc, |
| 21279 | 323 | 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
|
324 | _("Unable to read from socket")); |
| 11414 | 325 | return; |
| 326 | } | |
|
31661
2a8aceaee628
Don't update last_received when receiving data on gg. Fixes #13699.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31649
diff
changeset
|
327 | |
| 11414 | 328 | switch (ev->type) { |
| 329 | case GG_EVENT_NONE: | |
| 330 | /* Nothing happened. */ | |
| 331 | break; | |
|
34361
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
332 | case GG_EVENT_CONN_FAILED: |
|
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
333 | purple_connection_error (gc, |
|
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
334 | PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
335 | _("Server disconnected")); |
| 11414 | 336 | break; |
| 337 | case GG_EVENT_MSG: | |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34353
diff
changeset
|
338 | ggp_message_got(gc, &ev->event.msg); |
| 11414 | 339 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
340 | #if GGP_ENABLE_GG11 |
|
34406
46f06ef265e3
Gadu-Gadu: update for the newest devel libgadu
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34394
diff
changeset
|
341 | case GG_EVENT_ACK110: |
| 11414 | 342 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
343 | #endif |
|
24745
511df62cb366
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24683
diff
changeset
|
344 | 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
|
345 | 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
|
346 | break; |
|
511df62cb366
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24683
diff
changeset
|
347 | 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
|
348 | ggp_image_send(gc, &ev->event.image_request); |
| 11414 | 349 | break; |
| 350 | case GG_EVENT_NOTIFY60: | |
| 351 | case GG_EVENT_STATUS60: | |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
352 | ggp_status_got_others(gc, ev); |
| 12007 | 353 | break; |
|
31630
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
354 | case GG_EVENT_TYPING_NOTIFICATION: |
|
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
355 | 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
|
356 | ev->event.typing_notification.length); |
|
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
357 | 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
|
358 | 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
|
359 | 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
|
360 | 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
|
361 | break; |
|
33296
33a9adb52028
Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33295
diff
changeset
|
362 | 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
|
363 | 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
|
364 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
365 | #if GGP_ENABLE_GG11 |
|
34383
4b1a106bbf1d
Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34380
diff
changeset
|
366 | case GG_EVENT_JSON_EVENT: |
|
4b1a106bbf1d
Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34380
diff
changeset
|
367 | ggp_events_json(gc, &ev->event.json_event); |
|
4b1a106bbf1d
Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34380
diff
changeset
|
368 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
369 | #endif |
|
33314
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
370 | case GG_EVENT_USERLIST100_VERSION: |
|
33315
42bbe5b85df8
Gadu-Gadu: roster - uploading/synchronization - part1
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33314
diff
changeset
|
371 | ggp_roster_version(gc, &ev->event.userlist100_version); |
|
33314
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
372 | break; |
|
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
373 | case GG_EVENT_USERLIST100_REPLY: |
|
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
374 | ggp_roster_reply(gc, &ev->event.userlist100_reply); |
|
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
375 | break; |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
376 | case GG_EVENT_MULTILOGON_MSG: |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34353
diff
changeset
|
377 | 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
|
378 | break; |
|
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
379 | case GG_EVENT_MULTILOGON_INFO: |
|
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
380 | ggp_multilogon_info(gc, &ev->event.multilogon_info); |
|
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
381 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
382 | #if GGP_ENABLE_GG11 |
|
34348
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
383 | case GG_EVENT_IMTOKEN: |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
384 | 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
|
385 | g_free(info->imtoken); |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
386 | 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
|
387 | break; |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
388 | case GG_EVENT_PONG110: |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
389 | purple_debug_info("gg", "gg11: got PONG110 %lu\n", ev->event.pong110.time); |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
390 | break; |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
391 | case GG_EVENT_CHAT_INFO: |
|
34353
300c246402ac
Gadu-Gadu: delayed chat joining
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34352
diff
changeset
|
392 | 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
|
393 | case GG_EVENT_CHAT_INFO_UPDATE: |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
394 | case GG_EVENT_CHAT_CREATED: |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
395 | case GG_EVENT_CHAT_INVITE_ACK: |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
396 | ggp_chat_got_event(gc, ev); |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
397 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
398 | #endif |
| 12007 | 399 | default: |
|
34348
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
400 | purple_debug_warning("gg", |
| 12007 | 401 | "unsupported event type=%d\n", ev->type); |
| 402 | break; | |
| 403 | } | |
| 11414 | 404 | |
| 12007 | 405 | gg_free_event(ev); |
| 406 | } | |
| 11414 | 407 | |
|
34433
fa2313e5f320
Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34429
diff
changeset
|
408 | void ggp_async_login_handler(gpointer _gc, gint fd, PurpleInputCondition cond) |
| 12007 | 409 | { |
| 15884 | 410 | PurpleConnection *gc = _gc; |
|
15419
c8f83c72739d
[gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents:
15294
diff
changeset
|
411 | GGPInfo *info; |
| 12007 | 412 | struct gg_event *ev; |
| 11414 | 413 | |
| 15884 | 414 | g_return_if_fail(PURPLE_CONNECTION_IS_VALID(gc)); |
|
15419
c8f83c72739d
[gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents:
15294
diff
changeset
|
415 | |
|
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
|
416 | info = purple_connection_get_protocol_data(gc); |
|
15419
c8f83c72739d
[gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents:
15294
diff
changeset
|
417 | |
| 15884 | 418 | purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n", |
| 12007 | 419 | info->session->check, info->session->state); |
| 11414 | 420 | |
| 12007 | 421 | switch (info->session->state) { |
|
34442
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
422 | case GG_STATE_ERROR: |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
423 | 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
|
424 | break; |
| 12007 | 425 | case GG_STATE_RESOLVING: |
| 15884 | 426 | purple_debug_info("gg", "GG_STATE_RESOLVING\n"); |
| 12007 | 427 | 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
|
428 | 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
|
429 | 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
|
430 | break; |
| 12007 | 431 | case GG_STATE_CONNECTING_HUB: |
| 15884 | 432 | purple_debug_info("gg", "GG_STATE_CONNECTING_HUB\n"); |
| 12007 | 433 | break; |
| 434 | case GG_STATE_READING_DATA: | |
| 15884 | 435 | purple_debug_info("gg", "GG_STATE_READING_DATA\n"); |
| 12007 | 436 | break; |
| 437 | case GG_STATE_CONNECTING_GG: | |
| 15884 | 438 | purple_debug_info("gg", "GG_STATE_CONNECTING_GG\n"); |
| 12007 | 439 | break; |
| 440 | case GG_STATE_READING_KEY: | |
| 15884 | 441 | purple_debug_info("gg", "GG_STATE_READING_KEY\n"); |
| 12007 | 442 | break; |
| 443 | case GG_STATE_READING_REPLY: | |
| 15884 | 444 | purple_debug_info("gg", "GG_STATE_READING_REPLY\n"); |
| 11414 | 445 | 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
|
446 | 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
|
447 | 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
|
448 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
449 | #if GGP_ENABLE_GG11 |
|
34348
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
450 | case GG_STATE_RESOLVING_HUB: |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
451 | 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
|
452 | break; |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
453 | case GG_STATE_READING_HUB: |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
454 | 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
|
455 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
456 | #endif |
| 11414 | 457 | default: |
| 15884 | 458 | purple_debug_error("gg", "unknown state = %d\n", |
| 12007 | 459 | info->session->state); |
| 460 | break; | |
| 461 | } | |
| 462 | ||
| 463 | if (!(ev = gg_watch_fd(info->session))) { | |
| 15884 | 464 | 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
|
465 | purple_connection_error (gc, |
| 21279 | 466 | 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
|
467 | _("Unable to read from socket")); |
| 12007 | 468 | return; |
| 469 | } | |
| 15884 | 470 | purple_debug_info("gg", "login_handler: session->fd = %d\n", info->session->fd); |
| 471 | purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n", | |
| 12007 | 472 | info->session->check, info->session->state); |
| 473 | ||
|
32685
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
474 | purple_input_remove(info->inpa); |
|
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
475 | info->inpa = 0; |
| 12007 | 476 | |
| 477 | /** 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
|
478 | 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
|
479 | 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
|
480 | (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
|
481 | 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
|
482 | ggp_async_login_handler, gc); |
| 12007 | 483 | |
| 484 | switch (ev->type) { | |
| 485 | case GG_EVENT_NONE: | |
| 486 | /* Nothing happened. */ | |
| 15884 | 487 | purple_debug_info("gg", "GG_EVENT_NONE\n"); |
| 12007 | 488 | break; |
| 489 | case GG_EVENT_CONN_SUCCESS: | |
| 12964 | 490 | { |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
491 | #if GGP_ENABLE_GG11 |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
492 | purple_debug_info("gg", "GG_EVENT_CONN_SUCCESS:" |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
493 | " 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
|
494 | 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
|
495 | 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
|
496 | connect_host); |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
497 | #endif |
|
32685
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
498 | purple_input_remove(info->inpa); |
|
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
499 | info->inpa = purple_input_add(info->session->fd, |
| 15884 | 500 | PURPLE_INPUT_READ, |
| 12964 | 501 | ggp_callback_recv, gc); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30163
diff
changeset
|
502 | |
|
30163
e43601d06035
gg: Fix misuse of update_progress. Fixes #11774
Krzysztof Klinikowski <kkszysiu@gmail.com>
parents:
30138
diff
changeset
|
503 | purple_connection_update_progress(gc, _("Connected"), 1, 2); |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
504 | purple_connection_set_state(gc, PURPLE_CONNECTION_CONNECTED); |
|
33316
f4ae8440063a
Gadu-Gadu: roster - cleanups
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33315
diff
changeset
|
505 | |
|
f4ae8440063a
Gadu-Gadu: roster - cleanups
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33315
diff
changeset
|
506 | ggp_buddylist_send(gc); |
|
33318
636bfc28f2cf
Gadu-Gadu: roster - finally working
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33316
diff
changeset
|
507 | ggp_roster_request_update(gc); |
| 12964 | 508 | } |
| 12007 | 509 | break; |
| 510 | case GG_EVENT_CONN_FAILED: | |
|
33363
52cc04429e2c
Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33347
diff
changeset
|
511 | if (info->inpa > 0) |
|
52cc04429e2c
Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33347
diff
changeset
|
512 | { |
|
52cc04429e2c
Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33347
diff
changeset
|
513 | purple_input_remove(info->inpa); |
|
52cc04429e2c
Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33347
diff
changeset
|
514 | info->inpa = 0; |
|
52cc04429e2c
Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33347
diff
changeset
|
515 | } |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
516 | 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
|
517 | ev->event.failure); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
518 | switch (ev->event.failure) { |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
519 | case GG_FAILURE_RESOLVING: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
520 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
521 | 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
|
522 | _("Unable to resolve " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
523 | "hostname")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
524 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
525 | case GG_FAILURE_PASSWORD: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
526 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
527 | 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
|
528 | _("Incorrect password")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
529 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
530 | case GG_FAILURE_TLS: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
531 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
532 | 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
|
533 | _("SSL Connection Failed")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
534 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
535 | case GG_FAILURE_INTRUDER: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
536 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
537 | 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
|
538 | _("Your account has been " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
539 | "disabled because too many " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
540 | "incorrect passwords were " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
541 | "entered")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
542 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
543 | case GG_FAILURE_UNAVAILABLE: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
544 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
545 | 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
|
546 | _("Service temporarily " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
547 | "unavailable")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
548 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
549 | case GG_FAILURE_PROXY: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
550 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
551 | 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
|
552 | _("Error connecting to proxy " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
553 | "server")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
554 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
555 | case GG_FAILURE_HUB: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
556 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
557 | 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
|
558 | _("Error connecting to master " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
559 | "server")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
560 | break; |
|
34454
a7b6015534e0
Fix gg build with internal libgadu
Mark Doliner <mark@kingant.net>
parents:
34449
diff
changeset
|
561 | #if GGP_ENABLE_GG11 |
|
34442
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
562 | case GG_FAILURE_INTERNAL: |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
563 | purple_connection_error(gc, |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
564 | PURPLE_CONNECTION_ERROR_OTHER_ERROR, |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
565 | _("Internal error")); |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
566 | break; |
|
34454
a7b6015534e0
Fix gg build with internal libgadu
Mark Doliner <mark@kingant.net>
parents:
34449
diff
changeset
|
567 | #endif |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
568 | default: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
569 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
570 | 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
|
571 | _("Connection failed")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
572 | } |
| 12007 | 573 | break; |
|
31874
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
574 | case GG_EVENT_MSG: |
|
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
575 | 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
|
576 | { |
|
a8e9b3781df1
Gadu-Gadu: check for NULL pointer before logging system messages.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32646
diff
changeset
|
577 | 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
|
578 | break; |
|
a8e9b3781df1
Gadu-Gadu: check for NULL pointer before logging system messages.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32646
diff
changeset
|
579 | |
|
31874
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
580 | /* 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
|
581 | 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
|
582 | ev->event.msg.message); |
|
32647
a8e9b3781df1
Gadu-Gadu: check for NULL pointer before logging system messages.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32646
diff
changeset
|
583 | } |
|
31874
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
584 | else |
|
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
585 | 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
|
586 | "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
|
587 | 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
|
588 | ev->event.msg.message); |
|
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
589 | break; |
| 12007 | 590 | default: |
| 15884 | 591 | purple_debug_error("gg", "strange event: %d\n", ev->type); |
| 11414 | 592 | break; |
| 593 | } | |
| 594 | ||
| 595 | gg_free_event(ev); | |
| 596 | } | |
| 597 | ||
| 598 | /* ---------------------------------------------------------------------- */ | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36536
diff
changeset
|
599 | /* ----- PurpleProtocol ----------------------------------------- */ |
| 11360 | 600 | /* ---------------------------------------------------------------------- */ |
| 601 | ||
| 15884 | 602 | static const char *ggp_list_icon(PurpleAccount *account, PurpleBuddy *buddy) |
| 11360 | 603 | { |
| 604 | return "gadu-gadu"; | |
| 605 | } | |
| 606 | ||
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
607 | static const char *ggp_normalize(const PurpleAccount *account, const char *who) |
|
2846
4f0435806f95
[gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2835
diff
changeset
|
608 | { |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
609 | static char normalized[21]; /* maximum unsigned long long int size */ |
|
2846
4f0435806f95
[gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2835
diff
changeset
|
610 | |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
611 | uin_t uin = ggp_str_to_uin(who); |
|
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
612 | if (uin <= 0) |
|
31892
3368a7044a4a
Better status message handling in Gadu-Gadu. Fixes #14314
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31879
diff
changeset
|
613 | return NULL; |
|
3368a7044a4a
Better status message handling in Gadu-Gadu. Fixes #14314
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31879
diff
changeset
|
614 | |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
615 | 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
|
616 | |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
617 | return normalized; |
|
2846
4f0435806f95
[gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2835
diff
changeset
|
618 | } |
|
4f0435806f95
[gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2835
diff
changeset
|
619 | |
|
34409
198c6f5c19ca
Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34408
diff
changeset
|
620 | /* TODO: |
|
198c6f5c19ca
Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34408
diff
changeset
|
621 | * - move to status.c ? |
|
198c6f5c19ca
Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34408
diff
changeset
|
622 | * - 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
|
623 | */ |
| 15884 | 624 | static void ggp_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) |
| 11360 | 625 | { |
| 15884 | 626 | 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
|
627 | char *tmp; |
|
33342
26ba5e4e8c24
Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33341
diff
changeset
|
628 | const char *name, *alias; |
|
26ba5e4e8c24
Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33341
diff
changeset
|
629 | gchar *msg; |
| 11360 | 630 | |
| 15005 | 631 | g_return_if_fail(b != NULL); |
| 632 | ||
| 15884 | 633 | status = purple_presence_get_active_status(purple_buddy_get_presence(b)); |
| 634 | 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
|
635 | alias = purple_buddy_get_alias(b); |
|
33342
26ba5e4e8c24
Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33341
diff
changeset
|
636 | 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
|
637 | |
|
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
|
638 | purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), alias); |
| 11360 | 639 | |
| 640 | if (msg != NULL) { | |
| 15884 | 641 | 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
|
642 | 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
|
643 | 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
|
644 | g_free(tmp); |
| 15196 | 645 | } 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
|
646 | purple_notify_user_info_add_pair_plaintext(user_info, _("Message"), msg); |
| 15196 | 647 | } |
|
33342
26ba5e4e8c24
Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33341
diff
changeset
|
648 | g_free(msg); |
| 15227 | 649 | /* We don't want to duplicate 'Status: Offline'. */ |
| 15884 | 650 | } 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
|
651 | purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), name); |
| 11360 | 652 | } |
| 653 | } | |
| 654 | ||
| 15884 | 655 | static void ggp_login(PurpleAccount *account) |
| 2393 | 656 | { |
|
33303
50f7a92eeb90
Gadu-Gadu: code refactoring - token request, proxy setup (deprecated)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33302
diff
changeset
|
657 | PurpleConnection *gc = purple_account_get_connection(account); |
| 13515 | 658 | struct gg_login_params *glp; |
| 659 | GGPInfo *info; | |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
660 | #if GGP_ENABLE_GG11 |
|
27255
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
661 | const char *address; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
662 | #endif |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
663 | const gchar *encryption_type, *protocol_version; |
| 13515 | 664 | |
|
33303
50f7a92eeb90
Gadu-Gadu: code refactoring - token request, proxy setup (deprecated)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33302
diff
changeset
|
665 | if (!ggp_deprecated_setup_proxy(gc)) |
| 13515 | 666 | return; |
| 667 | ||
| 34946 | 668 | purple_connection_set_flags(gc, PURPLE_CONNECTION_FLAG_HTML | |
| 669 | PURPLE_CONNECTION_FLAG_NO_URLDESC); | |
|
34357
74dff2310289
Gadu-Gadu: reimplementation of sending messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34356
diff
changeset
|
670 | |
| 13515 | 671 | glp = g_new0(struct gg_login_params, 1); |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
672 | #if GGP_ENABLE_GG11 |
|
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
|
673 | glp->struct_size = sizeof(struct gg_login_params); |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
674 | #endif |
| 13515 | 675 | info = g_new0(GGPInfo, 1); |
| 11360 | 676 | |
|
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
|
677 | purple_connection_set_protocol_data(gc, info); |
| 11360 | 678 | |
|
34433
fa2313e5f320
Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34429
diff
changeset
|
679 | 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
|
680 | 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
|
681 | ggp_avatar_setup(gc); |
|
33314
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
682 | ggp_roster_setup(gc); |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
683 | ggp_multilogon_setup(gc); |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
684 | ggp_status_setup(gc); |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
685 | ggp_chat_setup(gc); |
|
34361
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
686 | ggp_message_setup(gc); |
|
34380
2179667660bc
Edisc authentication, file transfer implementation started
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34378
diff
changeset
|
687 | ggp_edisc_setup(gc); |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
688 | |
|
33299
b3c4ab3aeb7f
Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
689 | 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
|
690 | glp->password = |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34115
diff
changeset
|
691 | ggp_convert_to_cp1250(purple_connection_get_password(gc)); |
| 11360 | 692 | |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
693 | if (glp->uin == 0) { |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
694 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
695 | 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
|
696 | _("The username specified is invalid.")); |
|
34428
f52357f34177
Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34427
diff
changeset
|
697 | purple_str_wipe(glp->password); |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
698 | g_free(glp); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
699 | return; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
700 | } |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
701 | |
|
24745
511df62cb366
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24683
diff
changeset
|
702 | 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
|
703 | glp->status_flags = GG_STATUS_FLAG_UNKNOWN; |
| 11360 | 704 | |
|
32651
cc247c37281e
Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32650
diff
changeset
|
705 | 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
|
706 | glp->status_flags |= GG_STATUS_FLAG_SPAM; |
|
23382
8dfecaa62e66
Restore status on login on GG, rather than setting Available first.
Will Thompson <resiak@pidgin.im>
parents:
23381
diff
changeset
|
707 | |
|
29824
9878119b5d78
Finish making libgadu compile on Windows. Fixes #10542 finally!
Krzysztof Klinikowski <kkszysiu@gmail.com>
parents:
29404
diff
changeset
|
708 | glp->encoding = GG_ENCODING_UTF8; |
|
33296
33a9adb52028
Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33295
diff
changeset
|
709 | glp->protocol_features = (GG_FEATURE_DND_FFC | |
|
33a9adb52028
Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33295
diff
changeset
|
710 | GG_FEATURE_TYPING_NOTIFICATION | GG_FEATURE_MULTILOGON | |
|
33a9adb52028
Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33295
diff
changeset
|
711 | GG_FEATURE_USER_DATA); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30163
diff
changeset
|
712 | |
| 12007 | 713 | glp->async = 1; |
|
34115
a0f9b38226eb
Better name for CbInfo, revert cosmetic changes not related to master password branch
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34108
diff
changeset
|
714 | |
|
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
|
715 | 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
|
716 | "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
|
717 | 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
|
718 | encryption_type); |
|
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
|
719 | if (strcmp(encryption_type, "opportunistic_tls") == 0) |
|
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
|
720 | glp->tls = GG_SSL_ENABLED; |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
721 | else if (strcmp(encryption_type, "require_tls") == 0) { |
|
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
|
722 | 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
|
723 | 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
|
724 | 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
|
725 | 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
|
726 | 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
|
727 | _("SSL support unavailable")); |
|
34428
f52357f34177
Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34427
diff
changeset
|
728 | 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
|
729 | g_free(glp); |
|
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
|
730 | return; |
|
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
|
731 | } |
|
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
|
732 | } |
|
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
|
733 | 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
|
734 | glp->tls = GG_SSL_DISABLED; |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
735 | purple_debug_misc("gg", "TLS mode: %d\n", glp->tls); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
736 | |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
737 | 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
|
738 | "protocol_version", "default"); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
739 | 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
|
740 | protocol_version); |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
741 | #if GGP_ENABLE_GG11 |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
742 | if (g_strcmp0(protocol_version, "gg10") == 0) |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
743 | glp->protocol_version = GG_PROTOCOL_VERSION_100; |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
744 | else if (g_strcmp0(protocol_version, "gg11") == 0) |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
745 | glp->protocol_version = GG_PROTOCOL_VERSION_110; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
746 | #else |
|
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
747 | glp->protocol_version = 0x2e; |
|
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
748 | #endif |
| 11360 | 749 | |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
750 | ggp_status_set_initial(gc, 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
|
751 | |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
752 | #if GGP_ENABLE_GG11 |
|
27255
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
753 | 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
|
754 | 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
|
755 | glp->connect_host = g_strdup(address); |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
756 | #endif |
|
27255
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
757 | |
| 11360 | 758 | info->session = gg_login(glp); |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
759 | #if GGP_ENABLE_GG11 |
|
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
|
760 | g_free(glp->connect_host); |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
761 | #endif |
|
34428
f52357f34177
Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34427
diff
changeset
|
762 | 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
|
763 | 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
|
764 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30163
diff
changeset
|
765 | purple_connection_update_progress(gc, _("Connecting"), 0, 2); |
| 11360 | 766 | if (info->session == NULL) { |
|
32157
39ba2e2492ee
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <markdoliner@pidgin.im>
parents:
32147
diff
changeset
|
767 | purple_connection_error (gc, |
| 21279 | 768 | 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
|
769 | _("Connection failed")); |
| 11360 | 770 | return; |
| 771 | } | |
|
34433
fa2313e5f320
Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34429
diff
changeset
|
772 | |
|
fa2313e5f320
Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34429
diff
changeset
|
773 | 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
|
774 | 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
|
775 | PURPLE_INPUT_READ, ggp_async_login_handler, gc); |
|
fa2313e5f320
Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34429
diff
changeset
|
776 | } |
| 11360 | 777 | } |
| 778 | ||
| 15884 | 779 | static void ggp_close(PurpleConnection *gc) |
| 11360 | 780 | { |
|
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
|
781 | 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
|
782 | GGPInfo *info;; |
| 8997 | 783 | |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
784 | g_return_if_fail(gc != NULL); |
| 11360 | 785 | |
|
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
|
786 | 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
|
787 | info = purple_connection_get_protocol_data(gc); |
| 12964 | 788 | |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
789 | purple_notify_close_with_handle(gc); |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
790 | |
|
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
|
791 | if (info) { |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
792 | if (info->session != NULL) |
|
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
793 | { |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
794 | ggp_status_set_disconnected(account); |
|
11538
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
795 | gg_logoff(info->session); |
|
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
796 | gg_free_session(info->session); |
|
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
797 | } |
| 13641 | 798 | |
|
33313
5a0c6582d5b1
Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33311
diff
changeset
|
799 | 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
|
800 | ggp_avatar_cleanup(gc); |
|
33314
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
801 | ggp_roster_cleanup(gc); |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
802 | ggp_multilogon_cleanup(gc); |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
803 | ggp_status_cleanup(gc); |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
804 | ggp_chat_cleanup(gc); |
|
34361
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
805 | ggp_message_cleanup(gc); |
|
34380
2179667660bc
Edisc authentication, file transfer implementation started
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34378
diff
changeset
|
806 | ggp_edisc_cleanup(gc); |
|
32685
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
807 | |
|
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
808 | if (info->inpa > 0) |
|
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
809 | purple_input_remove(info->inpa); |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
810 | 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
|
811 | |
|
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
812 | purple_connection_set_protocol_data(gc, NULL); |
|
11545
df2f9bb3fd6e
[gaim-migrate @ 13800]
Daniel Atallah <datallah@pidgin.im>
parents:
11544
diff
changeset
|
813 | g_free(info); |
|
11538
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
814 | } |
| 11360 | 815 | |
| 15884 | 816 | purple_debug_info("gg", "Connection closed.\n"); |
| 11360 | 817 | } |
| 818 | ||
|
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
|
819 | static unsigned int ggp_send_typing(PurpleConnection *gc, const char *name, PurpleIMTypingState state) |
|
31648
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
820 | { |
|
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
|
821 | GGPInfo *info = purple_connection_get_protocol_data(gc); |
|
31648
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
822 | int dummy_length; // we don't send real length of typed message |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
823 | |
|
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
|
824 | 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
|
825 | return 1; |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
826 | |
|
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
|
827 | 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
|
828 | dummy_length = (int)g_random_int(); |
|
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
|
829 | 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
|
830 | dummy_length = 0; |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
831 | |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
832 | 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
|
833 | info->session, |
|
31648
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
834 | ggp_str_to_uin(name), |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
835 | dummy_length); |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
836 | |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
837 | return 1; // wait 1 second before another notification |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
838 | } |
|
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
839 | |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32261
diff
changeset
|
840 | static void ggp_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, const char *message) |
| 11360 | 841 | { |
|
33299
b3c4ab3aeb7f
Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
842 | 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
|
843 | 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
|
844 | const gchar *name = purple_buddy_get_name(buddy); |
| 11360 | 845 | |
|
24939
d25fdf62ae92
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
24043
diff
changeset
|
846 | 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
|
847 | |
|
33337
458d578d553d
Gadu-Gadu: status refactoring - fix bug with long status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33336
diff
changeset
|
848 | // gg server won't tell us our status here |
|
33299
b3c4ab3aeb7f
Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
849 | if (strcmp(purple_account_get_username(account), name) == 0) |
|
33337
458d578d553d
Gadu-Gadu: status refactoring - fix bug with long status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33336
diff
changeset
|
850 | ggp_status_fake_to_self(gc); |
|
33318
636bfc28f2cf
Gadu-Gadu: roster - finally working
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33316
diff
changeset
|
851 | |
|
636bfc28f2cf
Gadu-Gadu: roster - finally working
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33316
diff
changeset
|
852 | ggp_roster_add_buddy(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
|
853 | ggp_pubdir_request_buddy_alias(gc, buddy); |
| 11360 | 854 | } |
| 855 | ||
| 15884 | 856 | static void ggp_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, |
| 857 | PurpleGroup *group) | |
| 11360 | 858 | { |
|
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
|
859 | GGPInfo *info = purple_connection_get_protocol_data(gc); |
| 11360 | 860 | |
|
24939
d25fdf62ae92
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
24043
diff
changeset
|
861 | gg_remove_notify(info->session, ggp_str_to_uin(purple_buddy_get_name(buddy))); |
|
33318
636bfc28f2cf
Gadu-Gadu: roster - finally working
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33316
diff
changeset
|
862 | ggp_roster_remove_buddy(gc, buddy, group); |
| 11360 | 863 | } |
| 864 | ||
| 15884 | 865 | static void ggp_keepalive(PurpleConnection *gc) |
| 11360 | 866 | { |
|
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
|
867 | GGPInfo *info = purple_connection_get_protocol_data(gc); |
| 11360 | 868 | |
| 15884 | 869 | /* purple_debug_info("gg", "Keeping connection alive....\n"); */ |
| 11360 | 870 | |
| 871 | if (gg_ping(info->session) < 0) { | |
| 15884 | 872 | purple_debug_info("gg", "Not connected to the server " |
| 11360 | 873 | "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
|
874 | purple_connection_error (gc, |
| 21279 | 875 | 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
|
876 | _("Not connected to the server")); |
| 4916 | 877 | } |
| 2393 | 878 | } |
| 11360 | 879 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
880 | static void ggp_action_chpass(PurpleProtocolAction *action) |
| 11360 | 881 | { |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
882 | ggp_account_chpass(action->connection); |
|
33310
5d38cff87be2
Gadu-Gadu: refactoring of password change
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33306
diff
changeset
|
883 | } |
| 11360 | 884 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
885 | static void ggp_action_status_broadcasting(PurpleProtocolAction *action) |
| 11360 | 886 | { |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
887 | ggp_status_broadcasting_dialog(action->connection); |
| 2393 | 888 | } |
| 11360 | 889 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
890 | static void ggp_action_search(PurpleProtocolAction *action) |
|
33343
09f740724036
Gadu-Gadu: extended OAuth support, initial support for gg10.5 public directory
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33342
diff
changeset
|
891 | { |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
892 | ggp_pubdir_search(action->connection, NULL); |
|
33343
09f740724036
Gadu-Gadu: extended OAuth support, initial support for gg10.5 public directory
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33342
diff
changeset
|
893 | } |
|
09f740724036
Gadu-Gadu: extended OAuth support, initial support for gg10.5 public directory
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33342
diff
changeset
|
894 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
895 | static void ggp_action_set_info(PurpleProtocolAction *action) |
|
33347
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
896 | { |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
897 | ggp_pubdir_set_info(action->connection); |
| 2393 | 898 | } |
| 899 | ||
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
900 | static GList *ggp_get_actions(PurpleConnection *gc) |
|
8775
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
901 | { |
| 11360 | 902 | GList *m = NULL; |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
903 | PurpleProtocolAction *act; |
| 11360 | 904 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
905 | act = purple_protocol_action_new(_("Change password..."), |
|
33310
5d38cff87be2
Gadu-Gadu: refactoring of password change
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33306
diff
changeset
|
906 | ggp_action_chpass); |
| 11360 | 907 | m = g_list_append(m, act); |
| 908 | ||
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
909 | act = purple_protocol_action_new(_("Show status only for buddies"), |
|
33347
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
910 | ggp_action_status_broadcasting); |
| 11360 | 911 | m = g_list_append(m, act); |
| 912 | ||
| 913 | m = g_list_append(m, NULL); | |
| 914 | ||
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
915 | act = purple_protocol_action_new(_("Find buddies..."), |
|
33346
3b4cbb0e10d6
Gadu-Gadu: public directory search with gg10.5 api
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33345
diff
changeset
|
916 | ggp_action_search); |
| 11360 | 917 | m = g_list_append(m, act); |
|
8775
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
918 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
919 | act = purple_protocol_action_new(_("Set User Info"), |
|
33347
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
920 | ggp_action_set_info); |
| 11360 | 921 | m = g_list_append(m, act); |
| 922 | ||
| 923 | m = g_list_append(m, NULL); | |
| 924 | ||
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
925 | act = purple_protocol_action_new(_("Save buddylist to file..."), |
| 12007 | 926 | ggp_action_buddylist_save); |
| 11360 | 927 | m = g_list_append(m, act); |
|
8775
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
928 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
929 | act = purple_protocol_action_new(_("Load buddylist from file..."), |
| 12007 | 930 | ggp_action_buddylist_load); |
| 11360 | 931 | m = g_list_append(m, act); |
| 932 | ||
| 933 | return m; | |
|
8775
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
934 | } |
|
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
935 | |
|
33327
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
936 | static const char* ggp_list_emblem(PurpleBuddy *buddy) |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
937 | { |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
938 | 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
|
939 | |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
940 | if (buddy_data->blocked) |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
941 | return "not-authorized"; |
|
34409
198c6f5c19ca
Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34408
diff
changeset
|
942 | 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
|
943 | return "unavailable"; |
|
33327
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
944 | |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
945 | return NULL; |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
946 | } |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
947 | |
| 15884 | 948 | static gboolean ggp_offline_message(const PurpleBuddy *buddy) |
|
13298
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
949 | { |
|
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
950 | return TRUE; |
|
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
951 | } |
|
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
952 | |
|
33311
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
953 | static GHashTable * ggp_get_account_text_table(PurpleAccount *account) |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
954 | { |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
955 | GHashTable *table; |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
956 | 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
|
957 | 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
|
958 | return table; |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
959 | } |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
960 | |
|
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
|
961 | static gssize |
|
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
|
962 | ggp_get_max_message_size(PurpleConversation *conv) |
|
34312
4461d5c1e61c
Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
963 | { |
|
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
|
964 | /* 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
|
965 | return 1200; /* no more than 1232 */ |
|
34312
4461d5c1e61c
Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
966 | } |
|
4461d5c1e61c
Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
967 | |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
968 | static void |
|
36684
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
969 | ggp_protocol_init(PurpleProtocol *protocol) |
| 2393 | 970 | { |
| 15884 | 971 | PurpleAccountOption *option; |
|
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
|
972 | GList *encryption_options = NULL; |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
973 | GList *protocol_version = NULL; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
974 | |
|
36684
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
975 | protocol->id = "gg"; |
|
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
976 | protocol->name = "Gadu-Gadu"; |
|
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
977 | protocol->options = OPT_PROTO_REGISTER_NOSCREENNAME | |
|
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
978 | OPT_PROTO_IM_IMAGE; |
|
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
979 | protocol->icon_spec = purple_buddy_icon_spec_new("png", |
|
36609
637155f87448
Refactored the protocols to use purple_buddy_icon_spec_new()
Ankit Vani <a@nevitus.org>
parents:
36583
diff
changeset
|
980 | 1, 1, 200, 200, 0, |
|
637155f87448
Refactored the protocols to use purple_buddy_icon_spec_new()
Ankit Vani <a@nevitus.org>
parents:
36583
diff
changeset
|
981 | PURPLE_ICON_SCALE_DISPLAY | |
|
637155f87448
Refactored the protocols to use purple_buddy_icon_spec_new()
Ankit Vani <a@nevitus.org>
parents:
36583
diff
changeset
|
982 | PURPLE_ICON_SCALE_SEND); |
| 3572 | 983 | |
|
27255
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
984 | option = purple_account_option_string_new(_("GG server"), |
|
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
985 | "gg_server", ""); |
|
36684
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
986 | protocol->protocol_options = g_list_append(protocol->protocol_options, |
|
27255
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
987 | option); |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
988 | ggp_server_option = option; |
|
27255
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
989 | |
|
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
|
990 | #define ADD_VALUE(list, desc, v) { \ |
|
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
|
991 | PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); \ |
|
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
|
992 | kvp->key = g_strdup((desc)); \ |
|
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
|
993 | kvp->value = g_strdup((v)); \ |
|
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
|
994 | list = g_list_append(list, kvp); \ |
|
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
|
995 | } |
|
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
|
996 | |
|
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
|
997 | ADD_VALUE(encryption_options, _("Use encryption if available"), |
|
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
|
998 | "opportunistic_tls"); |
|
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
|
999 | ADD_VALUE(encryption_options, _("Require encryption"), "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
|
1000 | ADD_VALUE(encryption_options, _("Don't use encryption"), "none"); |
|
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
|
1001 | |
|
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
|
1002 | option = purple_account_option_list_new(_("Connection security"), |
|
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
|
1003 | "encryption", encryption_options); |
|
36684
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
1004 | protocol->protocol_options = g_list_append(protocol->protocol_options, |
|
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
|
1005 | option); |
|
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
|
1006 | |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1007 | ADD_VALUE(protocol_version, _("Default"), "default"); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1008 | ADD_VALUE(protocol_version, "GG 10", "gg10"); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1009 | ADD_VALUE(protocol_version, "GG 11", "gg11"); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1010 | |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1011 | option = purple_account_option_list_new(_("Protocol version"), |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1012 | "protocol_version", protocol_version); |
| 36744 | 1013 | protocol->protocol_options = g_list_append(protocol->protocol_options, |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1014 | option); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1015 | |
|
32651
cc247c37281e
Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32650
diff
changeset
|
1016 | option = purple_account_option_bool_new(_("Show links from strangers"), |
|
cc247c37281e
Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32650
diff
changeset
|
1017 | "show_links_from_strangers", 1); |
|
36684
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
1018 | protocol->protocol_options = g_list_append(protocol->protocol_options, |
|
32651
cc247c37281e
Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32650
diff
changeset
|
1019 | option); |
| 2393 | 1020 | } |
| 1021 | ||
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1022 | static void |
|
36684
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
1023 | ggp_protocol_class_init(PurpleProtocolClass *klass) |
|
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
1024 | { |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36730
diff
changeset
|
1025 | klass->login = ggp_login; |
|
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36730
diff
changeset
|
1026 | klass->close = ggp_close; |
|
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36730
diff
changeset
|
1027 | klass->status_types = ggp_status_types; |
|
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36730
diff
changeset
|
1028 | klass->list_icon = ggp_list_icon; |
|
36684
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
1029 | } |
|
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
1030 | |
|
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
1031 | static void |
|
36729
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1032 | ggp_protocol_client_iface_init(PurpleProtocolClientIface *client_iface) |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1033 | { |
|
36729
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1034 | client_iface->get_actions = ggp_get_actions; |
|
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1035 | client_iface->list_emblem = ggp_list_emblem; |
|
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1036 | 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
|
1037 | client_iface->tooltip_text = ggp_tooltip_text; |
|
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1038 | client_iface->buddy_free = ggp_buddy_free; |
|
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1039 | client_iface->normalize = ggp_normalize; |
|
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1040 | client_iface->offline_message = ggp_offline_message; |
|
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1041 | 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
|
1042 | 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
|
1043 | } |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1044 | |
|
36730
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1045 | static void |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1046 | ggp_protocol_server_iface_init(PurpleProtocolServerIface *server_iface) |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1047 | { |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1048 | server_iface->register_user = ggp_account_register; |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1049 | 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
|
1050 | 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
|
1051 | 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
|
1052 | 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
|
1053 | 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
|
1054 | 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
|
1055 | 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
|
1056 | 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
|
1057 | 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
|
1058 | } |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1059 | |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1060 | static void |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1061 | ggp_protocol_im_iface_init(PurpleProtocolIMIface *im_iface) |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1062 | { |
| 36744 | 1063 | 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
|
1064 | 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
|
1065 | } |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1066 | |
| 36744 | 1067 | #if GGP_ENABLE_GG11 |
| 1068 | static void | |
| 1069 | ggp_protocol_chat_iface_init(PurpleProtocolChatIface *chat_iface) | |
| 1070 | { | |
| 1071 | chat_iface->info = ggp_chat_info; | |
| 1072 | chat_iface->info_defaults = ggp_chat_info_defaults; | |
| 1073 | chat_iface->join = ggp_chat_join; | |
| 1074 | chat_iface->get_name = ggp_chat_get_name; | |
| 1075 | chat_iface->invite = ggp_chat_invite; | |
| 1076 | chat_iface->leave = ggp_chat_leave; | |
| 1077 | chat_iface->send = ggp_chat_send; | |
| 1078 | ||
| 1079 | chat_iface->reject = NULL; /* TODO */ | |
| 1080 | } | |
| 1081 | ||
|
36730
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1082 | static void |
| 36744 | 1083 | ggp_protocol_roomlist_iface_init(PurpleProtocolRoomlistIface *roomlist_iface) |
|
36730
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1084 | { |
| 36744 | 1085 | 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
|
1086 | } |
| 36744 | 1087 | #endif |
|
36730
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1088 | |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1089 | static void |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1090 | ggp_protocol_privacy_iface_init(PurpleProtocolPrivacyIface *privacy_iface) |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1091 | { |
|
36730
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1092 | privacy_iface->add_deny = ggp_add_deny; |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1093 | privacy_iface->rem_deny = ggp_rem_deny; |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1094 | } |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1095 | |
| 36744 | 1096 | static void |
| 1097 | ggp_protocol_xfer_iface_init(PurpleProtocolXferIface *xfer_iface) | |
| 1098 | { | |
| 1099 | xfer_iface->can_receive = ggp_edisc_xfer_can_receive_file; | |
| 1100 | xfer_iface->send = ggp_edisc_xfer_send_file; | |
| 1101 | xfer_iface->new_xfer = ggp_edisc_xfer_send_new; | |
| 1102 | } | |
| 1103 | ||
|
36714
ec178f7d66da
Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents:
36701
diff
changeset
|
1104 | PURPLE_DEFINE_TYPE_EXTENDED( |
|
ec178f7d66da
Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents:
36701
diff
changeset
|
1105 | 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
|
1106 | |
|
36729
7f9fac14ed60
Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents:
36714
diff
changeset
|
1107 | PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_CLIENT_IFACE, |
| 36733 | 1108 | 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
|
1109 | |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1110 | PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_SERVER_IFACE, |
| 36733 | 1111 | 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
|
1112 | |
|
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1113 | PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_IM_IFACE, |
| 36733 | 1114 | ggp_protocol_im_iface_init) |
| 36744 | 1115 | #if GGP_ENABLE_GG11 |
|
36730
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1116 | PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_CHAT_IFACE, |
| 36733 | 1117 | 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
|
1118 | |
| 36744 | 1119 | PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_ROOMLIST_IFACE, |
| 1120 | ggp_protocol_roomlist_iface_init) | |
| 1121 | #endif | |
|
36730
66018273528a
Refactored bonjour, gg, irc to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents:
36729
diff
changeset
|
1122 | PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_PRIVACY_IFACE, |
| 36733 | 1123 | ggp_protocol_privacy_iface_init) |
| 36744 | 1124 | |
| 1125 | PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_XFER_IFACE, | |
| 1126 | 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
|
1127 | ); |
|
ec178f7d66da
Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents:
36701
diff
changeset
|
1128 | |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1129 | static PurplePluginInfo * |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1130 | plugin_query(GError **error) |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1131 | { |
|
36642
b8ba53daa445
Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents:
36638
diff
changeset
|
1132 | const gchar * const authors[] = { |
|
b8ba53daa445
Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents:
36638
diff
changeset
|
1133 | "boler@sourceforge.net", |
|
b8ba53daa445
Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents:
36638
diff
changeset
|
1134 | NULL |
|
b8ba53daa445
Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents:
36638
diff
changeset
|
1135 | }; |
|
b8ba53daa445
Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents:
36638
diff
changeset
|
1136 | |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1137 | return purple_plugin_info_new( |
|
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
|
1138 | "id", "protocol-gg", |
|
5f6dcd83e8c1
Seperate plugin and protocol IDs. Protocol ID example: "msn". Plugin ID example: "protocol-msn".
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
1139 | "name", "Gadu-Gadu Protocol", |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1140 | "version", DISPLAY_VERSION, |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1141 | "category", N_("Protocol"), |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1142 | "summary", N_("Gadu-Gadu Protocol Plugin"), |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1143 | "description", N_("Polish popular IM"), |
|
36642
b8ba53daa445
Updated libpurple to use current GPlugin
Ankit Vani <a@nevitus.org>
parents:
36638
diff
changeset
|
1144 | "authors", authors, |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1145 | "website", PURPLE_WEBSITE, |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1146 | "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
|
1147 | "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
|
1148 | 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
|
1149 | NULL |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1150 | ); |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1151 | } |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1152 | |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1153 | static gboolean |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1154 | plugin_load(PurplePlugin *plugin, GError **error) |
|
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1155 | { |
|
36714
ec178f7d66da
Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents:
36701
diff
changeset
|
1156 | ggp_protocol_register_type(plugin); |
|
ec178f7d66da
Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents:
36701
diff
changeset
|
1157 | |
|
36628
3d43ca8d69ee
Refactored the protocols to use the error argument of purple_protocols_{add/remove}
Ankit Vani <a@nevitus.org>
parents:
36621
diff
changeset
|
1158 | my_protocol = purple_protocols_add(GGP_TYPE_PROTOCOL, error); |
|
3d43ca8d69ee
Refactored the protocols to use the error argument of purple_protocols_{add/remove}
Ankit Vani <a@nevitus.org>
parents:
36621
diff
changeset
|
1159 | if (!my_protocol) |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1160 | return FALSE; |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
1161 | |
|
36684
ecc74498e088
Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents:
36678
diff
changeset
|
1162 | purple_prefs_add_none("/protocols/gg"); |
|
11541
b1468184879c
[gaim-migrate @ 13796]
Daniel Atallah <datallah@pidgin.im>
parents:
11538
diff
changeset
|
1163 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1164 | 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
|
1165 | "libgadu %s...\n", gg_libgadu_version()); |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1166 | |
|
34408
ee5663c0ffe8
Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34406
diff
changeset
|
1167 | ggp_libgaduw_setup(); |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1168 | ggp_resolver_purple_setup(); |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1169 | ggp_servconn_setup(ggp_server_option); |
|
34359
7cf367cc1141
Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34357
diff
changeset
|
1170 | ggp_html_setup(); |
|
7cf367cc1141
Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34357
diff
changeset
|
1171 | 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
|
1172 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1173 | return TRUE; |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1174 | } |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1175 | |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
1176 | static gboolean |
|
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
1177 | plugin_unload(PurplePlugin *plugin, GError **error) |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1178 | { |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1179 | 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
|
1180 | ggp_html_cleanup(); |
|
7cf367cc1141
Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34357
diff
changeset
|
1181 | ggp_message_cleanup_global(); |
|
34408
ee5663c0ffe8
Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34406
diff
changeset
|
1182 | 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
|
1183 | |
|
36628
3d43ca8d69ee
Refactored the protocols to use the error argument of purple_protocols_{add/remove}
Ankit Vani <a@nevitus.org>
parents:
36621
diff
changeset
|
1184 | if (!purple_protocols_remove(my_protocol, error)) |
|
36578
219de60342be
Refactored gg to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36555
diff
changeset
|
1185 | return FALSE; |
|
36518
78f27f38b9ad
Refactored gg to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
1186 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1187 | return TRUE; |
| 2393 | 1188 | } |
| 1189 | ||
|
36714
ec178f7d66da
Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents:
36701
diff
changeset
|
1190 | PURPLE_PLUGIN_INIT(gg, plugin_query, plugin_load, plugin_unload); |
| 11360 | 1191 | |
| 12007 | 1192 | /* vim: set ts=8 sts=0 sw=8 noet: */ |