2 * GtkBuddyNote - Store notes on particular buddies
3 * Copyright (C) 2007 Etan Reisner <deryni@pidgin.im>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
22 #include <gtkplugin.h>
28 append_to_tooltip(PurpleBlistNode
*node
, GString
*text
, gboolean full
)
31 const gchar
*note
= purple_blist_node_get_string(node
, "notes");
33 if ((note
!= NULL
) && (*note
!= '\0')) {
35 purple_markup_html_to_xhtml(note
, NULL
, &tmp
);
36 esc
= g_markup_escape_text(tmp
, -1);
38 g_string_append_printf(text
, _("\n<b>Buddy Note</b>: %s"),
45 static PidginPluginInfo
*
46 plugin_query(GError
**error
)
48 const gchar
* const authors
[] = {
49 "Etan Reisner <deryni@pidgin.im>",
53 const gchar
* const dependencies
[] = {
54 "core-plugin_pack-buddynote",
58 return pidgin_plugin_info_new(
60 "name", N_("Buddy Note Tooltips"),
61 "version", DISPLAY_VERSION
,
62 "category", N_("User interface"),
63 "summary", N_("Shows stored buddy notes on the buddy's tooltip."),
64 "description", N_("Shows stored buddy notes on the buddy's tooltip."),
66 "website", PURPLE_WEBSITE
,
67 "abi-version", PURPLE_ABI_VERSION
,
68 "dependencies", dependencies
,
74 plugin_load(PurplePlugin
*plugin
, GError
**error
)
76 purple_signal_connect(pidgin_blist_get_handle(), "drawing-tooltip",
77 plugin
, PURPLE_CALLBACK(append_to_tooltip
), NULL
);
82 plugin_unload(PurplePlugin
*plugin
, GError
**error
)
87 PURPLE_PLUGIN_INIT(gtkbuddynote
, plugin_query
, plugin_load
, plugin_unload
);