Mercurial > pidgin.yaz
comparison plugins/raw.c @ 12020:440d9354b67f
[gaim-migrate @ 14313]
Apparently this works for some people? I'd thought G_MODULE_BIND_LOCAL
would not allow stuff like this.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 09 Nov 2005 03:09:55 +0000 |
parents | 4c05f4dd3ab9 |
children |
comparison
equal
deleted
inserted
replaced
12019:4c05f4dd3ab9 | 12020:440d9354b67f |
---|---|
1 /* | 1 /* |
2 * Gaim - Replace certain misspelled words with their correct form. | 2 * Gaim - Send raw data across the connections of some protocols. |
3 * | |
4 * Signification changes were made by Benjamin Kahn ("xkahn") and | |
5 * Richard Laager ("rlaager") in April 2005--you may want to contact | |
6 * them if you have questions. | |
7 * | 3 * |
8 * Gaim is the legal property of its developers, whose names are too numerous | 4 * Gaim is the legal property of its developers, whose names are too numerous |
9 * to list here. Please refer to the COPYRIGHT file distributed with this | 5 * to list here. Please refer to the COPYRIGHT file distributed with this |
10 * source distribution. | 6 * source distribution. |
11 * | 7 * |
33 #include "prpl.h" | 29 #include "prpl.h" |
34 #include "version.h" | 30 #include "version.h" |
35 | 31 |
36 #include "gtkplugin.h" | 32 #include "gtkplugin.h" |
37 #include "gtkutils.h" | 33 #include "gtkutils.h" |
34 | |
35 #include "protocols/jabber/jabber.h" | |
36 #include "protocols/msn/session.h" | |
38 | 37 |
39 #ifdef MAX | 38 #ifdef MAX |
40 # undef MAX | 39 # undef MAX |
41 # undef MIN | 40 # undef MIN |
42 #endif | 41 #endif |
81 write(*a, &seqno, 2); | 80 write(*a, &seqno, 2); |
82 write(*a, &len, 2); | 81 write(*a, &len, 2); |
83 write(*a, txt, ntohs(len)); | 82 write(*a, txt, ntohs(len)); |
84 gaim_debug(GAIM_DEBUG_MISC, "raw", "TOC C: %s\n", txt); | 83 gaim_debug(GAIM_DEBUG_MISC, "raw", "TOC C: %s\n", txt); |
85 | 84 |
85 } else if (strcmp(prpl_id, "prpl-msn") == 0) { | |
86 MsnSession *session = gc->proto_data; | |
87 char buf[strlen(txt) + 3]; | |
88 | |
89 g_snprintf(buf, sizeof(buf), "%s\r\n", txt); | |
90 msn_servconn_write(session->notification->servconn, buf, strlen(buf)); | |
91 | |
86 } else if (strcmp(prpl_id, "prpl-irc") == 0) { | 92 } else if (strcmp(prpl_id, "prpl-irc") == 0) { |
87 write(*(int *)gc->proto_data, txt, strlen(txt)); | 93 write(*(int *)gc->proto_data, txt, strlen(txt)); |
88 write(*(int *)gc->proto_data, "\r\n", 2); | 94 write(*(int *)gc->proto_data, "\r\n", 2); |
89 gaim_debug(GAIM_DEBUG_MISC, "raw", "IRC C: %s\n", txt); | 95 gaim_debug(GAIM_DEBUG_MISC, "raw", "IRC C: %s\n", txt); |
96 | |
97 } else if (strcmp(prpl_id, "prpl-jabber") == 0) { | |
98 jabber_send_raw((JabberStream *)gc->proto_data, txt, -1); | |
90 | 99 |
91 } else { | 100 } else { |
92 gaim_debug_error("raw", "Unknown protocol ID %s\n", prpl_id); | 101 gaim_debug_error("raw", "Unknown protocol ID %s\n", prpl_id); |
93 } | 102 } |
94 | 103 |
164 GAIM_PRIORITY_DEFAULT, | 173 GAIM_PRIORITY_DEFAULT, |
165 RAW_PLUGIN_ID, | 174 RAW_PLUGIN_ID, |
166 N_("Raw"), | 175 N_("Raw"), |
167 VERSION, | 176 VERSION, |
168 N_("Lets you send raw input to text-based protocols."), | 177 N_("Lets you send raw input to text-based protocols."), |
169 N_("Lets you send raw input to text-based protocols (IRC, " | 178 N_("Lets you send raw input to text-based protocols (Jabber, MSN, IRC, " |
170 "TOC). Hit 'Enter' in the entry box to send. Watch the debug window."), | 179 "TOC). Hit 'Enter' in the entry box to send. Watch the debug window."), |
171 "Eric Warmenhoven <eric@warmenhoven.org>", | 180 "Eric Warmenhoven <eric@warmenhoven.org>", |
172 GAIM_WEBSITE, | 181 GAIM_WEBSITE, |
173 plugin_load, | 182 plugin_load, |
174 plugin_unload, | 183 plugin_unload, |