Replace functions which called once with their bodies
[pidgin-git.git] / libpurple / protocols / oscar / icq.c
blobedad3d40320e24710b4c08efdd85dcdcbeaa64e6
1 /* purple
3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
23 #include "icq.h"
25 #include "core.h"
26 #include "plugins.h"
27 #include "signals.h"
29 #include "oscarcommon.h"
31 static GHashTable *
32 icq_get_account_text_table(PurpleAccount *account)
34 GHashTable *table;
35 table = g_hash_table_new(g_str_hash, g_str_equal);
36 g_hash_table_insert(table, "login_label", (gpointer)_("ICQ UIN..."));
37 return table;
40 static gssize
41 icq_get_max_message_size(PurpleConversation *conv)
43 /* XXX: got from pidgin-otr - verify and document it */
44 return 2346;
47 static void
48 icq_protocol_init(ICQProtocol *self)
50 PurpleProtocol *protocol = PURPLE_PROTOCOL(self);
52 protocol->id = "prpl-icq";
53 protocol->name = "ICQ";
55 oscar_init_account_options(protocol, TRUE);
58 static void
59 icq_protocol_class_init(ICQProtocolClass *klass)
61 PurpleProtocolClass *protocol_class = PURPLE_PROTOCOL_CLASS(klass);
63 protocol_class->list_icon = oscar_list_icon_icq;
66 static void
67 icq_protocol_class_finalize(G_GNUC_UNUSED ICQProtocolClass *klass)
71 static void
72 icq_protocol_client_iface_init(PurpleProtocolClientInterface *client_iface)
74 client_iface->get_account_text_table = icq_get_account_text_table;
75 client_iface->get_moods = oscar_get_purple_moods;
76 client_iface->get_max_message_size = icq_get_max_message_size;
79 G_DEFINE_DYNAMIC_TYPE_EXTENDED(
80 ICQProtocol, icq_protocol, OSCAR_TYPE_PROTOCOL, 0,
82 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_CLIENT,
83 icq_protocol_client_iface_init));
85 /* This exists solely because the above macro makes icq_protocol_register_type
86 * static. */
87 void
88 icq_protocol_register(PurplePlugin *plugin)
90 icq_protocol_register_type(G_TYPE_MODULE(plugin));