Wed, 23 May 2007 03:59:19 +0000
Fix file transfers aborting and mistakenly being marked as cancelled when they are actually complete. Fixes #814
| 15230 | 1 | /* |
| 2 | * BuddyNote - Store notes on particular buddies | |
| 3 | * Copyright (C) 2004 Stu Tomlinson <stu@nosnilmot.com> | |
| 4 | * | |
| 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. | |
| 9 | * | |
| 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. | |
| 14 | * | |
| 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
| 18 | */ | |
| 19 | #include "internal.h" | |
| 20 | ||
| 21 | #include <debug.h> | |
| 22 | #include <notify.h> | |
| 23 | #include <request.h> | |
| 24 | #include <signals.h> | |
| 25 | #include <util.h> | |
| 26 | #include <version.h> | |
| 27 | ||
| 28 | static void | |
| 15884 | 29 | dont_do_it_cb(PurpleBlistNode *node, const char *note) |
| 15230 | 30 | { |
| 31 | } | |
| 32 | ||
| 33 | static void | |
| 15884 | 34 | do_it_cb(PurpleBlistNode *node, const char *note) |
| 15230 | 35 | { |
| 15884 | 36 | purple_blist_node_set_string(node, "notes", note); |
| 15230 | 37 | } |
| 38 | ||
| 39 | static void | |
| 15884 | 40 | buddynote_edit_cb(PurpleBlistNode *node, gpointer data) |
| 15230 | 41 | { |
| 42 | const char *note; | |
| 43 | ||
| 15884 | 44 | note = purple_blist_node_get_string(node, "notes"); |
| 15230 | 45 | |
| 15884 | 46 | purple_request_input(node, _("Notes"), |
| 15230 | 47 | _("Enter your notes below..."), |
| 48 | NULL, | |
| 49 | note, TRUE, FALSE, "html", | |
| 50 | _("Save"), G_CALLBACK(do_it_cb), | |
| 51 | _("Cancel"), G_CALLBACK(dont_do_it_cb), | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16131
diff
changeset
|
52 | NULL, NULL, NULL, |
| 15230 | 53 | node); |
| 54 | } | |
| 55 | ||
| 56 | static void | |
| 15884 | 57 | buddynote_extended_menu_cb(PurpleBlistNode *node, GList **m) |
| 15230 | 58 | { |
| 15884 | 59 | PurpleMenuAction *bna = NULL; |
| 15230 | 60 | |
| 61 | *m = g_list_append(*m, bna); | |
| 15884 | 62 | bna = purple_menu_action_new(_("Edit Notes..."), PURPLE_CALLBACK(buddynote_edit_cb), NULL, NULL); |
| 15230 | 63 | *m = g_list_append(*m, bna); |
| 64 | } | |
| 65 | ||
| 66 | static gboolean | |
| 15884 | 67 | plugin_load(PurplePlugin *plugin) |
| 15230 | 68 | { |
| 69 | ||
| 15884 | 70 | purple_signal_connect(purple_blist_get_handle(), "blist-node-extended-menu", |
| 71 | plugin, PURPLE_CALLBACK(buddynote_extended_menu_cb), NULL); | |
| 15230 | 72 | |
| 73 | return TRUE; | |
| 74 | } | |
| 75 | ||
| 15884 | 76 | static PurplePluginInfo info = |
| 15230 | 77 | { |
| 15884 | 78 | PURPLE_PLUGIN_MAGIC, |
| 16131 | 79 | PURPLE_MAJOR_VERSION, /**< major version */ |
| 80 | PURPLE_MINOR_VERSION, /**< minor version */ | |
| 15884 | 81 | PURPLE_PLUGIN_STANDARD, /**< type */ |
| 15230 | 82 | NULL, /**< ui_requirement */ |
| 83 | 0, /**< flags */ | |
| 84 | NULL, /**< dependencies */ | |
| 16131 | 85 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 15230 | 86 | "core-plugin_pack-buddynote", /**< id */ |
| 87 | N_("Buddy Notes"), /**< name */ | |
| 88 | VERSION, /**< version */ | |
| 16131 | 89 | N_("Store notes on particular buddies."), /**< summary */ |
| 15230 | 90 | N_("Adds the option to store notes for buddies " |
| 16131 | 91 | "on your buddy list."), /**< description */ |
| 15230 | 92 | "Stu Tomlinson <stu@nosnilmot.com>", /**< author */ |
| 15884 | 93 | PURPLE_WEBSITE, /**< homepage */ |
| 15230 | 94 | plugin_load, /**< load */ |
| 95 | NULL, /**< unload */ | |
| 96 | NULL, /**< destroy */ | |
| 97 | NULL, /**< ui_info */ | |
| 98 | NULL, /**< extra_info */ | |
| 99 | NULL, /**< prefs_info */ | |
|
16745
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
100 | NULL, /**< actions */ |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
101 | |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
102 | /* padding */ |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
103 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
104 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
105 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
106 | NULL |
| 15230 | 107 | }; |
| 108 | ||
| 109 | ||
| 110 | static void | |
| 15884 | 111 | init_plugin(PurplePlugin *plugin) { |
| 15230 | 112 | } |
| 113 | ||
| 15884 | 114 | PURPLE_INIT_PLUGIN(buddynote, init_plugin, info) |