Thu, 22 May 2014 16:07:39 +0200
Remove dead send_whisper feature
| 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 | |
| 11360 | 31 | #include "plugin.h" |
| 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 "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
|
48 | #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
|
49 | #include "libgadu-events.h" |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
50 | #include "multilogon.h" |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
51 | #include "status.h" |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
52 | #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
|
53 | #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
|
54 | #include "pubdir-prpl.h" |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34353
diff
changeset
|
55 | #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
|
56 | #include "html.h" |
|
34408
ee5663c0ffe8
Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34406
diff
changeset
|
57 | #include "libgaduw.h" |
|
31550
909496097dcf
Gadu-Gadu: Allow showing your status only to people on your buddy list.
Mateusz Piękos <mateuszpiekos@gmail.com>
parents:
31386
diff
changeset
|
58 | |
| 11360 | 59 | /* ---------------------------------------------------------------------- */ |
| 9950 | 60 | |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
61 | ggp_buddy_data * ggp_buddy_get_data(PurpleBuddy *buddy) |
|
34474
f0210174619a
Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34303
diff
changeset
|
62 | { |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
63 | 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
|
64 | if (buddy_data) |
|
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
65 | return buddy_data; |
|
34474
f0210174619a
Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34303
diff
changeset
|
66 | |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
67 | 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
|
68 | purple_buddy_set_protocol_data(buddy, buddy_data); |
|
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
69 | return buddy_data; |
|
34474
f0210174619a
Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34303
diff
changeset
|
70 | } |
|
f0210174619a
Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34303
diff
changeset
|
71 | |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
72 | static void ggp_buddy_free(PurpleBuddy *buddy) |
| 13515 | 73 | { |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
74 | ggp_buddy_data *buddy_data = purple_buddy_get_protocol_data(buddy); |
| 13515 | 75 | |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
76 | if (!buddy_data) |
| 12007 | 77 | return; |
| 13515 | 78 | |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
79 | g_free(buddy_data); |
|
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
80 | purple_buddy_set_protocol_data(buddy, NULL); |
| 13515 | 81 | } |
| 82 | ||
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
83 | const gchar * ggp_get_imtoken(PurpleConnection *gc) |
| 12007 | 84 | { |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
85 | GGPInfo *accdata = purple_connection_get_protocol_data(gc); |
| 13515 | 86 | |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
87 | if (accdata->imtoken) |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
88 | return accdata->imtoken; |
| 13515 | 89 | |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
90 | if (accdata->imtoken_warned) |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
91 | return NULL; |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
92 | accdata->imtoken_warned = TRUE; |
| 12007 | 93 | |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
94 | purple_notify_error(gc, _("Authentication failed"), |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
95 | _("IMToken value has not been received."), |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
96 | _("Some features will be disabled. " |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
97 | "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
|
98 | 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
|
99 | return NULL; |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
100 | } |
| 12007 | 101 | |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
102 | 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
|
103 | { |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
104 | 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
|
105 | purple_connection_get_account(gc))); |
| 12007 | 106 | } |
| 107 | ||
| 108 | /* ---------------------------------------------------------------------- */ | |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
109 | /* buddy list import/export from/to file */ |
| 12007 | 110 | |
|
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
|
111 | static void ggp_callback_buddylist_save_ok(PurpleConnection *gc, const char *filename) |
| 11360 | 112 | { |
| 15884 | 113 | PurpleAccount *account = purple_connection_get_account(gc); |
| 11360 | 114 | |
| 115 | char *buddylist = ggp_buddylist_dump(account); | |
| 116 | ||
| 15884 | 117 | 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
|
118 | purple_debug_info("gg", "file = %s\n", filename); |
| 11360 | 119 | |
| 120 | if (buddylist == NULL) { | |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
121 | 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
|
122 | "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
|
123 | NULL, purple_request_cpar_from_connection(gc)); |
|
2792
f40db99e87c7
[gaim-migrate @ 2805]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2791
diff
changeset
|
124 | return; |
|
f40db99e87c7
[gaim-migrate @ 2805]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2791
diff
changeset
|
125 | } |
| 2393 | 126 | |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
127 | if (purple_util_write_data_to_file_absolute(filename, buddylist, -1)) { |
|
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
|
128 | 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
|
129 | _("Buddylist saved successfully!"), NULL, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
130 | 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
|
131 | } 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
|
132 | 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
|
133 | _("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
|
134 | 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
|
135 | 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
|
136 | 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
|
137 | g_free(primary); |
| 11360 | 138 | } |
| 139 | ||
| 140 | g_free(buddylist); | |
| 141 | } | |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
142 | |
| 15884 | 143 | static void ggp_callback_buddylist_load_ok(PurpleConnection *gc, gchar *file) |
| 11360 | 144 | { |
| 15884 | 145 | PurpleAccount *account = purple_connection_get_account(gc); |
| 12007 | 146 | GError *error = NULL; |
| 147 | char *buddylist = NULL; | |
| 148 | gsize length; | |
| 11360 | 149 | |
| 15884 | 150 | purple_debug_info("gg", "file_name = %s\n", file); |
| 11360 | 151 | |
| 12007 | 152 | 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
|
153 | 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
|
154 | _("Couldn't load buddylist"), error->message, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
155 | purple_request_cpar_from_connection(gc)); |
| 12007 | 156 | |
| 15884 | 157 | purple_debug_error("gg", |
| 12007 | 158 | "Couldn't load buddylist. file = %s; error = %s\n", |
| 159 | file, error->message); | |
| 160 | ||
| 161 | g_error_free(error); | |
| 162 | ||
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
163 | return; |
|
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
164 | } |
| 11360 | 165 | |
| 166 | ggp_buddylist_load(gc, buddylist); | |
| 167 | g_free(buddylist); | |
| 168 | ||
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
169 | purple_notify_info(account, _("Load Buddylist..."), |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
170 | _("Buddylist loaded successfully!"), NULL, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34448
diff
changeset
|
171 | purple_request_cpar_from_connection(gc)); |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
172 | } |
| 11360 | 173 | /* }}} */ |
| 174 | ||
| 175 | /* | |
| 176 | */ | |
| 15884 | 177 | /* static void ggp_action_buddylist_save(PurplePluginAction *action) {{{ */ |
| 178 | static void ggp_action_buddylist_save(PurplePluginAction *action) | |
| 11360 | 179 | { |
| 15884 | 180 | PurpleConnection *gc = (PurpleConnection *)action->context; |
| 11360 | 181 | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
182 | 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
|
183 | 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
|
184 | purple_request_cpar_from_connection(gc), gc); |
| 11360 | 185 | } |
|
2806
1576edefc75a
[gaim-migrate @ 2819]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2792
diff
changeset
|
186 | |
| 15884 | 187 | static void ggp_action_buddylist_load(PurplePluginAction *action) |
| 11360 | 188 | { |
| 15884 | 189 | PurpleConnection *gc = (PurpleConnection *)action->context; |
| 11360 | 190 | |
|
23379
536450c4f7f9
Mark a string as translatable in prpl-gg. References #5693.
Will Thompson <resiak@pidgin.im>
parents:
23325
diff
changeset
|
191 | 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
|
192 | 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
|
193 | purple_request_cpar_from_connection(gc), gc); |
| 11394 | 194 | } |
| 195 | ||
| 11414 | 196 | /* ----- BLOCK BUDDIES -------------------------------------------------- */ |
| 197 | ||
|
31938
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
198 | static void ggp_add_deny(PurpleConnection *gc, const char *who) |
| 11410 | 199 | { |
|
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
|
200 | 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
|
201 | uin_t uin = ggp_str_to_uin(who); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
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 | purple_debug_info("gg", "ggp_add_deny: %u\n", uin); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
204 | |
|
31938
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
205 | 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
|
206 | 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
|
207 | } |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
208 | |
|
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
209 | 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
|
210 | { |
|
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
|
211 | 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
|
212 | uin_t uin = ggp_str_to_uin(who); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
213 | |
|
31938
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
214 | purple_debug_info("gg", "ggp_rem_deny: %u\n", uin); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
215 | |
|
31938
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
216 | 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
|
217 | gg_add_notify_ex(info->session, uin, GG_USER_NORMAL); |
| 11410 | 218 | } |
| 219 | ||
| 11360 | 220 | /* ---------------------------------------------------------------------- */ |
| 11414 | 221 | /* ----- INTERNAL CALLBACKS --------------------------------------------- */ |
| 222 | /* ---------------------------------------------------------------------- */ | |
| 223 | ||
|
31630
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
224 | 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
|
225 | gchar *from; |
|
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
226 | |
|
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
227 | from = g_strdup_printf("%u", uin); |
|
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
228 | if (length) |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35360
diff
changeset
|
229 | purple_serv_got_typing(gc, from, 0, PURPLE_IM_TYPING); |
|
31795
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
230 | else |
| 35501 | 231 | purple_serv_got_typing_stopped(gc, from); |
|
31795
ee01a0566a86
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31739
diff
changeset
|
232 | g_free(from); |
|
31630
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
233 | } |
|
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
234 | |
|
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
|
235 | /** |
|
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
|
236 | * 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
|
237 | * |
|
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
|
238 | * @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
|
239 | * @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
|
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 | * @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
|
242 | * @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
|
243 | */ |
|
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 | 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
|
245 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34904
diff
changeset
|
246 | PurpleXmlNode *xml = NULL; |
| 34946 | 247 | 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
|
248 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34904
diff
changeset
|
249 | xml = purple_xmlnode_from_str(data, -1); |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
250 | if (xml == NULL) { |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
251 | 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
|
252 | "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
|
253 | goto out; |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
254 | } |
|
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 | |
| 34946 | 256 | xmlnode_next_event = purple_xmlnode_get_child(xml, "event"); |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
257 | while (xmlnode_next_event != NULL) { |
| 34946 | 258 | PurpleXmlNode *xmlnode_current_event = xmlnode_next_event; |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
259 | |
| 34946 | 260 | 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
|
261 | 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
|
262 | int event_type = 0; |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
263 | |
| 34946 | 264 | 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
|
265 | 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
|
266 | 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
|
267 | |
| 34946 | 268 | xmlnode_next_event = purple_xmlnode_get_next_twin(xmlnode_next_event); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
269 | |
| 34946 | 270 | 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
|
271 | 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
|
272 | continue; |
| 34946 | 273 | 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
|
274 | 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
|
275 | 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
|
276 | g_free(event_type_raw); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
277 | |
| 34946 | 278 | xmlnode_sender = purple_xmlnode_get_child(xmlnode_current_event, "sender"); |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
279 | if (xmlnode_sender != NULL) { |
| 34946 | 280 | 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
|
281 | 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
|
282 | 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
|
283 | 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
|
284 | } |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
285 | |
|
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 | 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
|
287 | { |
|
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
|
288 | 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
|
289 | 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
|
290 | "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
|
291 | 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
|
292 | 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
|
293 | 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
|
294 | 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
|
295 | "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
|
296 | 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
|
297 | } |
|
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 | } |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
299 | |
|
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
|
300 | 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
|
301 | if (xml) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
34904
diff
changeset
|
302 | 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
|
303 | } |
|
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 | |
| 15884 | 305 | static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond) |
| 11414 | 306 | { |
| 15884 | 307 | 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
|
308 | GGPInfo *info = purple_connection_get_protocol_data(gc); |
| 11414 | 309 | struct gg_event *ev; |
| 310 | ||
| 311 | if (!(ev = gg_watch_fd(info->session))) { | |
| 15884 | 312 | purple_debug_error("gg", |
| 12007 | 313 | "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
|
314 | purple_connection_error (gc, |
| 21279 | 315 | 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
|
316 | _("Unable to read from socket")); |
| 11414 | 317 | return; |
| 318 | } | |
|
31661
2a8aceaee628
Don't update last_received when receiving data on gg. Fixes #13699.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31649
diff
changeset
|
319 | |
|
34473
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
320 | #if GGP_ENABLE_GG11 |
|
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
321 | if (purple_debug_is_verbose()) { |
|
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
322 | purple_debug_misc("gg", "ggp_callback_recv: got event %s", |
|
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
323 | gg_debug_event(ev->type)); |
|
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
324 | } |
|
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
325 | #endif |
|
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
326 | |
|
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
327 | purple_input_remove(info->inpa); |
|
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
328 | info->inpa = purple_input_add(info->session->fd, |
|
34474
f0210174619a
Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34303
diff
changeset
|
329 | ggp_tcpsocket_inputcond_gg_to_purple(info->session->check), |
|
f0210174619a
Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34303
diff
changeset
|
330 | ggp_callback_recv, gc); |
|
f0210174619a
Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34303
diff
changeset
|
331 | |
| 11414 | 332 | switch (ev->type) { |
| 333 | case GG_EVENT_NONE: | |
| 334 | /* Nothing happened. */ | |
| 335 | break; | |
|
34361
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
336 | case GG_EVENT_CONN_FAILED: |
|
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
337 | purple_connection_error (gc, |
|
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
338 | PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
|
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
339 | _("Server disconnected")); |
| 11414 | 340 | break; |
| 341 | case GG_EVENT_MSG: | |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34353
diff
changeset
|
342 | ggp_message_got(gc, &ev->event.msg); |
| 11414 | 343 | break; |
| 344 | case GG_EVENT_ACK: | |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
345 | #if GGP_ENABLE_GG11 |
|
34406
46f06ef265e3
Gadu-Gadu: update for the newest devel libgadu
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34394
diff
changeset
|
346 | case GG_EVENT_ACK110: |
|
34473
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
347 | #endif |
| 11414 | 348 | break; |
|
24745
511df62cb366
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24683
diff
changeset
|
349 | 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
|
350 | 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
|
351 | break; |
|
511df62cb366
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24683
diff
changeset
|
352 | 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
|
353 | ggp_image_send(gc, &ev->event.image_request); |
| 11414 | 354 | break; |
| 355 | case GG_EVENT_NOTIFY60: | |
| 356 | case GG_EVENT_STATUS60: | |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
357 | ggp_status_got_others(gc, ev); |
| 12007 | 358 | break; |
|
31630
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
359 | case GG_EVENT_TYPING_NOTIFICATION: |
|
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
360 | 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
|
361 | ev->event.typing_notification.length); |
|
47b2ee63a797
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
Jan Zachorowski <quantifier666@gmail.com>
parents:
31628
diff
changeset
|
362 | 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
|
363 | 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
|
364 | 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
|
365 | 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
|
366 | break; |
|
33296
33a9adb52028
Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33295
diff
changeset
|
367 | 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
|
368 | 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
|
369 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
370 | #if GGP_ENABLE_GG11 |
|
34383
4b1a106bbf1d
Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34380
diff
changeset
|
371 | case GG_EVENT_JSON_EVENT: |
|
4b1a106bbf1d
Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34380
diff
changeset
|
372 | ggp_events_json(gc, &ev->event.json_event); |
|
4b1a106bbf1d
Preparing a file transfer
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34380
diff
changeset
|
373 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
374 | #endif |
|
33314
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
375 | case GG_EVENT_USERLIST100_VERSION: |
|
33315
42bbe5b85df8
Gadu-Gadu: roster - uploading/synchronization - part1
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33314
diff
changeset
|
376 | ggp_roster_version(gc, &ev->event.userlist100_version); |
|
33314
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
377 | break; |
|
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
378 | case GG_EVENT_USERLIST100_REPLY: |
|
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
379 | ggp_roster_reply(gc, &ev->event.userlist100_reply); |
|
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
380 | break; |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
381 | case GG_EVENT_MULTILOGON_MSG: |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34353
diff
changeset
|
382 | 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
|
383 | break; |
|
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
384 | case GG_EVENT_MULTILOGON_INFO: |
|
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
385 | ggp_multilogon_info(gc, &ev->event.multilogon_info); |
|
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
386 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
387 | #if GGP_ENABLE_GG11 |
|
34348
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
388 | case GG_EVENT_IMTOKEN: |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
389 | 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
|
390 | g_free(info->imtoken); |
|
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
391 | 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
|
392 | break; |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
393 | case GG_EVENT_PONG110: |
|
35139
c30787ce6256
Use external libgadu for win32 build and update some dependencies. Refs #343
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35079
diff
changeset
|
394 | purple_debug_info("gg", "gg11: got PONG110 %lu\n", |
|
c30787ce6256
Use external libgadu for win32 build and update some dependencies. Refs #343
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35079
diff
changeset
|
395 | (long unsigned)ev->event.pong110.time); |
|
34348
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
396 | break; |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
397 | case GG_EVENT_CHAT_INFO: |
|
34353
300c246402ac
Gadu-Gadu: delayed chat joining
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34352
diff
changeset
|
398 | 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
|
399 | case GG_EVENT_CHAT_INFO_UPDATE: |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
400 | case GG_EVENT_CHAT_CREATED: |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
401 | case GG_EVENT_CHAT_INVITE_ACK: |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
402 | ggp_chat_got_event(gc, ev); |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
403 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
404 | #endif |
|
35145
01ef7274b440
Gadu-Gadu: handle apropriate event when getting remotely disconnected from other session
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35144
diff
changeset
|
405 | case GG_EVENT_DISCONNECT: |
|
01ef7274b440
Gadu-Gadu: handle apropriate event when getting remotely disconnected from other session
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35144
diff
changeset
|
406 | ggp_servconn_remote_disconnect(gc); |
|
01ef7274b440
Gadu-Gadu: handle apropriate event when getting remotely disconnected from other session
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35144
diff
changeset
|
407 | break; |
| 12007 | 408 | default: |
|
34348
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
409 | purple_debug_warning("gg", |
| 12007 | 410 | "unsupported event type=%d\n", ev->type); |
| 411 | break; | |
| 412 | } | |
| 11414 | 413 | |
| 12007 | 414 | gg_free_event(ev); |
| 415 | } | |
| 11414 | 416 | |
|
34433
fa2313e5f320
Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34429
diff
changeset
|
417 | void ggp_async_login_handler(gpointer _gc, gint fd, PurpleInputCondition cond) |
| 12007 | 418 | { |
| 15884 | 419 | PurpleConnection *gc = _gc; |
|
15419
c8f83c72739d
[gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents:
15294
diff
changeset
|
420 | GGPInfo *info; |
| 12007 | 421 | struct gg_event *ev; |
| 11414 | 422 | |
|
36068
e9b9320a985a
Drop PURPLE_CONNECTION_IS_VALID in favor of (temporary) PURPLE_ASSERT_CONNECTION_IS_VALID
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36055
diff
changeset
|
423 | PURPLE_ASSERT_CONNECTION_IS_VALID(gc); |
|
15419
c8f83c72739d
[gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents:
15294
diff
changeset
|
424 | |
|
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
|
425 | info = purple_connection_get_protocol_data(gc); |
|
15419
c8f83c72739d
[gaim-migrate @ 18150]
Evan Schoenberg <evands@pidgin.im>
parents:
15294
diff
changeset
|
426 | |
| 15884 | 427 | purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n", |
| 12007 | 428 | info->session->check, info->session->state); |
| 11414 | 429 | |
| 12007 | 430 | switch (info->session->state) { |
|
34442
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
431 | case GG_STATE_ERROR: |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
432 | 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
|
433 | break; |
| 12007 | 434 | case GG_STATE_RESOLVING: |
| 15884 | 435 | purple_debug_info("gg", "GG_STATE_RESOLVING\n"); |
| 12007 | 436 | 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
|
437 | 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
|
438 | 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
|
439 | break; |
| 12007 | 440 | case GG_STATE_CONNECTING_HUB: |
| 15884 | 441 | purple_debug_info("gg", "GG_STATE_CONNECTING_HUB\n"); |
| 12007 | 442 | break; |
| 443 | case GG_STATE_READING_DATA: | |
| 15884 | 444 | purple_debug_info("gg", "GG_STATE_READING_DATA\n"); |
| 12007 | 445 | break; |
| 446 | case GG_STATE_CONNECTING_GG: | |
| 15884 | 447 | purple_debug_info("gg", "GG_STATE_CONNECTING_GG\n"); |
| 12007 | 448 | break; |
| 449 | case GG_STATE_READING_KEY: | |
| 15884 | 450 | purple_debug_info("gg", "GG_STATE_READING_KEY\n"); |
| 12007 | 451 | break; |
| 452 | case GG_STATE_READING_REPLY: | |
| 15884 | 453 | purple_debug_info("gg", "GG_STATE_READING_REPLY\n"); |
| 11414 | 454 | 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
|
455 | 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
|
456 | 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
|
457 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
458 | #if GGP_ENABLE_GG11 |
|
34348
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
459 | case GG_STATE_RESOLVING_HUB: |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
460 | 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
|
461 | break; |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
462 | case GG_STATE_READING_HUB: |
|
15361867e114
Gadu-Gadu: add some prints for gg11
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33363
diff
changeset
|
463 | 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
|
464 | break; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
465 | #endif |
| 11414 | 466 | default: |
| 15884 | 467 | purple_debug_error("gg", "unknown state = %d\n", |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
468 | info->session->state); |
| 12007 | 469 | break; |
| 470 | } | |
| 471 | ||
| 472 | if (!(ev = gg_watch_fd(info->session))) { | |
| 15884 | 473 | 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
|
474 | purple_connection_error (gc, |
| 21279 | 475 | 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
|
476 | _("Unable to read from socket")); |
| 12007 | 477 | return; |
| 478 | } | |
| 15884 | 479 | purple_debug_info("gg", "login_handler: session->fd = %d\n", info->session->fd); |
| 480 | purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n", | |
| 12007 | 481 | info->session->check, info->session->state); |
| 482 | ||
|
32685
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
483 | 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
|
484 | info->inpa = 0; |
| 12007 | 485 | |
| 486 | /** 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
|
487 | 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
|
488 | 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
|
489 | (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
|
490 | 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
|
491 | ggp_async_login_handler, gc); |
| 12007 | 492 | |
| 493 | switch (ev->type) { | |
| 494 | case GG_EVENT_NONE: | |
| 495 | /* Nothing happened. */ | |
| 15884 | 496 | purple_debug_info("gg", "GG_EVENT_NONE\n"); |
| 12007 | 497 | break; |
| 498 | case GG_EVENT_CONN_SUCCESS: | |
| 12964 | 499 | { |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
500 | #if GGP_ENABLE_GG11 |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
501 | purple_debug_info("gg", "GG_EVENT_CONN_SUCCESS:" |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
502 | " 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
|
503 | 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
|
504 | 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
|
505 | connect_host); |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
506 | #endif |
|
32685
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
507 | 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
|
508 | info->inpa = purple_input_add(info->session->fd, |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
509 | PURPLE_INPUT_READ, |
|
34474
f0210174619a
Gadu-Gadu: (almost) correctly refresh libgadu's file descriptor
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34303
diff
changeset
|
510 | ggp_callback_recv, gc); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30163
diff
changeset
|
511 | |
|
30163
e43601d06035
gg: Fix misuse of update_progress. Fixes #11774
Krzysztof Klinikowski <kkszysiu@gmail.com>
parents:
30138
diff
changeset
|
512 | purple_connection_update_progress(gc, _("Connected"), 1, 2); |
|
34746
dc9c911dbd35
Started GObjectification of PurpleConnection.
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
513 | purple_connection_set_state(gc, PURPLE_CONNECTION_CONNECTED); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
514 | |
|
27642
6ae79601ad84
Patch from kkszysiu to make the GG prpl support
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27626
diff
changeset
|
515 | ggp_buddylist_send(gc); |
|
33318
636bfc28f2cf
Gadu-Gadu: roster - finally working
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33316
diff
changeset
|
516 | ggp_roster_request_update(gc); |
| 12964 | 517 | } |
| 12007 | 518 | break; |
| 519 | case GG_EVENT_CONN_FAILED: | |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
520 | if (info->inpa > 0) { |
|
33363
52cc04429e2c
Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33347
diff
changeset
|
521 | purple_input_remove(info->inpa); |
|
52cc04429e2c
Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33347
diff
changeset
|
522 | info->inpa = 0; |
|
52cc04429e2c
Gadu-Gadu: small bugfixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33347
diff
changeset
|
523 | } |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
524 | 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
|
525 | ev->event.failure); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
526 | switch (ev->event.failure) { |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
527 | case GG_FAILURE_RESOLVING: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
528 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
529 | 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
|
530 | _("Unable to resolve " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
531 | "hostname")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
532 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
533 | case GG_FAILURE_PASSWORD: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
534 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
535 | 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
|
536 | _("Incorrect password")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
537 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
538 | case GG_FAILURE_TLS: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
539 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
540 | 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
|
541 | _("SSL Connection Failed")); |
|
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_INTRUDER: |
|
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_AUTHENTICATION_FAILED, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
546 | _("Your account has been " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
547 | "disabled because too many " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
548 | "incorrect passwords were " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
549 | "entered")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
550 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
551 | case GG_FAILURE_UNAVAILABLE: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
552 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
553 | 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
|
554 | _("Service temporarily " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
555 | "unavailable")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
556 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
557 | case GG_FAILURE_PROXY: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
558 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
559 | 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
|
560 | _("Error connecting to proxy " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
561 | "server")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
562 | break; |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
563 | case GG_FAILURE_HUB: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
564 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
565 | 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
|
566 | _("Error connecting to master " |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
567 | "server")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
568 | break; |
|
34454
a7b6015534e0
Fix gg build with internal libgadu
Mark Doliner <mark@kingant.net>
parents:
34449
diff
changeset
|
569 | #if GGP_ENABLE_GG11 |
|
34442
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
570 | case GG_FAILURE_INTERNAL: |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
571 | purple_connection_error(gc, |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
572 | PURPLE_CONNECTION_ERROR_OTHER_ERROR, |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
573 | _("Internal error")); |
|
4534c27446e8
Gadu-Gadu: better fit for new API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34437
diff
changeset
|
574 | break; |
|
34454
a7b6015534e0
Fix gg build with internal libgadu
Mark Doliner <mark@kingant.net>
parents:
34449
diff
changeset
|
575 | #endif |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
576 | default: |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
577 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
578 | 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
|
579 | _("Connection failed")); |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
580 | } |
| 12007 | 581 | break; |
|
31874
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
582 | case GG_EVENT_MSG: |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
583 | 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
|
584 | 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
|
585 | break; |
|
a8e9b3781df1
Gadu-Gadu: check for NULL pointer before logging system messages.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32646
diff
changeset
|
586 | |
|
31874
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
587 | /* 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
|
588 | 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
|
589 | ev->event.msg.message); |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
590 | } else { |
|
31874
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
591 | 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
|
592 | "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
|
593 | 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
|
594 | ev->event.msg.message); |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
595 | } |
|
31874
6ddbbcd38154
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31795
diff
changeset
|
596 | break; |
| 12007 | 597 | default: |
| 15884 | 598 | purple_debug_error("gg", "strange event: %d\n", ev->type); |
| 11414 | 599 | break; |
| 600 | } | |
| 601 | ||
| 602 | gg_free_event(ev); | |
| 603 | } | |
| 604 | ||
| 605 | /* ---------------------------------------------------------------------- */ | |
| 15884 | 606 | /* ----- PurplePluginProtocolInfo ----------------------------------------- */ |
| 11360 | 607 | /* ---------------------------------------------------------------------- */ |
| 608 | ||
| 15884 | 609 | static const char *ggp_list_icon(PurpleAccount *account, PurpleBuddy *buddy) |
| 11360 | 610 | { |
| 611 | return "gadu-gadu"; | |
| 612 | } | |
| 613 | ||
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
614 | 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
|
615 | { |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
616 | static char normalized[21]; /* maximum unsigned long long int size */ |
|
2846
4f0435806f95
[gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2835
diff
changeset
|
617 | |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
618 | 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
|
619 | if (uin <= 0) |
|
31892
3368a7044a4a
Better status message handling in Gadu-Gadu. Fixes #14314
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31879
diff
changeset
|
620 | return NULL; |
|
3368a7044a4a
Better status message handling in Gadu-Gadu. Fixes #14314
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31879
diff
changeset
|
621 | |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
622 | 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
|
623 | |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
624 | return normalized; |
|
2846
4f0435806f95
[gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2835
diff
changeset
|
625 | } |
|
4f0435806f95
[gaim-migrate @ 2859]
Arkadiusz Miskiewicz <arekm@maven.pl>
parents:
2835
diff
changeset
|
626 | |
|
34409
198c6f5c19ca
Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34408
diff
changeset
|
627 | /* TODO: |
|
198c6f5c19ca
Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34408
diff
changeset
|
628 | * - move to status.c ? |
|
198c6f5c19ca
Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34408
diff
changeset
|
629 | * - 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
|
630 | */ |
| 15884 | 631 | static void ggp_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) |
| 11360 | 632 | { |
| 15884 | 633 | 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
|
634 | char *tmp; |
|
33342
26ba5e4e8c24
Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33341
diff
changeset
|
635 | const char *name, *alias; |
|
26ba5e4e8c24
Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33341
diff
changeset
|
636 | gchar *msg; |
| 11360 | 637 | |
| 15005 | 638 | g_return_if_fail(b != NULL); |
| 639 | ||
| 15884 | 640 | status = purple_presence_get_active_status(purple_buddy_get_presence(b)); |
| 641 | 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
|
642 | alias = purple_buddy_get_alias(b); |
|
33342
26ba5e4e8c24
Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33341
diff
changeset
|
643 | 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
|
644 | |
|
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
|
645 | purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), alias); |
| 11360 | 646 | |
| 647 | if (msg != NULL) { | |
| 15884 | 648 | 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
|
649 | 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
|
650 | 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
|
651 | g_free(tmp); |
| 15196 | 652 | } 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
|
653 | purple_notify_user_info_add_pair_plaintext(user_info, _("Message"), msg); |
| 15196 | 654 | } |
|
33342
26ba5e4e8c24
Gadu-Gadu: status refactoring - polishing
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33341
diff
changeset
|
655 | g_free(msg); |
| 15227 | 656 | /* We don't want to duplicate 'Status: Offline'. */ |
| 15884 | 657 | } 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
|
658 | purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), name); |
| 11360 | 659 | } |
| 660 | } | |
| 661 | ||
| 15884 | 662 | static void ggp_login(PurpleAccount *account) |
| 11360 | 663 | { |
|
33303
50f7a92eeb90
Gadu-Gadu: code refactoring - token request, proxy setup (deprecated)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33302
diff
changeset
|
664 | PurpleConnection *gc = purple_account_get_connection(account); |
| 13515 | 665 | struct gg_login_params *glp; |
| 666 | GGPInfo *info; | |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
667 | #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
|
668 | const char *address; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
669 | #endif |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
670 | const gchar *encryption_type, *protocol_version; |
| 13515 | 671 | |
|
33303
50f7a92eeb90
Gadu-Gadu: code refactoring - token request, proxy setup (deprecated)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33302
diff
changeset
|
672 | if (!ggp_deprecated_setup_proxy(gc)) |
| 13515 | 673 | return; |
| 674 | ||
|
36069
f99249837123
Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36068
diff
changeset
|
675 | purple_connection_set_flags(gc, |
|
f99249837123
Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36068
diff
changeset
|
676 | #if ! GGP_ENABLE_GG11 |
|
f99249837123
Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36068
diff
changeset
|
677 | PURPLE_CONNECTION_FLAG_NO_IMAGES | |
|
f99249837123
Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36068
diff
changeset
|
678 | #endif |
|
f99249837123
Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36068
diff
changeset
|
679 | PURPLE_CONNECTION_FLAG_HTML | |
|
f99249837123
Gadu-Gadu: disable inline images for libgadu<1.12.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36068
diff
changeset
|
680 | PURPLE_CONNECTION_FLAG_NO_URLDESC); |
| 11360 | 681 | |
| 13515 | 682 | 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
|
683 | #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
|
684 | 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
|
685 | #endif |
| 13515 | 686 | info = g_new0(GGPInfo, 1); |
| 11360 | 687 | |
|
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
|
688 | purple_connection_set_protocol_data(gc, info); |
|
23382
8dfecaa62e66
Restore status on login on GG, rather than setting Available first.
Will Thompson <resiak@pidgin.im>
parents:
23381
diff
changeset
|
689 | |
|
34433
fa2313e5f320
Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34429
diff
changeset
|
690 | 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
|
691 | 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
|
692 | ggp_avatar_setup(gc); |
|
33314
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
693 | ggp_roster_setup(gc); |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
694 | ggp_multilogon_setup(gc); |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
695 | ggp_status_setup(gc); |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
696 | ggp_chat_setup(gc); |
|
34361
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
697 | ggp_message_setup(gc); |
|
34380
2179667660bc
Edisc authentication, file transfer implementation started
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34378
diff
changeset
|
698 | ggp_edisc_setup(gc); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30163
diff
changeset
|
699 | |
|
33299
b3c4ab3aeb7f
Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
700 | 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
|
701 | glp->password = |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34115
diff
changeset
|
702 | ggp_convert_to_cp1250(purple_connection_get_password(gc)); |
| 11360 | 703 | |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
704 | if (glp->uin == 0) { |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
705 | purple_connection_error(gc, |
|
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
706 | 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
|
707 | _("The username specified is invalid.")); |
|
34428
f52357f34177
Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34427
diff
changeset
|
708 | purple_str_wipe(glp->password); |
| 11360 | 709 | g_free(glp); |
| 710 | return; | |
| 711 | } | |
|
32646
d1e3538b0c5f
Gadu-Gadu: detailed descriptions on connection failures. Fixes #14648
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32645
diff
changeset
|
712 | |
|
24745
511df62cb366
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24683
diff
changeset
|
713 | 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
|
714 | glp->status_flags = GG_STATUS_FLAG_UNKNOWN; |
| 11360 | 715 | |
|
32651
cc247c37281e
Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32650
diff
changeset
|
716 | 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
|
717 | glp->status_flags |= GG_STATUS_FLAG_SPAM; |
| 11360 | 718 | |
|
29824
9878119b5d78
Finish making libgadu compile on Windows. Fixes #10542 finally!
Krzysztof Klinikowski <kkszysiu@gmail.com>
parents:
29404
diff
changeset
|
719 | glp->encoding = GG_ENCODING_UTF8; |
|
33296
33a9adb52028
Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33295
diff
changeset
|
720 | glp->protocol_features = (GG_FEATURE_DND_FFC | |
|
33a9adb52028
Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33295
diff
changeset
|
721 | GG_FEATURE_TYPING_NOTIFICATION | GG_FEATURE_MULTILOGON | |
|
33a9adb52028
Enable receiving of user_data packets
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33295
diff
changeset
|
722 | GG_FEATURE_USER_DATA); |
|
35976
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
723 | |
| 12007 | 724 | glp->async = 1; |
|
35976
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
725 | |
|
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
|
726 | 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
|
727 | "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
|
728 | 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
|
729 | 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
|
730 | 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
|
731 | 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
|
732 | 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
|
733 | 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
|
734 | 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
|
735 | 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
|
736 | 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
|
737 | 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
|
738 | _("SSL support unavailable")); |
|
34428
f52357f34177
Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34427
diff
changeset
|
739 | 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
|
740 | 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
|
741 | return; |
|
35976
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
742 | } |
|
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
|
743 | } |
|
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
|
744 | 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
|
745 | glp->tls = GG_SSL_DISABLED; |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
746 | purple_debug_misc("gg", "TLS mode: %d\n", glp->tls); |
|
35976
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
747 | |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
748 | 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
|
749 | "protocol_version", "default"); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
750 | 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
|
751 | protocol_version); |
|
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 |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
753 | 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
|
754 | 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
|
755 | 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
|
756 | glp->protocol_version = GG_PROTOCOL_VERSION_110; |
|
34473
fb04c75906e0
Gadu-Gadu: update code for the new libpurple and libgadu APIs
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34454
diff
changeset
|
757 | glp->compatibility = GG_COMPAT_1_12_0; |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
758 | #else |
|
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
759 | glp->protocol_version = 0x2e; |
|
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
760 | #endif |
| 11360 | 761 | |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
762 | ggp_status_set_initial(gc, glp); |
|
35976
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
763 | |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
764 | #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
|
765 | 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
|
766 | 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
|
767 | 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
|
768 | #endif |
|
27255
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
769 | |
| 11360 | 770 | 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
|
771 | #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
|
772 | 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
|
773 | #endif |
|
34428
f52357f34177
Gadu-Gadu: wipe password
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34427
diff
changeset
|
774 | 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
|
775 | 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
|
776 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30163
diff
changeset
|
777 | purple_connection_update_progress(gc, _("Connecting"), 0, 2); |
| 11360 | 778 | if (info->session == NULL) { |
|
32157
39ba2e2492ee
Rename purple_connection_error_reason to purple_connection_error
Mark Doliner <markdoliner@pidgin.im>
parents:
32147
diff
changeset
|
779 | purple_connection_error (gc, |
| 21279 | 780 | 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
|
781 | _("Connection failed")); |
|
35976
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
782 | return; |
|
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
783 | } |
|
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
784 | |
|
34433
fa2313e5f320
Gadu-Gadu: use our own proxy/tls connecting code instead of libgadu's
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34429
diff
changeset
|
785 | 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
|
786 | 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
|
787 | PURPLE_INPUT_READ, ggp_async_login_handler, gc); |
|
35976
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
788 | } |
|
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
789 | } |
|
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
790 | |
| 15884 | 791 | static void ggp_close(PurpleConnection *gc) |
| 11360 | 792 | { |
|
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
|
793 | 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
|
794 | GGPInfo *info;; |
| 8997 | 795 | |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
796 | g_return_if_fail(gc != NULL); |
| 11360 | 797 | |
|
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
|
798 | 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
|
799 | info = purple_connection_get_protocol_data(gc); |
| 12964 | 800 | |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
801 | purple_notify_close_with_handle(gc); |
|
35976
3f076483405f
Gadu-Gadu: use asynchronous purple_dnsquery_a_account instead of deprecated gg_gethostbyname
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35251
diff
changeset
|
802 | |
|
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
|
803 | if (info) { |
|
11538
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
804 | if (info->session != NULL) { |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
805 | ggp_status_set_disconnected(account); |
|
11538
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
806 | gg_logoff(info->session); |
|
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
807 | gg_free_session(info->session); |
|
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
808 | } |
| 13641 | 809 | |
|
33313
5a0c6582d5b1
Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33311
diff
changeset
|
810 | 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
|
811 | ggp_avatar_cleanup(gc); |
|
33314
57013b9e1a8e
Gadu-Gadu: roster - downloading
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
812 | ggp_roster_cleanup(gc); |
|
33334
734fc6da6179
Gadu-Gadu: initial multilogon support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33333
diff
changeset
|
813 | ggp_multilogon_cleanup(gc); |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
814 | ggp_status_cleanup(gc); |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
815 | ggp_chat_cleanup(gc); |
|
34361
ddcc82637afa
Gadu-Gadu: incoming images works again
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34359
diff
changeset
|
816 | ggp_message_cleanup(gc); |
|
34380
2179667660bc
Edisc authentication, file transfer implementation started
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34378
diff
changeset
|
817 | ggp_edisc_cleanup(gc); |
|
14060
e1a87aabd80c
[gaim-migrate @ 16583]
Evan Schoenberg <evands@pidgin.im>
parents:
13645
diff
changeset
|
818 | |
|
32685
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
819 | if (info->inpa > 0) |
|
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
820 | purple_input_remove(info->inpa); |
|
34373
169db6aa5e08
Gadu-Gadu: very initial GGDrive authentication support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34361
diff
changeset
|
821 | 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
|
822 | |
|
140518f18665
GG: Move the "inpa" input watcher into protocol_data.
Andrew Victor <andrew.victor@mxit.com>
parents:
32678
diff
changeset
|
823 | purple_connection_set_protocol_data(gc, NULL); |
|
11545
df2f9bb3fd6e
[gaim-migrate @ 13800]
Daniel Atallah <datallah@pidgin.im>
parents:
11544
diff
changeset
|
824 | g_free(info); |
|
11538
d87f3717d5a5
[gaim-migrate @ 13792]
Daniel Atallah <datallah@pidgin.im>
parents:
11522
diff
changeset
|
825 | } |
| 11360 | 826 | |
| 15884 | 827 | purple_debug_info("gg", "Connection closed.\n"); |
| 11360 | 828 | } |
| 829 | ||
|
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
|
830 | static unsigned int ggp_send_typing(PurpleConnection *gc, const char *name, PurpleIMTypingState state) |
| 11360 | 831 | { |
|
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
|
832 | GGPInfo *info = purple_connection_get_protocol_data(gc); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
833 | int dummy_length; /* we don't send real length of typed message */ |
|
24745
511df62cb366
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24683
diff
changeset
|
834 | |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
835 | 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
|
836 | return 1; |
|
31628
339576876d0b
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31611
diff
changeset
|
837 | |
|
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
|
838 | 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
|
839 | dummy_length = (int)g_random_int(); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
840 | else /* PURPLE_NOT_TYPING */ |
|
31648
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
841 | dummy_length = 0; |
|
24745
511df62cb366
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24683
diff
changeset
|
842 | |
|
31648
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
843 | 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
|
844 | info->session, |
|
31648
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
845 | ggp_str_to_uin(name), |
|
35358
7beae478c905
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35356
diff
changeset
|
846 | dummy_length); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30163
diff
changeset
|
847 | |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
848 | return 1; /* wait 1 second before another notification */ |
| 11360 | 849 | } |
| 850 | ||
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32261
diff
changeset
|
851 | static void ggp_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, const char *message) |
| 11360 | 852 | { |
|
33299
b3c4ab3aeb7f
Gadu-Gadu: utils refactoring, (partially) fix new account registration
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
853 | 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
|
854 | 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
|
855 | const gchar *name = purple_buddy_get_name(buddy); |
| 11360 | 856 | |
|
24939
d25fdf62ae92
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
24043
diff
changeset
|
857 | 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
|
858 | |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
859 | /* 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
|
860 | 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
|
861 | ggp_status_fake_to_self(gc); |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
862 | |
|
33318
636bfc28f2cf
Gadu-Gadu: roster - finally working
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33316
diff
changeset
|
863 | 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
|
864 | ggp_pubdir_request_buddy_alias(gc, buddy); |
| 11360 | 865 | } |
| 866 | ||
| 15884 | 867 | static void ggp_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, |
|
35786
99859ca3d617
Gadu-Gadu: fix style
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35501
diff
changeset
|
868 | PurpleGroup *group) |
| 11360 | 869 | { |
|
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
|
870 | GGPInfo *info = purple_connection_get_protocol_data(gc); |
| 11360 | 871 | |
|
24939
d25fdf62ae92
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
24043
diff
changeset
|
872 | 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
|
873 | ggp_roster_remove_buddy(gc, buddy, group); |
| 11394 | 874 | } |
| 875 | ||
| 15884 | 876 | static void ggp_keepalive(PurpleConnection *gc) |
| 11360 | 877 | { |
|
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
|
878 | GGPInfo *info = purple_connection_get_protocol_data(gc); |
| 11360 | 879 | |
| 15884 | 880 | /* purple_debug_info("gg", "Keeping connection alive....\n"); */ |
| 11360 | 881 | |
| 882 | if (gg_ping(info->session) < 0) { | |
| 15884 | 883 | purple_debug_info("gg", "Not connected to the server " |
| 11360 | 884 | "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
|
885 | purple_connection_error (gc, |
| 21279 | 886 | 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
|
887 | _("Not connected to the server")); |
| 4916 | 888 | } |
| 2393 | 889 | } |
| 11360 | 890 | |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
891 | static void ggp_action_multilogon(PurplePluginAction *action) |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
892 | { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
893 | ggp_multilogon_dialog((PurpleConnection *)action->context); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
894 | } |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
895 | |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
896 | static void ggp_action_status_broadcasting(PurplePluginAction *action) |
| 11360 | 897 | { |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
898 | ggp_status_broadcasting_dialog((PurpleConnection *)action->context); |
| 2393 | 899 | } |
| 11360 | 900 | |
|
33346
3b4cbb0e10d6
Gadu-Gadu: public directory search with gg10.5 api
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33345
diff
changeset
|
901 | static void ggp_action_search(PurplePluginAction *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
|
902 | { |
|
33346
3b4cbb0e10d6
Gadu-Gadu: public directory search with gg10.5 api
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33345
diff
changeset
|
903 | ggp_pubdir_search((PurpleConnection *)action->context, 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
|
904 | } |
|
09f740724036
Gadu-Gadu: extended OAuth support, initial support for gg10.5 public directory
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33342
diff
changeset
|
905 | |
|
33347
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
906 | static void ggp_action_set_info(PurplePluginAction *action) |
|
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
907 | { |
|
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
908 | ggp_pubdir_set_info((PurpleConnection *)action->context); |
| 2393 | 909 | } |
| 910 | ||
| 15884 | 911 | static GList *ggp_actions(PurplePlugin *plugin, gpointer context) |
|
8775
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
912 | { |
| 11360 | 913 | GList *m = NULL; |
| 15884 | 914 | PurplePluginAction *act; |
| 11360 | 915 | |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
916 | act = purple_plugin_action_new(_("Show other sessions"), |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
917 | ggp_action_multilogon); |
| 11360 | 918 | m = g_list_append(m, act); |
| 919 | ||
|
33347
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
920 | act = purple_plugin_action_new(_("Show status only for buddies"), |
|
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
921 | ggp_action_status_broadcasting); |
| 11360 | 922 | m = g_list_append(m, act); |
| 923 | ||
| 924 | m = g_list_append(m, NULL); | |
| 925 | ||
| 15884 | 926 | act = purple_plugin_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
|
927 | ggp_action_search); |
| 11360 | 928 | m = g_list_append(m, act); |
|
8775
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
929 | |
|
33347
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
930 | act = purple_plugin_action_new(_("Set User Info"), |
|
cc3f8295618a
Gadu-Gadu: setting public profile information. Fixes #6918
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33346
diff
changeset
|
931 | ggp_action_set_info); |
| 11360 | 932 | m = g_list_append(m, act); |
| 933 | ||
| 934 | m = g_list_append(m, NULL); | |
| 935 | ||
| 15884 | 936 | act = purple_plugin_action_new(_("Save buddylist to file..."), |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
937 | ggp_action_buddylist_save); |
| 11360 | 938 | m = g_list_append(m, act); |
|
8775
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
939 | |
| 15884 | 940 | act = purple_plugin_action_new(_("Load buddylist from file..."), |
|
35360
29d788c72350
Style: fix gg braces (part 1)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35358
diff
changeset
|
941 | ggp_action_buddylist_load); |
| 11360 | 942 | m = g_list_append(m, act); |
| 943 | ||
| 944 | return m; | |
|
8775
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
945 | } |
|
6cb5dddaad4f
[gaim-migrate @ 9537]
Andrew Wellington <proton@users.sourceforge.net>
parents:
8749
diff
changeset
|
946 | |
|
33327
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
947 | 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
|
948 | { |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
949 | 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
|
950 | |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
951 | if (buddy_data->blocked) |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
952 | return "not-authorized"; |
|
34409
198c6f5c19ca
Gadu-Gadu: Add support for GG_STATUS_UNKNOWN status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34408
diff
changeset
|
953 | 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
|
954 | return "unavailable"; |
|
33327
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
955 | |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
956 | return NULL; |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
957 | } |
|
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
958 | |
| 15884 | 959 | static gboolean ggp_offline_message(const PurpleBuddy *buddy) |
|
13298
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
960 | { |
|
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
961 | return TRUE; |
|
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
962 | } |
|
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
963 | |
|
33311
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
964 | 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
|
965 | { |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
966 | GHashTable *table; |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
967 | 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
|
968 | 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
|
969 | return table; |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
970 | } |
|
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
971 | |
|
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
|
972 | 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
|
973 | 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
|
974 | { |
|
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
|
975 | /* 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
|
976 | 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
|
977 | } |
|
4461d5c1e61c
Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
978 | |
| 15884 | 979 | static PurplePluginProtocolInfo prpl_info = |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
980 | { |
|
32316
21dab55b4699
Move struct_size to the beginning of the struct. Even if we don't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32315
diff
changeset
|
981 | sizeof(PurplePluginProtocolInfo), /* struct_size */ |
|
36055
33978dc8ef6f
Remove redundant OPT_PROTO_IM_IMAGE (use \!PURPLE_CONNECTION_FLAG_NO_IMAGES instead)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35989
diff
changeset
|
982 | 0, |
| 12007 | 983 | NULL, /* user_splits */ |
| 984 | NULL, /* protocol_options */ | |
|
33333
b20aed44c357
Gadu-Gadu: setting own buddy icon
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33327
diff
changeset
|
985 | {"png", 1, 1, 200, 200, 0, PURPLE_ICON_SCALE_DISPLAY | PURPLE_ICON_SCALE_SEND}, /* icon_spec */ |
| 11360 | 986 | ggp_list_icon, /* list_icon */ |
|
33327
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
987 | ggp_list_emblem, /* list_emblem */ |
|
33340
5f00ed891179
Gadu-Gadu: status refactoring - done
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33339
diff
changeset
|
988 | ggp_status_buddy_text, /* status_text */ |
| 11360 | 989 | ggp_tooltip_text, /* tooltip_text */ |
| 990 | ggp_status_types, /* status_types */ | |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
991 | NULL, /* blist_node_menu */ |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
992 | #if GGP_ENABLE_GG11 |
| 11394 | 993 | ggp_chat_info, /* chat_info */ |
|
34352
16ee13f507a0
Gadu-Gadu: room list
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34350
diff
changeset
|
994 | ggp_chat_info_defaults, /* chat_info_defaults */ |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
995 | #else |
|
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
996 | NULL, NULL, |
|
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
997 | #endif |
| 12007 | 998 | ggp_login, /* login */ |
| 999 | ggp_close, /* close */ | |
|
34357
74dff2310289
Gadu-Gadu: reimplementation of sending messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34356
diff
changeset
|
1000 | ggp_message_send_im, /* send_im */ |
| 12007 | 1001 | NULL, /* set_info */ |
|
31648
03cb811f6382
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31630
diff
changeset
|
1002 | ggp_send_typing, /* send_typing */ |
|
33344
2a2560bb1445
Gadu-Gadu: getting user information with gg10.5 API
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33343
diff
changeset
|
1003 | ggp_pubdir_get_info_prpl, /* get_info */ |
|
33336
7c97b5dd3bf4
Gadu-Gadu: status refactoring - own status
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33334
diff
changeset
|
1004 | ggp_status_set_purplestatus, /* set_away */ |
| 12007 | 1005 | NULL, /* set_idle */ |
| 1006 | NULL, /* change_passwd */ | |
| 11360 | 1007 | ggp_add_buddy, /* add_buddy */ |
| 12007 | 1008 | NULL, /* add_buddies */ |
| 11360 | 1009 | ggp_remove_buddy, /* remove_buddy */ |
| 12007 | 1010 | NULL, /* remove_buddies */ |
| 1011 | NULL, /* add_permit */ | |
|
31938
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
1012 | ggp_add_deny, /* add_deny */ |
| 12007 | 1013 | NULL, /* rem_permit */ |
|
31938
13c568701e8a
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
31892
diff
changeset
|
1014 | ggp_rem_deny, /* rem_deny */ |
| 12007 | 1015 | NULL, /* set_permit_deny */ |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
1016 | #if GGP_ENABLE_GG11 |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
1017 | ggp_chat_join, /* join_chat */ |
|
34352
16ee13f507a0
Gadu-Gadu: room list
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34350
diff
changeset
|
1018 | NULL, /* TODO */ /* reject_chat */ |
|
34350
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
1019 | ggp_chat_get_name, /* get_chat_name */ |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
1020 | ggp_chat_invite, /* chat_invite */ |
|
89441dbabc83
Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34348
diff
changeset
|
1021 | ggp_chat_leave, /* chat_leave */ |
| 11394 | 1022 | ggp_chat_send, /* chat_send */ |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
1023 | #else |
|
36078
ad2b7d9cc0c3
Remove dead send_whisper feature
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36069
diff
changeset
|
1024 | NULL, NULL, NULL, NULL, NULL, NULL, |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
1025 | #endif |
| 11360 | 1026 | ggp_keepalive, /* keepalive */ |
|
35251
07e827917960
Gadu-Gadu: disable password change and account registration. Fixes the crash when trying to register new account. Both functions will probably been reimplemented in 3.0.0
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34474
diff
changeset
|
1027 | NULL, /* register_user */ |
| 12007 | 1028 | NULL, /* get_cb_info */ |
|
33315
42bbe5b85df8
Gadu-Gadu: roster - uploading/synchronization - part1
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33314
diff
changeset
|
1029 | ggp_roster_alias_buddy, /* alias_buddy */ |
|
42bbe5b85df8
Gadu-Gadu: roster - uploading/synchronization - part1
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33314
diff
changeset
|
1030 | ggp_roster_group_buddy, /* group_buddy */ |
|
33318
636bfc28f2cf
Gadu-Gadu: roster - finally working
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33316
diff
changeset
|
1031 | ggp_roster_rename_group, /* rename_group */ |
|
33327
4e6e895f161b
Gadu-Gadu: correctly handle buddies that blocks us
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33318
diff
changeset
|
1032 | ggp_buddy_free, /* buddy_free */ |
| 12007 | 1033 | NULL, /* convo_closed */ |
|
32652
9cf860cf65f2
Gadu-Gadu: function to normalize gg usernames
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32651
diff
changeset
|
1034 | ggp_normalize, /* normalize */ |
|
33333
b20aed44c357
Gadu-Gadu: setting own buddy icon
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33327
diff
changeset
|
1035 | ggp_avatar_own_set, /* set_buddy_icon */ |
| 12007 | 1036 | NULL, /* remove_group */ |
| 1037 | NULL, /* get_cb_real_name */ | |
| 1038 | NULL, /* set_chat_topic */ | |
| 1039 | NULL, /* find_blist_chat */ | |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
1040 | #if GGP_ENABLE_GG11 |
|
34352
16ee13f507a0
Gadu-Gadu: room list
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34350
diff
changeset
|
1041 | ggp_chat_roomlist_get_list, /* roomlist_get_list */ |
|
34437
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
1042 | #else |
|
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
1043 | NULL, |
|
ca6d1b4d24b5
Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34435
diff
changeset
|
1044 | #endif |
| 12007 | 1045 | NULL, /* roomlist_cancel */ |
| 1046 | NULL, /* roomlist_expand_category */ | |
|
35354
aa1f0e988567
Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35305
diff
changeset
|
1047 | ggp_edisc_xfer_can_receive_file, /* can_receive_file */ |
|
34380
2179667660bc
Edisc authentication, file transfer implementation started
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34378
diff
changeset
|
1048 | ggp_edisc_xfer_send_file, /* send_file */ |
|
34394
ed78b0fc180e
Gadu-Gadu: file transfer code tidying, first stage of receiving a file
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34383
diff
changeset
|
1049 | ggp_edisc_xfer_send_new, /* new_xfer */ |
|
13298
7a41e676010b
[gaim-migrate @ 15663]
Richard Laager <rlaager@pidgin.im>
parents:
13297
diff
changeset
|
1050 | ggp_offline_message, /* offline_message */ |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12595
diff
changeset
|
1051 | NULL, /* whiteboard_prpl_ops */ |
| 14604 | 1052 | NULL, /* send_raw */ |
| 15185 | 1053 | NULL, /* roomlist_room_serialize */ |
|
22071
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22069
diff
changeset
|
1054 | NULL, /* unregister_user */ |
|
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22069
diff
changeset
|
1055 | NULL, /* send_attention */ |
|
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22069
diff
changeset
|
1056 | NULL, /* get_attention_types */ |
|
33311
3ba9260b0e74
Gadu-Gadu: add login_label field
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33310
diff
changeset
|
1057 | ggp_get_account_text_table, /* get_account_text_table */ |
|
33345
740174b22496
Gadu-Gadu: retrieve buddy public alias after adding to blist. Fixes #2188
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33344
diff
changeset
|
1058 | NULL, /* initiate_media */ |
|
740174b22496
Gadu-Gadu: retrieve buddy public alias after adding to blist. Fixes #2188
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33344
diff
changeset
|
1059 | NULL, /* can_do_media */ |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30134
diff
changeset
|
1060 | NULL, /* get_moods */ |
|
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
30134
diff
changeset
|
1061 | NULL, /* set_public_alias */ |
|
31595
ffc150f21bec
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31551
diff
changeset
|
1062 | NULL, /* get_public_alias */ |
|
34312
4461d5c1e61c
Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
1063 | ggp_get_max_message_size /* get_max_message_size */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1064 | }; |
|
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1065 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1066 | static gboolean ggp_load(PurplePlugin *plugin); |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1067 | static gboolean ggp_unload(PurplePlugin *plugin); |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1068 | |
| 15884 | 1069 | static PurplePluginInfo info = { |
|
24746
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1070 | PURPLE_PLUGIN_MAGIC, /* magic */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1071 | PURPLE_MAJOR_VERSION, /* major_version */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1072 | PURPLE_MINOR_VERSION, /* minor_version */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1073 | PURPLE_PLUGIN_PROTOCOL, /* plugin type */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1074 | NULL, /* ui_requirement */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1075 | 0, /* flags */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1076 | NULL, /* dependencies */ |
| 15884 | 1077 | PURPLE_PRIORITY_DEFAULT, /* priority */ |
| 11360 | 1078 | |
|
24746
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1079 | "prpl-gg", /* id */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1080 | "Gadu-Gadu", /* name */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1081 | DISPLAY_VERSION, /* version */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1082 | |
| 11360 | 1083 | N_("Gadu-Gadu Protocol Plugin"), /* summary */ |
| 1084 | N_("Polish popular IM"), /* description */ | |
|
24746
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1085 | "boler@sourceforge.net", /* author */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1086 | PURPLE_WEBSITE, /* homepage */ |
| 11360 | 1087 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1088 | ggp_load, /* load */ |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1089 | ggp_unload, /* unload */ |
|
24746
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1090 | NULL, /* destroy */ |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1091 | |
|
24746
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1092 | NULL, /* ui_info */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1093 | &prpl_info, /* extra_info */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1094 | NULL, /* prefs_info */ |
|
ffee942a34b2
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24745
diff
changeset
|
1095 | ggp_actions, /* actions */ |
|
16746
72faf41c3c4f
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1096 | |
|
72faf41c3c4f
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1097 | /* padding */ |
|
72faf41c3c4f
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1098 | NULL, |
|
72faf41c3c4f
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1099 | NULL, |
|
72faf41c3c4f
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1100 | NULL, |
|
72faf41c3c4f
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
1101 | NULL |
| 11360 | 1102 | }; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1103 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1104 | static PurpleAccountOption *ggp_server_option; |
|
11541
b1468184879c
[gaim-migrate @ 13796]
Daniel Atallah <datallah@pidgin.im>
parents:
11538
diff
changeset
|
1105 | |
| 15884 | 1106 | static void init_plugin(PurplePlugin *plugin) |
| 2393 | 1107 | { |
| 15884 | 1108 | 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
|
1109 | GList *encryption_options = NULL; |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1110 | GList *protocol_version = NULL; |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5136
diff
changeset
|
1111 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1112 | purple_prefs_add_none("/plugins/prpl/gg"); |
| 3572 | 1113 | |
|
27255
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
1114 | 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
|
1115 | "gg_server", ""); |
|
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
1116 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
d2284774cfed
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <darkrain42@pidgin.im>
parents:
27197
diff
changeset
|
1117 | option); |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1118 | 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
|
1119 | |
|
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
|
1120 | #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
|
1121 | 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
|
1122 | 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
|
1123 | 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
|
1124 | 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
|
1125 | } |
|
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
|
1126 | |
|
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
|
1127 | 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
|
1128 | "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
|
1129 | 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
|
1130 | 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
|
1131 | |
|
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
|
1132 | 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
|
1133 | "encryption", encryption_options); |
|
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
|
1134 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
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
|
1135 | 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
|
1136 | |
|
34424
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1137 | ADD_VALUE(protocol_version, _("Default"), "default"); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1138 | 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
|
1139 | 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
|
1140 | |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1141 | 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
|
1142 | "protocol_version", protocol_version); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1143 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1144 | option); |
|
70fb82cea2a7
Make it possible to select protocol version
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34415
diff
changeset
|
1145 | |
|
32651
cc247c37281e
Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32650
diff
changeset
|
1146 | 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
|
1147 | "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
|
1148 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
|
cc247c37281e
Gadu-Gadu: option to show links from strangers. Fixes #10591
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32650
diff
changeset
|
1149 | option); |
| 2393 | 1150 | } |
|
11541
b1468184879c
[gaim-migrate @ 13796]
Daniel Atallah <datallah@pidgin.im>
parents:
11538
diff
changeset
|
1151 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1152 | static gboolean ggp_load(PurplePlugin *plugin) |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1153 | { |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1154 | 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
|
1155 | "libgadu %s...\n", gg_libgadu_version()); |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1156 | |
|
34408
ee5663c0ffe8
Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34406
diff
changeset
|
1157 | ggp_libgaduw_setup(); |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1158 | ggp_resolver_purple_setup(); |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1159 | 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
|
1160 | ggp_html_setup(); |
|
7cf367cc1141
Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34357
diff
changeset
|
1161 | 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
|
1162 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1163 | return TRUE; |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1164 | } |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1165 | |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1166 | static gboolean ggp_unload(PurplePlugin *plugin) |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1167 | { |
|
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1168 | 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
|
1169 | ggp_html_cleanup(); |
|
7cf367cc1141
Gadu-Gadu: compile regular expressions only once per plugin load
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34357
diff
changeset
|
1170 | ggp_message_cleanup_global(); |
|
34408
ee5663c0ffe8
Gadu-Gadu: new libgadu debug handler
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34406
diff
changeset
|
1171 | 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
|
1172 | |
|
33339
02ee2834030c
Gadu-Gadu: servers history feature
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33337
diff
changeset
|
1173 | return TRUE; |
| 2393 | 1174 | } |
| 1175 | ||
| 15884 | 1176 | PURPLE_INIT_PLUGIN(gg, init_plugin, info); |
| 11360 | 1177 | |
| 12007 | 1178 | /* vim: set ts=8 sts=0 sw=8 noet: */ |