# HG changeset patch # User Christopher O'Brien # Date 1137553465 0 # Node ID e841e23a334c16acc2e0aef9ad9d2bfc4f291976 # Parent f50a99d5ba9b6673832c5a8f86311c44e86f912f [gaim-migrate @ 15277] patch #1408512 Psychic popups: disable when away committer: Tailor Script diff -r f50a99d5ba9b -r e841e23a334c COPYRIGHT --- a/COPYRIGHT Wed Jan 18 02:58:15 2006 +0000 +++ b/COPYRIGHT Wed Jan 18 03:04:25 2006 +0000 @@ -172,6 +172,7 @@ Arkadiusz Miskiewicz Andrew Molloy Sergio Moretto +Richard Nelson Matthew A. Nicholson Szilard Novaki Novell diff -r f50a99d5ba9b -r e841e23a334c plugins/psychic.c --- a/plugins/psychic.c Wed Jan 18 02:58:15 2006 +0000 +++ b/plugins/psychic.c Wed Jan 18 03:04:25 2006 +0000 @@ -2,10 +2,12 @@ #include "internal.h" +#include "account.h" #include "blist.h" #include "conversation.h" #include "debug.h" #include "signals.h" +#include "status.h" #include "version.h" #include "plugin.h" @@ -27,17 +29,23 @@ #define PREFS_BASE "/plugins/core/psychic" #define PREF_BUDDIES PREFS_BASE "/buddies_only" #define PREF_NOTICE PREFS_BASE "/show_notice" +#define PREF_STATUS PREFS_BASE "/activate_online" static void buddy_typing_cb(GaimAccount *acct, const char *name, void *data) { GaimConversation *gconv; - if(gaim_prefs_get_bool(PREF_BUDDIES)) { - if(! gaim_find_buddy(acct, name)) { - DEBUG_INFO("not in blist, doing nothing\n"); - return; - } + if(gaim_prefs_get_bool(PREF_STATUS) && + gaim_status_is_available(gaim_account_get_active_status(acct))) { + DEBUG_INFO("not available, doing nothing\n"); + return; + } + + if(gaim_prefs_get_bool(PREF_BUDDIES) && + ! gaim_find_buddy(acct, name)) { + DEBUG_INFO("not in blist, doing nothing\n"); + return; } gconv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, name, acct); @@ -65,7 +73,12 @@ frame = gaim_plugin_pref_frame_new(); pref = gaim_plugin_pref_new_with_name(PREF_BUDDIES); - gaim_plugin_pref_set_label(pref, _("Only enable for users on the buddy list")); + gaim_plugin_pref_set_label(pref, _("Only enable for users on" + " the buddy list")); + gaim_plugin_pref_frame_add(frame, pref); + + pref = gaim_plugin_pref_new_with_name(PREF_STATUS); + gaim_plugin_pref_set_label(pref, _("Disable when away")); gaim_plugin_pref_frame_add(frame, pref); pref = gaim_plugin_pref_new_with_name(PREF_NOTICE); @@ -131,6 +144,7 @@ gaim_prefs_add_none(PREFS_BASE); gaim_prefs_add_bool(PREF_BUDDIES, FALSE); gaim_prefs_add_bool(PREF_NOTICE, TRUE); + gaim_prefs_add_bool(PREF_STATUS, TRUE); }