Mercurial > pidgin
annotate libpurple/protocols/gg/gg.c @ 31776:eb7dfb01640d
Complete the conversion of win32 utsname construction to bounds-checked access.
This patch changes strcat to g_strlcat with appropriate bounds.
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sun, 17 Jul 2011 20:55:12 +0000 |
parents | e17b5aab37d0 |
children | 7df08e88d9bb |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file gg.c Gadu-Gadu protocol plugin |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15822 | 4 * purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6 * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * Some parts of the code are adapted or taken from the previous implementation |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * of this plugin written by Arkadiusz Miskiewicz <misiek@pld.org.pl> |
27164
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
10 * Some parts Copyright (C) 2009 Krzysztof Klinikowski <grommasher@gmail.com> |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * Thanks to Google's Summer of Code Program. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18445
diff
changeset
|
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include "internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #include "plugin.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "version.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "notify.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "status.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "blist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "accountopt.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "request.h" |
27164
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
40 #include "xmlnode.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 #include <libgadu.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "gg.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "confer.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 #include "search.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 #include "buddylist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 #include "gg-utils.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
15822 | 50 static PurplePlugin *my_protocol = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 |
31350
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
52 /* Prototypes */ |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
53 static void ggp_set_status(PurpleAccount *account, PurpleStatus *status); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
54 static int ggp_to_gg_status(PurpleStatus *status, char **msg); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
55 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 /* ----- EXTERNAL CALLBACKS --------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 /* ----- HELPERS -------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 * Set up libgadu's proxy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 * @param account Account for which to set up the proxy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 * @return Zero if proxy setup is valid, otherwise -1. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 */ |
15822 | 70 static int ggp_setup_proxy(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 { |
15822 | 72 PurpleProxyInfo *gpi; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 |
15822 | 74 gpi = purple_proxy_get_setup(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 |
15822 | 76 if ((purple_proxy_info_get_type(gpi) != PURPLE_PROXY_NONE) && |
77 (purple_proxy_info_get_host(gpi) == NULL || | |
78 purple_proxy_info_get_port(gpi) <= 0)) { | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 gg_proxy_enabled = 0; |
15822 | 81 purple_notify_error(NULL, NULL, _("Invalid proxy settings"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 _("Either the host name or port number specified for your given proxy type is invalid.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 return -1; |
15822 | 84 } else if (purple_proxy_info_get_type(gpi) != PURPLE_PROXY_NONE) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 gg_proxy_enabled = 1; |
15822 | 86 gg_proxy_host = g_strdup(purple_proxy_info_get_host(gpi)); |
87 gg_proxy_port = purple_proxy_info_get_port(gpi); | |
88 gg_proxy_username = g_strdup(purple_proxy_info_get_username(gpi)); | |
89 gg_proxy_password = g_strdup(purple_proxy_info_get_password(gpi)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 gg_proxy_enabled = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 |
15822 | 97 static void ggp_async_token_handler(gpointer _gc, gint fd, PurpleInputCondition cond) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 { |
15822 | 99 PurpleConnection *gc = _gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 GGPToken *token = info->token; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 GGPTokenCallback cb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 struct gg_token *t = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 |
15822 | 106 purple_debug_info("gg", "token_handler: token->req: check = %d; state = %d;\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 token->req->check, token->req->state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 if (gg_token_watch_fd(token->req) == -1 || token->req->state == GG_STATE_ERROR) { |
15822 | 110 purple_debug_error("gg", "token error (1): %d\n", token->req->error); |
111 purple_input_remove(token->inpa); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 gg_token_free(token->req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 token->req = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 |
15822 | 115 purple_notify_error(purple_connection_get_account(gc), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 _("Token Error"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 _("Unable to fetch the token.\n"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 if (token->req->state != GG_STATE_DONE) { |
15822 | 122 purple_input_remove(token->inpa); |
123 token->inpa = purple_input_add(token->req->fd, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 (token->req->check == 1) |
15822 | 125 ? PURPLE_INPUT_WRITE |
126 : PURPLE_INPUT_READ, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 ggp_async_token_handler, gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
128 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 if (!(t = token->req->data) || !token->req->body) { |
15822 | 132 purple_debug_error("gg", "token error (2): %d\n", token->req->error); |
133 purple_input_remove(token->inpa); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 gg_token_free(token->req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 token->req = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 |
15822 | 137 purple_notify_error(purple_connection_get_account(gc), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 _("Token Error"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 _("Unable to fetch the token.\n"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 |
15822 | 143 purple_input_remove(token->inpa); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 token->id = g_strdup(t->tokenid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 token->size = token->req->body_size; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 token->data = g_new0(char, token->size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 memcpy(token->data, token->req->body, token->size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 |
15822 | 150 purple_debug_info("gg", "TOKEN! tokenid = %s; size = %d\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 token->id, token->size); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 gg_token_free(token->req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 token->req = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 token->inpa = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 cb = token->cb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 token->cb = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 cb(gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 |
15822 | 162 static void ggp_token_request(PurpleConnection *gc, GGPTokenCallback cb) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 { |
15822 | 164 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 struct gg_http *req; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 GGPInfo *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 |
15822 | 168 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 if (ggp_setup_proxy(account) == -1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
174 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 if ((req = gg_token(1)) == NULL) { |
15822 | 176 purple_notify_error(account, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 _("Token Error"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 _("Unable to fetch the token.\n"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 info->token = g_new(GGPToken, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 info->token->cb = cb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 info->token->req = req; |
15822 | 186 info->token->inpa = purple_input_add(req->fd, PURPLE_INPUT_READ, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
187 ggp_async_token_handler, gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
188 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 /* }}} */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
190 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
191 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 * Request buddylist from the server. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 * Buddylist is received in the ggp_callback_recv(). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 * @param Current action handler. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 */ |
15822 | 199 static void ggp_action_buddylist_get(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 { |
15822 | 201 PurpleConnection *gc = (PurpleConnection *)action->context; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 |
15822 | 204 purple_debug_info("gg", "Downloading...\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 gg_userlist_request(info->session, GG_USERLIST_GET, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 * Upload the buddylist to the server. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 * @param action Current action handler. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 */ |
15822 | 214 static void ggp_action_buddylist_put(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 { |
15822 | 216 PurpleConnection *gc = (PurpleConnection *)action->context; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 |
15822 | 219 char *buddylist = ggp_buddylist_dump(purple_connection_get_account(gc)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 |
15822 | 221 purple_debug_info("gg", "Uploading...\n"); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
29868
diff
changeset
|
222 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 if (buddylist == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 gg_userlist_request(info->session, GG_USERLIST_PUT, buddylist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 g_free(buddylist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 * Delete buddylist from the server. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 * @param action Current action handler. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 */ |
15822 | 235 static void ggp_action_buddylist_delete(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 { |
15822 | 237 PurpleConnection *gc = (PurpleConnection *)action->context; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 |
15822 | 240 purple_debug_info("gg", "Deleting...\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 gg_userlist_request(info->session, GG_USERLIST_PUT, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 |
21321
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
245 static void ggp_callback_buddylist_save_ok(PurpleConnection *gc, const char *filename) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 { |
15822 | 247 PurpleAccount *account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 char *buddylist = ggp_buddylist_dump(account); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 |
15822 | 251 purple_debug_info("gg", "Saving...\n"); |
21321
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
252 purple_debug_info("gg", "file = %s\n", filename); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 if (buddylist == NULL) { |
15822 | 255 purple_notify_info(account, _("Save Buddylist..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 _("Your buddylist is empty, nothing was written to the file."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 |
21321
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
261 if(purple_util_write_data_to_file_absolute(filename, buddylist, -1)) { |
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
262 purple_notify_info(account, _("Save Buddylist..."), |
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
263 _("Buddylist saved successfully!"), NULL); |
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
264 } else { |
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
265 gchar *primary = g_strdup_printf( |
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
266 _("Couldn't write buddy list for %s to %s"), |
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
267 purple_account_get_username(account), filename); |
21322
93e9e022a470
May as well use an existing string as the title for the error notification.
Will Thompson <will.thompson@collabora.co.uk>
parents:
21321
diff
changeset
|
268 purple_notify_error(account, _("Save Buddylist..."), |
21321
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
269 primary, NULL); |
12d6b551fb6a
Actually properly fix this gg "write my buddy list to a file" callback by just
Will Thompson <will.thompson@collabora.co.uk>
parents:
21316
diff
changeset
|
270 g_free(primary); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 g_free(buddylist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 |
15822 | 276 static void ggp_callback_buddylist_load_ok(PurpleConnection *gc, gchar *file) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 { |
15822 | 278 PurpleAccount *account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 GError *error = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 char *buddylist = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 gsize length; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 |
15822 | 283 purple_debug_info("gg", "file_name = %s\n", file); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 if (!g_file_get_contents(file, &buddylist, &length, &error)) { |
15822 | 286 purple_notify_error(account, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 _("Couldn't load buddylist"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 _("Couldn't load buddylist"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 error->message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 |
15822 | 291 purple_debug_error("gg", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 "Couldn't load buddylist. file = %s; error = %s\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 file, error->message); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 g_error_free(error); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 ggp_buddylist_load(gc, buddylist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 g_free(buddylist); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 |
15822 | 303 purple_notify_info(account, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 _("Load Buddylist..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 _("Buddylist loaded successfully!"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 /* }}} */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 */ |
15822 | 311 /* static void ggp_action_buddylist_save(PurplePluginAction *action) {{{ */ |
312 static void ggp_action_buddylist_save(PurplePluginAction *action) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 { |
15822 | 314 PurpleConnection *gc = (PurpleConnection *)action->context; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
316 purple_request_file(action, _("Save buddylist..."), NULL, TRUE, |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
317 G_CALLBACK(ggp_callback_buddylist_save_ok), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
318 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
319 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 |
15822 | 322 static void ggp_action_buddylist_load(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 { |
15822 | 324 PurpleConnection *gc = (PurpleConnection *)action->context; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 |
23238
7981a140d81a
Mark a string as translatable in prpl-gg. References #5693.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23180
diff
changeset
|
326 purple_request_file(action, _("Load buddylist from file..."), NULL, |
7981a140d81a
Mark a string as translatable in prpl-gg. References #5693.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23180
diff
changeset
|
327 FALSE, |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
328 G_CALLBACK(ggp_callback_buddylist_load_ok), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
329 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
330 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 |
15822 | 333 static void ggp_callback_register_account_ok(PurpleConnection *gc, |
334 PurpleRequestFields *fields) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 { |
15822 | 336 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 struct gg_http *h = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 struct gg_pubdir *s; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 uin_t uin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 gchar *email, *p1, *p2, *t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 GGPToken *token = info->token; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 |
15822 | 344 email = charset_convert(purple_request_fields_get_string(fields, "email"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 "UTF-8", "CP1250"); |
15822 | 346 p1 = charset_convert(purple_request_fields_get_string(fields, "password1"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 "UTF-8", "CP1250"); |
15822 | 348 p2 = charset_convert(purple_request_fields_get_string(fields, "password2"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 "UTF-8", "CP1250"); |
15822 | 350 t = charset_convert(purple_request_fields_get_string(fields, "token"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 |
15822 | 353 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 if (email == NULL || p1 == NULL || p2 == NULL || t == NULL || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 *email == '\0' || *p1 == '\0' || *p2 == '\0' || *t == '\0') { |
21358 | 357 purple_connection_error_reason (gc, |
358 PURPLE_CONNECTION_ERROR_OTHER_ERROR, | |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
359 _("You must fill in all registration fields")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
363 if (g_utf8_collate(p1, p2) != 0) { |
20109
94062344397c
Modify gadu-gadu to use purple_connection_error_reason. I'm not sure about
Will Thompson <will.thompson@collabora.co.uk>
parents:
19697
diff
changeset
|
364 purple_connection_error_reason (gc, |
21358 | 365 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
366 _("Passwords do not match")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 |
22486
3225c99785b8
Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <mark@kingant.net>
parents:
22410
diff
changeset
|
370 purple_debug_info("gg", "register_account_ok: token_id = %s; t = %s\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
371 token->id, t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 h = gg_register3(email, p1, token->id, t, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
373 if (h == NULL || !(s = h->data) || !s->success) { |
21358 | 374 purple_connection_error_reason (gc, |
375 PURPLE_CONNECTION_ERROR_OTHER_ERROR, | |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
376 _("Unable to register new account. An unknown error occurred.")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
377 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
378 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
380 uin = s->uin; |
15822 | 381 purple_debug_info("gg", "registered uin: %d\n", uin); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
382 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
383 g_free(t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
384 t = g_strdup_printf("%u", uin); |
15822 | 385 purple_account_set_username(account, t); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 /* Save the password if remembering passwords for the account */ |
15822 | 387 purple_account_set_password(account, p1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
388 |
15822 | 389 purple_notify_info(NULL, _("New Gadu-Gadu Account Registered"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
390 _("Registration completed successfully!"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 |
18923
708a8b97ba87
Gadu-Gadu now calls the registration_cb for the account if it is set after performing a registration
Evan Schoenberg <evan.s@dreskin.net>
parents:
18445
diff
changeset
|
392 if(account->registration_cb) |
708a8b97ba87
Gadu-Gadu now calls the registration_cb for the account if it is set after performing a registration
Evan Schoenberg <evan.s@dreskin.net>
parents:
18445
diff
changeset
|
393 (account->registration_cb)(account, TRUE, account->registration_cb_user_data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
394 /* TODO: the currently open Accounts Window will not be updated withthe |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 * new username and etc, we need to somehow have it refresh at this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
396 * point |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
397 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
398 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
399 /* Need to disconnect or actually log in. For now, we disconnect. */ |
24350
8282911d5e17
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@wiktel.com>
parents:
23896
diff
changeset
|
400 purple_account_disconnect(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
401 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
402 exit_err: |
18923
708a8b97ba87
Gadu-Gadu now calls the registration_cb for the account if it is set after performing a registration
Evan Schoenberg <evan.s@dreskin.net>
parents:
18445
diff
changeset
|
403 if(account->registration_cb) |
708a8b97ba87
Gadu-Gadu now calls the registration_cb for the account if it is set after performing a registration
Evan Schoenberg <evan.s@dreskin.net>
parents:
18445
diff
changeset
|
404 (account->registration_cb)(account, FALSE, account->registration_cb_user_data); |
708a8b97ba87
Gadu-Gadu now calls the registration_cb for the account if it is set after performing a registration
Evan Schoenberg <evan.s@dreskin.net>
parents:
18445
diff
changeset
|
405 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
406 gg_register_free(h); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
407 g_free(email); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 g_free(p1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 g_free(p2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
410 g_free(t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 g_free(token->id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
412 g_free(token); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
414 |
15822 | 415 static void ggp_callback_register_account_cancel(PurpleConnection *gc, |
416 PurpleRequestFields *fields) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 GGPToken *token = info->token; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 |
24350
8282911d5e17
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@wiktel.com>
parents:
23896
diff
changeset
|
421 purple_account_disconnect(gc->account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 g_free(token->id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
424 g_free(token->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
425 g_free(token); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
426 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
427 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
428 |
15822 | 429 static void ggp_register_user_dialog(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
430 { |
15822 | 431 PurpleAccount *account; |
432 PurpleRequestFields *fields; | |
433 PurpleRequestFieldGroup *group; | |
434 PurpleRequestField *field; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
435 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
436 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
437 GGPToken *token = info->token; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
439 |
15822 | 440 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
441 |
15822 | 442 fields = purple_request_fields_new(); |
443 group = purple_request_field_group_new(NULL); | |
444 purple_request_fields_add_group(fields, group); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
445 |
15822 | 446 field = purple_request_field_string_new("email", |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23152
diff
changeset
|
447 _("Email"), "", FALSE); |
15822 | 448 purple_request_field_string_set_masked(field, FALSE); |
449 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 |
15822 | 451 field = purple_request_field_string_new("password1", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 _("Password"), "", FALSE); |
15822 | 453 purple_request_field_string_set_masked(field, TRUE); |
454 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 |
15822 | 456 field = purple_request_field_string_new("password2", |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
457 _("Password (again)"), "", FALSE); |
15822 | 458 purple_request_field_string_set_masked(field, TRUE); |
459 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 |
15822 | 461 field = purple_request_field_string_new("token", |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
462 _("Enter captcha text"), "", FALSE); |
15822 | 463 purple_request_field_string_set_masked(field, FALSE); |
464 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 /* original size: 60x24 */ |
15822 | 467 field = purple_request_field_image_new("token_img", |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
468 _("Captcha"), token->data, token->size); |
15822 | 469 purple_request_field_group_add_field(group, field); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
471 purple_request_fields(account, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 _("Register New Gadu-Gadu Account"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 _("Register New Gadu-Gadu Account"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 _("Please, fill in the following fields"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 fields, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 _("OK"), G_CALLBACK(ggp_callback_register_account_ok), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 _("Cancel"), G_CALLBACK(ggp_callback_register_account_cancel), |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
478 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
479 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 /* ----- PUBLIC DIRECTORY SEARCH ---------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
483 |
15822 | 484 static void ggp_callback_show_next(PurpleConnection *gc, GList *row, gpointer user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
487 GGPSearchForm *form = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 guint32 seq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
489 |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
490 form->page_number++; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 ggp_search_remove(info->searches, form->seq); |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
493 purple_debug_info("gg", "ggp_callback_show_next(): Removed seq %u\n", |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
494 form->seq); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 seq = ggp_search_start(gc, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 ggp_search_add(info->searches, seq, form); |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
498 purple_debug_info("gg", "ggp_callback_show_next(): Added seq %u\n", |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
499 seq); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 |
15822 | 502 static void ggp_callback_add_buddy(PurpleConnection *gc, GList *row, gpointer user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 { |
15822 | 504 purple_blist_request_add_buddy(purple_connection_get_account(gc), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 g_list_nth_data(row, 0), NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 |
15822 | 508 static void ggp_callback_im(PurpleConnection *gc, GList *row, gpointer user_data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 { |
15822 | 510 PurpleAccount *account; |
511 PurpleConversation *conv; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 |
15822 | 514 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 name = g_list_nth_data(row, 0); |
15822 | 517 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); |
518 purple_conversation_present(conv); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 |
15822 | 521 static void ggp_callback_find_buddies(PurpleConnection *gc, PurpleRequestFields *fields) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 GGPSearchForm *form; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 guint32 seq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 form = ggp_search_form_new(GGP_SEARCH_TYPE_FULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 form->user_data = info; |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
530 form->lastname = g_strdup( |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
531 purple_request_fields_get_string(fields, "lastname")); |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
532 form->firstname = g_strdup( |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
533 purple_request_fields_get_string(fields, "firstname")); |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
534 form->nickname = g_strdup( |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
535 purple_request_fields_get_string(fields, "nickname")); |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
536 form->city = g_strdup( |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
537 purple_request_fields_get_string(fields, "city")); |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
538 form->birthyear = g_strdup( |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
539 purple_request_fields_get_string(fields, "year")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 |
15822 | 541 switch (purple_request_fields_get_choice(fields, "gender")) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
542 case 1: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
543 form->gender = g_strdup(GG_PUBDIR50_GENDER_MALE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
545 case 2: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 form->gender = g_strdup(GG_PUBDIR50_GENDER_FEMALE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 form->gender = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 |
15822 | 553 form->active = purple_request_fields_get_bool(fields, "active") |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 ? g_strdup(GG_PUBDIR50_ACTIVE_TRUE) : NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 seq = ggp_search_start(gc, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 ggp_search_add(info->searches, seq, form); |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
558 purple_debug_info("gg", "ggp_callback_find_buddies(): Added seq %u\n", |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
559 seq); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 |
15822 | 562 static void ggp_find_buddies(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 { |
15822 | 564 PurpleConnection *gc = (PurpleConnection *)action->context; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 |
15822 | 566 PurpleRequestFields *fields; |
567 PurpleRequestFieldGroup *group; | |
568 PurpleRequestField *field; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 |
15822 | 570 fields = purple_request_fields_new(); |
571 group = purple_request_field_group_new(NULL); | |
572 purple_request_fields_add_group(fields, group); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 |
15822 | 574 field = purple_request_field_string_new("lastname", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
575 _("Last name"), NULL, FALSE); |
15822 | 576 purple_request_field_string_set_masked(field, FALSE); |
577 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 |
15822 | 579 field = purple_request_field_string_new("firstname", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 _("First name"), NULL, FALSE); |
15822 | 581 purple_request_field_string_set_masked(field, FALSE); |
582 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
583 |
15822 | 584 field = purple_request_field_string_new("nickname", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
585 _("Nickname"), NULL, FALSE); |
15822 | 586 purple_request_field_string_set_masked(field, FALSE); |
587 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 |
15822 | 589 field = purple_request_field_string_new("city", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 _("City"), NULL, FALSE); |
15822 | 591 purple_request_field_string_set_masked(field, FALSE); |
592 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
593 |
15822 | 594 field = purple_request_field_string_new("year", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 _("Year of birth"), NULL, FALSE); |
15822 | 596 purple_request_field_group_add_field(group, field); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
597 |
15822 | 598 field = purple_request_field_choice_new("gender", _("Gender"), 0); |
599 purple_request_field_choice_add(field, _("Male or female")); | |
600 purple_request_field_choice_add(field, _("Male")); | |
601 purple_request_field_choice_add(field, _("Female")); | |
602 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 |
15822 | 604 field = purple_request_field_bool_new("active", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
605 _("Only online"), FALSE); |
15822 | 606 purple_request_field_group_add_field(group, field); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
607 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
608 purple_request_fields(gc, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
609 _("Find buddies"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
610 _("Find buddies"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 _("Please, enter your search criteria below"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 fields, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 _("OK"), G_CALLBACK(ggp_callback_find_buddies), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 _("Cancel"), NULL, |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
615 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
616 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
617 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 /* ----- CHANGE PASSWORD ------------------------------------------------ */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
620 |
15822 | 621 static void ggp_callback_change_passwd_ok(PurpleConnection *gc, PurpleRequestFields *fields) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
622 { |
15822 | 623 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
624 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 struct gg_http *h; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
626 gchar *cur, *p1, *p2, *t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
627 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
628 cur = charset_convert( |
15822 | 629 purple_request_fields_get_string(fields, "password_cur"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
630 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 p1 = charset_convert( |
15822 | 632 purple_request_fields_get_string(fields, "password1"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
634 p2 = charset_convert( |
15822 | 635 purple_request_fields_get_string(fields, "password2"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 t = charset_convert( |
15822 | 638 purple_request_fields_get_string(fields, "token"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
640 |
15822 | 641 account = purple_connection_get_account(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
643 if (cur == NULL || p1 == NULL || p2 == NULL || t == NULL || |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 *cur == '\0' || *p1 == '\0' || *p2 == '\0' || *t == '\0') { |
15822 | 645 purple_notify_error(account, NULL, _("Fill in the fields."), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 if (g_utf8_collate(p1, p2) != 0) { |
15822 | 650 purple_notify_error(account, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 _("New passwords do not match."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 |
15822 | 655 if (g_utf8_collate(cur, purple_account_get_password(account)) != 0) { |
656 purple_notify_error(account, NULL, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 _("Your current password is different from the one that you specified."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
660 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
661 |
15822 | 662 purple_debug_info("gg", "Changing password\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23152
diff
changeset
|
664 /* XXX: this email should be a pref... */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 h = gg_change_passwd4(ggp_get_uin(account), |
15822 | 666 "user@example.net", purple_account_get_password(account), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
667 p1, info->token->id, t, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
669 if (h == NULL) { |
15822 | 670 purple_notify_error(account, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 _("Unable to change password. Error occurred.\n"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
674 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 |
15822 | 676 purple_account_set_password(account, p1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 gg_change_passwd_free(h); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 |
15822 | 680 purple_notify_info(account, _("Change password for the Gadu-Gadu account"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 _("Password was changed successfully!"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
683 exit_err: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
684 g_free(cur); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
685 g_free(p1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 g_free(p2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
687 g_free(t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 g_free(info->token->id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
689 g_free(info->token->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 g_free(info->token); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
691 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
692 |
15822 | 693 static void ggp_change_passwd_dialog(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
694 { |
15822 | 695 PurpleRequestFields *fields; |
696 PurpleRequestFieldGroup *group; | |
697 PurpleRequestField *field; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
700 GGPToken *token = info->token; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
701 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 |
15822 | 705 fields = purple_request_fields_new(); |
706 group = purple_request_field_group_new(NULL); | |
707 purple_request_fields_add_group(fields, group); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 |
15822 | 709 field = purple_request_field_string_new("password_cur", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 _("Current password"), "", FALSE); |
15822 | 711 purple_request_field_string_set_masked(field, TRUE); |
712 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 |
15822 | 714 field = purple_request_field_string_new("password1", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 _("Password"), "", FALSE); |
15822 | 716 purple_request_field_string_set_masked(field, TRUE); |
717 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 |
15822 | 719 field = purple_request_field_string_new("password2", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 _("Password (retype)"), "", FALSE); |
15822 | 721 purple_request_field_string_set_masked(field, TRUE); |
722 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 |
15822 | 724 field = purple_request_field_string_new("token", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 _("Enter current token"), "", FALSE); |
15822 | 726 purple_request_field_string_set_masked(field, FALSE); |
727 purple_request_field_group_add_field(group, field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
728 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
729 /* original size: 60x24 */ |
15822 | 730 field = purple_request_field_image_new("token_img", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
731 _("Current token"), token->data, token->size); |
15822 | 732 purple_request_field_group_add_field(group, field); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
734 msg = g_strdup_printf("%s %d", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
735 _("Please, enter your current password and your new password for UIN: "), |
15822 | 736 ggp_get_uin(purple_connection_get_account(gc))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
737 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
738 purple_request_fields(gc, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 _("Change Gadu-Gadu Password"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
740 _("Change Gadu-Gadu Password"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
742 fields, _("OK"), G_CALLBACK(ggp_callback_change_passwd_ok), |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
743 _("Cancel"), NULL, |
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
744 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
745 gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
748 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 |
15822 | 750 static void ggp_change_passwd(PurplePluginAction *action) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
751 { |
15822 | 752 PurpleConnection *gc = (PurpleConnection *)action->context; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
754 ggp_token_request(gc, ggp_change_passwd_dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
755 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
756 |
31350
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
757 /* ----- CHANGE STATUS BROADCASTING ------------------------------------------------ */ |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
758 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
759 static void ggp_action_change_status_broadcasting_ok(PurpleConnection *gc, PurpleRequestFields *fields) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
760 { |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
761 GGPInfo *info = gc->proto_data; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
762 int selected_field; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
763 PurpleAccount *account = purple_connection_get_account(gc); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
764 PurpleStatus *status; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
765 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
766 selected_field = purple_request_fields_get_choice(fields, "status_broadcasting"); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
767 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
768 if (selected_field == 0) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
769 info->status_broadcasting = TRUE; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
770 else |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
771 info->status_broadcasting = FALSE; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
772 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
773 status = purple_account_get_active_status(account); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
774 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
775 ggp_set_status(account, status); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
776 } |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
777 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
778 static void ggp_action_change_status_broadcasting(PurplePluginAction *action) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
779 { |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
780 PurpleConnection *gc = (PurpleConnection *)action->context; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
781 GGPInfo *info = gc->proto_data; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
782 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
783 PurpleRequestFields *fields; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
784 PurpleRequestFieldGroup *group; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
785 PurpleRequestField *field; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
786 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
787 fields = purple_request_fields_new(); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
788 group = purple_request_field_group_new(NULL); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
789 purple_request_fields_add_group(fields, group); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
790 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
791 field = purple_request_field_choice_new("status_broadcasting", _("Show status to:"), 0); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
792 purple_request_field_choice_add(field, _("All people")); |
31351
e31163acae07
Make terminology more consistent with the rest of our strings. Refs #13358.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31350
diff
changeset
|
793 purple_request_field_choice_add(field, _("Only buddies")); |
31350
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
794 purple_request_field_group_add_field(group, field); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
795 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
796 if (info->status_broadcasting) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
797 purple_request_field_choice_set_default_value(field, 0); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
798 else |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
799 purple_request_field_choice_set_default_value(field, 1); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
800 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
801 purple_request_fields(gc, |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
802 _("Change status broadcasting"), |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
803 _("Change status broadcasting"), |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
804 _("Please, select who can see your status"), |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
805 fields, |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
806 _("OK"), G_CALLBACK(ggp_action_change_status_broadcasting_ok), |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
807 _("Cancel"), NULL, |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
808 purple_connection_get_account(gc), NULL, NULL, |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
809 gc); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
810 } |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
811 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
812 /* ----- CONFERENCES ---------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
813 |
25323
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
814 static void ggp_callback_add_to_chat_ok(PurpleBuddy *buddy, PurpleRequestFields *fields) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
815 { |
25323
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
816 PurpleConnection *conn; |
15822 | 817 PurpleRequestField *field; |
18118
ab6d2763b8d8
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents:
17377
diff
changeset
|
818 GList *sel; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
819 |
25323
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
820 conn = purple_account_get_connection(purple_buddy_get_account(buddy)); |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
821 |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
822 g_return_if_fail(conn != NULL); |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
823 |
15822 | 824 field = purple_request_fields_get_field(fields, "name"); |
825 sel = purple_request_field_list_get_selected(field); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 |
25323
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
827 if (sel == NULL) { |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
828 purple_debug_error("gg", "No chat selected\n"); |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
829 return; |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
830 } |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
831 |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
832 ggp_confer_participants_add_uin(conn, sel->data, |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
833 ggp_str_to_uin(purple_buddy_get_name(buddy))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 |
15822 | 836 static void ggp_bmenu_add_to_chat(PurpleBlistNode *node, gpointer ignored) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 { |
15822 | 838 PurpleBuddy *buddy; |
839 PurpleConnection *gc; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 GGPInfo *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 |
15822 | 842 PurpleRequestFields *fields; |
843 PurpleRequestFieldGroup *group; | |
844 PurpleRequestField *field; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
847 gchar *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 |
15822 | 849 buddy = (PurpleBuddy *)node; |
850 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 |
15822 | 853 fields = purple_request_fields_new(); |
854 group = purple_request_field_group_new(NULL); | |
855 purple_request_fields_add_group(fields, group); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 |
15822 | 857 field = purple_request_field_list_new("name", "Chat name"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
858 for (l = info->chats; l != NULL; l = l->next) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 GGPChat *chat = l->data; |
25323
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
860 purple_request_field_list_add(field, chat->name, chat->name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 } |
15822 | 862 purple_request_field_group_add_field(group, field); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 msg = g_strdup_printf(_("Select a chat for buddy: %s"), |
15822 | 865 purple_buddy_get_alias(buddy)); |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
866 purple_request_fields(gc, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
867 _("Add to chat..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 _("Add to chat..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
870 fields, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 _("Add"), G_CALLBACK(ggp_callback_add_to_chat_ok), |
16439
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15822
diff
changeset
|
872 _("Cancel"), NULL, |
25323
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
873 purple_connection_get_account(gc), NULL, NULL, |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
874 buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
876 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 /* ----- BLOCK BUDDIES -------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 |
31723
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
880 static void ggp_add_deny(PurpleConnection *gc, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
881 { |
31723
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
882 GGPInfo *info = gc->proto_data; |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
883 uin_t uin = ggp_str_to_uin(who); |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
884 |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
885 purple_debug_info("gg", "ggp_add_deny: %u\n", uin); |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
886 |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
887 gg_remove_notify_ex(info->session, uin, GG_USER_NORMAL); |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
888 gg_add_notify_ex(info->session, uin, GG_USER_BLOCKED); |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
889 } |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
890 |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
891 static void ggp_rem_deny(PurpleConnection *gc, const char *who) |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
892 { |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
893 GGPInfo *info = gc->proto_data; |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
894 uin_t uin = ggp_str_to_uin(who); |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
895 |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
896 purple_debug_info("gg", "ggp_rem_deny: %u\n", uin); |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
897 |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
898 gg_remove_notify_ex(info->session, uin, GG_USER_BLOCKED); |
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
899 gg_add_notify_ex(info->session, uin, GG_USER_NORMAL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
901 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 /* ----- INTERNAL CALLBACKS --------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
905 |
27164
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
906 struct gg_fetch_avatar_data |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
907 { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
908 PurpleConnection *gc; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
909 gchar *uin; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
910 gchar *avatar_url; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
911 }; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
912 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
913 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
914 static void gg_fetch_avatar_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
915 const gchar *data, size_t len, const gchar *error_message) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
916 struct gg_fetch_avatar_data *d = user_data; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
917 PurpleAccount *account; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
918 PurpleBuddy *buddy; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
919 gpointer buddy_icon_data; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
920 |
31737
e17b5aab37d0
More debugging informations when updating avatars in Gadu-Gadu
tomkiewicz@cpw.pidgin.im
parents:
31723
diff
changeset
|
921 purple_debug_info("gg", "gg_fetch_avatar_cb: got avatar image for %s\n", |
e17b5aab37d0
More debugging informations when updating avatars in Gadu-Gadu
tomkiewicz@cpw.pidgin.im
parents:
31723
diff
changeset
|
922 d->uin); |
e17b5aab37d0
More debugging informations when updating avatars in Gadu-Gadu
tomkiewicz@cpw.pidgin.im
parents:
31723
diff
changeset
|
923 |
27164
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
924 /* FIXME: This shouldn't be necessary */ |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
925 if (!PURPLE_CONNECTION_IS_VALID(d->gc)) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
926 g_free(d->uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
927 g_free(d->avatar_url); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
928 g_free(d); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
929 g_return_if_reached(); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
930 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
931 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
932 account = purple_connection_get_account(d->gc); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
933 buddy = purple_find_buddy(account, d->uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
934 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
935 if (buddy == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
936 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
937 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
938 buddy_icon_data = g_memdup(data, len); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
939 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
940 purple_buddy_icons_set_for_user(account, purple_buddy_get_name(buddy), |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
941 buddy_icon_data, len, d->avatar_url); |
31737
e17b5aab37d0
More debugging informations when updating avatars in Gadu-Gadu
tomkiewicz@cpw.pidgin.im
parents:
31723
diff
changeset
|
942 purple_debug_info("gg", "gg_fetch_avatar_cb: UIN %s should have avatar " |
e17b5aab37d0
More debugging informations when updating avatars in Gadu-Gadu
tomkiewicz@cpw.pidgin.im
parents:
31723
diff
changeset
|
943 "now\n", d->uin); |
27164
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
944 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
945 out: |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
946 g_free(d->uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
947 g_free(d->avatar_url); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
948 g_free(d); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
949 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
950 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
951 static void gg_get_avatar_url_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
952 const gchar *url_text, size_t len, const gchar *error_message) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
953 struct gg_fetch_avatar_data *data; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
954 PurpleConnection *gc = user_data; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
955 PurpleAccount *account; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
956 PurpleBuddy *buddy; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
957 const char *uin; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
958 const char *is_blank; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
959 const char *checksum; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
960 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
961 gchar *bigavatar = NULL; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
962 xmlnode *xml = NULL; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
963 xmlnode *xmlnode_users; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
964 xmlnode *xmlnode_user; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
965 xmlnode *xmlnode_avatars; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
966 xmlnode *xmlnode_avatar; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
967 xmlnode *xmlnode_bigavatar; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
968 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
969 g_return_if_fail(PURPLE_CONNECTION_IS_VALID(gc)); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
970 account = purple_connection_get_account(gc); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
971 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
972 if (error_message != NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
973 purple_debug_error("gg", "gg_get_avatars_cb error: %s\n", error_message); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
974 else if (len > 0 && url_text && *url_text) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
975 xml = xmlnode_from_str(url_text, -1); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
976 if (xml == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
977 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
978 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
979 xmlnode_users = xmlnode_get_child(xml, "users"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
980 if (xmlnode_users == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
981 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
982 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
983 xmlnode_user = xmlnode_get_child(xmlnode_users, "user"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
984 if (xmlnode_user == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
985 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
986 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
987 uin = xmlnode_get_attrib(xmlnode_user, "uin"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
988 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
989 xmlnode_avatars = xmlnode_get_child(xmlnode_user, "avatars"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
990 if (xmlnode_avatars == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
991 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
992 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
993 xmlnode_avatar = xmlnode_get_child(xmlnode_avatars, "avatar"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
994 if (xmlnode_avatar == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
995 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
996 |
28845
737b75b5a888
Fix Gadu-Gadu avatars. The server's response format has changed. Fixes #11050.
grommasher@gmail.com
parents:
27385
diff
changeset
|
997 xmlnode_bigavatar = xmlnode_get_child(xmlnode_avatar, "originBigAvatar"); |
27164
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
998 if (xmlnode_bigavatar == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
999 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1000 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1001 is_blank = xmlnode_get_attrib(xmlnode_avatar, "blank"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1002 bigavatar = xmlnode_get_data(xmlnode_bigavatar); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1003 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1004 purple_debug_info("gg", "gg_get_avatar_url_cb: UIN %s, IS_BLANK %s, " |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1005 "URL %s\n", |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1006 uin ? uin : "(null)", is_blank ? is_blank : "(null)", |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1007 bigavatar ? bigavatar : "(null)"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1008 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1009 if (uin != NULL && bigavatar != NULL) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1010 buddy = purple_find_buddy(account, uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1011 if (buddy == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1012 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1013 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1014 checksum = purple_buddy_icons_get_checksum_for_user(buddy); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1015 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1016 if (purple_strequal(is_blank, "1")) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1017 purple_buddy_icons_set_for_user(account, |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1018 purple_buddy_get_name(buddy), NULL, 0, NULL); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1019 } else if (!purple_strequal(checksum, bigavatar)) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1020 data = g_new0(struct gg_fetch_avatar_data, 1); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1021 data->gc = gc; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1022 data->uin = g_strdup(uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1023 data->avatar_url = g_strdup(bigavatar); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1024 |
31737
e17b5aab37d0
More debugging informations when updating avatars in Gadu-Gadu
tomkiewicz@cpw.pidgin.im
parents:
31723
diff
changeset
|
1025 purple_debug_info("gg", "gg_get_avatar_url_cb: " |
e17b5aab37d0
More debugging informations when updating avatars in Gadu-Gadu
tomkiewicz@cpw.pidgin.im
parents:
31723
diff
changeset
|
1026 "requesting avatar for %s\n", uin); |
27164
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1027 url_data = purple_util_fetch_url_request_len_with_account(account, |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1028 bigavatar, TRUE, "Mozilla/4.0 (compatible; MSIE 5.0)", |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1029 FALSE, NULL, FALSE, -1, gg_fetch_avatar_cb, data); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1030 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1031 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1032 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1033 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1034 out: |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1035 if (xml) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1036 xmlnode_free(xml); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1037 g_free(bigavatar); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1038 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1039 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1040 /** |
31466
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1041 * Try to update avatar of the buddy. |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1042 * |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1043 * @param gc PurpleConnection |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1044 * @param uin UIN of the buddy. |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1045 */ |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1046 static void ggp_update_buddy_avatar(PurpleConnection *gc, uin_t uin) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1047 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1048 gchar *avatarurl; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1049 PurpleUtilFetchUrlData *url_data; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1050 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1051 purple_debug_info("gg", "ggp_update_buddy_avatar(gc, %u)\n", uin); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1052 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1053 avatarurl = g_strdup_printf("http://api.gadu-gadu.pl/avatars/%u/0.xml", uin); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1054 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1055 url_data = purple_util_fetch_url_request_len_with_account( |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1056 purple_connection_get_account(gc), avatarurl, TRUE, |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1057 "Mozilla/4.0 (compatible; MSIE 5.5)", FALSE, NULL, FALSE, -1, |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1058 gg_get_avatar_url_cb, gc); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1059 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1060 g_free(avatarurl); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1061 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1062 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1063 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1064 * Handle change of the status of the buddy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1065 * |
15822 | 1066 * @param gc PurpleConnection |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1067 * @param uin UIN of the buddy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1068 * @param status ID of the status. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1069 * @param descr Description. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1070 */ |
15822 | 1071 static void ggp_generic_status_handler(PurpleConnection *gc, uin_t uin, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1072 int status, const char *descr) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1073 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1074 gchar *from; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1075 const char *st; |
31681
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1076 char *status_msg = NULL; |
31466
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1077 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1078 ggp_update_buddy_avatar(gc, uin); |
27164
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1079 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1080 from = g_strdup_printf("%u", uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27147
diff
changeset
|
1081 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1082 switch (status) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1083 case GG_STATUS_NOT_AVAIL: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1084 case GG_STATUS_NOT_AVAIL_DESCR: |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1085 st = purple_primitive_get_id_from_type(PURPLE_STATUS_OFFLINE); |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1086 break; |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1087 case GG_STATUS_FFC: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1088 case GG_STATUS_FFC_DESCR: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1089 st = purple_primitive_get_id_from_type(PURPLE_STATUS_AVAILABLE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1090 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1091 case GG_STATUS_AVAIL: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1092 case GG_STATUS_AVAIL_DESCR: |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1093 st = purple_primitive_get_id_from_type(PURPLE_STATUS_AVAILABLE); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1094 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1095 case GG_STATUS_BUSY: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1096 case GG_STATUS_BUSY_DESCR: |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1097 st = purple_primitive_get_id_from_type(PURPLE_STATUS_AWAY); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1098 break; |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1099 case GG_STATUS_DND: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1100 case GG_STATUS_DND_DESCR: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1101 st = purple_primitive_get_id_from_type(PURPLE_STATUS_UNAVAILABLE); |
29771 | 1102 break; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1103 case GG_STATUS_BLOCKED: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1104 /* user is blocking us.... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1105 st = "blocked"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1106 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1107 default: |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1108 st = purple_primitive_get_id_from_type(PURPLE_STATUS_AVAILABLE); |
15822 | 1109 purple_debug_info("gg", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1110 "GG_EVENT_NOTIFY: Unknown status: %d\n", status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1111 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1112 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1113 |
31681
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1114 if (descr != NULL) { |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1115 status_msg = g_strdup(descr); |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1116 g_strstrip(status_msg); |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1117 if (status_msg[0] == '\0') { |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1118 g_free(status_msg); |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1119 status_msg = NULL; |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1120 } |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1121 } |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1122 |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1123 purple_debug_info("gg", "status of %u is %s [%s]\n", uin, st, |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1124 status_msg ? status_msg : ""); |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1125 if (status_msg == NULL) { |
29722
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29544
diff
changeset
|
1126 purple_prpl_got_user_status(purple_connection_get_account(gc), |
31681
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1127 from, st, NULL); |
29722
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29544
diff
changeset
|
1128 } else { |
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29544
diff
changeset
|
1129 purple_prpl_got_user_status(purple_connection_get_account(gc), |
31681
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1130 from, st, "message", status_msg, NULL); |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1131 g_free(status_msg); |
29722
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29544
diff
changeset
|
1132 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1133 g_free(from); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1134 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1135 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1136 static void ggp_sr_close_cb(gpointer user_data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1137 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 GGPSearchForm *form = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1139 GGPInfo *info = form->user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1140 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1141 ggp_search_remove(info->searches, form->seq); |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1142 purple_debug_info("gg", "ggp_sr_close_cb(): Removed seq %u\n", |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1143 form->seq); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1144 ggp_search_form_destroy(form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1145 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1146 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1147 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1148 * Translate a status' ID to a more user-friendly name. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1149 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 * @param id The ID of the status. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1151 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1152 * @return The user-friendly name of the status. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1153 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1154 static const char *ggp_status_by_id(unsigned int id) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1155 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 const char *st; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1157 |
15822 | 1158 purple_debug_info("gg", "ggp_status_by_id: %d\n", id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1159 switch (id) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1160 case GG_STATUS_NOT_AVAIL: |
27147
ef9e68020265
Correctly show status in tooltips for GG contacts with status messages.
grommasher@gmail.com
parents:
27036
diff
changeset
|
1161 case GG_STATUS_NOT_AVAIL_DESCR: |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1162 st = _("Offline"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1163 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1164 case GG_STATUS_AVAIL: |
27147
ef9e68020265
Correctly show status in tooltips for GG contacts with status messages.
grommasher@gmail.com
parents:
27036
diff
changeset
|
1165 case GG_STATUS_AVAIL_DESCR: |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1166 st = _("Available"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1167 break; |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1168 case GG_STATUS_FFC: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1169 case GG_STATUS_FFC_DESCR: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1170 return _("Chatty"); |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1171 case GG_STATUS_DND: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1172 case GG_STATUS_DND_DESCR: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1173 return _("Do Not Disturb"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 case GG_STATUS_BUSY: |
27147
ef9e68020265
Correctly show status in tooltips for GG contacts with status messages.
grommasher@gmail.com
parents:
27036
diff
changeset
|
1175 case GG_STATUS_BUSY_DESCR: |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 st = _("Away"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1177 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1178 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1179 st = _("Unknown"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1180 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1182 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1183 return st; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1184 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 |
15822 | 1186 static void ggp_pubdir_handle_info(PurpleConnection *gc, gg_pubdir50_t req, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 GGPSearchForm *form) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 { |
15822 | 1189 PurpleNotifyUserInfo *user_info; |
1190 PurpleBuddy *buddy; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1191 char *val, *who; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 |
15822 | 1193 user_info = purple_notify_user_info_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1194 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1195 val = ggp_search_get_result(req, 0, GG_PUBDIR50_STATUS); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 /* XXX: Use of ggp_str_to_uin() is an ugly hack! */ |
15822 | 1197 purple_notify_user_info_add_pair(user_info, _("Status"), ggp_status_by_id(ggp_str_to_uin(val))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1198 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 who = ggp_search_get_result(req, 0, GG_PUBDIR50_UIN); |
15822 | 1201 purple_notify_user_info_add_pair(user_info, _("UIN"), who); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1202 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 val = ggp_search_get_result(req, 0, GG_PUBDIR50_FIRSTNAME); |
15822 | 1204 purple_notify_user_info_add_pair(user_info, _("First Name"), val); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1207 val = ggp_search_get_result(req, 0, GG_PUBDIR50_NICKNAME); |
15822 | 1208 purple_notify_user_info_add_pair(user_info, _("Nickname"), val); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1209 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1210 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1211 val = ggp_search_get_result(req, 0, GG_PUBDIR50_CITY); |
15822 | 1212 purple_notify_user_info_add_pair(user_info, _("City"), val); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1213 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1214 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1215 val = ggp_search_get_result(req, 0, GG_PUBDIR50_BIRTHYEAR); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 if (strncmp(val, "0", 1)) { |
15822 | 1217 purple_notify_user_info_add_pair(user_info, _("Birth Year"), val); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1218 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1219 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1220 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1221 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1222 * Include a status message, if exists and buddy is in the blist. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1223 */ |
15822 | 1224 buddy = purple_find_buddy(purple_connection_get_account(gc), who); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1225 if (NULL != buddy) { |
15822 | 1226 PurpleStatus *status; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1227 const char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 char *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1229 |
15822 | 1230 status = purple_presence_get_active_status(purple_buddy_get_presence(buddy)); |
1231 msg = purple_status_get_attr_string(status, "message"); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1232 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1233 if (msg != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1234 text = g_markup_escape_text(msg, -1); |
15822 | 1235 purple_notify_user_info_add_pair(user_info, _("Message"), text); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1236 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1238 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1239 |
18445
ac7b380daa0a
Close temporary Get Info window when showing the real one. Fixes #1720.
Bartoz Oler <bartosz@pidgin.im>
parents:
18118
diff
changeset
|
1240 purple_notify_userinfo(gc, who, user_info, ggp_sr_close_cb, form); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 g_free(who); |
15822 | 1242 purple_notify_user_info_destroy(user_info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1243 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 |
15822 | 1245 static void ggp_pubdir_handle_full(PurpleConnection *gc, gg_pubdir50_t req, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1246 GGPSearchForm *form) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1247 { |
15822 | 1248 PurpleNotifySearchResults *results; |
1249 PurpleNotifySearchColumn *column; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 int res_count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 int start; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 g_return_if_fail(form != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1256 res_count = gg_pubdir50_count(req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 res_count = (res_count > PUBDIR_RESULTS_MAX) ? PUBDIR_RESULTS_MAX : res_count; |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1258 if (form->page_size == 0) |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1259 form->page_size = res_count; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 |
15822 | 1261 results = purple_notify_searchresults_new(); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 if (results == NULL) { |
15822 | 1264 purple_debug_error("gg", "ggp_pubdir_reply_handler: " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 "Unable to display the search results.\n"); |
15822 | 1266 purple_notify_error(gc, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 _("Unable to display the search results."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 NULL); |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1269 if (form->window == NULL) |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1270 ggp_sr_close_cb(form); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 |
15822 | 1274 column = purple_notify_searchresults_column_new(_("UIN")); |
1275 purple_notify_searchresults_column_add(results, column); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 |
15822 | 1277 column = purple_notify_searchresults_column_new(_("First Name")); |
1278 purple_notify_searchresults_column_add(results, column); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 |
15822 | 1280 column = purple_notify_searchresults_column_new(_("Nickname")); |
1281 purple_notify_searchresults_column_add(results, column); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 |
15822 | 1283 column = purple_notify_searchresults_column_new(_("City")); |
1284 purple_notify_searchresults_column_add(results, column); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 |
15822 | 1286 column = purple_notify_searchresults_column_new(_("Birth Year")); |
1287 purple_notify_searchresults_column_add(results, column); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 |
15822 | 1289 purple_debug_info("gg", "Going with %d entries\n", res_count); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1290 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 start = (int)ggp_str_to_uin(gg_pubdir50_get(req, 0, GG_PUBDIR50_START)); |
15822 | 1292 purple_debug_info("gg", "start = %d\n", start); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1294 for (i = 0; i < res_count; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 GList *row = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1296 char *birth = ggp_search_get_result(req, i, GG_PUBDIR50_BIRTHYEAR); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1298 /* TODO: Status will be displayed as an icon. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1299 /* row = g_list_append(row, ggp_search_get_result(req, i, GG_PUBDIR50_STATUS)); */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 row = g_list_append(row, ggp_search_get_result(req, i, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1301 GG_PUBDIR50_UIN)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1302 row = g_list_append(row, ggp_search_get_result(req, i, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 GG_PUBDIR50_FIRSTNAME)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 row = g_list_append(row, ggp_search_get_result(req, i, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 GG_PUBDIR50_NICKNAME)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 row = g_list_append(row, ggp_search_get_result(req, i, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 GG_PUBDIR50_CITY)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 row = g_list_append(row, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 (birth && strncmp(birth, "0", 1)) ? birth : g_strdup("-")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1310 |
15822 | 1311 purple_notify_searchresults_row_add(results, row); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1312 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 |
15822 | 1314 purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_CONTINUE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1315 ggp_callback_show_next); |
15822 | 1316 purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_ADD, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 ggp_callback_add_buddy); |
15822 | 1318 purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_IM, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 ggp_callback_im); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1321 if (form->window == NULL) { |
15822 | 1322 void *h = purple_notify_searchresults(gc, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 _("Gadu-Gadu Public Directory"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 _("Search results"), NULL, results, |
15822 | 1325 (PurpleNotifyCloseCallback)ggp_sr_close_cb, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 if (h == NULL) { |
15822 | 1329 purple_debug_error("gg", "ggp_pubdir_reply_handler: " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 "Unable to display the search results.\n"); |
15822 | 1331 purple_notify_error(gc, NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 _("Unable to display the search results."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 form->window = h; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 } else { |
15822 | 1339 purple_notify_searchresults_new_rows(gc, results, form->window); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1340 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 |
15822 | 1343 static void ggp_pubdir_reply_handler(PurpleConnection *gc, gg_pubdir50_t req) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 GGPSearchForm *form; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 int res_count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 guint32 seq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 seq = gg_pubdir50_seq(req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 form = ggp_search_get(info->searches, seq); |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1352 purple_debug_info("gg", |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1353 "ggp_pubdir_reply_handler(): seq %u --> form %p\n", seq, form); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 * this can happen when user will request more results |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 * and close the results window before they arrive. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1357 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 g_return_if_fail(form != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 res_count = gg_pubdir50_count(req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 if (res_count < 1) { |
15822 | 1362 purple_debug_info("gg", "GG_EVENT_PUBDIR50_SEARCH_REPLY: Nothing found\n"); |
1363 purple_notify_error(gc, NULL, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 _("No matching users found"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 _("There are no users matching your search criteria.")); |
31670
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1366 if (form->window == NULL) |
34404b2719c5
Fixed searching for buddies in Gadu-Gadu public directory. Fixes #5242
tomkiewicz@cpw.pidgin.im
parents:
31663
diff
changeset
|
1367 ggp_sr_close_cb(form); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 switch (form->search_type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 case GGP_SEARCH_TYPE_INFO: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1373 ggp_pubdir_handle_info(gc, req, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1374 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1375 case GGP_SEARCH_TYPE_FULL: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 ggp_pubdir_handle_full(gc, req, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1378 default: |
15822 | 1379 purple_debug_warning("gg", "Unknown search_type!\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1380 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1384 static void ggp_recv_image_handler(PurpleConnection *gc, const struct gg_event *ev) |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1385 { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1386 gint imgid = 0; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1387 GGPInfo *info = gc->proto_data; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1388 GList *entry = g_list_first(info->pending_richtext_messages); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1389 gchar *handlerid = g_strdup_printf("IMGID_HANDLER-%i", ev->event.image_reply.crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1390 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1391 imgid = purple_imgstore_add_with_id( |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1392 g_memdup(ev->event.image_reply.image, ev->event.image_reply.size), |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1393 ev->event.image_reply.size, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1394 ev->event.image_reply.filename); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1395 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1396 purple_debug_info("gg", "ggp_recv_image_handler: got image with crc32: %u\n", ev->event.image_reply.crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1397 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1398 while(entry) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1399 if (strstr((gchar *)entry->data, handlerid) != NULL) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1400 gchar **split = g_strsplit((gchar *)entry->data, handlerid, 3); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1401 gchar *text = g_strdup_printf("%s%i%s", split[0], imgid, split[1]); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1402 purple_debug_info("gg", "ggp_recv_image_handler: found message matching crc32: %s\n", (gchar *)entry->data); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1403 g_strfreev(split); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1404 info->pending_richtext_messages = g_list_remove(info->pending_richtext_messages, entry->data); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1405 /* We don't have any more images to download */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1406 if (strstr(text, "<IMG ID=\"IMGID_HANDLER") == NULL) { |
31464 | 1407 gchar *buf = g_strdup_printf("%lu", (unsigned long int)ev->event.image_reply.sender); |
1408 serv_got_im(gc, buf, text, PURPLE_MESSAGE_IMAGES, time(NULL)); | |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1409 g_free(buf); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1410 purple_debug_info("gg", "ggp_recv_image_handler: richtext message: %s\n", text); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1411 g_free(text); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1412 break; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1413 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1414 info->pending_richtext_messages = g_list_append(info->pending_richtext_messages, text); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1415 break; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1416 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1417 entry = g_list_next(entry); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1418 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1419 g_free(handlerid); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1420 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1421 return; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1422 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1423 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1424 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1425 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 * Dispatch a message received from a buddy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1427 * |
15822 | 1428 * @param gc PurpleConnection. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 * @param ev Gadu-Gadu event structure. |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1430 * |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1431 * Image receiving, some code borrowed from Kadu http://www.kadu.net |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 */ |
15822 | 1433 static void ggp_recv_message_handler(PurpleConnection *gc, const struct gg_event *ev) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1434 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1435 GGPInfo *info = gc->proto_data; |
15822 | 1436 PurpleConversation *conv; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1437 gchar *from; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1438 gchar *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1439 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1440 |
31412
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31397
diff
changeset
|
1441 if (ev->event.msg.message == NULL) |
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31397
diff
changeset
|
1442 { |
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31397
diff
changeset
|
1443 purple_debug_warning("gg", "ggp_recv_message_handler: NULL as message pointer\n"); |
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31397
diff
changeset
|
1444 return; |
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31397
diff
changeset
|
1445 } |
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31397
diff
changeset
|
1446 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1447 from = g_strdup_printf("%lu", (unsigned long int)ev->event.msg.sender); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1448 |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1449 /* |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1450 tmp = charset_convert((const char *)ev->event.msg.message, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1451 "CP1250", "UTF-8"); |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1452 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1453 tmp = g_strdup_printf("%s", ev->event.msg.message); |
15822 | 1454 purple_str_strip_char(tmp, '\r'); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1455 msg = g_markup_escape_text(tmp, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1456 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1457 |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1458 /* We got richtext message */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1459 if (ev->event.msg.formats_length) |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1460 { |
24484
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
1461 gboolean got_image = FALSE, bold = FALSE, italic = FALSE, under = FALSE; |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1462 char *cformats = (char *)ev->event.msg.formats; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1463 char *cformats_end = cformats + ev->event.msg.formats_length; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1464 gint increased_len = 0; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1465 struct gg_msg_richtext_format *actformat; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1466 struct gg_msg_richtext_image *actimage; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1467 GString *message = g_string_new(msg); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1468 gchar *handlerid; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1469 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1470 purple_debug_info("gg", "ggp_recv_message_handler: richtext msg from (%s): %s %i formats\n", from, msg, ev->event.msg.formats_length); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1471 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1472 while (cformats < cformats_end) |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1473 { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1474 gint byteoffset; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1475 actformat = (struct gg_msg_richtext_format *)cformats; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1476 cformats += sizeof(struct gg_msg_richtext_format); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1477 byteoffset = g_utf8_offset_to_pointer(message->str, actformat->position + increased_len) - message->str; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1478 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1479 if(actformat->position == 0 && actformat->font == 0) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1480 purple_debug_warning("gg", "ggp_recv_message_handler: bogus formatting (inc: %i)\n", increased_len); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1481 continue; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1482 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1483 purple_debug_info("gg", "ggp_recv_message_handler: format at pos: %i, image:%i, bold:%i, italic: %i, under:%i (inc: %i)\n", |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1484 actformat->position, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1485 (actformat->font & GG_FONT_IMAGE) != 0, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1486 (actformat->font & GG_FONT_BOLD) != 0, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1487 (actformat->font & GG_FONT_ITALIC) != 0, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1488 (actformat->font & GG_FONT_UNDERLINE) != 0, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1489 increased_len); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1490 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1491 if (actformat->font & GG_FONT_IMAGE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1492 got_image = TRUE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1493 actimage = (struct gg_msg_richtext_image*)(cformats); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1494 cformats += sizeof(struct gg_msg_richtext_image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1495 purple_debug_info("gg", "ggp_recv_message_handler: image received, size: %d, crc32: %i\n", actimage->size, actimage->crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1496 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1497 /* Checking for errors, image size shouldn't be |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1498 * larger than 255.000 bytes */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1499 if (actimage->size > 255000) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1500 purple_debug_warning("gg", "ggp_recv_message_handler: received image large than 255 kb\n"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1501 continue; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1502 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1503 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1504 gg_image_request(info->session, ev->event.msg.sender, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1505 actimage->size, actimage->crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1506 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1507 handlerid = g_strdup_printf("<IMG ID=\"IMGID_HANDLER-%i\">", actimage->crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1508 g_string_insert(message, byteoffset, handlerid); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1509 increased_len += strlen(handlerid); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1510 g_free(handlerid); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1511 continue; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1512 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1513 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1514 if (actformat->font & GG_FONT_BOLD) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1515 if (bold == FALSE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1516 g_string_insert(message, byteoffset, "<b>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1517 increased_len += 3; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1518 bold = TRUE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1519 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1520 } else if (bold) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1521 g_string_insert(message, byteoffset, "</b>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1522 increased_len += 4; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1523 bold = FALSE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1524 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1525 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1526 if (actformat->font & GG_FONT_ITALIC) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1527 if (italic == FALSE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1528 g_string_insert(message, byteoffset, "<i>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1529 increased_len += 3; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1530 italic = TRUE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1531 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1532 } else if (italic) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1533 g_string_insert(message, byteoffset, "</i>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1534 increased_len += 4; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1535 italic = FALSE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1536 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1537 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1538 if (actformat->font & GG_FONT_UNDERLINE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1539 if (under == FALSE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1540 g_string_insert(message, byteoffset, "<u>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1541 increased_len += 3; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1542 under = TRUE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1543 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1544 } else if (under) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1545 g_string_insert(message, byteoffset, "</u>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1546 increased_len += 4; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1547 under = FALSE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1548 } |
31168
1607b413a139
gg: Prevent dropping whole messages when the text is colored. Fixes #13259.
quantifier666@gmail.com
parents:
31086
diff
changeset
|
1549 |
1607b413a139
gg: Prevent dropping whole messages when the text is colored. Fixes #13259.
quantifier666@gmail.com
parents:
31086
diff
changeset
|
1550 if (actformat->font & GG_FONT_COLOR) { |
1607b413a139
gg: Prevent dropping whole messages when the text is colored. Fixes #13259.
quantifier666@gmail.com
parents:
31086
diff
changeset
|
1551 cformats += sizeof(struct gg_msg_richtext_color); |
1607b413a139
gg: Prevent dropping whole messages when the text is colored. Fixes #13259.
quantifier666@gmail.com
parents:
31086
diff
changeset
|
1552 } |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1553 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1554 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1555 msg = message->str; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1556 g_string_free(message, FALSE); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1557 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1558 if (got_image) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1559 info->pending_richtext_messages = g_list_append(info->pending_richtext_messages, msg); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1560 return; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1561 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1562 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1563 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1564 purple_debug_info("gg", "ggp_recv_message_handler: msg from (%s): %s (class = %d; rcpt_count = %d)\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1565 from, msg, ev->event.msg.msgclass, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1566 ev->event.msg.recipients_count); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1567 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1568 if (ev->event.msg.recipients_count == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1569 serv_got_im(gc, from, msg, 0, ev->event.msg.time); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1570 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1571 const char *chat_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1572 int chat_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1573 char *buddy_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1574 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1575 chat_name = ggp_confer_find_by_participants(gc, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1576 ev->event.msg.recipients, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1577 ev->event.msg.recipients_count); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1578 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1579 if (chat_name == NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1580 chat_name = ggp_confer_add_new(gc, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1581 serv_got_joined_chat(gc, info->chats_count, chat_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1582 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1583 ggp_confer_participants_add_uin(gc, chat_name, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1584 ev->event.msg.sender); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1585 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1586 ggp_confer_participants_add(gc, chat_name, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1587 ev->event.msg.recipients, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1588 ev->event.msg.recipients_count); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1589 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1590 conv = ggp_confer_find_by_name(gc, chat_name); |
15822 | 1591 chat_id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1592 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1593 buddy_name = ggp_buddy_get_name(gc, ev->event.msg.sender); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1594 serv_got_chat_in(gc, chat_id, buddy_name, |
15822 | 1595 PURPLE_MESSAGE_RECV, msg, ev->event.msg.time); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1596 g_free(buddy_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1597 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1598 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1599 g_free(from); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1600 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1601 |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1602 static void ggp_send_image_handler(PurpleConnection *gc, const struct gg_event *ev) |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1603 { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1604 GGPInfo *info = gc->proto_data; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1605 PurpleStoredImage *image; |
31429
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
1606 gint imgid = GPOINTER_TO_INT(g_hash_table_lookup(info->pending_images, GINT_TO_POINTER(ev->event.image_request.crc32))); |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
1607 |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
1608 purple_debug_info("gg", "ggp_send_image_handler: image request received, crc32: %u, imgid: %d\n", ev->event.image_request.crc32, imgid); |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1609 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1610 if(imgid) |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1611 { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1612 if((image = purple_imgstore_find_by_id(imgid))) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1613 gint image_size = purple_imgstore_get_size(image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1614 gconstpointer image_bin = purple_imgstore_get_data(image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1615 const char *image_filename = purple_imgstore_get_filename(image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1616 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1617 purple_debug_info("gg", "ggp_send_image_handler: sending image imgid: %i, crc: %u\n", imgid, ev->event.image_request.crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1618 gg_image_reply(info->session, (unsigned long int)ev->event.image_request.sender, image_filename, image_bin, image_size); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1619 purple_imgstore_unref(image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1620 } else { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1621 purple_debug_error("gg", "ggp_send_image_handler: image imgid: %i, crc: %u in hash but not found in imgstore!\n", imgid, ev->event.image_request.crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1622 } |
31429
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
1623 g_hash_table_remove(info->pending_images, GINT_TO_POINTER(ev->event.image_request.crc32)); |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1624 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1625 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1626 |
31431
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
1627 static void ggp_typing_notification_handler(PurpleConnection *gc, uin_t uin, int length) { |
31594
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1628 gchar *from; |
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1629 |
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1630 from = g_strdup_printf("%u", uin); |
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1631 if (length) |
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1632 serv_got_typing(gc, from, 0, PURPLE_TYPING); |
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1633 else |
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1634 serv_got_typing_stopped(gc, from); |
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1635 g_free(from); |
31431
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
1636 } |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
1637 |
31466
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1638 /** |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1639 * Handling of XML events. |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1640 * |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1641 * @param gc PurpleConnection. |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1642 * @param data Raw XML contents. |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1643 * |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1644 * @see http://toxygen.net/libgadu/protocol/#ch1.13 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1645 */ |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1646 static void ggp_xml_event_handler(PurpleConnection *gc, char *data) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1647 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1648 xmlnode *xml = NULL; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1649 xmlnode *xmlnode_next_event; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1650 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1651 xml = xmlnode_from_str(data, -1); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1652 if (xml == NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1653 goto out; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1654 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1655 xmlnode_next_event = xmlnode_get_child(xml, "event"); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1656 while (xmlnode_next_event != NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1657 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1658 xmlnode *xmlnode_current_event = xmlnode_next_event; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1659 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1660 xmlnode *xmlnode_type; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1661 char *event_type_raw; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1662 int event_type = 0; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1663 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1664 xmlnode *xmlnode_sender; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1665 char *event_sender_raw; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1666 uin_t event_sender = 0; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1667 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1668 xmlnode_next_event = xmlnode_get_next_twin(xmlnode_next_event); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1669 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1670 xmlnode_type = xmlnode_get_child(xmlnode_current_event, "type"); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1671 if (xmlnode_type == NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1672 continue; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1673 event_type_raw = xmlnode_get_data(xmlnode_type); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1674 if (event_type_raw != NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1675 event_type = atoi(event_type_raw); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1676 g_free(event_type_raw); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1677 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1678 xmlnode_sender = xmlnode_get_child(xmlnode_current_event, "sender"); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1679 if (xmlnode_sender != NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1680 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1681 event_sender_raw = xmlnode_get_data(xmlnode_sender); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1682 if (event_sender_raw != NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1683 event_sender = ggp_str_to_uin(event_sender_raw); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1684 g_free(event_sender_raw); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1685 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1686 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1687 switch (event_type) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1688 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1689 case 28: /* avatar update */ |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1690 purple_debug_info("gg", |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1691 "ggp_xml_event_handler: avatar updated (uid: %u)\n", |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1692 event_sender); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1693 ggp_update_buddy_avatar(gc, event_sender); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1694 break; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1695 default: |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1696 purple_debug_error("gg", |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1697 "ggp_xml_event_handler: unsupported event type=%d from=%u\n", |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1698 event_type, event_sender); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1699 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1700 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1701 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1702 out: |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1703 if (xml) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1704 xmlnode_free(xml); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1705 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1706 |
15822 | 1707 static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1708 { |
15822 | 1709 PurpleConnection *gc = _gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1710 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1711 struct gg_event *ev; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1712 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1713 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1714 if (!(ev = gg_watch_fd(info->session))) { |
15822 | 1715 purple_debug_error("gg", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1716 "ggp_callback_recv: gg_watch_fd failed -- CRITICAL!\n"); |
21358 | 1717 purple_connection_error_reason (gc, |
1718 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
1719 _("Unable to read from socket")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1720 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 } |
31462
277b7f1d6214
Don't update last_received when receiving data on gg. Fixes #13699.
quantifier666@gmail.com
parents:
31450
diff
changeset
|
1722 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1723 switch (ev->type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1724 case GG_EVENT_NONE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1725 /* Nothing happened. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1726 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1727 case GG_EVENT_MSG: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1728 ggp_recv_message_handler(gc, ev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1729 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1730 case GG_EVENT_ACK: |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1731 /* Changing %u to %i fixes compiler warning */ |
15822 | 1732 purple_debug_info("gg", |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1733 "ggp_callback_recv: message sent to: %i, delivery status=%d, seq=%d\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1734 ev->event.ack.recipient, ev->event.ack.status, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1735 ev->event.ack.seq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1736 break; |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1737 case GG_EVENT_IMAGE_REPLY: |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1738 ggp_recv_image_handler(gc, ev); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1739 break; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1740 case GG_EVENT_IMAGE_REQUEST: |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1741 ggp_send_image_handler(gc, ev); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1742 break; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1743 case GG_EVENT_NOTIFY: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1744 case GG_EVENT_NOTIFY_DESCR: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1745 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1746 struct gg_notify_reply *n; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 char *descr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1748 |
15822 | 1749 purple_debug_info("gg", "notify_pre: (%d) status: %d\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1750 ev->event.notify->uin, |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1751 GG_S(ev->event.notify->status)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 n = (ev->type == GG_EVENT_NOTIFY) ? ev->event.notify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1754 : ev->event.notify_descr.notify; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1755 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1756 for (; n->uin; n++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 descr = (ev->type == GG_EVENT_NOTIFY) ? NULL |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 : ev->event.notify_descr.descr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1759 |
15822 | 1760 purple_debug_info("gg", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1761 "notify: (%d) status: %d; descr: %s\n", |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1762 n->uin, GG_S(n->status), descr ? descr : "(null)"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1763 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 ggp_generic_status_handler(gc, |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1765 n->uin, GG_S(n->status), descr); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1766 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1767 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1768 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1769 case GG_EVENT_NOTIFY60: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1770 for (i = 0; ev->event.notify60[i].uin; i++) { |
15822 | 1771 purple_debug_info("gg", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1772 "notify60: (%d) status=%d; version=%d; descr=%s\n", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1773 ev->event.notify60[i].uin, |
29722
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29544
diff
changeset
|
1774 GG_S(ev->event.notify60[i].status), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1775 ev->event.notify60[i].version, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1776 ev->event.notify60[i].descr ? ev->event.notify60[i].descr : "(null)"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1777 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1778 ggp_generic_status_handler(gc, ev->event.notify60[i].uin, |
29722
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29544
diff
changeset
|
1779 GG_S(ev->event.notify60[i].status), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 ev->event.notify60[i].descr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1781 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1783 case GG_EVENT_STATUS: |
15822 | 1784 purple_debug_info("gg", "status: (%d) status=%d; descr=%s\n", |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1785 ev->event.status.uin, GG_S(ev->event.status.status), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1786 ev->event.status.descr ? ev->event.status.descr : "(null)"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1788 ggp_generic_status_handler(gc, ev->event.status.uin, |
29722
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29544
diff
changeset
|
1789 GG_S(ev->event.status.status), ev->event.status.descr); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1790 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1791 case GG_EVENT_STATUS60: |
15822 | 1792 purple_debug_info("gg", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1793 "status60: (%d) status=%d; version=%d; descr=%s\n", |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1794 ev->event.status60.uin, GG_S(ev->event.status60.status), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1795 ev->event.status60.version, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1796 ev->event.status60.descr ? ev->event.status60.descr : "(null)"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1797 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1798 ggp_generic_status_handler(gc, ev->event.status60.uin, |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
1799 GG_S(ev->event.status60.status), ev->event.status60.descr); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1800 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1801 case GG_EVENT_USERLIST: |
31594
dc1c25b81efd
Small space to tab changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31529
diff
changeset
|
1802 if (ev->event.userlist.type == GG_USERLIST_GET_REPLY) { |
15822 | 1803 purple_debug_info("gg", "GG_USERLIST_GET_REPLY\n"); |
1804 purple_notify_info(gc, NULL, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1805 _("Buddy list downloaded"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1806 _("Your buddy list was downloaded from the server.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1807 if (ev->event.userlist.reply != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1808 ggp_buddylist_load(gc, ev->event.userlist.reply); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1809 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1810 } else { |
15822 | 1811 purple_debug_info("gg", "GG_USERLIST_PUT_REPLY\n"); |
1812 purple_notify_info(gc, NULL, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1813 _("Buddy list uploaded"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1814 _("Your buddy list was stored on the server.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1815 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1816 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1817 case GG_EVENT_PUBDIR50_SEARCH_REPLY: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1818 ggp_pubdir_reply_handler(gc, ev->event.pubdir50); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1819 break; |
31431
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
1820 case GG_EVENT_TYPING_NOTIFICATION: |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
1821 ggp_typing_notification_handler(gc, ev->event.typing_notification.uin, |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
1822 ev->event.typing_notification.length); |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
1823 break; |
31466
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1824 case GG_EVENT_XML_EVENT: |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1825 purple_debug_info("gg", "GG_EVENT_XML_EVENT\n"); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1826 ggp_xml_event_handler(gc, ev->event.xml_event.data); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31464
diff
changeset
|
1827 break; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1828 default: |
15822 | 1829 purple_debug_error("gg", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1830 "unsupported event type=%d\n", ev->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1831 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1832 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1833 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1834 gg_free_event(ev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1835 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1836 |
15822 | 1837 static void ggp_async_login_handler(gpointer _gc, gint fd, PurpleInputCondition cond) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1838 { |
15822 | 1839 PurpleConnection *gc = _gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 GGPInfo *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1841 struct gg_event *ev; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 |
15822 | 1843 g_return_if_fail(PURPLE_CONNECTION_IS_VALID(gc)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1844 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1846 |
15822 | 1847 purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 info->session->check, info->session->state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1849 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 switch (info->session->state) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 case GG_STATE_RESOLVING: |
15822 | 1852 purple_debug_info("gg", "GG_STATE_RESOLVING\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 break; |
31515
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1854 case GG_STATE_RESOLVING_GG: |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1855 purple_debug_info("gg", "GG_STATE_RESOLVING_GG\n"); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1856 break; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1857 case GG_STATE_CONNECTING_HUB: |
15822 | 1858 purple_debug_info("gg", "GG_STATE_CONNECTING_HUB\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1859 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1860 case GG_STATE_READING_DATA: |
15822 | 1861 purple_debug_info("gg", "GG_STATE_READING_DATA\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1862 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1863 case GG_STATE_CONNECTING_GG: |
15822 | 1864 purple_debug_info("gg", "GG_STATE_CONNECTING_GG\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1865 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1866 case GG_STATE_READING_KEY: |
15822 | 1867 purple_debug_info("gg", "GG_STATE_READING_KEY\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 case GG_STATE_READING_REPLY: |
15822 | 1870 purple_debug_info("gg", "GG_STATE_READING_REPLY\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1871 break; |
31515
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1872 case GG_STATE_TLS_NEGOTIATION: |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1873 purple_debug_info("gg", "GG_STATE_TLS_NEGOTIATION\n"); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1874 break; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1875 default: |
15822 | 1876 purple_debug_error("gg", "unknown state = %d\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1877 info->session->state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1879 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1880 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 if (!(ev = gg_watch_fd(info->session))) { |
15822 | 1882 purple_debug_error("gg", "login_handler: gg_watch_fd failed!\n"); |
21358 | 1883 purple_connection_error_reason (gc, |
1884 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
1885 _("Unable to read from socket")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 } |
15822 | 1888 purple_debug_info("gg", "login_handler: session->fd = %d\n", info->session->fd); |
1889 purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n", | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1890 info->session->check, info->session->state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1891 |
15822 | 1892 purple_input_remove(gc->inpa); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1893 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1894 /** XXX I think that this shouldn't be done if ev->type is GG_EVENT_CONN_FAILED or GG_EVENT_CONN_SUCCESS -datallah */ |
31515
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1895 if (info->session->fd >= 0) |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1896 gc->inpa = purple_input_add(info->session->fd, |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1897 (info->session->check == 1) ? PURPLE_INPUT_WRITE : |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1898 PURPLE_INPUT_READ, |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
1899 ggp_async_login_handler, gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1900 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1901 switch (ev->type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1902 case GG_EVENT_NONE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1903 /* Nothing happened. */ |
15822 | 1904 purple_debug_info("gg", "GG_EVENT_NONE\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1905 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1906 case GG_EVENT_CONN_SUCCESS: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1907 { |
15822 | 1908 purple_debug_info("gg", "GG_EVENT_CONN_SUCCESS\n"); |
1909 purple_input_remove(gc->inpa); | |
1910 gc->inpa = purple_input_add(info->session->fd, | |
1911 PURPLE_INPUT_READ, | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1912 ggp_callback_recv, gc); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
29868
diff
changeset
|
1913 |
27385
ac299d029823
Patch from kkszysiu to make the GG prpl support
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27372
diff
changeset
|
1914 ggp_buddylist_send(gc); |
29868
fb6312881d56
gg: Fix misuse of update_progress. Fixes #11774
kkszysiu@gmail.com
parents:
29847
diff
changeset
|
1915 purple_connection_update_progress(gc, _("Connected"), 1, 2); |
15822 | 1916 purple_connection_set_state(gc, PURPLE_CONNECTED); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1917 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1918 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 case GG_EVENT_CONN_FAILED: |
15822 | 1920 purple_input_remove(gc->inpa); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1921 gc->inpa = 0; |
20109
94062344397c
Modify gadu-gadu to use purple_connection_error_reason. I'm not sure about
Will Thompson <will.thompson@collabora.co.uk>
parents:
19697
diff
changeset
|
1922 purple_connection_error_reason (gc, |
21358 | 1923 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
1924 _("Connection failed")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1925 break; |
31663
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1926 case GG_EVENT_MSG: |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1927 if (ev->event.msg.sender == 0) |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1928 /* system messages are mostly ads */ |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1929 purple_debug_info("gg", "System message:\n%s\n", |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1930 ev->event.msg.message); |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1931 else |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1932 purple_debug_warning("gg", "GG_EVENT_MSG: message from user %u " |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1933 "unexpected while connecting:\n%s\n", |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1934 ev->event.msg.sender, |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1935 ev->event.msg.message); |
df7a22ec0bc3
No more warnings when receiving Gadu-Gadu system messages - fixes #13914
tomkiewicz@cpw.pidgin.im
parents:
31594
diff
changeset
|
1936 break; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1937 default: |
15822 | 1938 purple_debug_error("gg", "strange event: %d\n", ev->type); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1939 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1940 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1941 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1942 gg_free_event(ev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1943 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 /* ---------------------------------------------------------------------- */ |
15822 | 1946 /* ----- PurplePluginProtocolInfo ----------------------------------------- */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1948 |
15822 | 1949 static const char *ggp_list_icon(PurpleAccount *account, PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1951 return "gadu-gadu"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1953 |
15822 | 1954 static char *ggp_status_text(PurpleBuddy *b) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1955 { |
15822 | 1956 PurpleStatus *status; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 const char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1958 char *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1960 |
31681
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1961 status = purple_presence_get_active_status( |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1962 purple_buddy_get_presence(b)); |
15822 | 1963 msg = purple_status_get_attr_string(status, "message"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1964 |
31681
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1965 if (msg == NULL) |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1966 return NULL; |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1967 |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1968 tmp = purple_markup_strip_html(msg); |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1969 text = g_markup_escape_text(tmp, -1); |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1970 g_free(tmp); |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1971 |
3e98b34853ee
Better status message handling in Gadu-Gadu. Fixes #14314
tomkiewicz@cpw.pidgin.im
parents:
31670
diff
changeset
|
1972 return text; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1973 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 |
15822 | 1975 static void ggp_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1976 { |
15822 | 1977 PurpleStatus *status; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1978 char *text, *tmp; |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1979 const char *msg, *name, *alias; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1980 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1981 g_return_if_fail(b != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1982 |
15822 | 1983 status = purple_presence_get_active_status(purple_buddy_get_presence(b)); |
1984 msg = purple_status_get_attr_string(status, "message"); | |
1985 name = purple_status_get_name(status); | |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1986 alias = purple_buddy_get_alias(b); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1987 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
1988 purple_notify_user_info_add_pair (user_info, _("Alias"), alias); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1989 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 if (msg != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 text = g_markup_escape_text(msg, -1); |
15822 | 1992 if (PURPLE_BUDDY_IS_ONLINE(b)) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1993 tmp = g_strdup_printf("%s: %s", name, text); |
15822 | 1994 purple_notify_user_info_add_pair(user_info, _("Status"), tmp); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1995 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1996 } else { |
15822 | 1997 purple_notify_user_info_add_pair(user_info, _("Message"), text); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1998 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1999 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2000 /* We don't want to duplicate 'Status: Offline'. */ |
15822 | 2001 } else if (PURPLE_BUDDY_IS_ONLINE(b)) { |
2002 purple_notify_user_info_add_pair(user_info, _("Status"), name); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2003 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2004 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2005 |
15822 | 2006 static GList *ggp_status_types(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2007 { |
15822 | 2008 PurpleStatusType *type; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2009 GList *types = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2010 |
15822 | 2011 type = purple_status_type_new_with_attrs( |
2012 PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, | |
2013 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2014 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2015 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2016 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2017 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2018 * Without this selecting Invisible as own status doesn't |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2019 * work. It's not used and not needed to show status of buddies. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2020 */ |
15822 | 2021 type = purple_status_type_new_with_attrs( |
2022 PURPLE_STATUS_INVISIBLE, NULL, NULL, TRUE, TRUE, FALSE, | |
2023 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2024 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2025 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2026 |
15822 | 2027 type = purple_status_type_new_with_attrs( |
2028 PURPLE_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE, | |
2029 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2030 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2031 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2032 |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2033 /* |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
29868
diff
changeset
|
2034 * New statuses for GG 8.0 like PoGGadaj ze mna (not yet because |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2035 * libpurple can't support Chatty status) and Nie przeszkadzac |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2036 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2037 type = purple_status_type_new_with_attrs( |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2038 PURPLE_STATUS_UNAVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2039 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2040 NULL); |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2041 types = g_list_append(types, type); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
29868
diff
changeset
|
2042 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2043 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2044 * This status is necessary to display guys who are blocking *us*. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2045 */ |
15822 | 2046 type = purple_status_type_new_with_attrs( |
2047 PURPLE_STATUS_INVISIBLE, "blocked", _("Blocked"), TRUE, FALSE, FALSE, | |
2048 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), NULL); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2049 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2050 |
15822 | 2051 type = purple_status_type_new_with_attrs( |
2052 PURPLE_STATUS_OFFLINE, NULL, NULL, TRUE, TRUE, FALSE, | |
2053 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2054 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2055 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2056 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2057 return types; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2058 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2059 |
15822 | 2060 static GList *ggp_blist_node_menu(PurpleBlistNode *node) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2061 { |
15822 | 2062 PurpleMenuAction *act; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2063 GList *m = NULL; |
25323
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2064 PurpleAccount *account; |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2065 GGPInfo *info; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2066 |
15822 | 2067 if (!PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2068 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2069 |
25323
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2070 account = purple_buddy_get_account((PurpleBuddy *) node); |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2071 info = purple_account_get_connection(account)->proto_data; |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2072 if (info->chats) { |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2073 act = purple_menu_action_new(_("Add to chat"), |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2074 PURPLE_CALLBACK(ggp_bmenu_add_to_chat), |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2075 NULL, NULL); |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2076 m = g_list_append(m, act); |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24485
diff
changeset
|
2077 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2078 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2079 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2080 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2081 |
15822 | 2082 static GList *ggp_chat_info(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2083 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 GList *m = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2086 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2087 pce = g_new0(struct proto_chat_entry, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2088 pce->label = _("Chat _name:"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2089 pce->identifier = "name"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2090 pce->required = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2091 m = g_list_append(m, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2092 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2093 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2094 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2095 |
15822 | 2096 static void ggp_login(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2097 { |
15822 | 2098 PurpleConnection *gc; |
23241
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2099 PurplePresence *presence; |
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2100 PurpleStatus *status; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2101 struct gg_login_params *glp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2102 GGPInfo *info; |
27036
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2103 const char *address; |
31515
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2104 const gchar *encryption_type; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2105 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2106 if (ggp_setup_proxy(account) == -1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2107 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2108 |
15822 | 2109 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 glp = g_new0(struct gg_login_params, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2111 info = g_new0(GGPInfo, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2112 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2113 /* Probably this should be moved to *_new() function. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2114 info->session = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2115 info->chats = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2116 info->chats_count = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2117 info->token = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 info->searches = ggp_search_new(); |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2119 info->pending_richtext_messages = NULL; |
31429
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2120 info->pending_images = g_hash_table_new(g_direct_hash, g_direct_equal); |
31350
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2121 info->status_broadcasting = purple_account_get_bool(account, "status_broadcasting", TRUE); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2122 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2123 gc->proto_data = info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2124 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2125 glp->uin = ggp_get_uin(account); |
15822 | 2126 glp->password = (char *)purple_account_get_password(account); |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2127 glp->image_size = 255; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2128 |
23241
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2129 presence = purple_account_get_presence(account); |
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2130 status = purple_presence_get_active_status(presence); |
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2131 |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2132 glp->encoding = GG_ENCODING_UTF8; |
31431
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
2133 glp->protocol_features = (GG_FEATURE_STATUS80|GG_FEATURE_DND_FFC |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31429
diff
changeset
|
2134 |GG_FEATURE_TYPING_NOTIFICATION); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
29868
diff
changeset
|
2135 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2136 glp->async = 1; |
23241
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2137 glp->status = ggp_to_gg_status(status, &glp->status_descr); |
31515
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2138 |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2139 encryption_type = purple_account_get_string(account, "encryption", "none"); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2140 purple_debug_info("gg", "Requested encryption type: %s\n", encryption_type); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2141 if (strcmp(encryption_type, "opportunistic_tls") == 0) |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2142 glp->tls = 1; |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2143 else |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2144 glp->tls = 0; |
31450
66b30e47caec
Gadu-Gadu: Add encrypted (SSL) connection support for GNUTLS users.
tomkiewicz@o2.pl
parents:
31449
diff
changeset
|
2145 purple_debug_info("gg", "TLS enabled: %d\n", glp->tls); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2146 |
31350
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2147 if (!info->status_broadcasting) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2148 glp->status = glp->status|GG_STATUS_FRIENDS_MASK; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2149 |
27036
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2150 address = purple_account_get_string(account, "gg_server", ""); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2151 if (address && *address) { |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
2152 /* TODO: Make this non-blocking */ |
27036
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2153 struct in_addr *addr = gg_gethostbyname(address); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2154 |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2155 purple_debug_info("gg", "Using gg server given by user (%s)\n", address); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2156 |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2157 if (addr == NULL) { |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
2158 gchar *tmp = g_strdup_printf(_("Unable to resolve hostname '%s': %s"), |
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
2159 address, g_strerror(errno)); |
27036
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2160 purple_connection_error_reason(gc, |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2161 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, /* should this be a settings error? */ |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
2162 tmp); |
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
2163 g_free(tmp); |
27036
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2164 return; |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2165 } |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2166 |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2167 glp->server_addr = inet_addr(inet_ntoa(*addr)); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2168 glp->server_port = 8074; |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2169 } else |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2170 purple_debug_info("gg", "Trying to retrieve address from gg appmsg service\n"); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2171 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2172 info->session = gg_login(glp); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
29868
diff
changeset
|
2173 purple_connection_update_progress(gc, _("Connecting"), 0, 2); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 if (info->session == NULL) { |
21358 | 2175 purple_connection_error_reason (gc, |
2176 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
2177 _("Connection failed")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 g_free(glp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2179 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 } |
15822 | 2181 gc->inpa = purple_input_add(info->session->fd, PURPLE_INPUT_READ, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2182 ggp_async_login_handler, gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2183 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2184 |
15822 | 2185 static void ggp_close(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2186 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2187 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 if (gc == NULL) { |
15822 | 2189 purple_debug_info("gg", "gc == NULL\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2190 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2191 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 if (gc->proto_data) { |
15822 | 2194 PurpleAccount *account = purple_connection_get_account(gc); |
2195 PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2196 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 |
15822 | 2198 status = purple_account_get_active_status(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2200 if (info->session != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2201 ggp_set_status(account, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2202 gg_logoff(info->session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2203 gg_free_session(info->session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2204 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2205 |
31350
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2206 purple_account_set_bool(account, "status_broadcasting", info->status_broadcasting); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2207 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2208 /* Immediately close any notifications on this handle since that process depends |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2209 * upon the contents of info->searches, which we are about to destroy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2210 */ |
15822 | 2211 purple_notify_close_with_handle(gc); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2212 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2213 ggp_search_destroy(info->searches); |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2214 g_list_free(info->pending_richtext_messages); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2215 g_hash_table_destroy(info->pending_images); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2216 g_free(info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 gc->proto_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2218 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2219 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2220 if (gc->inpa > 0) |
15822 | 2221 purple_input_remove(gc->inpa); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2222 |
15822 | 2223 purple_debug_info("gg", "Connection closed.\n"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2224 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2225 |
15822 | 2226 static int ggp_send_im(PurpleConnection *gc, const char *who, const char *msg, |
2227 PurpleMessageFlags flags) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2228 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2229 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2230 char *tmp, *plain; |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2231 int ret = 1; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2232 unsigned char format[1024]; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2233 unsigned int format_length = sizeof(struct gg_msg_richtext); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2234 gint pos = 0; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2235 GData *attribs; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2236 const char *start, *end = NULL, *last; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2237 |
24485
c83ee78ecbe7
Fix two warnings introduced by the image patch I committed earlier and make
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24484
diff
changeset
|
2238 if (msg == NULL || *msg == '\0') { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2239 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2240 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2241 |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2242 last = msg; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2243 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2244 /* Check if the message is richtext */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2245 /* TODO: Check formatting, too */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2246 if(purple_markup_find_tag("img", last, &start, &end, &attribs)) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2247 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2248 GString *string_buffer = g_string_new(NULL); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2249 struct gg_msg_richtext fmt; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2250 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2251 do { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2252 PurpleStoredImage *image; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2253 const char *id; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2254 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2255 /* Add text before the image */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2256 if(start - last) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2257 pos = pos + g_utf8_strlen(last, start - last); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2258 g_string_append_len(string_buffer, last, start - last); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2259 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2260 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2261 if((id = g_datalist_get_data(&attribs, "id")) && (image = purple_imgstore_find_by_id(atoi(id)))) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2262 struct gg_msg_richtext_format actformat; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2263 struct gg_msg_richtext_image actimage; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2264 gint image_size = purple_imgstore_get_size(image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2265 gconstpointer image_bin = purple_imgstore_get_data(image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2266 const char *image_filename = purple_imgstore_get_filename(image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2267 uint32_t crc32 = gg_crc32(0, image_bin, image_size); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2268 |
31429
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2269 g_hash_table_insert(info->pending_images, GINT_TO_POINTER(crc32), GINT_TO_POINTER(atoi(id))); |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2270 purple_imgstore_ref(image); |
31429
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2271 purple_debug_info("gg", "ggp_send_im_richtext: got crc: %u for imgid: %i\n", crc32, atoi(id)); |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2272 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2273 actformat.font = GG_FONT_IMAGE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2274 actformat.position = pos; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2275 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2276 actimage.unknown1 = 0x0109; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2277 actimage.size = gg_fix32(image_size); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2278 actimage.crc32 = gg_fix32(crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2279 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2280 if (actimage.size > 255000) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2281 purple_debug_warning("gg", "ggp_send_im_richtext: image over 255kb!\n"); |
31429
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2282 } else { |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2283 purple_debug_info("gg", "ggp_send_im_richtext: adding images to richtext, size: %i, crc32: %u, name: %s\n", actimage.size, actimage.crc32, image_filename); |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2284 |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2285 memcpy(format + format_length, &actformat, sizeof(actformat)); |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2286 format_length += sizeof(actformat); |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2287 memcpy(format + format_length, &actimage, sizeof(actimage)); |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31412
diff
changeset
|
2288 format_length += sizeof(actimage); |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2289 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2290 } else { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2291 purple_debug_error("gg", "ggp_send_im_richtext: image not found in the image store!"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2292 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2293 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2294 last = end + 1; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2295 g_datalist_clear(&attribs); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2296 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2297 } while(purple_markup_find_tag("img", last, &start, &end, &attribs)); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2298 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2299 /* Add text after the images */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2300 if(last && *last) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2301 pos = pos + g_utf8_strlen(last, -1); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2302 g_string_append(string_buffer, last); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2303 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2304 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2305 fmt.flag = 2; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2306 fmt.length = format_length - sizeof(fmt); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2307 memcpy(format, &fmt, sizeof(fmt)); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2308 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2309 purple_debug_info("gg", "ggp_send_im: richtext msg = %s\n", string_buffer->str); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2310 plain = purple_unescape_html(string_buffer->str); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2311 g_string_free(string_buffer, TRUE); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2312 } else { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2313 purple_debug_info("gg", "ggp_send_im: msg = %s\n", msg); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2314 plain = purple_unescape_html(msg); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2315 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2316 |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2317 /* |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2318 tmp = charset_convert(plain, "UTF-8", "CP1250"); |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2319 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2320 tmp = g_strdup_printf("%s", plain); |
31086
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
29868
diff
changeset
|
2321 |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2322 if (tmp && (format_length - sizeof(struct gg_msg_richtext))) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2323 if(gg_send_message_richtext(info->session, GG_CLASS_CHAT, ggp_str_to_uin(who), (unsigned char *)tmp, format, format_length) < 0) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2324 ret = -1; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2325 } else { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2326 ret = 1; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2327 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2328 } else if (NULL == tmp || *tmp == 0) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2329 ret = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2330 } else if (strlen(tmp) > GG_MSG_MAXSIZE) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2331 ret = -E2BIG; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2332 } else if (gg_send_message(info->session, GG_CLASS_CHAT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2333 ggp_str_to_uin(who), (unsigned char *)tmp) < 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2334 ret = -1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2335 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2336 ret = 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2337 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2338 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2339 g_free(plain); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2340 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2341 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2342 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2343 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2344 |
31449
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2345 static unsigned int ggp_send_typing(PurpleConnection *gc, const char *name, PurpleTypingState state) |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2346 { |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2347 int dummy_length; // we don't send real length of typed message |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2348 |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2349 if (state == PURPLE_TYPED) // not supported |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2350 return 1; |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2351 |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2352 if (state == PURPLE_TYPING) |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2353 dummy_length = (int)g_random_int(); |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2354 else // PURPLE_NOT_TYPING |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2355 dummy_length = 0; |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2356 |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2357 gg_typing_notification( |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2358 ((GGPInfo*)gc->proto_data)->session, |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2359 ggp_str_to_uin(name), |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2360 dummy_length); |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2361 |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2362 return 1; // wait 1 second before another notification |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2363 } |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2364 |
15822 | 2365 static void ggp_get_info(PurpleConnection *gc, const char *name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2366 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 GGPSearchForm *form; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 guint32 seq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2371 form = ggp_search_form_new(GGP_SEARCH_TYPE_INFO); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2372 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2373 form->user_data = info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 form->uin = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2375 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2376 seq = ggp_search_start(gc, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2377 ggp_search_add(info->searches, seq, form); |
23442
56cf59d028f7
Gadu-Gadu Get Info isn't behaving properly. Added debug logging to its traking
Evan Schoenberg <evan.s@dreskin.net>
parents:
23241
diff
changeset
|
2378 purple_debug_info("gg", "ggp_get_info(): Added seq %u", seq); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2379 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2380 |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2381 static int ggp_to_gg_status(PurpleStatus *status, char **msg) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 { |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2383 const char *status_id = purple_status_get_id(status); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 int new_status, new_status_descr; |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2385 const char *new_msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 |
23896
4b920b9ea9ca
Fixed an inverted g_return_val_if_fail() which caused gadu-gadu to always set an available status with no status message
Evan Schoenberg <evan.s@dreskin.net>
parents:
23442
diff
changeset
|
2387 g_return_val_if_fail(msg != NULL, 0); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2388 |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2389 purple_debug_info("gg", "ggp_to_gg_status: Requested status = %s\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2390 status_id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2391 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2392 if (strcmp(status_id, "available") == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2393 new_status = GG_STATUS_AVAIL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2394 new_status_descr = GG_STATUS_AVAIL_DESCR; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2395 } else if (strcmp(status_id, "away") == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 new_status = GG_STATUS_BUSY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 new_status_descr = GG_STATUS_BUSY_DESCR; |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2398 } else if (strcmp(status_id, "unavailable") == 0) { |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2399 new_status = GG_STATUS_DND; |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2400 new_status_descr = GG_STATUS_DND_DESCR; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2401 } else if (strcmp(status_id, "invisible") == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2402 new_status = GG_STATUS_INVISIBLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 new_status_descr = GG_STATUS_INVISIBLE_DESCR; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2404 } else if (strcmp(status_id, "offline") == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2405 new_status = GG_STATUS_NOT_AVAIL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2406 new_status_descr = GG_STATUS_NOT_AVAIL_DESCR; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2408 new_status = GG_STATUS_AVAIL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2409 new_status_descr = GG_STATUS_AVAIL_DESCR; |
15822 | 2410 purple_debug_info("gg", |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2411 "ggp_set_status: unknown status requested (status_id=%s)\n", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2412 status_id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2413 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2414 |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2415 new_msg = purple_status_get_attr_string(status, "message"); |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2416 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2417 if(new_msg) { |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2418 /* |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2419 char *tmp = purple_markup_strip_html(new_msg); |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2420 *msg = charset_convert(tmp, "UTF-8", "CP1250"); |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2421 g_free(tmp); |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2422 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2423 *msg = purple_markup_strip_html(new_msg); |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2424 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2425 return new_status_descr; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2426 } else { |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2427 *msg = NULL; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2428 return new_status; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2429 } |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2430 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2431 |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2432 static void ggp_set_status(PurpleAccount *account, PurpleStatus *status) |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2433 { |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2434 PurpleConnection *gc; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2435 GGPInfo *info; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2436 int new_status; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2437 char *new_msg = NULL; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2438 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2439 if (!purple_status_is_active(status)) |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2440 return; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2441 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2442 gc = purple_account_get_connection(account); |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2443 info = gc->proto_data; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2444 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2445 new_status = ggp_to_gg_status(status, &new_msg); |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2446 |
31350
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2447 if (!info->status_broadcasting) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2448 new_status = new_status|GG_STATUS_FRIENDS_MASK; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2449 |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2450 if (new_msg == NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2451 gg_change_status(info->session, new_status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2452 } else { |
23239
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23238
diff
changeset
|
2453 gg_change_status_descr(info->session, new_status, new_msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2454 g_free(new_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2455 } |
21061
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2456 |
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2457 ggp_status_fake_to_self(account); |
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2458 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2459 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2460 |
15822 | 2461 static void ggp_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2462 { |
21061
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2463 PurpleAccount *account; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2464 GGPInfo *info = gc->proto_data; |
25792
4d20fa86455b
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
23896
diff
changeset
|
2465 const gchar *name = purple_buddy_get_name(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2466 |
25792
4d20fa86455b
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
23896
diff
changeset
|
2467 gg_add_notify(info->session, ggp_str_to_uin(name)); |
21061
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2468 |
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2469 account = purple_connection_get_account(gc); |
25792
4d20fa86455b
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
23896
diff
changeset
|
2470 if (strcmp(purple_account_get_username(account), name) == 0) { |
21061
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2471 ggp_status_fake_to_self(account); |
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2472 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2473 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2474 |
15822 | 2475 static void ggp_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, |
2476 PurpleGroup *group) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2477 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2478 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 |
25792
4d20fa86455b
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
23896
diff
changeset
|
2480 gg_remove_notify(info->session, ggp_str_to_uin(purple_buddy_get_name(buddy))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2481 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2482 |
15822 | 2483 static void ggp_join_chat(PurpleConnection *gc, GHashTable *data) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2484 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2485 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2486 GGPChat *chat; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2487 char *chat_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2488 GList *l; |
15822 | 2489 PurpleConversation *conv; |
2490 PurpleAccount *account = purple_connection_get_account(gc); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2491 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2492 chat_name = g_hash_table_lookup(data, "name"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2493 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2494 if (chat_name == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2495 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2496 |
15822 | 2497 purple_debug_info("gg", "joined %s chat\n", chat_name); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2498 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2499 for (l = info->chats; l != NULL; l = l->next) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2500 chat = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2501 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2502 if (chat != NULL && g_utf8_collate(chat->name, chat_name) == 0) { |
15822 | 2503 purple_notify_error(gc, _("Chat error"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2504 _("This chat name is already in use"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2505 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2506 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2507 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2508 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2509 ggp_confer_add_new(gc, chat_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2510 conv = serv_got_joined_chat(gc, info->chats_count, chat_name); |
15822 | 2511 purple_conv_chat_add_user(PURPLE_CONV_CHAT(conv), |
2512 purple_account_get_username(account), NULL, | |
2513 PURPLE_CBFLAGS_NONE, TRUE); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2514 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2515 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2516 static char *ggp_get_chat_name(GHashTable *data) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2517 return g_strdup(g_hash_table_lookup(data, "name")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2518 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2519 |
15822 | 2520 static int ggp_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2521 { |
15822 | 2522 PurpleConversation *conv; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2523 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2524 GGPChat *chat = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2525 GList *l; |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2526 /* char *msg, *plain; */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2527 gchar *msg; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2528 uin_t *uins; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2529 int count = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2530 |
15822 | 2531 if ((conv = purple_find_chat(gc, id)) == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2532 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2533 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2534 for (l = info->chats; l != NULL; l = l->next) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2535 chat = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2536 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2537 if (g_utf8_collate(chat->name, conv->name) == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2538 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2539 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2540 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2541 chat = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2542 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2543 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2544 if (chat == NULL) { |
15822 | 2545 purple_debug_error("gg", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2546 "ggp_chat_send: Hm... that's strange. No such chat?\n"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2547 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2548 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2549 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2550 uins = g_new0(uin_t, g_list_length(chat->participants)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2551 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2552 for (l = chat->participants; l != NULL; l = l->next) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2553 uin_t uin = GPOINTER_TO_INT(l->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2554 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2555 uins[count++] = uin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2556 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2557 |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2558 /* |
15822 | 2559 plain = purple_unescape_html(message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2560 msg = charset_convert(plain, "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2561 g_free(plain); |
29544
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2562 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29460
diff
changeset
|
2563 msg = purple_unescape_html(message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2564 gg_send_message_confer(info->session, GG_CLASS_CHAT, count, uins, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2565 (unsigned char *)msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2566 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2567 g_free(uins); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2568 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2569 serv_got_chat_in(gc, id, |
15822 | 2570 purple_account_get_username(purple_connection_get_account(gc)), |
23152
caa533b62902
When calling serv_got_chat_in() after sending a group chat message (to let
Evan Schoenberg <evan.s@dreskin.net>
parents:
23110
diff
changeset
|
2571 flags, message, time(NULL)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2572 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2573 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2574 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2575 |
15822 | 2576 static void ggp_keepalive(PurpleConnection *gc) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2577 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2578 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2579 |
15822 | 2580 /* purple_debug_info("gg", "Keeping connection alive....\n"); */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2581 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2582 if (gg_ping(info->session) < 0) { |
15822 | 2583 purple_debug_info("gg", "Not connected to the server " |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2584 "or gg_session is not correct\n"); |
21358 | 2585 purple_connection_error_reason (gc, |
2586 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
27372
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27164
diff
changeset
|
2587 _("Not connected to the server")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2588 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2589 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2590 |
15822 | 2591 static void ggp_register_user(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2592 { |
15822 | 2593 PurpleConnection *gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2594 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2595 ggp_token_request(gc, ggp_register_user_dialog); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2596 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2597 |
15822 | 2598 static GList *ggp_actions(PurplePlugin *plugin, gpointer context) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2599 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2600 GList *m = NULL; |
15822 | 2601 PurplePluginAction *act; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2602 |
15822 | 2603 act = purple_plugin_action_new(_("Find buddies..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2604 ggp_find_buddies); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2605 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2606 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2607 m = g_list_append(m, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2608 |
15822 | 2609 act = purple_plugin_action_new(_("Change password..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2610 ggp_change_passwd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2611 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2612 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2613 m = g_list_append(m, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2614 |
15822 | 2615 act = purple_plugin_action_new(_("Upload buddylist to Server"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2616 ggp_action_buddylist_put); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2617 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2618 |
15822 | 2619 act = purple_plugin_action_new(_("Download buddylist from Server"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2620 ggp_action_buddylist_get); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2621 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2622 |
15822 | 2623 act = purple_plugin_action_new(_("Delete buddylist from Server"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2624 ggp_action_buddylist_delete); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2625 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2626 |
15822 | 2627 act = purple_plugin_action_new(_("Save buddylist to file..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2628 ggp_action_buddylist_save); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2629 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2630 |
15822 | 2631 act = purple_plugin_action_new(_("Load buddylist from file..."), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2632 ggp_action_buddylist_load); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2633 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2634 |
31350
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2635 act = purple_plugin_action_new(_("Change status broadcasting"), |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2636 ggp_action_change_status_broadcasting); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2637 m = g_list_append(m, act); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31168
diff
changeset
|
2638 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2639 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2640 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2641 |
15822 | 2642 static gboolean ggp_offline_message(const PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2643 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2644 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2645 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2646 |
15822 | 2647 static PurplePluginProtocolInfo prpl_info = |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2648 { |
24483
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24453
diff
changeset
|
2649 OPT_PROTO_REGISTER_NOSCREENNAME | OPT_PROTO_IM_IMAGE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2650 NULL, /* user_splits */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2651 NULL, /* protocol_options */ |
22410
d3c8fd63e296
Patch from Tomasz Salacinski to allow setting buddy icons in GG prpl.
Bartoz Oler <bartosz@pidgin.im>
parents:
22149
diff
changeset
|
2652 {"png", 32, 32, 96, 96, 0, PURPLE_ICON_SCALE_DISPLAY}, /* icon_spec */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2653 ggp_list_icon, /* list_icon */ |
15462 | 2654 NULL, /* list_emblem */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2655 ggp_status_text, /* status_text */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2656 ggp_tooltip_text, /* tooltip_text */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2657 ggp_status_types, /* status_types */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2658 ggp_blist_node_menu, /* blist_node_menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2659 ggp_chat_info, /* chat_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2660 NULL, /* chat_info_defaults */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2661 ggp_login, /* login */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2662 ggp_close, /* close */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2663 ggp_send_im, /* send_im */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2664 NULL, /* set_info */ |
31449
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31431
diff
changeset
|
2665 ggp_send_typing, /* send_typing */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2666 ggp_get_info, /* get_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2667 ggp_set_status, /* set_away */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2668 NULL, /* set_idle */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2669 NULL, /* change_passwd */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2670 ggp_add_buddy, /* add_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2671 NULL, /* add_buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2672 ggp_remove_buddy, /* remove_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2673 NULL, /* remove_buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2674 NULL, /* add_permit */ |
31723
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
2675 ggp_add_deny, /* add_deny */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2676 NULL, /* rem_permit */ |
31723
f8cc6922b296
Merged two buddy blocking methods in Gadu-Gadu protocol. Fixes #5303
tomkiewicz@cpw.pidgin.im
parents:
31681
diff
changeset
|
2677 ggp_rem_deny, /* rem_deny */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2678 NULL, /* set_permit_deny */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2679 ggp_join_chat, /* join_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2680 NULL, /* reject_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2681 ggp_get_chat_name, /* get_chat_name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2682 NULL, /* chat_invite */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2683 NULL, /* chat_leave */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2684 NULL, /* chat_whisper */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2685 ggp_chat_send, /* chat_send */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2686 ggp_keepalive, /* keepalive */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2687 ggp_register_user, /* register_user */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2688 NULL, /* get_cb_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2689 NULL, /* get_cb_away */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2690 NULL, /* alias_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2691 NULL, /* group_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2692 NULL, /* rename_group */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2693 NULL, /* buddy_free */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2694 NULL, /* convo_closed */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2695 NULL, /* normalize */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2696 NULL, /* set_buddy_icon */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2697 NULL, /* remove_group */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2698 NULL, /* get_cb_real_name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2699 NULL, /* set_chat_topic */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2700 NULL, /* find_blist_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2701 NULL, /* roomlist_get_list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2702 NULL, /* roomlist_cancel */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2703 NULL, /* roomlist_expand_category */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2704 NULL, /* can_receive_file */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2705 NULL, /* send_file */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2706 NULL, /* new_xfer */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2707 ggp_offline_message, /* offline_message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2708 NULL, /* whiteboard_prpl_ops */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2709 NULL, /* send_raw */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2710 NULL, /* roomlist_room_serialize */ |
23772
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23769
diff
changeset
|
2711 NULL, /* unregister_user */ |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23769
diff
changeset
|
2712 NULL, /* send_attention */ |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23769
diff
changeset
|
2713 NULL, /* get_attention_types */ |
23109
718a9c287839
Use up the last padding for PurplePluginProtocolInfo in a way that allows
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22486
diff
changeset
|
2714 sizeof(PurplePluginProtocolInfo), /* struct_size */ |
23807
ff29208e03ef
propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5)
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
2715 NULL, /* get_account_text_table */ |
ff29208e03ef
propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5)
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
2716 NULL, /* initiate_media */ |
29460 | 2717 NULL, /* can_do_media */ |
29847
2a436e0ce977
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents:
29843
diff
changeset
|
2718 NULL, /* get_moods */ |
2a436e0ce977
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents:
29843
diff
changeset
|
2719 NULL, /* set_public_alias */ |
31397
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31351
diff
changeset
|
2720 NULL, /* get_public_alias */ |
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31351
diff
changeset
|
2721 NULL, /* add_buddy_with_invite */ |
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31351
diff
changeset
|
2722 NULL /* add_buddies_with_invite */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2723 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2724 |
15822 | 2725 static PurplePluginInfo info = { |
24484
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2726 PURPLE_PLUGIN_MAGIC, /* magic */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2727 PURPLE_MAJOR_VERSION, /* major_version */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2728 PURPLE_MINOR_VERSION, /* minor_version */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2729 PURPLE_PLUGIN_PROTOCOL, /* plugin type */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2730 NULL, /* ui_requirement */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2731 0, /* flags */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2732 NULL, /* dependencies */ |
15822 | 2733 PURPLE_PRIORITY_DEFAULT, /* priority */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2734 |
24484
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2735 "prpl-gg", /* id */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2736 "Gadu-Gadu", /* name */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2737 DISPLAY_VERSION, /* version */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2738 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2739 N_("Gadu-Gadu Protocol Plugin"), /* summary */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2740 N_("Polish popular IM"), /* description */ |
24484
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2741 "boler@sourceforge.net", /* author */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2742 PURPLE_WEBSITE, /* homepage */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2743 |
24484
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2744 NULL, /* load */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2745 NULL, /* unload */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2746 NULL, /* destroy */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2747 |
24484
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2748 NULL, /* ui_info */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2749 &prpl_info, /* extra_info */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2750 NULL, /* prefs_info */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24483
diff
changeset
|
2751 ggp_actions, /* actions */ |
16667
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16439
diff
changeset
|
2752 |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16439
diff
changeset
|
2753 /* padding */ |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16439
diff
changeset
|
2754 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16439
diff
changeset
|
2755 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16439
diff
changeset
|
2756 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16439
diff
changeset
|
2757 NULL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2758 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2759 |
15822 | 2760 static void purple_gg_debug_handler(int level, const char * format, va_list args) { |
2761 PurpleDebugLevel purple_level; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2762 char *msg = g_strdup_vprintf(format, args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2763 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2764 /* This is pretty pointless since the GG_DEBUG levels don't correspond to |
15822 | 2765 * the purple ones */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2766 switch (level) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2767 case GG_DEBUG_FUNCTION: |
15822 | 2768 purple_level = PURPLE_DEBUG_INFO; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2769 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2770 case GG_DEBUG_MISC: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2771 case GG_DEBUG_NET: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2772 case GG_DEBUG_DUMP: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2773 case GG_DEBUG_TRAFFIC: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2774 default: |
15822 | 2775 purple_level = PURPLE_DEBUG_MISC; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2776 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2777 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2778 |
24453
0320b4a33432
Backport the 'purple_debug_*(msg)' -> 'purple_debug_*("%s", msg);' fixes.
Richard Laager <rlaager@wiktel.com>
parents:
24350
diff
changeset
|
2779 purple_debug(purple_level, "gg", "%s", msg); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2780 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2781 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2782 |
15822 | 2783 static void init_plugin(PurplePlugin *plugin) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2784 { |
15822 | 2785 PurpleAccountOption *option; |
31515
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2786 GList *encryption_options = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2787 |
15822 | 2788 option = purple_account_option_string_new(_("Nickname"), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2789 "nick", _("Gadu-Gadu User")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2790 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2791 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2792 |
27036
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2793 option = purple_account_option_string_new(_("GG server"), |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2794 "gg_server", ""); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2795 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2796 option); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
26992
diff
changeset
|
2797 |
31515
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2798 #define ADD_VALUE(list, desc, v) { \ |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2799 PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); \ |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2800 kvp->key = g_strdup((desc)); \ |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2801 kvp->value = g_strdup((v)); \ |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2802 list = g_list_append(list, kvp); \ |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2803 } |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2804 |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2805 ADD_VALUE(encryption_options, _("Don't use encryption"), "none"); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2806 ADD_VALUE(encryption_options, _("Use encryption if available"), |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2807 "opportunistic_tls"); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2808 #if 0 |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2809 /* TODO */ |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2810 ADD_VALUE(encryption_options, _("Require encryption"), "require_tls"); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2811 #endif |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2812 |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2813 option = purple_account_option_list_new(_("Connection security"), |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2814 "encryption", encryption_options); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2815 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2816 option); |
b2daa6e51596
gg: Allow the user to choose whether to use SSL/TLS support. Fixes #13894.
tomkiewicz@o2.pl
parents:
31466
diff
changeset
|
2817 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2818 my_protocol = plugin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2819 |
15822 | 2820 gg_debug_handler = purple_gg_debug_handler; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2821 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2822 |
15822 | 2823 PURPLE_INIT_PLUGIN(gg, init_plugin, info); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2824 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2825 /* vim: set ts=8 sts=0 sw=8 noet: */ |