Mercurial > pidgin
annotate libgaim/plugins/newline.c @ 15314:4a4e1dfd8716
[gaim-migrate @ 18105]
Can't use new protocol version because of different login scheme. Revert to old version.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Huetsch <markhuetsch> |
|---|---|
| date | Thu, 11 Jan 2007 07:26:28 +0000 |
| parents | 1a54e98534ec |
| children | 2db21e0292b8 |
| rev | line source |
|---|---|
| 15168 | 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 | |
| 31 addnewline_msg_cb(GaimAccount *account, char *sender, char **message, | |
| 32 GaimConversation *conv, int *flags, void *data) | |
| 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 | |
| 44 plugin_load(GaimPlugin *plugin) | |
| 45 { | |
| 46 void *conversation = gaim_conversations_get_handle(); | |
| 47 | |
|
15191
1a54e98534ec
[gaim-migrate @ 17980]
Gary Kramlich <grim@reaperworld.com>
parents:
15168
diff
changeset
|
48 gaim_signal_connect(conversation, "writing-im-msg", |
| 15168 | 49 plugin, GAIM_CALLBACK(addnewline_msg_cb), NULL); |
|
15191
1a54e98534ec
[gaim-migrate @ 17980]
Gary Kramlich <grim@reaperworld.com>
parents:
15168
diff
changeset
|
50 gaim_signal_connect(conversation, "writing-chat-msg", |
| 15168 | 51 plugin, GAIM_CALLBACK(addnewline_msg_cb), NULL); |
| 52 | |
| 53 return TRUE; | |
| 54 } | |
| 55 | |
| 56 static GaimPluginInfo info = | |
| 57 { | |
| 58 GAIM_PLUGIN_MAGIC, /**< magic */ | |
| 59 GAIM_MAJOR_VERSION, /**< major version */ | |
| 60 GAIM_MINOR_VERSION, /**< minor version */ | |
| 61 GAIM_PLUGIN_STANDARD, /**< type */ | |
| 62 NULL, /**< ui_requirement */ | |
| 63 0, /**< flags */ | |
| 64 NULL, /**< dependencies */ | |
| 65 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
| 66 | |
| 67 "core-plugin_pack-newline", /**< id */ | |
| 68 N_("New Line"), /**< name */ | |
| 69 VERSION, /**< version */ | |
| 70 N_("Prepends a newline to displayed message."), /** summary */ | |
| 71 N_("Prepends a newline to messages so that the " | |
| 72 "test of the message appears below the " | |
| 73 "screen name in the conversation window."), /** description */ | |
| 74 "Stu Tomlinson <stu@nosnilmot.com>", /**< author */ | |
| 75 GAIM_WEBSITE, /**< homepage */ | |
| 76 | |
| 77 plugin_load, /**< load */ | |
| 78 NULL, /**< unload */ | |
| 79 NULL, /**< destroy */ | |
| 80 | |
| 81 NULL, /**< ui_info */ | |
| 82 NULL, /**< extra_info */ | |
| 83 NULL, /**< prefs_info */ | |
| 84 NULL /**< actions */ | |
| 85 }; | |
| 86 | |
| 87 static void | |
| 88 init_plugin(GaimPlugin *plugin) { | |
| 89 } | |
| 90 | |
| 91 GAIM_INIT_PLUGIN(lastseen, init_plugin, info) |
