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 | * Displays messages on a new line, below the nick | |
| 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 <string.h> | |
| 22 | ||
| 23 | #include <conversation.h> | |
| 24 | #include <debug.h> | |
| 25 | #include <plugin.h> | |
| 26 | #include <signals.h> | |
| 27 | #include <util.h> | |
| 28 | #include <version.h> | |
| 29 | ||
| 30 | static gboolean | |
| 15884 | 31 | addnewline_msg_cb(PurpleAccount *account, char *sender, char **message, |
| 32 | PurpleConversation *conv, int *flags, void *data) | |
| 15230 | 33 | { |
| 34 | if (g_ascii_strncasecmp(*message, "/me ", strlen("/me "))) { | |
| 35 | char *tmp = g_strdup_printf("\n%s", *message); | |
| 36 | g_free(*message); | |
| 37 | *message = tmp; | |
| 38 | } | |
| 39 | ||
| 40 | return FALSE; | |
| 41 | } | |
| 42 | ||
| 43 | static gboolean | |
| 15884 | 44 | plugin_load(PurplePlugin *plugin) |
| 15230 | 45 | { |
| 15884 | 46 | void *conversation = purple_conversations_get_handle(); |
| 15230 | 47 | |
| 15884 | 48 | purple_signal_connect(conversation, "writing-im-msg", |
| 49 | plugin, PURPLE_CALLBACK(addnewline_msg_cb), NULL); | |
| 50 | purple_signal_connect(conversation, "writing-chat-msg", | |
| 51 | plugin, PURPLE_CALLBACK(addnewline_msg_cb), NULL); | |
| 15230 | 52 | |
| 53 | return TRUE; | |
| 54 | } | |
| 55 | ||
| 15884 | 56 | static PurplePluginInfo info = |
| 15230 | 57 | { |
| 16132 | 58 | PURPLE_PLUGIN_MAGIC, /**< magic */ |
| 59 | PURPLE_MAJOR_VERSION, /**< major version */ | |
| 60 | PURPLE_MINOR_VERSION, /**< minor version */ | |
| 15884 | 61 | PURPLE_PLUGIN_STANDARD, /**< type */ |
| 15230 | 62 | NULL, /**< ui_requirement */ |
| 63 | 0, /**< flags */ | |
| 64 | NULL, /**< dependencies */ | |
| 16132 | 65 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 15230 | 66 | |
| 67 | "core-plugin_pack-newline", /**< id */ | |
| 68 | N_("New Line"), /**< name */ | |
| 69 | VERSION, /**< version */ | |
| 16132 | 70 | N_("Prepends a newline to displayed message."), /**< summary */ |
| 15230 | 71 | N_("Prepends a newline to messages so that the " |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15253
diff
changeset
|
72 | "rest of the message appears below the " |
| 16132 | 73 | "screen name in the conversation window."), /**< description */ |
| 15230 | 74 | "Stu Tomlinson <stu@nosnilmot.com>", /**< author */ |
| 15884 | 75 | PURPLE_WEBSITE, /**< homepage */ |
| 15230 | 76 | |
| 77 | plugin_load, /**< load */ | |
| 78 | NULL, /**< unload */ | |
| 79 | NULL, /**< destroy */ | |
| 80 | ||
| 81 | NULL, /**< ui_info */ | |
| 82 | NULL, /**< extra_info */ | |
| 83 | NULL, /**< prefs_info */ | |
|
16745
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16132
diff
changeset
|
84 | NULL, /**< actions */ |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16132
diff
changeset
|
85 | |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16132
diff
changeset
|
86 | /* padding */ |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16132
diff
changeset
|
87 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16132
diff
changeset
|
88 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16132
diff
changeset
|
89 | NULL, |
|
df2c3d6b609a
And the rest of the plugins that are compiling for me by default...
Gary Kramlich <grim@reaperworld.com>
parents:
16132
diff
changeset
|
90 | NULL |
| 15230 | 91 | }; |
| 92 | ||
| 93 | static void | |
| 15884 | 94 | init_plugin(PurplePlugin *plugin) { |
| 15230 | 95 | } |
| 96 | ||
| 15884 | 97 | PURPLE_INIT_PLUGIN(lastseen, init_plugin, info) |