grim/purple-plugin-pack
* Show Offline - Show specific buddies while offline * Copyright (C) 2004-2008 Stu Tomlinson <stu@nosnilmot.com> * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. /* If you can't figure out what this line is for, DON'T TOUCH IT. */ #include "../common/pp_internal.h" showoffline_cb(PurpleBlistNode *node, gpointer data) PurpleBuddyList *blist = purple_get_blist(); PurpleBlistUiOps *ops = purple_blist_get_ui_ops(); if (PURPLE_BLIST_NODE_IS_BUDDY(node)) purple_blist_node_set_bool(node, "show_offline", !purple_blist_node_get_bool(node, "show_offline")); else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) gboolean setting = !purple_blist_node_get_bool(node, "show_offline"); purple_blist_node_set_bool(node, "show_offline", setting); for (bnode = node->child; bnode != NULL; bnode = bnode->next) { purple_blist_node_set_bool(bnode, "show_offline", setting); ops->update(blist, node); showoffline_extended_menu_cb(PurpleBlistNode *node, GList **m) PurpleMenuAction *bna = NULL; if (purple_blist_node_get_flags(node) & PURPLE_BLIST_NODE_FLAG_NO_SAVE) if (!PURPLE_BLIST_NODE_IS_CONTACT(node) && !PURPLE_BLIST_NODE_IS_BUDDY(node)) *m = g_list_append(*m, bna); if (purple_blist_node_get_bool(node, "show_offline")) bna = purple_menu_action_new(_("Hide when offline"), PURPLE_CALLBACK(showoffline_cb), bna = purple_menu_action_new(_("Show when offline"), PURPLE_CALLBACK(showoffline_cb), *m = g_list_append(*m, bna); plugin_load(PurplePlugin *plugin) if (purple_version_check(2,3,0) == NULL) { purple_notify_info(plugin, _("Plugin deprecated"), _("Show Offline plugin deprecated"), _("This plugin has been deprecated as of Pidgin 2.3.0 which\n" "includes the same functionality.")); purple_signal_connect(purple_blist_get_handle(), "blist-node-extended-menu", plugin, PURPLE_CALLBACK(showoffline_extended_menu_cb), NULL); static PurplePluginInfo info = PURPLE_MAJOR_VERSION, /**< major version */ PURPLE_PLUGIN_STANDARD, /**< type */ NULL, /**< ui_requirement */ NULL, /**< dependencies */ PURPLE_PRIORITY_DEFAULT, /**< priority */ "core-plugin_pack-showoffline", /**< id */ PP_VERSION, /**< version */ "Stu Tomlinson <stu@nosnilmot.com>", /**< author */ PP_WEBSITE, /**< homepage */ plugin_load, /**< load */ init_plugin(PurplePlugin *plugin) { bindtextdomain(GETTEXT_PACKAGE, PP_LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); info.name = _("Show Offline"); info.summary = _("Show specific buddies while offline."); info.description = _("Adds the option to show specific buddies in your buddy " "list when they are offline, even with \"Show Offline Buddies\" turned off."); PURPLE_INIT_PLUGIN(showoffline, init_plugin, info)