3 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
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.
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.
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
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
24 #include "conversation.h"
29 #include "gtkplugin.h"
31 #define ICONAWAY_PLUGIN_ID "gtk-iconaway"
34 iconify_windows(PurpleAccount
*account
, PurpleStatus
*old
, PurpleStatus
*newstatus
)
36 PurplePresence
*presence
;
37 PidginConvWindow
*win
;
40 presence
= purple_status_get_presence(newstatus
);
42 if (purple_presence_is_available(presence
))
45 purple_blist_set_visible(FALSE
);
47 for (windows
= pidgin_conv_windows_get_list();
49 windows
= windows
->next
) {
51 win
= (PidginConvWindow
*)windows
->data
;
53 gtk_window_iconify(GTK_WINDOW(win
->window
));
61 static PidginPluginInfo
*
62 plugin_query(GError
**error
)
64 const gchar
* const authors
[] = {
65 "Eric Warmenhoven <eric@warmenhoven.org>",
69 return pidgin_plugin_info_new(
70 "id", ICONAWAY_PLUGIN_ID
,
71 "name", N_("Iconify on Away"),
72 "version", DISPLAY_VERSION
,
73 "category", N_("User interface"),
74 "summary", N_("Iconifies the buddy list and your conversations "
76 "description", N_("Iconifies the buddy list and your conversations "
79 "website", PURPLE_WEBSITE
,
80 "abi-version", PURPLE_ABI_VERSION
,
86 plugin_load(PurplePlugin
*plugin
, GError
**error
)
88 purple_signal_connect(purple_accounts_get_handle(), "account-status-changed",
89 plugin
, PURPLE_CALLBACK(iconify_windows
), NULL
);
95 plugin_unload(PurplePlugin
*plugin
, GError
**error
)
100 PURPLE_PLUGIN_INIT(iconaway
, plugin_query
, plugin_load
, plugin_unload
);