Sat, 17 Aug 2013 23:28:51 +0530
Renamed PurplePluginProtocolInfo to PurpleProtocol
| 15884 | 1 | /* purple |
| 15030 | 2 | * |
| 15884 | 3 | * Purple is the legal property of its developers, whose names are too numerous |
| 15030 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 6 | * | |
| 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. | |
| 11 | * | |
| 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. | |
| 16 | * | |
| 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 | |
|
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 | 20 | * |
| 21 | */ | |
| 22 | ||
| 30403 | 23 | /* libicq is the ICQ protocol plugin. It is linked against liboscar, |
| 15030 | 24 | * which contains all the shared implementation code with libaim |
| 25 | */ | |
| 26 | ||
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
27 | #include "plugins.h" |
| 15030 | 28 | |
| 29 | #include "oscarcommon.h" | |
| 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 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36538
diff
changeset
|
40 | static PurpleProtocol protocol = |
| 15030 | 41 | { |
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
42 | "prpl-icq", /* id */ |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
43 | "ICQ", /* name */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36538
diff
changeset
|
44 | sizeof(PurpleProtocol), /* struct_size */ |
|
33696
b210b3afb63d
Add some prpl flags to indicate support for auth response messages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32338
diff
changeset
|
45 | OPT_PROTO_MAIL_CHECK | OPT_PROTO_IM_IMAGE | OPT_PROTO_INVITE_MESSAGE | OPT_PROTO_AUTHORIZATION_DENIED_MESSAGE, |
| 15030 | 46 | NULL, /* user_splits */ |
| 47 | NULL, /* protocol_options */ | |
|
31806
c9a9c04947a4
Fix setting icons with dimensions greater than 64x64 pixels by scaling
Mark Doliner <markdoliner@pidgin.im>
parents:
31599
diff
changeset
|
48 | {"gif,jpeg,bmp,ico", 0, 0, 64, 64, 7168, PURPLE_ICON_SCALE_SEND | PURPLE_ICON_SCALE_DISPLAY}, /* icon_spec */ |
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
49 | oscar_get_actions, /* get_actions */ |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
50 | oscar_list_icon_icq, /* list_icon */ |
| 15524 | 51 | oscar_list_emblem, /* list_emblems */ |
| 15030 | 52 | oscar_status_text, /* status_text */ |
| 53 | oscar_tooltip_text, /* tooltip_text */ | |
| 54 | oscar_status_types, /* status_types */ | |
| 55 | oscar_blist_node_menu, /* blist_node_menu */ | |
| 56 | oscar_chat_info, /* chat_info */ | |
| 57 | oscar_chat_info_defaults, /* chat_info_defaults */ | |
| 58 | oscar_login, /* login */ | |
| 59 | oscar_close, /* close */ | |
| 60 | oscar_send_im, /* send_im */ | |
| 61 | oscar_set_info, /* set_info */ | |
| 62 | oscar_send_typing, /* send_typing */ | |
| 63 | oscar_get_info, /* get_info */ | |
| 64 | oscar_set_status, /* set_status */ | |
| 65 | oscar_set_idle, /* set_idle */ | |
| 66 | oscar_change_passwd, /* change_passwd */ | |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31806
diff
changeset
|
67 | oscar_add_buddy, /* add_buddy */ |
| 15030 | 68 | NULL, /* add_buddies */ |
| 69 | oscar_remove_buddy, /* remove_buddy */ | |
| 70 | NULL, /* remove_buddies */ | |
|
30645
941f22b19796
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30138
diff
changeset
|
71 | NULL, /* add_permit */ |
| 15030 | 72 | oscar_add_deny, /* add_deny */ |
|
30645
941f22b19796
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30138
diff
changeset
|
73 | NULL, /* rem_permit */ |
| 15030 | 74 | oscar_rem_deny, /* rem_deny */ |
|
30645
941f22b19796
Start using the real ICQ block list (SSI type 0xe) for allowing/blocking
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30138
diff
changeset
|
75 | NULL, /* set_permit_deny */ |
| 15030 | 76 | oscar_join_chat, /* join_chat */ |
| 77 | NULL, /* reject_chat */ | |
| 78 | oscar_get_chat_name, /* get_chat_name */ | |
| 79 | oscar_chat_invite, /* chat_invite */ | |
| 80 | oscar_chat_leave, /* chat_leave */ | |
| 81 | NULL, /* chat_whisper */ | |
| 82 | oscar_send_chat, /* chat_send */ | |
| 83 | oscar_keepalive, /* keepalive */ | |
| 84 | NULL, /* register_user */ | |
| 85 | NULL, /* get_cb_info */ | |
| 86 | oscar_alias_buddy, /* alias_buddy */ | |
| 87 | oscar_move_buddy, /* group_buddy */ | |
| 88 | oscar_rename_group, /* rename_group */ | |
| 89 | NULL, /* buddy_free */ | |
| 90 | oscar_convo_closed, /* convo_closed */ | |
| 91 | oscar_normalize, /* normalize */ | |
| 92 | oscar_set_icon, /* set_buddy_icon */ | |
|
19050
78ed2f8cd58d
Some changes from Matthew Goldstein and I to not automatically remove
Mark Doliner <markdoliner@pidgin.im>
parents:
18354
diff
changeset
|
93 | oscar_remove_group, /* remove_group */ |
| 15030 | 94 | NULL, /* get_cb_real_name */ |
| 95 | NULL, /* set_chat_topic */ | |
| 96 | NULL, /* find_blist_chat */ | |
| 97 | NULL, /* roomlist_get_list */ | |
| 98 | NULL, /* roomlist_cancel */ | |
| 99 | NULL, /* roomlist_expand_category */ | |
| 100 | oscar_can_receive_file, /* can_receive_file */ | |
| 101 | oscar_send_file, /* send_file */ | |
| 102 | oscar_new_xfer, /* new_xfer */ | |
| 103 | oscar_offline_message, /* offline_message */ | |
| 104 | NULL, /* whiteboard_prpl_ops */ | |
| 15185 | 105 | NULL, /* send_raw */ |
| 106 | NULL, /* roomlist_room_serialize */ | |
|
22244
221f48b173e3
Update some comments in oscar's prpl callback structs
Mark Doliner <markdoliner@pidgin.im>
parents:
20288
diff
changeset
|
107 | NULL, /* unregister_user */ |
|
221f48b173e3
Update some comments in oscar's prpl callback structs
Mark Doliner <markdoliner@pidgin.im>
parents:
20288
diff
changeset
|
108 | NULL, /* send_attention */ |
|
221f48b173e3
Update some comments in oscar's prpl callback structs
Mark Doliner <markdoliner@pidgin.im>
parents:
20288
diff
changeset
|
109 | NULL, /* get_attention_types */ |
|
24235
46abfb2f03e4
Show 'ICQ UIN...' and 'Yahoo ID...' in the screenname field
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23277
diff
changeset
|
110 | icq_get_account_text_table, /* get_account_text_table */ |
|
23707
480f94157418
propagate from branch 'im.pidgin.pidgin' (head bd5f7f61d9349053ee4738efc0d17453f0574057)
Sadrul Habib Chowdhury <sadrul@pidgin.im>
diff
changeset
|
111 | NULL, /* initiate_media */ |
| 29404 | 112 | NULL, /* can_do_media */ |
|
24912
9ae8349f0353
Move the mood UI for ICQ into Pidgin. It still uses the new request API
Richard Laager <rlaager@pidgin.im>
parents:
24235
diff
changeset
|
113 | oscar_get_purple_moods, /* get_moods */ |
|
30138
cca9685df785
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <darkrain42@pidgin.im>
parents:
29859
diff
changeset
|
114 | NULL, /* set_public_alias */ |
|
32315
2550a39e0285
Rename the _with_invite functions to their counterparts.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31806
diff
changeset
|
115 | NULL /* get_public_alias */ |
| 15030 | 116 | }; |
| 117 | ||
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
118 | static PurplePluginInfo * |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
119 | plugin_query(GError **error) |
| 15030 | 120 | { |
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
121 | return purple_plugin_info_new( |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
122 | "id", "prpl-icq", |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
123 | "name", "ICQ", |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
124 | "version", DISPLAY_VERSION, |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
125 | "category", N_("Protocol"), |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
126 | "summary", N_("ICQ Protocol Plugin"), |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
127 | "description", N_("ICQ Protocol Plugin"), |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
128 | "website", PURPLE_WEBSITE, |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
129 | "abi-version", PURPLE_ABI_VERSION, |
| 36536 | 130 | "flags", GPLUGIN_PLUGIN_INFO_FLAGS_INTERNAL | |
| 131 | GPLUGIN_PLUGIN_INFO_FLAGS_LOAD_ON_QUERY, | |
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
132 | NULL |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
133 | ); |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
134 | } |
| 15030 | 135 | |
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
136 | static gboolean |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
137 | plugin_load(PurplePlugin *plugin, GError **error) |
| 15030 | 138 | { |
| 15884 | 139 | PurpleAccountOption *option; |
| 15030 | 140 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36538
diff
changeset
|
141 | oscar_init(&protocol, TRUE); |
| 15030 | 142 | |
| 15884 | 143 | option = purple_account_option_string_new(_("Encoding"), "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36538
diff
changeset
|
144 | protocol.protocol_options = g_list_append(protocol.protocol_options, option); |
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
145 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36538
diff
changeset
|
146 | purple_protocols_add(&protocol); |
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
147 | |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
148 | return TRUE; |
| 15030 | 149 | } |
| 150 | ||
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
151 | static gboolean |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
152 | plugin_unload(PurplePlugin *plugin, GError **error) |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
153 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36538
diff
changeset
|
154 | purple_protocols_remove(&protocol); |
|
36530
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
155 | |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
156 | return TRUE; |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
157 | } |
|
b8caab360c96
Refactored oscar to use the new plugin API
Ankit Vani <a@nevitus.org>
parents:
33696
diff
changeset
|
158 | |
| 36538 | 159 | PURPLE_PLUGIN_INIT(icq, plugin_query, plugin_load, plugin_unload); |