comparison libpurple/protocols/yahoo/libyahoo.c @ 27314:4aa78e6524b1

Very rudimentary start to separate prpls. Removed URI handler from the JAPAN prpl since it would collide with the other prpl's scheme. Need to figure out if there is a second URI scheme we need to deal with.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sun, 05 Jul 2009 05:35:05 +0000
parents
children 1f30c4a47e3d
comparison
equal deleted inserted replaced
27313:ef5f0cde8d74 27314:4aa78e6524b1
1 /*
2 * purple
3 *
4 * Purple is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
6 * source distribution.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
21 *
22 */
23
24 static PurpleWhiteboardPrplOps yahoo_whiteboard_prpl_ops =
25 {
26 yahoo_doodle_start,
27 yahoo_doodle_end,
28 yahoo_doodle_get_dimensions,
29 NULL,
30 yahoo_doodle_get_brush,
31 yahoo_doodle_set_brush,
32 yahoo_doodle_send_draw_list,
33 yahoo_doodle_clear,
34
35 /* padding */
36 NULL,
37 NULL,
38 NULL,
39 NULL
40 };
41
42 static PurplePluginProtocolInfo prpl_info =
43 {
44 OPT_PROTO_MAIL_CHECK | OPT_PROTO_CHAT_TOPIC,
45 NULL, /* user_splits */
46 NULL, /* protocol_options */
47 {"png,gif,jpeg", 96, 96, 96, 96, 0, PURPLE_ICON_SCALE_SEND},
48 yahoo_list_icon,
49 yahoo_list_emblem,
50 yahoo_status_text,
51 yahoo_tooltip_text,
52 yahoo_status_types,
53 yahoo_blist_node_menu,
54 yahoo_c_info,
55 yahoo_c_info_defaults,
56 yahoo_login,
57 yahoo_close,
58 yahoo_send_im,
59 NULL, /* set info */
60 yahoo_send_typing,
61 yahoo_get_info,
62 yahoo_set_status,
63 yahoo_set_idle,
64 NULL, /* change_passwd*/
65 yahoo_add_buddy,
66 NULL, /* add_buddies */
67 yahoo_remove_buddy,
68 NULL, /* remove_buddies */
69 NULL, /* add_permit */
70 yahoo_add_deny,
71 NULL, /* rem_permit */
72 yahoo_rem_deny,
73 yahoo_set_permit_deny,
74 yahoo_c_join,
75 NULL, /* reject chat invite */
76 yahoo_get_chat_name,
77 yahoo_c_invite,
78 yahoo_c_leave,
79 NULL, /* chat whisper */
80 yahoo_c_send,
81 yahoo_keepalive,
82 NULL, /* register_user */
83 NULL, /* get_cb_info */
84 NULL, /* get_cb_away */
85 yahoo_update_alias, /* alias_buddy */
86 yahoo_change_buddys_group,
87 yahoo_rename_group,
88 NULL, /* buddy_free */
89 NULL, /* convo_closed */
90 purple_normalize_nocase, /* normalize */
91 yahoo_set_buddy_icon,
92 NULL, /* void (*remove_group)(PurpleConnection *gc, const char *group);*/
93 NULL, /* char *(*get_cb_real_name)(PurpleConnection *gc, int id, const char *who); */
94 NULL, /* set_chat_topic */
95 NULL, /* find_blist_chat */
96 yahoo_roomlist_get_list,
97 yahoo_roomlist_cancel,
98 yahoo_roomlist_expand_category,
99 NULL, /* can_receive_file */
100 yahoo_send_file,
101 yahoo_new_xfer,
102 yahoo_offline_message, /* offline_message */
103 &yahoo_whiteboard_prpl_ops,
104 NULL, /* send_raw */
105 NULL, /* roomlist_room_serialize */
106 NULL, /* unregister_user */
107
108 yahoo_send_attention,
109 yahoo_attention_types,
110
111 sizeof(PurplePluginProtocolInfo), /* struct_size */
112 yahoo_get_account_text_table, /* get_account_text_table */
113 NULL, /* initiate_media */
114 NULL /* can_do_media */
115 };
116
117 static PurplePluginInfo info =
118 {
119 PURPLE_PLUGIN_MAGIC,
120 PURPLE_MAJOR_VERSION,
121 PURPLE_MINOR_VERSION,
122 PURPLE_PLUGIN_PROTOCOL, /**< type */
123 NULL, /**< ui_requirement */
124 0, /**< flags */
125 NULL, /**< dependencies */
126 PURPLE_PRIORITY_DEFAULT, /**< priority */
127 "prpl-yahoo", /**< id */
128 "Yahoo", /**< name */
129 DISPLAY_VERSION, /**< version */
130 /** summary */
131 N_("Yahoo Protocol Plugin"),
132 /** description */
133 N_("Yahoo Protocol Plugin"),
134 NULL, /**< author */
135 PURPLE_WEBSITE, /**< homepage */
136 NULL, /**< load */
137 yahoo_unload_plugin, /**< unload */
138 NULL, /**< destroy */
139 NULL, /**< ui_info */
140 &prpl_info, /**< extra_info */
141 NULL,
142 yahoo_actions,
143
144 /* padding */
145 NULL,
146 NULL,
147 NULL,
148 NULL
149 };
150
151 static void
152 init_plugin(PurplePlugin *plugin)
153 {
154 PurpleAccountOption *option;
155
156 option = purple_account_option_string_new(_("Pager server"), "server", YAHOO_PAGER_HOST);
157 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
158
159 option = purple_account_option_int_new(_("Pager port"), "port", YAHOO_PAGER_PORT);
160 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
161
162 option = purple_account_option_string_new(_("File transfer server"), "xfer_host", YAHOO_XFER_HOST);
163 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
164
165 option = purple_account_option_int_new(_("File transfer port"), "xfer_port", YAHOO_XFER_PORT);
166 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
167
168 option = purple_account_option_string_new(_("Chat room locale"), "room_list_locale", YAHOO_ROOMLIST_LOCALE);
169 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
170
171 option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
172 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
173
174 option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
175 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
176
177
178 #if 0
179 option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
180 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
181
182 option = purple_account_option_string_new(_("Yahoo Chat server"), "ycht-server", YAHOO_YCHT_HOST);
183 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
184
185 option = purple_account_option_int_new(_("Yahoo Chat port"), "ycht-port", YAHOO_YCHT_PORT);
186 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
187 #endif
188
189 my_protocol = plugin;
190 yahoopurple_register_commands();
191 yahoo_init_colorht();
192
193 purple_signal_connect(purple_get_core(), "uri-handler", plugin,
194 PURPLE_CALLBACK(yahoo_uri_handler), NULL);
195 }
196
197 PURPLE_INIT_PLUGIN(yahoo, init_plugin, info);