Mercurial > pidgin.yaz
annotate libpurple/protocols/gg/gg.c @ 31917:64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
don't get it updated. New avatar is visible after our reconnect, or after this
other user status change.
I found out, that we get these updates in XML event packet, but we don't handle
them. XML events can contain:
- GGLive messages (I think, it's something like tweeter service)
- notifications about avatar changes
- notifications about user's new blog entries
- graphical statuses (I hope we will NOT support this one)
Detailed information (in Polish): http://toxygen.net/libgadu/protocol/#ch1.13
I have implemented general support for XML events, so we could provide support
for new !GaduGadu features in the future. Also, I have fixed that small issue,
by implementing avatar change notifications, provided by these events.
committer: John Bailey <rekkanoryo@rekkanoryo.org>
author | tomkiewicz@o2.pl |
---|---|
date | Sat, 16 Apr 2011 15:35:53 +0000 |
parents | 566bed5c02f2 |
children | b2daa6e51596 |
rev | line source |
---|---|
15374
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 * |
15823 | 4 * purple |
15374
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> |
27246
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
10 * Some parts Copyright (C) 2009 Krzysztof Klinikowski <grommasher@gmail.com> |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * 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 |
19680
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 |
15374
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" |
27246
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
40 #include "xmlnode.h" |
15374
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 |
15823 | 50 static PurplePlugin *my_protocol = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 |
31799
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
52 /* Prototypes */ |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
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:
31616
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:
31616
diff
changeset
|
55 |
15374
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 */ |
15823 | 70 static int ggp_setup_proxy(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 { |
15823 | 72 PurpleProxyInfo *gpi; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 |
15823 | 74 gpi = purple_proxy_get_setup(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 |
15823 | 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)) { | |
15374
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; |
15823 | 81 purple_notify_error(NULL, NULL, _("Invalid proxy settings"), |
15374
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; |
15823 | 84 } else if (purple_proxy_info_get_type(gpi) != PURPLE_PROXY_NONE) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 gg_proxy_enabled = 1; |
15823 | 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)); | |
15374
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 |
15823 | 97 static void ggp_async_token_handler(gpointer _gc, gint fd, PurpleInputCondition cond) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 { |
15823 | 99 PurpleConnection *gc = _gc; |
15374
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 |
15823 | 106 purple_debug_info("gg", "token_handler: token->req: check = %d; state = %d;\n", |
15374
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) { |
15823 | 110 purple_debug_error("gg", "token error (1): %d\n", token->req->error); |
111 purple_input_remove(token->inpa); | |
15374
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 |
15823 | 115 purple_notify_error(purple_connection_get_account(gc), |
15374
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) { |
15823 | 122 purple_input_remove(token->inpa); |
123 token->inpa = purple_input_add(token->req->fd, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 (token->req->check == 1) |
15823 | 125 ? PURPLE_INPUT_WRITE |
126 : PURPLE_INPUT_READ, | |
15374
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) { |
15823 | 132 purple_debug_error("gg", "token error (2): %d\n", token->req->error); |
133 purple_input_remove(token->inpa); | |
15374
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 |
15823 | 137 purple_notify_error(purple_connection_get_account(gc), |
15374
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 |
15823 | 143 purple_input_remove(token->inpa); |
15374
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 |
15823 | 150 purple_debug_info("gg", "TOKEN! tokenid = %s; size = %d\n", |
15374
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 |
15823 | 162 static void ggp_token_request(PurpleConnection *gc, GGPTokenCallback cb) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 { |
15823 | 164 PurpleAccount *account; |
15374
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 |
15823 | 168 account = purple_connection_get_account(gc); |
15374
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) { |
15823 | 176 purple_notify_error(account, |
15374
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; |
15823 | 186 info->token->inpa = purple_input_add(req->fd, PURPLE_INPUT_READ, |
15374
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 */ |
15823 | 199 static void ggp_action_buddylist_get(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 { |
15823 | 201 PurpleConnection *gc = (PurpleConnection *)action->context; |
15374
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 |
15823 | 204 purple_debug_info("gg", "Downloading...\n"); |
15374
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 */ |
15823 | 214 static void ggp_action_buddylist_put(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 { |
15823 | 216 PurpleConnection *gc = (PurpleConnection *)action->context; |
15374
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 |
15823 | 219 char *buddylist = ggp_buddylist_dump(purple_connection_get_account(gc)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 |
15823 | 221 purple_debug_info("gg", "Uploading...\n"); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30283
diff
changeset
|
222 |
15374
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 */ |
15823 | 235 static void ggp_action_buddylist_delete(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 { |
15823 | 237 PurpleConnection *gc = (PurpleConnection *)action->context; |
15374
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 |
15823 | 240 purple_debug_info("gg", "Deleting...\n"); |
15374
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) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 { |
15823 | 247 PurpleAccount *account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
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 |
15823 | 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); |
15374
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) { |
15823 | 255 purple_notify_info(account, _("Save Buddylist..."), |
15374
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); |
15374
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 |
15823 | 276 static void ggp_callback_buddylist_load_ok(PurpleConnection *gc, gchar *file) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 { |
15823 | 278 PurpleAccount *account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
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 |
15823 | 283 purple_debug_info("gg", "file_name = %s\n", file); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 if (!g_file_get_contents(file, &buddylist, &length, &error)) { |
15823 | 286 purple_notify_error(account, |
15374
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 |
15823 | 291 purple_debug_error("gg", |
15374
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 |
15823 | 303 purple_notify_info(account, |
15374
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 */ |
15823 | 311 /* static void ggp_action_buddylist_save(PurplePluginAction *action) {{{ */ |
312 static void ggp_action_buddylist_save(PurplePluginAction *action) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 { |
15823 | 314 PurpleConnection *gc = (PurpleConnection *)action->context; |
15374
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, |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
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:
15823
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); |
15374
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 |
15823 | 322 static void ggp_action_buddylist_load(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 { |
15823 | 324 PurpleConnection *gc = (PurpleConnection *)action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 |
23240
7981a140d81a
Mark a string as translatable in prpl-gg. References #5693.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23182
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:
23182
diff
changeset
|
327 FALSE, |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
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:
15823
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); |
15374
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 |
15823 | 333 static void ggp_callback_register_account_ok(PurpleConnection *gc, |
334 PurpleRequestFields *fields) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 { |
15823 | 336 PurpleAccount *account; |
15374
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 |
15823 | 344 email = charset_convert(purple_request_fields_get_string(fields, "email"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 "UTF-8", "CP1250"); |
15823 | 346 p1 = charset_convert(purple_request_fields_get_string(fields, "password1"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
347 "UTF-8", "CP1250"); |
15823 | 348 p2 = charset_convert(purple_request_fields_get_string(fields, "password2"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 "UTF-8", "CP1250"); |
15823 | 350 t = charset_convert(purple_request_fields_get_string(fields, "token"), |
15374
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 |
15823 | 353 account = purple_connection_get_account(gc); |
15374
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, | |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
359 _("You must fill in all registration fields")); |
15374
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:
19696
diff
changeset
|
364 purple_connection_error_reason (gc, |
21358 | 365 PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
366 _("Passwords do not match")); |
15374
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 |
22475
3225c99785b8
Fix a bunch of compiler warnings caused by my addition of G_GNUC_PRINTF()
Mark Doliner <mark@kingant.net>
parents:
22400
diff
changeset
|
370 purple_debug_info("gg", "register_account_ok: token_id = %s; t = %s\n", |
15374
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, | |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
376 _("Unable to register new account. An unknown error occurred.")); |
15374
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; |
15823 | 381 purple_debug_info("gg", "registered uin: %d\n", uin); |
15374
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); |
15823 | 385 purple_account_set_username(account, t); |
15374
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 */ |
15823 | 387 purple_account_set_password(account, p1); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
388 |
15823 | 389 purple_notify_info(NULL, _("New Gadu-Gadu Account Registered"), |
15374
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); |
15374
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. */ |
24292
8282911d5e17
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@wiktel.com>
parents:
23834
diff
changeset
|
400 purple_account_disconnect(account); |
15374
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 |
15374
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 |
15823 | 415 static void ggp_callback_register_account_cancel(PurpleConnection *gc, |
416 PurpleRequestFields *fields) | |
15374
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 |
24292
8282911d5e17
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@wiktel.com>
parents:
23834
diff
changeset
|
421 purple_account_disconnect(gc->account); |
15374
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 |
15823 | 429 static void ggp_register_user_dialog(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
430 { |
15823 | 431 PurpleAccount *account; |
432 PurpleRequestFields *fields; | |
433 PurpleRequestFieldGroup *group; | |
434 PurpleRequestField *field; | |
15374
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 |
15823 | 440 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
441 |
15823 | 442 fields = purple_request_fields_new(); |
443 group = purple_request_field_group_new(NULL); | |
444 purple_request_fields_add_group(fields, group); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
445 |
15823 | 446 field = purple_request_field_string_new("email", |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23154
diff
changeset
|
447 _("Email"), "", FALSE); |
15823 | 448 purple_request_field_string_set_masked(field, FALSE); |
449 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 |
15823 | 451 field = purple_request_field_string_new("password1", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 _("Password"), "", FALSE); |
15823 | 453 purple_request_field_string_set_masked(field, TRUE); |
454 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 |
15823 | 456 field = purple_request_field_string_new("password2", |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
457 _("Password (again)"), "", FALSE); |
15823 | 458 purple_request_field_string_set_masked(field, TRUE); |
459 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 |
15823 | 461 field = purple_request_field_string_new("token", |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
462 _("Enter captcha text"), "", FALSE); |
15823 | 463 purple_request_field_string_set_masked(field, FALSE); |
464 purple_request_field_group_add_field(group, field); | |
15374
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 */ |
15823 | 467 field = purple_request_field_image_new("token_img", |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
468 _("Captcha"), token->data, token->size); |
15823 | 469 purple_request_field_group_add_field(group, field); |
15374
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, |
15374
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), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
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); |
15374
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 |
15823 | 484 static void ggp_callback_show_next(PurpleConnection *gc, GList *row, gpointer user_data) |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 g_free(form->offset); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 form->offset = g_strdup(form->last_uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 ggp_search_remove(info->searches, form->seq); |
23444
56cf59d028f7
Gadu-Gadu Get Info isn't behaving properly. Added debug logging to its traking
Evan Schoenberg <evan.s@dreskin.net>
parents:
23243
diff
changeset
|
494 purple_debug_info("gg", "ggp_callback_show_next(): Removed seq %u", form->seq); |
15374
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); |
23444
56cf59d028f7
Gadu-Gadu Get Info isn't behaving properly. Added debug logging to its traking
Evan Schoenberg <evan.s@dreskin.net>
parents:
23243
diff
changeset
|
498 purple_debug_info("gg", "ggp_callback_show_next(): Added seq %u", seq); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 |
15823 | 501 static void ggp_callback_add_buddy(PurpleConnection *gc, GList *row, gpointer user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 { |
15823 | 503 purple_blist_request_add_buddy(purple_connection_get_account(gc), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 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
|
505 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 |
15823 | 507 static void ggp_callback_im(PurpleConnection *gc, GList *row, gpointer user_data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 { |
15823 | 509 PurpleAccount *account; |
510 PurpleConversation *conv; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 char *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 |
15823 | 513 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 name = g_list_nth_data(row, 0); |
15823 | 516 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); |
517 purple_conversation_present(conv); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 |
15823 | 520 static void ggp_callback_find_buddies(PurpleConnection *gc, PurpleRequestFields *fields) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 GGPSearchForm *form; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 guint32 seq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 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
|
527 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 form->user_data = info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 form->lastname = charset_convert( |
15823 | 530 purple_request_fields_get_string(fields, "lastname"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 form->firstname = charset_convert( |
15823 | 533 purple_request_fields_get_string(fields, "firstname"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 form->nickname = charset_convert( |
15823 | 536 purple_request_fields_get_string(fields, "nickname"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
537 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 form->city = charset_convert( |
15823 | 539 purple_request_fields_get_string(fields, "city"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
541 form->birthyear = charset_convert( |
15823 | 542 purple_request_fields_get_string(fields, "year"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
543 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 |
15823 | 545 switch (purple_request_fields_get_choice(fields, "gender")) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 case 1: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 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
|
548 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 case 2: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 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
|
551 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 form->gender = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 break; |
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 |
15823 | 557 form->active = purple_request_fields_get_bool(fields, "active") |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 ? g_strdup(GG_PUBDIR50_ACTIVE_TRUE) : NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 form->offset = g_strdup("0"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 seq = ggp_search_start(gc, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 ggp_search_add(info->searches, seq, form); |
23444
56cf59d028f7
Gadu-Gadu Get Info isn't behaving properly. Added debug logging to its traking
Evan Schoenberg <evan.s@dreskin.net>
parents:
23243
diff
changeset
|
564 purple_debug_info("gg", "ggp_callback_find_buddies(): Added seq %u", seq); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 |
15823 | 567 static void ggp_find_buddies(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 { |
15823 | 569 PurpleConnection *gc = (PurpleConnection *)action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 |
15823 | 571 PurpleRequestFields *fields; |
572 PurpleRequestFieldGroup *group; | |
573 PurpleRequestField *field; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
574 |
15823 | 575 fields = purple_request_fields_new(); |
576 group = purple_request_field_group_new(NULL); | |
577 purple_request_fields_add_group(fields, group); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 |
15823 | 579 field = purple_request_field_string_new("lastname", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 _("Last name"), NULL, FALSE); |
15823 | 581 purple_request_field_string_set_masked(field, FALSE); |
582 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
583 |
15823 | 584 field = purple_request_field_string_new("firstname", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
585 _("First name"), NULL, FALSE); |
15823 | 586 purple_request_field_string_set_masked(field, FALSE); |
587 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 |
15823 | 589 field = purple_request_field_string_new("nickname", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 _("Nickname"), NULL, FALSE); |
15823 | 591 purple_request_field_string_set_masked(field, FALSE); |
592 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
593 |
15823 | 594 field = purple_request_field_string_new("city", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 _("City"), NULL, FALSE); |
15823 | 596 purple_request_field_string_set_masked(field, FALSE); |
597 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
598 |
15823 | 599 field = purple_request_field_string_new("year", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 _("Year of birth"), NULL, FALSE); |
15823 | 601 purple_request_field_group_add_field(group, field); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
602 |
15823 | 603 field = purple_request_field_choice_new("gender", _("Gender"), 0); |
604 purple_request_field_choice_add(field, _("Male or female")); | |
605 purple_request_field_choice_add(field, _("Male")); | |
606 purple_request_field_choice_add(field, _("Female")); | |
607 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
608 |
15823 | 609 field = purple_request_field_bool_new("active", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
610 _("Only online"), FALSE); |
15823 | 611 purple_request_field_group_add_field(group, field); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
613 purple_request_fields(gc, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 _("Find buddies"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 _("Find buddies"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 _("Please, enter your search criteria below"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
617 fields, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 _("OK"), G_CALLBACK(ggp_callback_find_buddies), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 _("Cancel"), NULL, |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
620 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
621 gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
622 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
624 /* ----- CHANGE PASSWORD ------------------------------------------------ */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 |
15823 | 626 static void ggp_callback_change_passwd_ok(PurpleConnection *gc, PurpleRequestFields *fields) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
627 { |
15823 | 628 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
629 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
630 struct gg_http *h; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 gchar *cur, *p1, *p2, *t; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 cur = charset_convert( |
15823 | 634 purple_request_fields_get_string(fields, "password_cur"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 p1 = charset_convert( |
15823 | 637 purple_request_fields_get_string(fields, "password1"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 p2 = charset_convert( |
15823 | 640 purple_request_fields_get_string(fields, "password2"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 t = charset_convert( |
15823 | 643 purple_request_fields_get_string(fields, "token"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 |
15823 | 646 account = purple_connection_get_account(gc); |
15374
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 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
|
649 *cur == '\0' || *p1 == '\0' || *p2 == '\0' || *t == '\0') { |
15823 | 650 purple_notify_error(account, NULL, _("Fill in the fields."), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 } |
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 if (g_utf8_collate(p1, p2) != 0) { |
15823 | 655 purple_notify_error(account, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
656 _("New passwords do not match."), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 |
15823 | 660 if (g_utf8_collate(cur, purple_account_get_password(account)) != 0) { |
661 purple_notify_error(account, NULL, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 _("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
|
663 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
664 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 |
15823 | 667 purple_debug_info("gg", "Changing password\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 |
23182
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23154
diff
changeset
|
669 /* XXX: this email should be a pref... */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 h = gg_change_passwd4(ggp_get_uin(account), |
15823 | 671 "user@example.net", purple_account_get_password(account), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 p1, info->token->id, t, 0); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
673 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
674 if (h == NULL) { |
15823 | 675 purple_notify_error(account, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
676 _("Unable to change password. Error occurred.\n"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
677 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 goto exit_err; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
679 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
680 |
15823 | 681 purple_account_set_password(account, p1); |
15374
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 gg_change_passwd_free(h); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
684 |
15823 | 685 purple_notify_info(account, _("Change password for the Gadu-Gadu account"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
686 _("Password was changed successfully!"), NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
687 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 exit_err: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
689 g_free(cur); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 g_free(p1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
691 g_free(p2); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
692 g_free(t); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
693 g_free(info->token->id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
694 g_free(info->token->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
695 g_free(info->token); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
697 |
15823 | 698 static void ggp_change_passwd_dialog(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 { |
15823 | 700 PurpleRequestFields *fields; |
701 PurpleRequestFieldGroup *group; | |
702 PurpleRequestField *field; | |
15374
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 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 GGPToken *token = info->token; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
709 |
15823 | 710 fields = purple_request_fields_new(); |
711 group = purple_request_field_group_new(NULL); | |
712 purple_request_fields_add_group(fields, group); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 |
15823 | 714 field = purple_request_field_string_new("password_cur", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 _("Current password"), "", FALSE); |
15823 | 716 purple_request_field_string_set_masked(field, TRUE); |
717 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 |
15823 | 719 field = purple_request_field_string_new("password1", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 _("Password"), "", FALSE); |
15823 | 721 purple_request_field_string_set_masked(field, TRUE); |
722 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 |
15823 | 724 field = purple_request_field_string_new("password2", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 _("Password (retype)"), "", FALSE); |
15823 | 726 purple_request_field_string_set_masked(field, TRUE); |
727 purple_request_field_group_add_field(group, field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
728 |
15823 | 729 field = purple_request_field_string_new("token", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 _("Enter current token"), "", FALSE); |
15823 | 731 purple_request_field_string_set_masked(field, FALSE); |
732 purple_request_field_group_add_field(group, field); | |
15374
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 /* original size: 60x24 */ |
15823 | 735 field = purple_request_field_image_new("token_img", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
736 _("Current token"), token->data, token->size); |
15823 | 737 purple_request_field_group_add_field(group, field); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
738 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
739 msg = g_strdup_printf("%s %d", |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
740 _("Please, enter your current password and your new password for UIN: "), |
15823 | 741 ggp_get_uin(purple_connection_get_account(gc))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
742 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
743 purple_request_fields(gc, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
744 _("Change Gadu-Gadu Password"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
745 _("Change Gadu-Gadu Password"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 fields, _("OK"), G_CALLBACK(ggp_callback_change_passwd_ok), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
748 _("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:
15823
diff
changeset
|
749 purple_connection_get_account(gc), NULL, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
750 gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
751 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 g_free(msg); |
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 |
15823 | 755 static void ggp_change_passwd(PurplePluginAction *action) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
756 { |
15823 | 757 PurpleConnection *gc = (PurpleConnection *)action->context; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
758 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
759 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
|
760 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
761 |
31799
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
762 /* ----- CHANGE STATUS BROADCASTING ------------------------------------------------ */ |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
763 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
764 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:
31616
diff
changeset
|
765 { |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
766 GGPInfo *info = gc->proto_data; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
767 int selected_field; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
768 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:
31616
diff
changeset
|
769 PurpleStatus *status; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
770 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
771 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:
31616
diff
changeset
|
772 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
773 if (selected_field == 0) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
774 info->status_broadcasting = TRUE; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
775 else |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
776 info->status_broadcasting = FALSE; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
777 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
778 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:
31616
diff
changeset
|
779 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
780 ggp_set_status(account, status); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
781 } |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
782 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
783 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:
31616
diff
changeset
|
784 { |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
785 PurpleConnection *gc = (PurpleConnection *)action->context; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
786 GGPInfo *info = gc->proto_data; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
787 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
788 PurpleRequestFields *fields; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
789 PurpleRequestFieldGroup *group; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
790 PurpleRequestField *field; |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
791 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
792 fields = purple_request_fields_new(); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
793 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:
31616
diff
changeset
|
794 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:
31616
diff
changeset
|
795 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
796 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:
31616
diff
changeset
|
797 purple_request_field_choice_add(field, _("All people")); |
31800
e31163acae07
Make terminology more consistent with the rest of our strings. Refs #13358.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31799
diff
changeset
|
798 purple_request_field_choice_add(field, _("Only buddies")); |
31799
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
799 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:
31616
diff
changeset
|
800 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
801 if (info->status_broadcasting) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
802 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:
31616
diff
changeset
|
803 else |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
804 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:
31616
diff
changeset
|
805 |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
806 purple_request_fields(gc, |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
807 _("Change status broadcasting"), |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
808 _("Change status broadcasting"), |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
809 _("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:
31616
diff
changeset
|
810 fields, |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
811 _("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:
31616
diff
changeset
|
812 _("Cancel"), NULL, |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
813 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:
31616
diff
changeset
|
814 gc); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
815 } |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
816 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
817 /* ----- CONFERENCES ---------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
818 |
24959
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
819 static void ggp_callback_add_to_chat_ok(PurpleBuddy *buddy, PurpleRequestFields *fields) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 { |
24959
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
821 GGPInfo *info; |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
822 PurpleConnection *conn; |
15823 | 823 PurpleRequestField *field; |
18118
ab6d2763b8d8
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents:
17457
diff
changeset
|
824 GList *sel; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
825 |
24959
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
826 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:
24430
diff
changeset
|
827 |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
828 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:
24430
diff
changeset
|
829 |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
830 info = conn->proto_data; |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
831 |
15823 | 832 field = purple_request_fields_get_field(fields, "name"); |
833 sel = purple_request_field_list_get_selected(field); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 |
24959
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
835 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:
24430
diff
changeset
|
836 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:
24430
diff
changeset
|
837 return; |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
838 } |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
839 |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
840 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:
24430
diff
changeset
|
841 ggp_str_to_uin(purple_buddy_get_name(buddy))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
842 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 |
15823 | 844 static void ggp_bmenu_add_to_chat(PurpleBlistNode *node, gpointer ignored) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 { |
15823 | 846 PurpleBuddy *buddy; |
847 PurpleConnection *gc; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 GGPInfo *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 |
15823 | 850 PurpleRequestFields *fields; |
851 PurpleRequestFieldGroup *group; | |
852 PurpleRequestField *field; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 gchar *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 |
15823 | 857 buddy = (PurpleBuddy *)node; |
858 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 |
15823 | 861 fields = purple_request_fields_new(); |
862 group = purple_request_field_group_new(NULL); | |
863 purple_request_fields_add_group(fields, group); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 |
15823 | 865 field = purple_request_field_list_new("name", "Chat name"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 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
|
867 GGPChat *chat = l->data; |
24959
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
868 purple_request_field_list_add(field, chat->name, chat->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 } |
15823 | 870 purple_request_field_group_add_field(group, field); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 msg = g_strdup_printf(_("Select a chat for buddy: %s"), |
15823 | 873 purple_buddy_get_alias(buddy)); |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
874 purple_request_fields(gc, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 _("Add to chat..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
876 _("Add to chat..."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 msg, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 fields, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 _("Add"), G_CALLBACK(ggp_callback_add_to_chat_ok), |
16442
08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents:
15823
diff
changeset
|
880 _("Cancel"), NULL, |
24959
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
881 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:
24430
diff
changeset
|
882 buddy); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
883 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 /* ----- BLOCK BUDDIES -------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
887 |
15823 | 888 static void ggp_bmenu_block(PurpleBlistNode *node, gpointer ignored) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 { |
15823 | 890 PurpleConnection *gc; |
891 PurpleBuddy *buddy; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 GGPInfo *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 uin_t uin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 |
15823 | 895 buddy = (PurpleBuddy *)node; |
896 gc = purple_account_get_connection(purple_buddy_get_account(buddy)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
897 info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 |
15823 | 899 uin = ggp_str_to_uin(purple_buddy_get_name(buddy)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 |
15823 | 901 if (purple_blist_node_get_bool(node, "blocked")) { |
902 purple_blist_node_set_bool(node, "blocked", FALSE); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 gg_remove_notify_ex(info->session, uin, GG_USER_BLOCKED); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 gg_add_notify_ex(info->session, uin, GG_USER_NORMAL); |
15823 | 905 purple_debug_info("gg", "send: uin=%d; mode=NORMAL\n", uin); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 } else { |
15823 | 907 purple_blist_node_set_bool(node, "blocked", TRUE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 gg_remove_notify_ex(info->session, uin, GG_USER_NORMAL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 gg_add_notify_ex(info->session, uin, GG_USER_BLOCKED); |
15823 | 910 purple_debug_info("gg", "send: uin=%d; mode=BLOCKED\n", uin); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 /* ----- INTERNAL CALLBACKS --------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
916 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 |
27246
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
918 struct gg_fetch_avatar_data |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
919 { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
920 PurpleConnection *gc; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
921 gchar *uin; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
922 gchar *avatar_url; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
923 }; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
924 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
925 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
926 static void gg_fetch_avatar_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
927 const gchar *data, size_t len, const gchar *error_message) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
928 struct gg_fetch_avatar_data *d = user_data; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
929 PurpleAccount *account; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
930 PurpleBuddy *buddy; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
931 gpointer buddy_icon_data; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
932 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
933 /* FIXME: This shouldn't be necessary */ |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
934 if (!PURPLE_CONNECTION_IS_VALID(d->gc)) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
935 g_free(d->uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
936 g_free(d->avatar_url); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
937 g_free(d); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
938 g_return_if_reached(); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
939 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
940 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
941 account = purple_connection_get_account(d->gc); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
942 buddy = purple_find_buddy(account, d->uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
943 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
944 if (buddy == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
945 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
946 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
947 buddy_icon_data = g_memdup(data, len); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
948 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
949 purple_buddy_icons_set_for_user(account, purple_buddy_get_name(buddy), |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
950 buddy_icon_data, len, d->avatar_url); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
951 purple_debug_info("gg", "UIN: %s should have avatar now\n", d->uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
952 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
953 out: |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
954 g_free(d->uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
955 g_free(d->avatar_url); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
956 g_free(d); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
957 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
958 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
959 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:
27229
diff
changeset
|
960 const gchar *url_text, size_t len, const gchar *error_message) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
961 struct gg_fetch_avatar_data *data; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
962 PurpleConnection *gc = user_data; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
963 PurpleAccount *account; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
964 PurpleBuddy *buddy; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
965 const char *uin; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
966 const char *is_blank; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
967 const char *checksum; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
968 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
969 gchar *bigavatar = NULL; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
970 xmlnode *xml = NULL; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
971 xmlnode *xmlnode_users; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
972 xmlnode *xmlnode_user; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
973 xmlnode *xmlnode_avatars; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
974 xmlnode *xmlnode_avatar; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
975 xmlnode *xmlnode_bigavatar; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
976 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
977 g_return_if_fail(PURPLE_CONNECTION_IS_VALID(gc)); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
978 account = purple_connection_get_account(gc); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
979 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
980 if (error_message != NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
981 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:
27229
diff
changeset
|
982 else if (len > 0 && url_text && *url_text) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
983 xml = xmlnode_from_str(url_text, -1); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
984 if (xml == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
985 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
986 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
987 xmlnode_users = xmlnode_get_child(xml, "users"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
988 if (xmlnode_users == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
989 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
990 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
991 xmlnode_user = xmlnode_get_child(xmlnode_users, "user"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
992 if (xmlnode_user == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
993 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
994 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
995 uin = xmlnode_get_attrib(xmlnode_user, "uin"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
996 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
997 xmlnode_avatars = xmlnode_get_child(xmlnode_user, "avatars"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
998 if (xmlnode_avatars == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
999 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1000 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1001 xmlnode_avatar = xmlnode_get_child(xmlnode_avatars, "avatar"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1002 if (xmlnode_avatar == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1003 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1004 |
29229
737b75b5a888
Fix Gadu-Gadu avatars. The server's response format has changed. Fixes #11050.
grommasher@gmail.com
parents:
27467
diff
changeset
|
1005 xmlnode_bigavatar = xmlnode_get_child(xmlnode_avatar, "originBigAvatar"); |
27246
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1006 if (xmlnode_bigavatar == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1007 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1008 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1009 is_blank = xmlnode_get_attrib(xmlnode_avatar, "blank"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1010 bigavatar = xmlnode_get_data(xmlnode_bigavatar); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1011 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1012 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:
27229
diff
changeset
|
1013 "URL %s\n", |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1014 uin ? uin : "(null)", is_blank ? is_blank : "(null)", |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1015 bigavatar ? bigavatar : "(null)"); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1016 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1017 if (uin != NULL && bigavatar != NULL) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1018 buddy = purple_find_buddy(account, uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1019 if (buddy == NULL) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1020 goto out; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1021 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1022 checksum = purple_buddy_icons_get_checksum_for_user(buddy); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1023 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1024 if (purple_strequal(is_blank, "1")) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1025 purple_buddy_icons_set_for_user(account, |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1026 purple_buddy_get_name(buddy), NULL, 0, NULL); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1027 } else if (!purple_strequal(checksum, bigavatar)) { |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1028 data = g_new0(struct gg_fetch_avatar_data, 1); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1029 data->gc = gc; |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1030 data->uin = g_strdup(uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1031 data->avatar_url = g_strdup(bigavatar); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1032 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1033 url_data = purple_util_fetch_url_request_len_with_account(account, |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1034 bigavatar, TRUE, "Mozilla/4.0 (compatible; MSIE 5.0)", |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1035 FALSE, NULL, FALSE, -1, gg_fetch_avatar_cb, data); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1036 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1037 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1038 } |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1039 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1040 out: |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1041 if (xml) |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1042 xmlnode_free(xml); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1043 g_free(bigavatar); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1044 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1045 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1046 /** |
31917
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1047 * 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:
31915
diff
changeset
|
1048 * |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1049 * @param gc PurpleConnection |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1050 * @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:
31915
diff
changeset
|
1051 */ |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1052 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:
31915
diff
changeset
|
1053 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1054 gchar *avatarurl; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1055 PurpleUtilFetchUrlData *url_data; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1056 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1057 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:
31915
diff
changeset
|
1058 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1059 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:
31915
diff
changeset
|
1060 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1061 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:
31915
diff
changeset
|
1062 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:
31915
diff
changeset
|
1063 "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:
31915
diff
changeset
|
1064 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:
31915
diff
changeset
|
1065 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1066 g_free(avatarurl); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1067 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1068 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1069 /** |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1070 * 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
|
1071 * |
15823 | 1072 * @param gc PurpleConnection |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1073 * @param uin UIN of the buddy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1074 * @param status ID of the status. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1075 * @param descr Description. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1076 */ |
15823 | 1077 static void ggp_generic_status_handler(PurpleConnection *gc, uin_t uin, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1078 int status, const char *descr) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1079 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1080 gchar *from; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1081 const char *st; |
31917
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1082 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1083 ggp_update_buddy_avatar(gc, uin); |
27246
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1084 |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1085 from = g_strdup_printf("%u", uin); |
959e86c022f7
Support fetching Gadu-Gadu avatars. Closes #9371.
grommasher@gmail.com
parents:
27229
diff
changeset
|
1086 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1087 switch (status) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1088 case GG_STATUS_NOT_AVAIL: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1089 case GG_STATUS_NOT_AVAIL_DESCR: |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1090 st = purple_primitive_get_id_from_type(PURPLE_STATUS_OFFLINE); |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1091 break; |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1092 case GG_STATUS_FFC: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1093 case GG_STATUS_FFC_DESCR: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1094 st = purple_primitive_get_id_from_type(PURPLE_STATUS_AVAILABLE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1095 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1096 case GG_STATUS_AVAIL: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1097 case GG_STATUS_AVAIL_DESCR: |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1098 st = purple_primitive_get_id_from_type(PURPLE_STATUS_AVAILABLE); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1099 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1100 case GG_STATUS_BUSY: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1101 case GG_STATUS_BUSY_DESCR: |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1102 st = purple_primitive_get_id_from_type(PURPLE_STATUS_AWAY); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1103 break; |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1104 case GG_STATUS_DND: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1105 case GG_STATUS_DND_DESCR: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1106 st = purple_primitive_get_id_from_type(PURPLE_STATUS_UNAVAILABLE); |
30183 | 1107 break; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1108 case GG_STATUS_BLOCKED: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1109 /* user is blocking us.... */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1110 st = "blocked"; |
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 default: |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1113 st = purple_primitive_get_id_from_type(PURPLE_STATUS_AVAILABLE); |
15823 | 1114 purple_debug_info("gg", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1115 "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
|
1116 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1117 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1118 |
15823 | 1119 purple_debug_info("gg", "st = %s\n", st); |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1120 //msg = charset_convert(descr, "CP1250", "UTF-8"); |
30133
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1121 if (descr == NULL) { |
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1122 purple_prpl_got_user_status(purple_connection_get_account(gc), |
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1123 from, st, NULL); |
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1124 } else { |
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1125 purple_prpl_got_user_status(purple_connection_get_account(gc), |
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1126 from, st, "message", descr, NULL); |
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1127 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1128 g_free(from); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1129 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1130 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1131 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
|
1132 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1133 GGPSearchForm *form = user_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1134 GGPInfo *info = form->user_data; |
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 ggp_search_remove(info->searches, form->seq); |
23444
56cf59d028f7
Gadu-Gadu Get Info isn't behaving properly. Added debug logging to its traking
Evan Schoenberg <evan.s@dreskin.net>
parents:
23243
diff
changeset
|
1137 purple_debug_info("gg", "ggp_sr_close_cb(): Removed seq %u", form->seq); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1138 ggp_search_form_destroy(form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1139 } |
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 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1142 * 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
|
1143 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1144 * @param id The ID of the status. |
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 * @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
|
1147 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1148 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
|
1149 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1150 const char *st; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1151 |
15823 | 1152 purple_debug_info("gg", "ggp_status_by_id: %d\n", id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1153 switch (id) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1154 case GG_STATUS_NOT_AVAIL: |
27229
ef9e68020265
Correctly show status in tooltips for GG contacts with status messages.
grommasher@gmail.com
parents:
27118
diff
changeset
|
1155 case GG_STATUS_NOT_AVAIL_DESCR: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1156 st = _("Offline"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1157 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1158 case GG_STATUS_AVAIL: |
27229
ef9e68020265
Correctly show status in tooltips for GG contacts with status messages.
grommasher@gmail.com
parents:
27118
diff
changeset
|
1159 case GG_STATUS_AVAIL_DESCR: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1160 st = _("Available"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1161 break; |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1162 case GG_STATUS_FFC: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1163 case GG_STATUS_FFC_DESCR: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1164 return _("Chatty"); |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1165 case GG_STATUS_DND: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1166 case GG_STATUS_DND_DESCR: |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1167 return _("Do Not Disturb"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1168 case GG_STATUS_BUSY: |
27229
ef9e68020265
Correctly show status in tooltips for GG contacts with status messages.
grommasher@gmail.com
parents:
27118
diff
changeset
|
1169 case GG_STATUS_BUSY_DESCR: |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1170 st = _("Away"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1171 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 default: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1173 st = _("Unknown"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1175 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1177 return st; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1178 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1179 |
15823 | 1180 static void ggp_pubdir_handle_info(PurpleConnection *gc, gg_pubdir50_t req, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 GGPSearchForm *form) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1182 { |
15823 | 1183 PurpleNotifyUserInfo *user_info; |
1184 PurpleBuddy *buddy; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 char *val, *who; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1186 |
15823 | 1187 user_info = purple_notify_user_info_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 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
|
1190 /* XXX: Use of ggp_str_to_uin() is an ugly hack! */ |
15823 | 1191 purple_notify_user_info_add_pair(user_info, _("Status"), ggp_status_by_id(ggp_str_to_uin(val))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1194 who = ggp_search_get_result(req, 0, GG_PUBDIR50_UIN); |
15823 | 1195 purple_notify_user_info_add_pair(user_info, _("UIN"), who); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1197 val = ggp_search_get_result(req, 0, GG_PUBDIR50_FIRSTNAME); |
15823 | 1198 purple_notify_user_info_add_pair(user_info, _("First Name"), val); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 val = ggp_search_get_result(req, 0, GG_PUBDIR50_NICKNAME); |
15823 | 1202 purple_notify_user_info_add_pair(user_info, _("Nickname"), val); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1204 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 val = ggp_search_get_result(req, 0, GG_PUBDIR50_CITY); |
15823 | 1206 purple_notify_user_info_add_pair(user_info, _("City"), val); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1207 g_free(val); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1208 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1209 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
|
1210 if (strncmp(val, "0", 1)) { |
15823 | 1211 purple_notify_user_info_add_pair(user_info, _("Birth Year"), val); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1212 } |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1216 * 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
|
1217 */ |
15823 | 1218 buddy = purple_find_buddy(purple_connection_get_account(gc), who); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1219 if (NULL != buddy) { |
15823 | 1220 PurpleStatus *status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1221 const char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1222 char *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1223 |
15823 | 1224 status = purple_presence_get_active_status(purple_buddy_get_presence(buddy)); |
1225 msg = purple_status_get_attr_string(status, "message"); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1226 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1227 if (msg != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1228 text = g_markup_escape_text(msg, -1); |
15823 | 1229 purple_notify_user_info_add_pair(user_info, _("Message"), text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1230 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1231 } |
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 |
18445
ac7b380daa0a
Close temporary Get Info window when showing the real one. Fixes #1720.
Bartoz Oler <bartosz@pidgin.im>
parents:
18118
diff
changeset
|
1234 purple_notify_userinfo(gc, who, user_info, ggp_sr_close_cb, form); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1235 g_free(who); |
15823 | 1236 purple_notify_user_info_destroy(user_info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1237 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1238 |
15823 | 1239 static void ggp_pubdir_handle_full(PurpleConnection *gc, gg_pubdir50_t req, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 GGPSearchForm *form) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 { |
15823 | 1242 PurpleNotifySearchResults *results; |
1243 PurpleNotifySearchColumn *column; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 int res_count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 int start; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1246 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1247 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1248 g_return_if_fail(form != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 res_count = gg_pubdir50_count(req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 res_count = (res_count > PUBDIR_RESULTS_MAX) ? PUBDIR_RESULTS_MAX : res_count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 |
15823 | 1253 results = purple_notify_searchresults_new(); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 if (results == NULL) { |
15823 | 1256 purple_debug_error("gg", "ggp_pubdir_reply_handler: " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 "Unable to display the search results.\n"); |
15823 | 1258 purple_notify_error(gc, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 _("Unable to display the search results."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1261 ggp_sr_close_cb(form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 |
15823 | 1265 column = purple_notify_searchresults_column_new(_("UIN")); |
1266 purple_notify_searchresults_column_add(results, column); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 |
15823 | 1268 column = purple_notify_searchresults_column_new(_("First Name")); |
1269 purple_notify_searchresults_column_add(results, column); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 |
15823 | 1271 column = purple_notify_searchresults_column_new(_("Nickname")); |
1272 purple_notify_searchresults_column_add(results, column); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 |
15823 | 1274 column = purple_notify_searchresults_column_new(_("City")); |
1275 purple_notify_searchresults_column_add(results, column); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 |
15823 | 1277 column = purple_notify_searchresults_column_new(_("Birth Year")); |
1278 purple_notify_searchresults_column_add(results, column); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1279 |
15823 | 1280 purple_debug_info("gg", "Going with %d entries\n", res_count); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 start = (int)ggp_str_to_uin(gg_pubdir50_get(req, 0, GG_PUBDIR50_START)); |
15823 | 1283 purple_debug_info("gg", "start = %d\n", start); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 for (i = 0; i < res_count; i++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1286 GList *row = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1287 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
|
1288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 /* 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
|
1290 /* 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
|
1291 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
|
1292 GG_PUBDIR50_UIN)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1293 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
|
1294 GG_PUBDIR50_FIRSTNAME)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1295 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
|
1296 GG_PUBDIR50_NICKNAME)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1297 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
|
1298 GG_PUBDIR50_CITY)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1299 row = g_list_append(row, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1300 (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
|
1301 |
15823 | 1302 purple_notify_searchresults_row_add(results, row); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1304 if (i == res_count - 1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1305 g_free(form->last_uin); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1306 form->last_uin = ggp_search_get_result(req, i, GG_PUBDIR50_UIN); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1307 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1308 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1309 |
15823 | 1310 purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_CONTINUE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1311 ggp_callback_show_next); |
15823 | 1312 purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_ADD, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1313 ggp_callback_add_buddy); |
15823 | 1314 purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_IM, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1315 ggp_callback_im); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1316 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1317 if (form->window == NULL) { |
15823 | 1318 void *h = purple_notify_searchresults(gc, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1319 _("Gadu-Gadu Public Directory"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1320 _("Search results"), NULL, results, |
15823 | 1321 (PurpleNotifyCloseCallback)ggp_sr_close_cb, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1322 form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 if (h == NULL) { |
15823 | 1325 purple_debug_error("gg", "ggp_pubdir_reply_handler: " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 "Unable to display the search results.\n"); |
15823 | 1327 purple_notify_error(gc, NULL, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 _("Unable to display the search results."), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1331 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 form->window = h; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 } else { |
15823 | 1335 purple_notify_searchresults_new_rows(gc, results, form->window); |
15374
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 |
15823 | 1339 static void ggp_pubdir_reply_handler(PurpleConnection *gc, gg_pubdir50_t req) |
15374
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 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 GGPSearchForm *form; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1343 int res_count; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 guint32 seq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 seq = gg_pubdir50_seq(req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 form = ggp_search_get(info->searches, seq); |
23444
56cf59d028f7
Gadu-Gadu Get Info isn't behaving properly. Added debug logging to its traking
Evan Schoenberg <evan.s@dreskin.net>
parents:
23243
diff
changeset
|
1348 purple_debug_info("gg", "ggp_pubdir_reply_handler(): seq %u --> form %p", seq, form); |
15374
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 * 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
|
1351 * 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
|
1352 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1353 g_return_if_fail(form != NULL); |
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 res_count = gg_pubdir50_count(req); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1356 if (res_count < 1) { |
15823 | 1357 purple_debug_info("gg", "GG_EVENT_PUBDIR50_SEARCH_REPLY: Nothing found\n"); |
1358 purple_notify_error(gc, NULL, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 _("No matching users found"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 _("There are no users matching your search criteria.")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1361 ggp_sr_close_cb(form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1362 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1364 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 switch (form->search_type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 case GGP_SEARCH_TYPE_INFO: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 ggp_pubdir_handle_info(gc, req, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 case GGP_SEARCH_TYPE_FULL: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 ggp_pubdir_handle_full(gc, req, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 default: |
15823 | 1373 purple_debug_warning("gg", "Unknown search_type!\n"); |
15374
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1378 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:
24398
diff
changeset
|
1379 { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1380 gint imgid = 0; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1381 GGPInfo *info = gc->proto_data; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1382 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:
24398
diff
changeset
|
1383 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:
24398
diff
changeset
|
1384 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1385 imgid = purple_imgstore_add_with_id( |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1386 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:
24398
diff
changeset
|
1387 ev->event.image_reply.size, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1388 ev->event.image_reply.filename); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1389 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1390 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:
24398
diff
changeset
|
1391 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1392 while(entry) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1393 if (strstr((gchar *)entry->data, handlerid) != NULL) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1394 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:
24398
diff
changeset
|
1395 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:
24398
diff
changeset
|
1396 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:
24398
diff
changeset
|
1397 g_strfreev(split); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1398 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:
24398
diff
changeset
|
1399 /* 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:
24398
diff
changeset
|
1400 if (strstr(text, "<IMG ID=\"IMGID_HANDLER") == NULL) { |
31915 | 1401 gchar *buf = g_strdup_printf("%lu", (unsigned long int)ev->event.image_reply.sender); |
1402 serv_got_im(gc, buf, text, PURPLE_MESSAGE_IMAGES, time(NULL)); | |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1403 g_free(buf); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1404 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:
24398
diff
changeset
|
1405 g_free(text); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1406 break; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1407 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1408 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:
24398
diff
changeset
|
1409 break; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1410 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1411 entry = g_list_next(entry); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1412 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1413 g_free(handlerid); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1414 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1415 return; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1416 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1417 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1418 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1419 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1420 * Dispatch a message received from a buddy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1421 * |
15823 | 1422 * @param gc PurpleConnection. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1423 * @param ev Gadu-Gadu event structure. |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1424 * |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1425 * Image receiving, some code borrowed from Kadu http://www.kadu.net |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1426 */ |
15823 | 1427 static void ggp_recv_message_handler(PurpleConnection *gc, const struct gg_event *ev) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1428 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1429 GGPInfo *info = gc->proto_data; |
15823 | 1430 PurpleConversation *conv; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1431 gchar *from; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 gchar *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1433 gchar *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1434 |
31862
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31847
diff
changeset
|
1435 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:
31847
diff
changeset
|
1436 { |
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31847
diff
changeset
|
1437 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:
31847
diff
changeset
|
1438 return; |
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31847
diff
changeset
|
1439 } |
fa728fd38c00
When somebody sends me an image, I get some (depends on image size) empty
tomkiewicz@o2.pl
parents:
31847
diff
changeset
|
1440 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1441 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
|
1442 |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1443 /* |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1444 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
|
1445 "CP1250", "UTF-8"); |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1446 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1447 tmp = g_strdup_printf("%s", ev->event.msg.message); |
15823 | 1448 purple_str_strip_char(tmp, '\r'); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1449 msg = g_markup_escape_text(tmp, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1450 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1451 |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1452 /* We got richtext message */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1453 if (ev->event.msg.formats_length) |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1454 { |
24429
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
1455 gboolean got_image = FALSE, bold = FALSE, italic = FALSE, under = FALSE; |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1456 char *cformats = (char *)ev->event.msg.formats; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1457 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:
24398
diff
changeset
|
1458 gint increased_len = 0; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1459 struct gg_msg_richtext_format *actformat; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1460 struct gg_msg_richtext_image *actimage; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1461 GString *message = g_string_new(msg); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1462 gchar *handlerid; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1463 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1464 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:
24398
diff
changeset
|
1465 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1466 while (cformats < cformats_end) |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1467 { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1468 gint byteoffset; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1469 actformat = (struct gg_msg_richtext_format *)cformats; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1470 cformats += sizeof(struct gg_msg_richtext_format); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1471 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:
24398
diff
changeset
|
1472 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1473 if(actformat->position == 0 && actformat->font == 0) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1474 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:
24398
diff
changeset
|
1475 continue; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1476 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1477 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:
24398
diff
changeset
|
1478 actformat->position, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1479 (actformat->font & GG_FONT_IMAGE) != 0, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1480 (actformat->font & GG_FONT_BOLD) != 0, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1481 (actformat->font & GG_FONT_ITALIC) != 0, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1482 (actformat->font & GG_FONT_UNDERLINE) != 0, |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1483 increased_len); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1484 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1485 if (actformat->font & GG_FONT_IMAGE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1486 got_image = TRUE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1487 actimage = (struct gg_msg_richtext_image*)(cformats); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1488 cformats += sizeof(struct gg_msg_richtext_image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1489 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:
24398
diff
changeset
|
1490 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1491 /* 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:
24398
diff
changeset
|
1492 * larger than 255.000 bytes */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1493 if (actimage->size > 255000) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1494 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:
24398
diff
changeset
|
1495 continue; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1496 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1497 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1498 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:
24398
diff
changeset
|
1499 actimage->size, actimage->crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1500 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1501 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:
24398
diff
changeset
|
1502 g_string_insert(message, byteoffset, handlerid); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1503 increased_len += strlen(handlerid); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1504 g_free(handlerid); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1505 continue; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1506 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1507 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1508 if (actformat->font & GG_FONT_BOLD) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1509 if (bold == FALSE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1510 g_string_insert(message, byteoffset, "<b>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1511 increased_len += 3; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1512 bold = TRUE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1513 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1514 } else if (bold) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1515 g_string_insert(message, byteoffset, "</b>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1516 increased_len += 4; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1517 bold = FALSE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1518 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1519 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1520 if (actformat->font & GG_FONT_ITALIC) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1521 if (italic == FALSE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1522 g_string_insert(message, byteoffset, "<i>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1523 increased_len += 3; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1524 italic = TRUE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1525 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1526 } else if (italic) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1527 g_string_insert(message, byteoffset, "</i>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1528 increased_len += 4; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1529 italic = FALSE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1530 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1531 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1532 if (actformat->font & GG_FONT_UNDERLINE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1533 if (under == FALSE) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1534 g_string_insert(message, byteoffset, "<u>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1535 increased_len += 3; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1536 under = TRUE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1537 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1538 } else if (under) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1539 g_string_insert(message, byteoffset, "</u>"); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1540 increased_len += 4; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1541 under = FALSE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1542 } |
31616
1607b413a139
gg: Prevent dropping whole messages when the text is colored. Fixes #13259.
quantifier666@gmail.com
parents:
31534
diff
changeset
|
1543 |
1607b413a139
gg: Prevent dropping whole messages when the text is colored. Fixes #13259.
quantifier666@gmail.com
parents:
31534
diff
changeset
|
1544 if (actformat->font & GG_FONT_COLOR) { |
1607b413a139
gg: Prevent dropping whole messages when the text is colored. Fixes #13259.
quantifier666@gmail.com
parents:
31534
diff
changeset
|
1545 cformats += sizeof(struct gg_msg_richtext_color); |
1607b413a139
gg: Prevent dropping whole messages when the text is colored. Fixes #13259.
quantifier666@gmail.com
parents:
31534
diff
changeset
|
1546 } |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1547 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1548 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1549 msg = message->str; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1550 g_string_free(message, FALSE); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1551 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1552 if (got_image) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1553 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:
24398
diff
changeset
|
1554 return; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1555 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1556 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1557 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1558 purple_debug_info("gg", "ggp_recv_message_handler: msg from (%s): %s (class = %d; rcpt_count = %d)\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1559 from, msg, ev->event.msg.msgclass, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1560 ev->event.msg.recipients_count); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1561 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1562 if (ev->event.msg.recipients_count == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1563 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
|
1564 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1565 const char *chat_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1566 int chat_id; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1567 char *buddy_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1568 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1569 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
|
1570 ev->event.msg.recipients, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1571 ev->event.msg.recipients_count); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1572 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1573 if (chat_name == NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1574 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
|
1575 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
|
1576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1577 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
|
1578 ev->event.msg.sender); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1579 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1580 ggp_confer_participants_add(gc, chat_name, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1581 ev->event.msg.recipients, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1582 ev->event.msg.recipients_count); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1583 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1584 conv = ggp_confer_find_by_name(gc, chat_name); |
15823 | 1585 chat_id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1586 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1587 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
|
1588 serv_got_chat_in(gc, chat_id, buddy_name, |
15823 | 1589 PURPLE_MESSAGE_RECV, msg, ev->event.msg.time); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1590 g_free(buddy_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1591 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1592 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1593 g_free(from); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1594 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1595 |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1596 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:
24398
diff
changeset
|
1597 { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1598 GGPInfo *info = gc->proto_data; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1599 PurpleStoredImage *image; |
31879
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
1600 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:
31862
diff
changeset
|
1601 |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
1602 purple_debug_info("gg", "ggp_send_image_handler: image request received, crc32: %u, imgid: %d\n", ev->event.image_request.crc32, imgid); |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1603 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1604 if(imgid) |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1605 { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1606 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:
24398
diff
changeset
|
1607 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:
24398
diff
changeset
|
1608 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:
24398
diff
changeset
|
1609 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:
24398
diff
changeset
|
1610 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1611 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:
24398
diff
changeset
|
1612 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:
24398
diff
changeset
|
1613 purple_imgstore_unref(image); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1614 } else { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1615 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:
24398
diff
changeset
|
1616 } |
31879
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
1617 g_hash_table_remove(info->pending_images, GINT_TO_POINTER(ev->event.image_request.crc32)); |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1618 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1619 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1620 |
31881
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1621 static void ggp_typing_notification_handler(PurpleConnection *gc, uin_t uin, int length) { |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1622 gchar *from; |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1623 |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1624 from = g_strdup_printf("%u", uin); |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1625 if (length) |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1626 serv_got_typing(gc, from, 0, PURPLE_TYPING); |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1627 else |
31900
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
1628 serv_got_typing_stopped(gc, from); |
31881
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1629 g_free(from); |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1630 } |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1631 |
31917
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1632 /** |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1633 * Handling of XML events. |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1634 * |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1635 * @param gc PurpleConnection. |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1636 * @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:
31915
diff
changeset
|
1637 * |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1638 * @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:
31915
diff
changeset
|
1639 */ |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1640 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:
31915
diff
changeset
|
1641 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1642 xmlnode *xml = NULL; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1643 xmlnode *xmlnode_next_event; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1644 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1645 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:
31915
diff
changeset
|
1646 if (xml == NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1647 goto out; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1648 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1649 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:
31915
diff
changeset
|
1650 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:
31915
diff
changeset
|
1651 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1652 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:
31915
diff
changeset
|
1653 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1654 xmlnode *xmlnode_type; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1655 char *event_type_raw; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1656 int event_type = 0; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1657 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1658 xmlnode *xmlnode_sender; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1659 char *event_sender_raw; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1660 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:
31915
diff
changeset
|
1661 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1662 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:
31915
diff
changeset
|
1663 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1664 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:
31915
diff
changeset
|
1665 if (xmlnode_type == NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1666 continue; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1667 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:
31915
diff
changeset
|
1668 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:
31915
diff
changeset
|
1669 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:
31915
diff
changeset
|
1670 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:
31915
diff
changeset
|
1671 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1672 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:
31915
diff
changeset
|
1673 if (xmlnode_sender != NULL) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1674 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1675 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:
31915
diff
changeset
|
1676 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:
31915
diff
changeset
|
1677 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:
31915
diff
changeset
|
1678 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:
31915
diff
changeset
|
1679 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1680 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1681 switch (event_type) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1682 { |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1683 case 28: /* avatar update */ |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1684 purple_debug_info("gg", |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1685 "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:
31915
diff
changeset
|
1686 event_sender); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1687 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:
31915
diff
changeset
|
1688 break; |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1689 default: |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1690 purple_debug_error("gg", |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1691 "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:
31915
diff
changeset
|
1692 event_type, event_sender); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1693 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1694 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1695 |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1696 out: |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1697 if (xml) |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1698 xmlnode_free(xml); |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1699 } |
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1700 |
15823 | 1701 static void ggp_callback_recv(gpointer _gc, gint fd, PurpleInputCondition cond) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1702 { |
15823 | 1703 PurpleConnection *gc = _gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1704 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1705 struct gg_event *ev; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1706 int i; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1707 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1708 if (!(ev = gg_watch_fd(info->session))) { |
15823 | 1709 purple_debug_error("gg", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1710 "ggp_callback_recv: gg_watch_fd failed -- CRITICAL!\n"); |
21358 | 1711 purple_connection_error_reason (gc, |
1712 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
1713 _("Unable to read from socket")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1714 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1715 } |
31913
277b7f1d6214
Don't update last_received when receiving data on gg. Fixes #13699.
quantifier666@gmail.com
parents:
31901
diff
changeset
|
1716 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1717 switch (ev->type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1718 case GG_EVENT_NONE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1719 /* Nothing happened. */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1720 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1721 case GG_EVENT_MSG: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1722 ggp_recv_message_handler(gc, ev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1723 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1724 case GG_EVENT_ACK: |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1725 /* Changing %u to %i fixes compiler warning */ |
15823 | 1726 purple_debug_info("gg", |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1727 "ggp_callback_recv: message sent to: %i, delivery status=%d, seq=%d\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1728 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
|
1729 ev->event.ack.seq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1730 break; |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1731 case GG_EVENT_IMAGE_REPLY: |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1732 ggp_recv_image_handler(gc, ev); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1733 break; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1734 case GG_EVENT_IMAGE_REQUEST: |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1735 ggp_send_image_handler(gc, ev); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1736 break; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1737 case GG_EVENT_NOTIFY: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1738 case GG_EVENT_NOTIFY_DESCR: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1739 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1740 struct gg_notify_reply *n; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1741 char *descr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1742 |
15823 | 1743 purple_debug_info("gg", "notify_pre: (%d) status: %d\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1744 ev->event.notify->uin, |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1745 GG_S(ev->event.notify->status)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1746 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1747 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
|
1748 : ev->event.notify_descr.notify; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1749 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1750 for (; n->uin; n++) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1751 descr = (ev->type == GG_EVENT_NOTIFY) ? NULL |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1752 : ev->event.notify_descr.descr; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1753 |
15823 | 1754 purple_debug_info("gg", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1755 "notify: (%d) status: %d; descr: %s\n", |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1756 n->uin, GG_S(n->status), descr ? descr : "(null)"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1757 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1758 ggp_generic_status_handler(gc, |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1759 n->uin, GG_S(n->status), descr); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1760 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1761 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1762 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1763 case GG_EVENT_NOTIFY60: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1764 for (i = 0; ev->event.notify60[i].uin; i++) { |
15823 | 1765 purple_debug_info("gg", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1766 "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
|
1767 ev->event.notify60[i].uin, |
30133
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1768 GG_S(ev->event.notify60[i].status), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1769 ev->event.notify60[i].version, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1770 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
|
1771 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1772 ggp_generic_status_handler(gc, ev->event.notify60[i].uin, |
30133
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1773 GG_S(ev->event.notify60[i].status), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1774 ev->event.notify60[i].descr); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1775 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1776 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1777 case GG_EVENT_STATUS: |
15823 | 1778 purple_debug_info("gg", "status: (%d) status=%d; descr=%s\n", |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1779 ev->event.status.uin, GG_S(ev->event.status.status), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1780 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
|
1781 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1782 ggp_generic_status_handler(gc, ev->event.status.uin, |
30133
0665d7eff0a3
gadu-gadu: (NULL)-like descriptions and packet size problems. Fixes #11676
kkszysiu@gmail.com
parents:
29944
diff
changeset
|
1783 GG_S(ev->event.status.status), ev->event.status.descr); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1784 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1785 case GG_EVENT_STATUS60: |
15823 | 1786 purple_debug_info("gg", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1787 "status60: (%d) status=%d; version=%d; descr=%s\n", |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1788 ev->event.status60.uin, GG_S(ev->event.status60.status), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1789 ev->event.status60.version, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1790 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
|
1791 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1792 ggp_generic_status_handler(gc, ev->event.status60.uin, |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
1793 GG_S(ev->event.status60.status), ev->event.status60.descr); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1794 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1795 case GG_EVENT_USERLIST: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1796 if (ev->event.userlist.type == GG_USERLIST_GET_REPLY) { |
15823 | 1797 purple_debug_info("gg", "GG_USERLIST_GET_REPLY\n"); |
1798 purple_notify_info(gc, NULL, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1799 _("Buddy list downloaded"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1800 _("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
|
1801 if (ev->event.userlist.reply != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1802 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
|
1803 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1804 } else { |
15823 | 1805 purple_debug_info("gg", "GG_USERLIST_PUT_REPLY\n"); |
1806 purple_notify_info(gc, NULL, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1807 _("Buddy list uploaded"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1808 _("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
|
1809 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1810 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1811 case GG_EVENT_PUBDIR50_SEARCH_REPLY: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1812 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
|
1813 break; |
31881
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1814 case GG_EVENT_TYPING_NOTIFICATION: |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1815 ggp_typing_notification_handler(gc, ev->event.typing_notification.uin, |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1816 ev->event.typing_notification.length); |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
1817 break; |
31917
64d1be114e02
Recently I found out a small issue: if another user changes it's avatar, we
tomkiewicz@o2.pl
parents:
31915
diff
changeset
|
1818 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:
31915
diff
changeset
|
1819 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:
31915
diff
changeset
|
1820 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:
31915
diff
changeset
|
1821 break; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1822 default: |
15823 | 1823 purple_debug_error("gg", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1824 "unsupported event type=%d\n", ev->type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1825 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1826 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1827 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1828 gg_free_event(ev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1829 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1830 |
15823 | 1831 static void ggp_async_login_handler(gpointer _gc, gint fd, PurpleInputCondition cond) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1832 { |
15823 | 1833 PurpleConnection *gc = _gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1834 GGPInfo *info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1835 struct gg_event *ev; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1836 |
15823 | 1837 g_return_if_fail(PURPLE_CONNECTION_IS_VALID(gc)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1838 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1839 info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1840 |
15823 | 1841 purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1842 info->session->check, info->session->state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1843 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1844 switch (info->session->state) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1845 case GG_STATE_RESOLVING: |
15823 | 1846 purple_debug_info("gg", "GG_STATE_RESOLVING\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1847 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1848 case GG_STATE_CONNECTING_HUB: |
15823 | 1849 purple_debug_info("gg", "GG_STATE_CONNECTING_HUB\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1850 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1851 case GG_STATE_READING_DATA: |
15823 | 1852 purple_debug_info("gg", "GG_STATE_READING_DATA\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1853 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1854 case GG_STATE_CONNECTING_GG: |
15823 | 1855 purple_debug_info("gg", "GG_STATE_CONNECTING_GG\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1856 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1857 case GG_STATE_READING_KEY: |
15823 | 1858 purple_debug_info("gg", "GG_STATE_READING_KEY\n"); |
15374
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_REPLY: |
15823 | 1861 purple_debug_info("gg", "GG_STATE_READING_REPLY\n"); |
15374
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 default: |
15823 | 1864 purple_debug_error("gg", "unknown state = %d\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1865 info->session->state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1866 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1867 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1868 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1869 if (!(ev = gg_watch_fd(info->session))) { |
15823 | 1870 purple_debug_error("gg", "login_handler: gg_watch_fd failed!\n"); |
21358 | 1871 purple_connection_error_reason (gc, |
1872 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
1873 _("Unable to read from socket")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1874 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1875 } |
15823 | 1876 purple_debug_info("gg", "login_handler: session->fd = %d\n", info->session->fd); |
1877 purple_debug_info("gg", "login_handler: session: check = %d; state = %d;\n", | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1878 info->session->check, info->session->state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1879 |
15823 | 1880 purple_input_remove(gc->inpa); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1881 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1882 /** XXX I think that this shouldn't be done if ev->type is GG_EVENT_CONN_FAILED or GG_EVENT_CONN_SUCCESS -datallah */ |
15823 | 1883 gc->inpa = purple_input_add(info->session->fd, |
1884 (info->session->check == 1) ? PURPLE_INPUT_WRITE | |
1885 : PURPLE_INPUT_READ, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1886 ggp_async_login_handler, gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1887 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1888 switch (ev->type) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1889 case GG_EVENT_NONE: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1890 /* Nothing happened. */ |
15823 | 1891 purple_debug_info("gg", "GG_EVENT_NONE\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1892 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1893 case GG_EVENT_CONN_SUCCESS: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1894 { |
15823 | 1895 purple_debug_info("gg", "GG_EVENT_CONN_SUCCESS\n"); |
1896 purple_input_remove(gc->inpa); | |
1897 gc->inpa = purple_input_add(info->session->fd, | |
1898 PURPLE_INPUT_READ, | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1899 ggp_callback_recv, gc); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30283
diff
changeset
|
1900 |
27467
ac299d029823
Patch from kkszysiu to make the GG prpl support
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
27454
diff
changeset
|
1901 ggp_buddylist_send(gc); |
30283
fb6312881d56
gg: Fix misuse of update_progress. Fixes #11774
kkszysiu@gmail.com
parents:
30262
diff
changeset
|
1902 purple_connection_update_progress(gc, _("Connected"), 1, 2); |
15823 | 1903 purple_connection_set_state(gc, PURPLE_CONNECTED); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1904 } |
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_FAILED: |
15823 | 1907 purple_input_remove(gc->inpa); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1908 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:
19696
diff
changeset
|
1909 purple_connection_error_reason (gc, |
21358 | 1910 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
1911 _("Connection failed")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1912 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1913 default: |
15823 | 1914 purple_debug_error("gg", "strange event: %d\n", ev->type); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1915 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1916 } |
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 gg_free_event(ev); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1919 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1920 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1921 /* ---------------------------------------------------------------------- */ |
15823 | 1922 /* ----- PurplePluginProtocolInfo ----------------------------------------- */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1923 /* ---------------------------------------------------------------------- */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1924 |
15823 | 1925 static const char *ggp_list_icon(PurpleAccount *account, PurpleBuddy *buddy) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1926 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1927 return "gadu-gadu"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1928 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1929 |
15823 | 1930 static char *ggp_status_text(PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1931 { |
15823 | 1932 PurpleStatus *status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1933 const char *msg; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1934 char *text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1935 char *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1936 |
15823 | 1937 status = purple_presence_get_active_status(purple_buddy_get_presence(b)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1938 |
15823 | 1939 msg = purple_status_get_attr_string(status, "message"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1940 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1941 if (msg != NULL) { |
15823 | 1942 tmp = purple_markup_strip_html(msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1943 text = g_markup_escape_text(tmp, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1944 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1945 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1946 return text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1947 } else { |
15823 | 1948 tmp = purple_utf8_salvage(purple_status_get_name(status)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1949 text = g_markup_escape_text(tmp, -1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1950 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1951 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1952 return text; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1953 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1954 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1955 |
15823 | 1956 static void ggp_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1957 { |
15823 | 1958 PurpleStatus *status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1959 char *text, *tmp; |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1960 const char *msg, *name, *alias; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1961 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1962 g_return_if_fail(b != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1963 |
15823 | 1964 status = purple_presence_get_active_status(purple_buddy_get_presence(b)); |
1965 msg = purple_status_get_attr_string(status, "message"); | |
1966 name = purple_status_get_name(status); | |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1967 alias = purple_buddy_get_alias(b); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1968 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
1969 purple_notify_user_info_add_pair (user_info, _("Alias"), alias); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1970 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1971 if (msg != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1972 text = g_markup_escape_text(msg, -1); |
15823 | 1973 if (PURPLE_BUDDY_IS_ONLINE(b)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1974 tmp = g_strdup_printf("%s: %s", name, text); |
15823 | 1975 purple_notify_user_info_add_pair(user_info, _("Status"), tmp); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1976 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1977 } else { |
15823 | 1978 purple_notify_user_info_add_pair(user_info, _("Message"), text); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1979 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1980 g_free(text); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1981 /* We don't want to duplicate 'Status: Offline'. */ |
15823 | 1982 } else if (PURPLE_BUDDY_IS_ONLINE(b)) { |
1983 purple_notify_user_info_add_pair(user_info, _("Status"), name); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1984 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1985 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1986 |
15823 | 1987 static GList *ggp_status_types(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1988 { |
15823 | 1989 PurpleStatusType *type; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1990 GList *types = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1991 |
15823 | 1992 type = purple_status_type_new_with_attrs( |
1993 PURPLE_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, | |
1994 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1995 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1996 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1997 |
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 * 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
|
2000 * 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
|
2001 */ |
15823 | 2002 type = purple_status_type_new_with_attrs( |
2003 PURPLE_STATUS_INVISIBLE, NULL, NULL, TRUE, TRUE, FALSE, | |
2004 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2005 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2006 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2007 |
15823 | 2008 type = purple_status_type_new_with_attrs( |
2009 PURPLE_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE, | |
2010 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2011 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2012 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2013 |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2014 /* |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30283
diff
changeset
|
2015 * New statuses for GG 8.0 like PoGGadaj ze mna (not yet because |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2016 * libpurple can't support Chatty status) and Nie przeszkadzac |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2017 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2018 type = purple_status_type_new_with_attrs( |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2019 PURPLE_STATUS_UNAVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2020 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2021 NULL); |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2022 types = g_list_append(types, type); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30283
diff
changeset
|
2023 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2024 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2025 * 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
|
2026 */ |
15823 | 2027 type = purple_status_type_new_with_attrs( |
2028 PURPLE_STATUS_INVISIBLE, "blocked", _("Blocked"), TRUE, FALSE, FALSE, | |
2029 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), NULL); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2030 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2031 |
15823 | 2032 type = purple_status_type_new_with_attrs( |
2033 PURPLE_STATUS_OFFLINE, NULL, NULL, TRUE, TRUE, FALSE, | |
2034 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2035 NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2036 types = g_list_append(types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2037 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2038 return types; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2039 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2040 |
15823 | 2041 static GList *ggp_blist_node_menu(PurpleBlistNode *node) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2042 { |
15823 | 2043 PurpleMenuAction *act; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2044 GList *m = NULL; |
24959
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
2045 PurpleAccount *account; |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
2046 GGPInfo *info; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2047 |
15823 | 2048 if (!PURPLE_BLIST_NODE_IS_BUDDY(node)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2049 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2050 |
24959
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
2051 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:
24430
diff
changeset
|
2052 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:
24430
diff
changeset
|
2053 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:
24430
diff
changeset
|
2054 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:
24430
diff
changeset
|
2055 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:
24430
diff
changeset
|
2056 NULL, NULL); |
051fe71c3d8f
Fix some bogocity related to the GG "Add To Chat" menu item. Fixes #8112.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24430
diff
changeset
|
2057 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:
24430
diff
changeset
|
2058 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2059 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2060 /* Using a blist node boolean here is also wrong. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2061 * Once the Block and Unblock actions are added to the core, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2062 * this will have to go. -- rlaager */ |
15823 | 2063 if (purple_blist_node_get_bool(node, "blocked")) { |
2064 act = purple_menu_action_new(_("Unblock"), | |
2065 PURPLE_CALLBACK(ggp_bmenu_block), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2066 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2067 } else { |
15823 | 2068 act = purple_menu_action_new(_("Block"), |
2069 PURPLE_CALLBACK(ggp_bmenu_block), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2070 NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2071 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2072 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2073 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2074 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2075 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2076 |
15823 | 2077 static GList *ggp_chat_info(PurpleConnection *gc) |
15374
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 GList *m = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2080 struct proto_chat_entry *pce; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2081 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2082 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
|
2083 pce->label = _("Chat _name:"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2084 pce->identifier = "name"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2085 pce->required = TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2086 m = g_list_append(m, pce); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2087 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2088 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2089 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2090 |
15823 | 2091 static void ggp_login(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2092 { |
15823 | 2093 PurpleConnection *gc; |
23243
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23242
diff
changeset
|
2094 PurplePresence *presence; |
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23242
diff
changeset
|
2095 PurpleStatus *status; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2096 struct gg_login_params *glp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2097 GGPInfo *info; |
27118
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2098 const char *address; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2099 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2100 if (ggp_setup_proxy(account) == -1) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2101 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2102 |
15823 | 2103 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2104 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
|
2105 info = g_new0(GGPInfo, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2106 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2107 /* 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
|
2108 info->session = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2109 info->chats = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2110 info->chats_count = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2111 info->token = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2112 info->searches = ggp_search_new(); |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2113 info->pending_richtext_messages = NULL; |
31879
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
2114 info->pending_images = g_hash_table_new(g_direct_hash, g_direct_equal); |
31799
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2115 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:
31616
diff
changeset
|
2116 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2117 gc->proto_data = info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2118 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2119 glp->uin = ggp_get_uin(account); |
15823 | 2120 glp->password = (char *)purple_account_get_password(account); |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2121 glp->image_size = 255; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2122 |
23243
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23242
diff
changeset
|
2123 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:
23242
diff
changeset
|
2124 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:
23242
diff
changeset
|
2125 |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2126 glp->encoding = GG_ENCODING_UTF8; |
31881
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
2127 glp->protocol_features = (GG_FEATURE_STATUS80|GG_FEATURE_DND_FFC |
bcaa76a01b42
Gadu-Gadu: Support receiving typing indications. Fixes #13362.
quantifier666@gmail.com
parents:
31879
diff
changeset
|
2128 |GG_FEATURE_TYPING_NOTIFICATION); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30283
diff
changeset
|
2129 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2130 glp->async = 1; |
23243
56d88bfeed76
Restore status on login on GG, rather than setting Available first.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23242
diff
changeset
|
2131 glp->status = ggp_to_gg_status(status, &glp->status_descr); |
31901
66b30e47caec
Gadu-Gadu: Add encrypted (SSL) connection support for GNUTLS users.
tomkiewicz@o2.pl
parents:
31900
diff
changeset
|
2132 #if defined(USE_GNUTLS) || !defined(USE_INTERNAL_LIBGADU) |
66b30e47caec
Gadu-Gadu: Add encrypted (SSL) connection support for GNUTLS users.
tomkiewicz@o2.pl
parents:
31900
diff
changeset
|
2133 glp->tls = 1; |
66b30e47caec
Gadu-Gadu: Add encrypted (SSL) connection support for GNUTLS users.
tomkiewicz@o2.pl
parents:
31900
diff
changeset
|
2134 #else |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2135 glp->tls = 0; |
31901
66b30e47caec
Gadu-Gadu: Add encrypted (SSL) connection support for GNUTLS users.
tomkiewicz@o2.pl
parents:
31900
diff
changeset
|
2136 #endif |
66b30e47caec
Gadu-Gadu: Add encrypted (SSL) connection support for GNUTLS users.
tomkiewicz@o2.pl
parents:
31900
diff
changeset
|
2137 purple_debug_info("gg", "TLS enabled: %d\n", glp->tls); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2138 |
31799
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2139 if (!info->status_broadcasting) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2140 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:
31616
diff
changeset
|
2141 |
27118
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2142 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:
27074
diff
changeset
|
2143 if (address && *address) { |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
2144 /* TODO: Make this non-blocking */ |
27118
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2145 struct in_addr *addr = gg_gethostbyname(address); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2146 |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2147 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:
27074
diff
changeset
|
2148 |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2149 if (addr == NULL) { |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
2150 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:
27246
diff
changeset
|
2151 address, g_strerror(errno)); |
27118
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2152 purple_connection_error_reason(gc, |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2153 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, /* should this be a settings error? */ |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
2154 tmp); |
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
2155 g_free(tmp); |
27118
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2156 return; |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2157 } |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2158 |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2159 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:
27074
diff
changeset
|
2160 glp->server_port = 8074; |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2161 } else |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2162 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:
27074
diff
changeset
|
2163 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2164 info->session = gg_login(glp); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30283
diff
changeset
|
2165 purple_connection_update_progress(gc, _("Connecting"), 0, 2); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2166 if (info->session == NULL) { |
21358 | 2167 purple_connection_error_reason (gc, |
2168 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
2169 _("Connection failed")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2170 g_free(glp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2171 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2172 } |
15823 | 2173 gc->inpa = purple_input_add(info->session->fd, PURPLE_INPUT_READ, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2174 ggp_async_login_handler, gc); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2175 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2176 |
15823 | 2177 static void ggp_close(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2178 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2179 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2180 if (gc == NULL) { |
15823 | 2181 purple_debug_info("gg", "gc == NULL\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2182 return; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2185 if (gc->proto_data) { |
15823 | 2186 PurpleAccount *account = purple_connection_get_account(gc); |
2187 PurpleStatus *status; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2188 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2189 |
15823 | 2190 status = purple_account_get_active_status(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2191 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2192 if (info->session != NULL) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2193 ggp_set_status(account, status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2194 gg_logoff(info->session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2195 gg_free_session(info->session); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2196 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2197 |
31799
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2198 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:
31616
diff
changeset
|
2199 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2200 /* 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
|
2201 * 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
|
2202 */ |
15823 | 2203 purple_notify_close_with_handle(gc); |
15374
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 ggp_search_destroy(info->searches); |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2206 g_list_free(info->pending_richtext_messages); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2207 g_hash_table_destroy(info->pending_images); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2208 g_free(info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2209 gc->proto_data = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2210 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2211 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2212 if (gc->inpa > 0) |
15823 | 2213 purple_input_remove(gc->inpa); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2214 |
15823 | 2215 purple_debug_info("gg", "Connection closed.\n"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2216 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2217 |
15823 | 2218 static int ggp_send_im(PurpleConnection *gc, const char *who, const char *msg, |
2219 PurpleMessageFlags flags) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2220 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2221 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2222 char *tmp, *plain; |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2223 int ret = 1; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2224 unsigned char format[1024]; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2225 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:
24398
diff
changeset
|
2226 gint pos = 0; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2227 GData *attribs; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2228 const char *start, *end = NULL, *last; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2229 |
24430
c83ee78ecbe7
Fix two warnings introduced by the image patch I committed earlier and make
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24429
diff
changeset
|
2230 if (msg == NULL || *msg == '\0') { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2231 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2232 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2233 |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2234 last = msg; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2235 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2236 /* Check if the message is richtext */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2237 /* TODO: Check formatting, too */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2238 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:
24398
diff
changeset
|
2239 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2240 GString *string_buffer = g_string_new(NULL); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2241 struct gg_msg_richtext fmt; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2242 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2243 do { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2244 PurpleStoredImage *image; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2245 const char *id; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2246 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2247 /* Add text before the image */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2248 if(start - last) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2249 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:
24398
diff
changeset
|
2250 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:
24398
diff
changeset
|
2251 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2252 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2253 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:
24398
diff
changeset
|
2254 struct gg_msg_richtext_format actformat; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2255 struct gg_msg_richtext_image actimage; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2256 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:
24398
diff
changeset
|
2257 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:
24398
diff
changeset
|
2258 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:
24398
diff
changeset
|
2259 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:
24398
diff
changeset
|
2260 |
31879
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
2261 g_hash_table_insert(info->pending_images, GINT_TO_POINTER(crc32), GINT_TO_POINTER(atoi(id))); |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2262 purple_imgstore_ref(image); |
31879
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
2263 purple_debug_info("gg", "ggp_send_im_richtext: got crc: %u for imgid: %i\n", crc32, atoi(id)); |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2264 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2265 actformat.font = GG_FONT_IMAGE; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2266 actformat.position = pos; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2267 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2268 actimage.unknown1 = 0x0109; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2269 actimage.size = gg_fix32(image_size); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2270 actimage.crc32 = gg_fix32(crc32); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2271 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2272 if (actimage.size > 255000) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2273 purple_debug_warning("gg", "ggp_send_im_richtext: image over 255kb!\n"); |
31879
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
2274 } else { |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
2275 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:
31862
diff
changeset
|
2276 |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
2277 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:
31862
diff
changeset
|
2278 format_length += sizeof(actformat); |
dc63d77fea03
Gadu-Gadu: Fix sending inline images to remote users. Also fix sending images
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31862
diff
changeset
|
2279 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:
31862
diff
changeset
|
2280 format_length += sizeof(actimage); |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2281 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2282 } else { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2283 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:
24398
diff
changeset
|
2284 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2285 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2286 last = end + 1; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2287 g_datalist_clear(&attribs); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2288 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2289 } 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:
24398
diff
changeset
|
2290 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2291 /* Add text after the images */ |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2292 if(last && *last) { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2293 pos = pos + g_utf8_strlen(last, -1); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2294 g_string_append(string_buffer, last); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2295 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2296 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2297 fmt.flag = 2; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2298 fmt.length = format_length - sizeof(fmt); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2299 memcpy(format, &fmt, sizeof(fmt)); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2300 |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2301 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:
24398
diff
changeset
|
2302 plain = purple_unescape_html(string_buffer->str); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2303 g_string_free(string_buffer, TRUE); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2304 } else { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2305 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:
24398
diff
changeset
|
2306 plain = purple_unescape_html(msg); |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2307 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2308 |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2309 /* |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2310 tmp = charset_convert(plain, "UTF-8", "CP1250"); |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2311 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2312 tmp = g_strdup_printf("%s", plain); |
31534
a8cc50c2279f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30283
diff
changeset
|
2313 |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2314 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:
24398
diff
changeset
|
2315 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:
24398
diff
changeset
|
2316 ret = -1; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2317 } else { |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2318 ret = 1; |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2319 } |
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2320 } else if (NULL == tmp || *tmp == 0) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2321 ret = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2322 } else if (strlen(tmp) > GG_MSG_MAXSIZE) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2323 ret = -E2BIG; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2324 } 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
|
2325 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
|
2326 ret = -1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2327 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2328 ret = 1; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2329 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2330 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2331 g_free(plain); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2332 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2333 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2334 return ret; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2336 |
31900
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2337 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:
31881
diff
changeset
|
2338 { |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2339 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:
31881
diff
changeset
|
2340 |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2341 if (state == PURPLE_TYPED) // not supported |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2342 return 1; |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2343 |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2344 if (state == PURPLE_TYPING) |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2345 dummy_length = (int)g_random_int(); |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2346 else // PURPLE_NOT_TYPING |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2347 dummy_length = 0; |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2348 |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2349 gg_typing_notification( |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2350 ((GGPInfo*)gc->proto_data)->session, |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2351 ggp_str_to_uin(name), |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2352 dummy_length); |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2353 |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2354 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:
31881
diff
changeset
|
2355 } |
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2356 |
15823 | 2357 static void ggp_get_info(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2358 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2359 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2360 GGPSearchForm *form; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2361 guint32 seq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2362 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2363 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
|
2364 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2365 form->user_data = info; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2366 form->uin = g_strdup(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2367 form->offset = g_strdup("0"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2368 form->last_uin = g_strdup("0"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2369 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2370 seq = ggp_search_start(gc, form); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2371 ggp_search_add(info->searches, seq, form); |
23444
56cf59d028f7
Gadu-Gadu Get Info isn't behaving properly. Added debug logging to its traking
Evan Schoenberg <evan.s@dreskin.net>
parents:
23243
diff
changeset
|
2372 purple_debug_info("gg", "ggp_get_info(): Added seq %u", seq); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2373 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2374 |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2375 static int ggp_to_gg_status(PurpleStatus *status, char **msg) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2376 { |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2377 const char *status_id = purple_status_get_id(status); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2378 int new_status, new_status_descr; |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2379 const char *new_msg; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2380 |
23834
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:
23444
diff
changeset
|
2381 g_return_val_if_fail(msg != NULL, 0); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2382 |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2383 purple_debug_info("gg", "ggp_to_gg_status: Requested status = %s\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2384 status_id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2385 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2386 if (strcmp(status_id, "available") == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2387 new_status = GG_STATUS_AVAIL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2388 new_status_descr = GG_STATUS_AVAIL_DESCR; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2389 } else if (strcmp(status_id, "away") == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2390 new_status = GG_STATUS_BUSY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2391 new_status_descr = GG_STATUS_BUSY_DESCR; |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2392 } else if (strcmp(status_id, "unavailable") == 0) { |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2393 new_status = GG_STATUS_DND; |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2394 new_status_descr = GG_STATUS_DND_DESCR; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2395 } else if (strcmp(status_id, "invisible") == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2396 new_status = GG_STATUS_INVISIBLE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2397 new_status_descr = GG_STATUS_INVISIBLE_DESCR; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2398 } else if (strcmp(status_id, "offline") == 0) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2399 new_status = GG_STATUS_NOT_AVAIL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2400 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
|
2401 } else { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2402 new_status = GG_STATUS_AVAIL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2403 new_status_descr = GG_STATUS_AVAIL_DESCR; |
15823 | 2404 purple_debug_info("gg", |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2405 "ggp_set_status: unknown status requested (status_id=%s)\n", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2406 status_id); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2407 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2408 |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2409 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:
23240
diff
changeset
|
2410 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2411 if(new_msg) { |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2412 /* |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2413 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:
23240
diff
changeset
|
2414 *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:
23240
diff
changeset
|
2415 g_free(tmp); |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2416 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2417 *msg = purple_markup_strip_html(new_msg); |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2418 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2419 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:
23240
diff
changeset
|
2420 } else { |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2421 *msg = NULL; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2422 return new_status; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2423 } |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2424 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2425 |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2426 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:
23240
diff
changeset
|
2427 { |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2428 PurpleConnection *gc; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2429 GGPInfo *info; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2430 int new_status; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2431 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:
23240
diff
changeset
|
2432 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2433 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:
23240
diff
changeset
|
2434 return; |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2435 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2436 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:
23240
diff
changeset
|
2437 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:
23240
diff
changeset
|
2438 |
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2439 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:
23240
diff
changeset
|
2440 |
31799
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2441 if (!info->status_broadcasting) |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2442 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:
31616
diff
changeset
|
2443 |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2444 if (new_msg == NULL) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2445 gg_change_status(info->session, new_status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2446 } else { |
23241
636a116113d1
Extract converting a PurpleStatus to GG's format to its own function.
Will Thompson <will.thompson@collabora.co.uk>
parents:
23240
diff
changeset
|
2447 gg_change_status_descr(info->session, new_status, new_msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2448 g_free(new_msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2449 } |
21061
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2450 |
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2451 ggp_status_fake_to_self(account); |
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2452 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2453 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2454 |
15823 | 2455 static void ggp_add_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2456 { |
21061
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2457 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2458 GGPInfo *info = gc->proto_data; |
25283
4d20fa86455b
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
23834
diff
changeset
|
2459 const gchar *name = purple_buddy_get_name(buddy); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2460 |
25283
4d20fa86455b
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
23834
diff
changeset
|
2461 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
|
2462 |
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2463 account = purple_connection_get_account(gc); |
25283
4d20fa86455b
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
23834
diff
changeset
|
2464 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
|
2465 ggp_status_fake_to_self(account); |
1d92b85ef5d9
gg: Properly display your status in the buddylist.
Bartoz Oler <bartosz@pidgin.im>
parents:
21030
diff
changeset
|
2466 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2467 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2468 |
15823 | 2469 static void ggp_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, |
2470 PurpleGroup *group) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2471 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2472 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2473 |
25283
4d20fa86455b
moved gg to use the api rather than structs directly
Gary Kramlich <grim@reaperworld.com>
parents:
23834
diff
changeset
|
2474 gg_remove_notify(info->session, ggp_str_to_uin(purple_buddy_get_name(buddy))); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2475 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2476 |
15823 | 2477 static void ggp_join_chat(PurpleConnection *gc, GHashTable *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2478 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2479 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2480 GGPChat *chat; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2481 char *chat_name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2482 GList *l; |
15823 | 2483 PurpleConversation *conv; |
2484 PurpleAccount *account = purple_connection_get_account(gc); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2485 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2486 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
|
2487 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2488 if (chat_name == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2489 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2490 |
15823 | 2491 purple_debug_info("gg", "joined %s chat\n", chat_name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2492 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2493 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
|
2494 chat = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2496 if (chat != NULL && g_utf8_collate(chat->name, chat_name) == 0) { |
15823 | 2497 purple_notify_error(gc, _("Chat error"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2498 _("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
|
2499 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2500 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2501 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2502 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2503 ggp_confer_add_new(gc, chat_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2504 conv = serv_got_joined_chat(gc, info->chats_count, chat_name); |
15823 | 2505 purple_conv_chat_add_user(PURPLE_CONV_CHAT(conv), |
2506 purple_account_get_username(account), NULL, | |
2507 PURPLE_CBFLAGS_NONE, TRUE); | |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2510 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
|
2511 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
|
2512 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2513 |
15823 | 2514 static int ggp_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2515 { |
15823 | 2516 PurpleConversation *conv; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2517 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2518 GGPChat *chat = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2519 GList *l; |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2520 /* char *msg, *plain; */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2521 gchar *msg; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2522 uin_t *uins; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2523 int count = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2524 |
15823 | 2525 if ((conv = purple_find_chat(gc, id)) == NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2526 return -EINVAL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2527 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2528 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
|
2529 chat = l->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2530 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2531 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
|
2532 break; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2535 chat = NULL; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2538 if (chat == NULL) { |
15823 | 2539 purple_debug_error("gg", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2540 "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
|
2541 return -EINVAL; |
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 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
|
2545 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2546 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
|
2547 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
|
2548 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2549 uins[count++] = uin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2550 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2551 |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2552 /* |
15823 | 2553 plain = purple_unescape_html(message); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2554 msg = charset_convert(plain, "UTF-8", "CP1250"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2555 g_free(plain); |
29944
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2556 */ |
818f2845ab47
Finish making libgadu compile on Windows. Fixes #10542 finally!
kkszysiu@gmail.com
parents:
29854
diff
changeset
|
2557 msg = purple_unescape_html(message); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2558 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
|
2559 (unsigned char *)msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2560 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2561 g_free(uins); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2562 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2563 serv_got_chat_in(gc, id, |
15823 | 2564 purple_account_get_username(purple_connection_get_account(gc)), |
23154
caa533b62902
When calling serv_got_chat_in() after sending a group chat message (to let
Evan Schoenberg <evan.s@dreskin.net>
parents:
23112
diff
changeset
|
2565 flags, message, time(NULL)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2566 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2567 return 0; |
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 |
15823 | 2570 static void ggp_keepalive(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2571 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2572 GGPInfo *info = gc->proto_data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2573 |
15823 | 2574 /* purple_debug_info("gg", "Keeping connection alive....\n"); */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2575 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2576 if (gg_ping(info->session) < 0) { |
15823 | 2577 purple_debug_info("gg", "Not connected to the server " |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2578 "or gg_session is not correct\n"); |
21358 | 2579 purple_connection_error_reason (gc, |
2580 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
27454
7fd1b4c73310
Connection error message changes for gg, and a few other strings changes.
Mark Doliner <mark@kingant.net>
parents:
27246
diff
changeset
|
2581 _("Not connected to the server")); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2582 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2583 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2584 |
15823 | 2585 static void ggp_register_user(PurpleAccount *account) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2586 { |
15823 | 2587 PurpleConnection *gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2588 GGPInfo *info; |
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 info = gc->proto_data = g_new0(GGPInfo, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2591 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2592 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
|
2593 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2594 |
15823 | 2595 static GList *ggp_actions(PurplePlugin *plugin, gpointer context) |
15374
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 GList *m = NULL; |
15823 | 2598 PurplePluginAction *act; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2599 |
15823 | 2600 act = purple_plugin_action_new(_("Find buddies..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2601 ggp_find_buddies); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2602 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2603 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2604 m = g_list_append(m, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2605 |
15823 | 2606 act = purple_plugin_action_new(_("Change password..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2607 ggp_change_passwd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2608 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2609 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2610 m = g_list_append(m, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2611 |
15823 | 2612 act = purple_plugin_action_new(_("Upload buddylist to Server"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2613 ggp_action_buddylist_put); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2614 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2615 |
15823 | 2616 act = purple_plugin_action_new(_("Download buddylist from Server"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2617 ggp_action_buddylist_get); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2618 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2619 |
15823 | 2620 act = purple_plugin_action_new(_("Delete buddylist from Server"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2621 ggp_action_buddylist_delete); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2622 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2623 |
15823 | 2624 act = purple_plugin_action_new(_("Save buddylist to file..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2625 ggp_action_buddylist_save); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2626 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2627 |
15823 | 2628 act = purple_plugin_action_new(_("Load buddylist from file..."), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2629 ggp_action_buddylist_load); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2630 m = g_list_append(m, act); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2631 |
31799
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2632 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:
31616
diff
changeset
|
2633 ggp_action_change_status_broadcasting); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2634 m = g_list_append(m, act); |
64b362d1c49e
Gadu-Gadu: Allow showing your status only to people on your buddy list.
mateuszpiekos@gmail.com
parents:
31616
diff
changeset
|
2635 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2636 return m; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2637 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2638 |
15823 | 2639 static gboolean ggp_offline_message(const PurpleBuddy *buddy) |
15374
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 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2642 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2643 |
15823 | 2644 static PurplePluginProtocolInfo prpl_info = |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2645 { |
24428
4d50b5d09d4a
Support displaying buddy icons from Gadu-Gadu buddies. Fixes #220.
Adam Strzelecki <ono@java.pl>
parents:
24398
diff
changeset
|
2646 OPT_PROTO_REGISTER_NOSCREENNAME | OPT_PROTO_IM_IMAGE, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2647 NULL, /* user_splits */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2648 NULL, /* protocol_options */ |
22400
d3c8fd63e296
Patch from Tomasz Salacinski to allow setting buddy icons in GG prpl.
Bartoz Oler <bartosz@pidgin.im>
parents:
22149
diff
changeset
|
2649 {"png", 32, 32, 96, 96, 0, PURPLE_ICON_SCALE_DISPLAY}, /* icon_spec */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2650 ggp_list_icon, /* list_icon */ |
15463 | 2651 NULL, /* list_emblem */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2652 ggp_status_text, /* status_text */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2653 ggp_tooltip_text, /* tooltip_text */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2654 ggp_status_types, /* status_types */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2655 ggp_blist_node_menu, /* blist_node_menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2656 ggp_chat_info, /* chat_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2657 NULL, /* chat_info_defaults */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2658 ggp_login, /* login */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2659 ggp_close, /* close */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2660 ggp_send_im, /* send_im */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2661 NULL, /* set_info */ |
31900
7db33b356d4a
This patch from kkszysiu and tomkiewicz implements full typing notification
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31881
diff
changeset
|
2662 ggp_send_typing, /* send_typing */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2663 ggp_get_info, /* get_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2664 ggp_set_status, /* set_away */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2665 NULL, /* set_idle */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2666 NULL, /* change_passwd */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2667 ggp_add_buddy, /* add_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2668 NULL, /* add_buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2669 ggp_remove_buddy, /* remove_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2670 NULL, /* remove_buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2671 NULL, /* add_permit */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2672 NULL, /* add_deny */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2673 NULL, /* rem_permit */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2674 NULL, /* rem_deny */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2675 NULL, /* set_permit_deny */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2676 ggp_join_chat, /* join_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2677 NULL, /* reject_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2678 ggp_get_chat_name, /* get_chat_name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2679 NULL, /* chat_invite */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2680 NULL, /* chat_leave */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2681 NULL, /* chat_whisper */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2682 ggp_chat_send, /* chat_send */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2683 ggp_keepalive, /* keepalive */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2684 ggp_register_user, /* register_user */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2685 NULL, /* get_cb_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2686 NULL, /* get_cb_away */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2687 NULL, /* alias_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2688 NULL, /* group_buddy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2689 NULL, /* rename_group */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2690 NULL, /* buddy_free */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2691 NULL, /* convo_closed */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2692 NULL, /* normalize */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2693 NULL, /* set_buddy_icon */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2694 NULL, /* remove_group */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2695 NULL, /* get_cb_real_name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2696 NULL, /* set_chat_topic */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2697 NULL, /* find_blist_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2698 NULL, /* roomlist_get_list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2699 NULL, /* roomlist_cancel */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2700 NULL, /* roomlist_expand_category */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2701 NULL, /* can_receive_file */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2702 NULL, /* send_file */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2703 NULL, /* new_xfer */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2704 ggp_offline_message, /* offline_message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2705 NULL, /* whiteboard_prpl_ops */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2706 NULL, /* send_raw */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2707 NULL, /* roomlist_room_serialize */ |
25560
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25557
diff
changeset
|
2708 NULL, /* unregister_user */ |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25557
diff
changeset
|
2709 NULL, /* send_attention */ |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
25557
diff
changeset
|
2710 NULL, /* get_attention_types */ |
23111
718a9c287839
Use up the last padding for PurplePluginProtocolInfo in a way that allows
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22475
diff
changeset
|
2711 sizeof(PurplePluginProtocolInfo), /* struct_size */ |
25657
ff29208e03ef
propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5)
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
2712 NULL, /* get_account_text_table */ |
ff29208e03ef
propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5)
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
2713 NULL, /* initiate_media */ |
29854 | 2714 NULL, /* can_do_media */ |
30262
2a436e0ce977
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents:
30258
diff
changeset
|
2715 NULL, /* get_moods */ |
2a436e0ce977
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents:
30258
diff
changeset
|
2716 NULL, /* set_public_alias */ |
31847
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31800
diff
changeset
|
2717 NULL, /* get_public_alias */ |
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31800
diff
changeset
|
2718 NULL, /* add_buddy_with_invite */ |
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31800
diff
changeset
|
2719 NULL /* add_buddies_with_invite */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2720 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2721 |
15823 | 2722 static PurplePluginInfo info = { |
24429
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2723 PURPLE_PLUGIN_MAGIC, /* magic */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2724 PURPLE_MAJOR_VERSION, /* major_version */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2725 PURPLE_MINOR_VERSION, /* minor_version */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2726 PURPLE_PLUGIN_PROTOCOL, /* plugin type */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2727 NULL, /* ui_requirement */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2728 0, /* flags */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2729 NULL, /* dependencies */ |
15823 | 2730 PURPLE_PRIORITY_DEFAULT, /* priority */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2731 |
24429
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2732 "prpl-gg", /* id */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2733 "Gadu-Gadu", /* name */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2734 DISPLAY_VERSION, /* version */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2735 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2736 N_("Gadu-Gadu Protocol Plugin"), /* summary */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2737 N_("Polish popular IM"), /* description */ |
24429
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2738 "boler@sourceforge.net", /* author */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2739 PURPLE_WEBSITE, /* homepage */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2740 |
24429
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2741 NULL, /* load */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2742 NULL, /* unload */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2743 NULL, /* destroy */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2744 |
24429
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2745 NULL, /* ui_info */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2746 &prpl_info, /* extra_info */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2747 NULL, /* prefs_info */ |
0d3af2ecf4ad
Kill off a bajillion comments that just needlessly duplicate function
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24428
diff
changeset
|
2748 ggp_actions, /* actions */ |
16675
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
2749 |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
2750 /* padding */ |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
2751 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
2752 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
2753 NULL, |
a338acd14365
And now the protocols
Gary Kramlich <grim@reaperworld.com>
parents:
16442
diff
changeset
|
2754 NULL |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2755 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2756 |
15823 | 2757 static void purple_gg_debug_handler(int level, const char * format, va_list args) { |
2758 PurpleDebugLevel purple_level; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2759 char *msg = g_strdup_vprintf(format, args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2760 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2761 /* This is pretty pointless since the GG_DEBUG levels don't correspond to |
15823 | 2762 * the purple ones */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2763 switch (level) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2764 case GG_DEBUG_FUNCTION: |
15823 | 2765 purple_level = PURPLE_DEBUG_INFO; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2766 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2767 case GG_DEBUG_MISC: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2768 case GG_DEBUG_NET: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2769 case GG_DEBUG_DUMP: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2770 case GG_DEBUG_TRAFFIC: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2771 default: |
15823 | 2772 purple_level = PURPLE_DEBUG_MISC; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2773 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2774 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2775 |
24398
0320b4a33432
Backport the 'purple_debug_*(msg)' -> 'purple_debug_*("%s", msg);' fixes.
Richard Laager <rlaager@wiktel.com>
parents:
24292
diff
changeset
|
2776 purple_debug(purple_level, "gg", "%s", msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2777 g_free(msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2778 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2779 |
15823 | 2780 static void init_plugin(PurplePlugin *plugin) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2781 { |
15823 | 2782 PurpleAccountOption *option; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2783 |
15823 | 2784 option = purple_account_option_string_new(_("Nickname"), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2785 "nick", _("Gadu-Gadu User")); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2786 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
|
2787 option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2788 |
27118
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2789 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:
27074
diff
changeset
|
2790 "gg_server", ""); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2791 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:
27074
diff
changeset
|
2792 option); |
c3fcdd59ab76
Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691.
Paul Aurich <paul@darkrain42.org>
parents:
27074
diff
changeset
|
2793 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2794 my_protocol = plugin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2795 |
15823 | 2796 gg_debug_handler = purple_gg_debug_handler; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2797 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2798 |
15823 | 2799 PURPLE_INIT_PLUGIN(gg, init_plugin, info); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2800 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2801 /* vim: set ts=8 sts=0 sw=8 noet: */ |