Wed, 19 Oct 2022 06:25:35 -0500
Back out the PurpleProtocol->login change that returned a PurpleConnection
This remains to be a good idea, but this implementation caused more issues than
it solved. I'm working on that better implementation, but we need to revert all
of this first, otherwise the new review request is going to be massive.
This reverts commits 3f96e2b2b03d, d567f89d6a9b, and 6ef5bb284651. These were
backed out manually due to some other commits that made automative backouts
difficult.
Testing Done:
Connected a demo, ircv3, and xmpp accounts without issue.
Reviewed at https://reviews.imfreedom.org/r/1937/
|
33348
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
1 | /* purple |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
2 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
3 | * Purple is the legal property of its developers, whose names are too numerous |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
5 | * source distribution. |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
6 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
7 | * Rewritten from scratch during Google Summer of Code 2012 |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
8 | * by Tomek Wasilczyk (http://www.wasilczyk.pl). |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
9 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
10 | * Previously implemented by: |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
11 | * - Arkadiusz Miskiewicz <misiek@pld.org.pl> - first implementation (2001); |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
12 | * - Bartosz Oler <bartosz@bzimage.us> - reimplemented during GSoC 2005; |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
13 | * - Krzysztof Klinikowski <grommasher@gmail.com> - some parts (2009-2011). |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
14 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
15 | * This program is free software; you can redistribute it and/or modify |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
16 | * it under the terms of the GNU General Public License as published by |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
17 | * the Free Software Foundation; either version 2 of the License, or |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
18 | * (at your option) any later version. |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
19 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
20 | * This program is distributed in the hope that it will be useful, |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
23 | * GNU General Public License for more details. |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
24 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
25 | * You should have received a copy of the GNU General Public License |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
26 | * along with this program; if not, write to the Free Software |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33348
diff
changeset
|
27 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
33348
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
28 | */ |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33335
diff
changeset
|
29 | |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
30 | #include "multilogon.h" |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
31 | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40358
diff
changeset
|
32 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40358
diff
changeset
|
33 | |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
34 | #include "gg.h" |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
35 | #include "keymapper.h" |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33348
diff
changeset
|
36 | #include "utils.h" |
|
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33348
diff
changeset
|
37 | #include "message-prpl.h" |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
38 | |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
39 | typedef struct |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
40 | { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
41 | uint64_t id; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
42 | uint32_t remote_addr; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
43 | gchar *name; |
|
41763
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
44 | GDateTime *logon_time; |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
45 | } ggp_multilogon_session_info; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
46 | |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
47 | struct _ggp_multilogon_session_data |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
48 | { |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
49 | int session_count; |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
50 | ggp_multilogon_session_info *sessions; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
51 | PurpleRequestDatasheet *sheet_handle; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
52 | gpointer dialog_handle; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
53 | ggp_keymapper *sid_mapper; |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
54 | }; |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
55 | |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
56 | static inline ggp_multilogon_session_data * |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
57 | ggp_multilogon_get_mldata(PurpleConnection *gc); |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
58 | |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
59 | |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
60 | static inline ggp_multilogon_session_data * |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
61 | ggp_multilogon_get_mldata(PurpleConnection *gc) |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
62 | { |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
63 | GGPInfo *accdata = purple_connection_get_protocol_data(gc); |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
64 | return accdata->multilogon_data; |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
65 | } |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
66 | |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
67 | void |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
68 | ggp_multilogon_setup(PurpleConnection *gc) |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
69 | { |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
70 | GGPInfo *accdata = purple_connection_get_protocol_data(gc); |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
71 | |
|
34356
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33348
diff
changeset
|
72 | ggp_multilogon_session_data *mldata = |
|
5d59fd4d5b2d
Gadu-Gadu: reimplementation of receiving messages
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33348
diff
changeset
|
73 | g_new0(ggp_multilogon_session_data, 1); |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
74 | accdata->multilogon_data = mldata; |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
75 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
76 | mldata->sid_mapper = ggp_keymapper_new(); |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
77 | } |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
78 | |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
79 | static void |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
80 | ggp_multilogon_free_sessions(PurpleConnection *gc) |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
81 | { |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
82 | ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc); |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
83 | int i; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
84 | |
|
41763
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
85 | for (i = 0; i < mldata->session_count; i++) { |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
86 | g_free(mldata->sessions[i].name); |
|
41763
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
87 | g_clear_pointer(&mldata->sessions[i].logon_time, g_date_time_unref); |
|
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
88 | } |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
89 | g_free(mldata->sessions); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
90 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
91 | mldata->sessions = NULL; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
92 | mldata->session_count = 0; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
93 | } |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
94 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
95 | void |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
96 | ggp_multilogon_cleanup(PurpleConnection *gc) |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
97 | { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
98 | ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
99 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
100 | if (mldata->dialog_handle) { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
101 | purple_request_close(PURPLE_REQUEST_FIELDS, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
102 | mldata->dialog_handle); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
103 | mldata->dialog_handle = NULL; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
104 | } |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
105 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
106 | ggp_multilogon_free_sessions(gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
107 | ggp_keymapper_free(mldata->sid_mapper); |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
108 | g_free(mldata); |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
109 | } |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
110 | |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
111 | static uint64_t |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
112 | ggp_multilogon_sid_from_libgadu(gg_multilogon_id_t lsid) |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
113 | { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
114 | uint64_t sid; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
115 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
116 | memcpy(&sid, lsid.id, sizeof(uint64_t)); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
117 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
118 | return sid; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
119 | } |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
120 | |
|
39276
89f307c3aa27
gg: Fix -Waggregate-return warning for function returning a struct
Mike Ruprecht <cmaiku@gmail.com>
parents:
35358
diff
changeset
|
121 | static void |
|
89f307c3aa27
gg: Fix -Waggregate-return warning for function returning a struct
Mike Ruprecht <cmaiku@gmail.com>
parents:
35358
diff
changeset
|
122 | ggp_multilogon_sid_to_libgadu(uint64_t sid, gg_multilogon_id_t *lsid) |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
123 | { |
|
39276
89f307c3aa27
gg: Fix -Waggregate-return warning for function returning a struct
Mike Ruprecht <cmaiku@gmail.com>
parents:
35358
diff
changeset
|
124 | g_return_if_fail(lsid != NULL); |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
125 | |
|
39276
89f307c3aa27
gg: Fix -Waggregate-return warning for function returning a struct
Mike Ruprecht <cmaiku@gmail.com>
parents:
35358
diff
changeset
|
126 | memcpy(lsid->id, &sid, sizeof(uint64_t)); |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
127 | } |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
128 | |
|
35149
7804dd798227
Fix warnings by marking two functions as static.
Mark Doliner <mark@kingant.net>
parents:
35144
diff
changeset
|
129 | static void |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
130 | ggp_multilogon_fill_sessions(PurpleRequestDatasheet *sheet, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
131 | PurpleConnection *gc) |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
132 | { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
133 | ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
134 | ggp_keymapper *km = mldata->sid_mapper; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
135 | int i; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
136 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
137 | purple_request_datasheet_record_mark_all_for_rem(sheet); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
138 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
139 | for (i = 0; i < mldata->session_count; i++) { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
140 | ggp_multilogon_session_info *sess = &mldata->sessions[i]; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
141 | PurpleRequestDatasheetRecord *rec; |
|
41763
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
142 | gchar *tmp = NULL; |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
143 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
144 | rec = purple_request_datasheet_record_add(sheet, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
145 | ggp_keymapper_to_key(km, sess->id)); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
146 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
147 | purple_request_datasheet_record_set_string_data(rec, 0, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
148 | ggp_ipv4_to_str(sess->remote_addr)); |
|
41763
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
149 | |
|
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
150 | tmp = g_date_time_format(sess->logon_time, "%c"); |
|
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
151 | purple_request_datasheet_record_set_string_data(rec, 1, tmp); |
|
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
152 | g_free(tmp); |
|
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
153 | |
|
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
154 | purple_request_datasheet_record_set_string_data(rec, 2, sess->name); |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
155 | } |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
156 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
157 | purple_request_datasheet_record_remove_marked(sheet); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
158 | } |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
159 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
160 | void |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
161 | ggp_multilogon_info(PurpleConnection *gc, struct gg_event_multilogon_info *info) |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
162 | { |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
163 | ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc); |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
164 | int i; |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
165 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
166 | ggp_multilogon_free_sessions(gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
167 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
168 | purple_debug_info("gg", "ggp_multilogon_info: session list changed " |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
169 | "(count now: %d)\n", info->count); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
170 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
171 | mldata->sessions = g_new(ggp_multilogon_session_info, info->count); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
172 | for (i = 0; i < info->count; i++) { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
173 | struct gg_multilogon_session *lsess = &info->sessions[i]; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
174 | ggp_multilogon_session_info *psess = &mldata->sessions[i]; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
175 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
176 | psess->id = ggp_multilogon_sid_from_libgadu(lsess->id); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
177 | psess->remote_addr = lsess->remote_addr; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
178 | psess->name = g_strdup(lsess->name); |
|
41763
4a51008d3f64
Remove purple_date_format_full
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40545
diff
changeset
|
179 | psess->logon_time = g_date_time_new_from_unix_local(lsess->logon_time); |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
180 | } |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
181 | |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
182 | mldata->session_count = info->count; |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
183 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
184 | if (mldata->sheet_handle != NULL) |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
185 | ggp_multilogon_fill_sessions(mldata->sheet_handle, gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
186 | } |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
187 | |
|
35149
7804dd798227
Fix warnings by marking two functions as static.
Mark Doliner <mark@kingant.net>
parents:
35144
diff
changeset
|
188 | static void |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
189 | ggp_multilogon_disconnect(PurpleRequestDatasheetRecord *rec, gpointer _gc) |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
190 | { |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
191 | PurpleConnection *gc = _gc; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
192 | ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
193 | GGPInfo *accdata = purple_connection_get_protocol_data(gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
194 | uint64_t sid; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
195 | gpointer key; |
|
39276
89f307c3aa27
gg: Fix -Waggregate-return warning for function returning a struct
Mike Ruprecht <cmaiku@gmail.com>
parents:
35358
diff
changeset
|
196 | gg_multilogon_id_t lsid; |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
197 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
198 | key = purple_request_datasheet_record_get_key(rec); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
199 | sid = ggp_keymapper_from_key(mldata->sid_mapper, key); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
200 | |
|
39276
89f307c3aa27
gg: Fix -Waggregate-return warning for function returning a struct
Mike Ruprecht <cmaiku@gmail.com>
parents:
35358
diff
changeset
|
201 | ggp_multilogon_sid_to_libgadu(sid, &lsid); |
|
89f307c3aa27
gg: Fix -Waggregate-return warning for function returning a struct
Mike Ruprecht <cmaiku@gmail.com>
parents:
35358
diff
changeset
|
202 | gg_multilogon_disconnect(accdata->session, lsid); |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
203 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
204 | purple_request_datasheet_record_remove( |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
205 | purple_request_datasheet_record_get_datasheet(rec), key); |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
206 | } |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
207 | |
|
40545
5f512eb3857f
Remove purple_callback_set_zero.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40439
diff
changeset
|
208 | static void |
|
5f512eb3857f
Remove purple_callback_set_zero.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40439
diff
changeset
|
209 | ggp_multilogin_close_request(ggp_multilogon_session_data *mldata) |
|
5f512eb3857f
Remove purple_callback_set_zero.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40439
diff
changeset
|
210 | { |
|
5f512eb3857f
Remove purple_callback_set_zero.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40439
diff
changeset
|
211 | mldata->sheet_handle = NULL; |
|
5f512eb3857f
Remove purple_callback_set_zero.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40439
diff
changeset
|
212 | mldata->dialog_handle = NULL; |
|
5f512eb3857f
Remove purple_callback_set_zero.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40439
diff
changeset
|
213 | } |
|
5f512eb3857f
Remove purple_callback_set_zero.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40439
diff
changeset
|
214 | |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
215 | void |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
216 | ggp_multilogon_dialog(PurpleConnection *gc) |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
217 | { |
|
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
218 | ggp_multilogon_session_data *mldata = ggp_multilogon_get_mldata(gc); |
|
35144
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
219 | PurpleRequestField *field; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
220 | PurpleRequestFields *fields; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
221 | PurpleRequestFieldGroup *group; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
222 | PurpleRequestCommonParameters *cpar; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
223 | PurpleRequestDatasheet *sheet; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
224 | PurpleRequestDatasheetAction *action; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
225 | gpointer dialog_handle; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
226 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
227 | if (mldata->dialog_handle != NULL) |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
228 | return; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
229 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
230 | fields = purple_request_fields_new(); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
231 | group = purple_request_field_group_new(NULL); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
232 | purple_request_fields_add_group(fields, group); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
233 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
234 | sheet = purple_request_datasheet_new(); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
235 | purple_request_datasheet_add_column(sheet, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
236 | PURPLE_REQUEST_DATASHEET_COLUMN_STRING, _("IP")); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
237 | purple_request_datasheet_add_column(sheet, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
238 | PURPLE_REQUEST_DATASHEET_COLUMN_STRING, _("Logon time")); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
239 | purple_request_datasheet_add_column(sheet, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
240 | PURPLE_REQUEST_DATASHEET_COLUMN_STRING, _("Session")); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
241 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
242 | action = purple_request_datasheet_action_new(); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
243 | purple_request_datasheet_action_set_label(action, _("Disconnect")); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
244 | purple_request_datasheet_action_set_cb(action, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
245 | ggp_multilogon_disconnect, gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
246 | purple_request_datasheet_add_action(sheet, action); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
247 | ggp_multilogon_fill_sessions(sheet, gc); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
248 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
249 | field = purple_request_field_datasheet_new("sessions", NULL, sheet); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
250 | purple_request_field_group_add_field(group, field); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
251 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
252 | cpar = purple_request_cpar_new(); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
253 | purple_request_cpar_set_icon(cpar, PURPLE_REQUEST_ICON_DIALOG); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
254 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
255 | dialog_handle = purple_request_fields(gc, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
256 | _("Other Gadu-Gadu sessions"), NULL, NULL, fields, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
257 | NULL, NULL, _("Close"), NULL, |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
258 | cpar, NULL); |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
259 | mldata->sheet_handle = sheet; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
260 | mldata->dialog_handle = dialog_handle; |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
261 | |
|
3590ceb242b5
Gadu-Gadu: multilogon / other sessions dialog implementation. Refs #14366
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35139
diff
changeset
|
262 | purple_request_add_close_notify(dialog_handle, |
|
40545
5f512eb3857f
Remove purple_callback_set_zero.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40439
diff
changeset
|
263 | (GDestroyNotify)ggp_multilogin_close_request, mldata); |
|
33335
a6356adbe365
Gadu-Gadu: initial multilogon support (2)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
264 | } |