comparison src/protocols/oscar/oscar.c @ 9935:bb0c04ebcdef

[gaim-migrate @ 10827] Someone should make this work so I don't have to #if 0 it out. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 02 Sep 2004 04:47:16 +0000
parents cee849d17167
children 3578cec797db
comparison
equal deleted inserted replaced
9934:31fddde685dd 9935:bb0c04ebcdef
293 293
294 /* remove these at some point? */ 294 /* remove these at some point? */
295 /* Because I don't like forward declarations? I think that was why... */ 295 /* Because I don't like forward declarations? I think that was why... */
296 static void oscar_set_info(GaimConnection *gc, const char *text); 296 static void oscar_set_info(GaimConnection *gc, const char *text);
297 static void oscar_set_away(GaimConnection *gc, const char *state, const char *message); 297 static void oscar_set_away(GaimConnection *gc, const char *state, const char *message);
298
299 static void recent_buddies_cb(const char *name, GaimPrefType type, gpointer value, gpointer data);
298 300
299 static void oscar_free_name_data(struct name_data *data) { 301 static void oscar_free_name_data(struct name_data *data) {
300 g_free(data->name); 302 g_free(data->name);
301 g_free(data->nick); 303 g_free(data->nick);
302 g_free(data); 304 g_free(data);
1715 */ 1717 */
1716 aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL); 1718 aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL);
1717 od->sess = sess; 1719 od->sess = sess;
1718 sess->aux_data = gc; 1720 sess->aux_data = gc;
1719 1721
1722 /* Connect to core Gaim signals */
1723 gaim_prefs_connect_callback("/plugins/prpl/oscar/recent_buddies", recent_buddies_cb, gc);
1724
1720 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL); 1725 conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL);
1721 if (conn == NULL) { 1726 if (conn == NULL) {
1722 gaim_debug_error("oscar", 1727 gaim_debug_error("oscar",
1723 "internal connection error\n"); 1728 "internal connection error\n");
1724 gaim_connection_error(gc, _("Unable to login to AIM")); 1729 gaim_connection_error(gc, _("Unable to login to AIM"));
7279 7284
7280 if (!dim) 7285 if (!dim)
7281 return; 7286 return;
7282 7287
7283 oscar_direct_im_destroy(od, dim); 7288 oscar_direct_im_destroy(od, dim);
7289 }
7290
7291 static void
7292 recent_buddies_cb(const char *name, GaimPrefType type, gpointer value, gpointer data)
7293 {
7294 GaimConnection *gc = data;
7295 OscarData *od = gc->proto_data;
7296 aim_session_t *sess = od->sess;
7297 fu32_t presence;
7298
7299 presence = aim_ssi_getpresence(sess->ssi.local);
7300
7301 if (value) {
7302 presence |= 0x00400000;
7303 aim_ssi_setpresence(sess, presence);
7304 } else {
7305 presence &= 0xFFBFFFFF;
7306 aim_ssi_setpresence(sess, presence);
7307 }
7308 }
7309
7310 static GaimPluginPrefFrame *
7311 get_plugin_pref_frame(GaimPlugin *plugin) {
7312 GaimPluginPrefFrame *frame;
7313 GaimPluginPref *ppref;
7314
7315 frame = gaim_plugin_pref_frame_new();
7316
7317 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/prpl/oscar/recent_buddies", _("Use recent buddies group"));
7318 gaim_plugin_pref_frame_add(frame, ppref);
7319
7320 /* XXX - Why doesn't the following show up? */
7321 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/prpl/oscar/show_idle", _("Show how long you have been idle"));
7322 gaim_plugin_pref_frame_add(frame, ppref);
7323
7324 return frame;
7284 } 7325 }
7285 7326
7286 static GaimPluginProtocolInfo prpl_info = 7327 static GaimPluginProtocolInfo prpl_info =
7287 { 7328 {
7288 GAIM_PRPL_API_VERSION, 7329 GAIM_PRPL_API_VERSION,
7350 NULL, /* roomlist_expand_category */ 7391 NULL, /* roomlist_expand_category */
7351 oscar_can_receive_file, /* can_receive_file */ 7392 oscar_can_receive_file, /* can_receive_file */
7352 oscar_send_file /* send_file */ 7393 oscar_send_file /* send_file */
7353 }; 7394 };
7354 7395
7396 static GaimPluginUiInfo prefs_info = {
7397 get_plugin_pref_frame
7398 };
7399
7355 static GaimPluginInfo info = 7400 static GaimPluginInfo info =
7356 { 7401 {
7357 GAIM_PLUGIN_API_VERSION, /**< api_version */ 7402 GAIM_PLUGIN_API_VERSION, /**< api_version */
7358 GAIM_PLUGIN_PROTOCOL, /**< type */ 7403 GAIM_PLUGIN_PROTOCOL, /**< type */
7359 NULL, /**< ui_requirement */ 7404 NULL, /**< ui_requirement */
7375 NULL, /**< unload */ 7420 NULL, /**< unload */
7376 NULL, /**< destroy */ 7421 NULL, /**< destroy */
7377 7422
7378 NULL, /**< ui_info */ 7423 NULL, /**< ui_info */
7379 &prpl_info, /**< extra_info */ 7424 &prpl_info, /**< extra_info */
7380 NULL, 7425 &prefs_info, /**< prefs_info */
7381 oscar_actions 7426 oscar_actions
7382 }; 7427 };
7383 7428
7384 static void 7429 static void
7385 init_plugin(GaimPlugin *plugin) 7430 init_plugin(GaimPlugin *plugin)
7394 7439
7395 option = gaim_account_option_string_new(_("Encoding"), "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); 7440 option = gaim_account_option_string_new(_("Encoding"), "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING);
7396 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); 7441 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
7397 7442
7398 my_protocol = plugin; 7443 my_protocol = plugin;
7444
7445 gaim_prefs_add_none("/plugins/prpl/oscar");
7446 gaim_prefs_add_bool("/plugins/prpl/oscar/recent_buddies", FALSE);
7399 } 7447 }
7400 7448
7401 GAIM_INIT_PLUGIN(oscar, init_plugin, info); 7449 GAIM_INIT_PLUGIN(oscar, init_plugin, info);