libpurple/protocols/oscar/icq.c

Wed, 12 Dec 2018 16:43:40 -0600

author
Mike Ruprecht <cmaiku@gmail.com>
date
Wed, 12 Dec 2018 16:43:40 -0600
changeset 39376
e15e1d67b37c
parent 37939
8df8870e946c
child 39757
4a5ba806d8c9
permissions
-rw-r--r--

oscar: Remove dead usage of tm.tm_gmtoff and HAVE_TM_GMTOFF config

Oscar at one time used tm.tm_gmtoff in order to offset a timestamp.
Now, the function is always passed 0 for the timestamp, which avoids
this code path. Therefore, this patch removes the timestamp argument
from the function, removes the dead code path which included the only
usage of tm.tm_gmtoff, and gets rid of the check/setting in meson for
HAVE_TM_GMTOFF.

15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
1 /* purple
15030
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
2 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15685
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
15030
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
5 * source distribution.
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
6 *
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
10 * (at your option) any later version.
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
11 *
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
15 * GNU General Public License for more details.
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
16 *
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19050
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15030
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
20 *
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
21 */
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
22
36666
5739f1f04078 Build a single library for oscar.
Ankit Vani <a@nevitus.org>
parents: 36657
diff changeset
23 #include "icq.h"
36657
4a7f5f97d1ec Make sure internal.h is included first
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
24
36590
e77919ff5e74 Refactored oscar to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
25 #include "core.h"
36530
b8caab360c96 Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents: 33696
diff changeset
26 #include "plugins.h"
36590
e77919ff5e74 Refactored oscar to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
27 #include "signals.h"
15030
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
28
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
29 #include "oscarcommon.h"
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
30
24235
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
31 static GHashTable *
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
32 icq_get_account_text_table(PurpleAccount *account)
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
33 {
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
34 GHashTable *table;
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
35 table = g_hash_table_new(g_str_hash, g_str_equal);
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
36 g_hash_table_insert(table, "login_label", (gpointer)_("ICQ UIN..."));
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
37 return table;
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
38 }
46abfb2f03e4 Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23277
diff changeset
39
34321
f60fcab02bd4 Reconsidered characters count callback for prpl API: make it per-conversation and distinguish infinite from undefined
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34312
diff changeset
40 static gssize
f60fcab02bd4 Reconsidered characters count callback for prpl API: make it per-conversation and distinguish infinite from undefined
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34312
diff changeset
41 icq_get_max_message_size(PurpleConversation *conv)
34312
4461d5c1e61c Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33696
diff changeset
42 {
34321
f60fcab02bd4 Reconsidered characters count callback for prpl API: make it per-conversation and distinguish infinite from undefined
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34312
diff changeset
43 /* XXX: got from pidgin-otr - verify and document it */
34312
4461d5c1e61c Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33696
diff changeset
44 return 2346;
4461d5c1e61c Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33696
diff changeset
45 }
4461d5c1e61c Extend prpl with max message length callback
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33696
diff changeset
46
36590
e77919ff5e74 Refactored oscar to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
47 static void
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
48 icq_protocol_init(PurpleProtocol *protocol)
15030
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
49 {
37004
c8dce7bef0e6 Change protocol IDs to prpl-*
Ankit Vani <a@nevitus.org>
parents: 36735
diff changeset
50 protocol->id = "prpl-icq";
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
51 protocol->name = "ICQ";
15030
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
52
37761
4b57eced35d5 oscar: Code cleaning by moving AIM/ICQ specific options to oscar.c
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents: 37759
diff changeset
53 oscar_init_account_options(protocol, TRUE);
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
54 }
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
55
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
56 static void
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
57 icq_protocol_class_init(PurpleProtocolClass *klass)
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
58 {
36735
e336804e65d2 Refactored oscar to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
59 klass->list_icon = oscar_list_icon_icq;
36590
e77919ff5e74 Refactored oscar to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
60 }
15030
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
61
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
62 static void
36729
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
63 icq_protocol_client_iface_init(PurpleProtocolClientIface *client_iface)
15030
6a6cf7be07ea [gaim-migrate @ 17747]
Sean Egan <seanegan@pidgin.im>
parents:
diff changeset
64 {
36729
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
65 client_iface->get_account_text_table = icq_get_account_text_table;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
66 client_iface->get_moods = oscar_get_purple_moods;
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
67 client_iface->get_max_message_size = icq_get_max_message_size;
36590
e77919ff5e74 Refactored oscar to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
68 }
e77919ff5e74 Refactored oscar to use the new protocol API
Ankit Vani <a@nevitus.org>
parents: 36583
diff changeset
69
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
70 PURPLE_DEFINE_TYPE_EXTENDED(
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
71 ICQProtocol, icq_protocol, OSCAR_TYPE_PROTOCOL, 0,
36735
e336804e65d2 Refactored oscar to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
72
36729
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
73 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_CLIENT_IFACE,
36735
e336804e65d2 Refactored oscar to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
74 icq_protocol_client_iface_init)
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
75 );

mercurial