pidgin/plugins/raw.c

branch
release-2.x.y
changeset 38072
bbe95e29bdaf
parent 20288
5ca925a094e2
child 38240
0552f69f1996
child 38259
c593fc9f5438
equal deleted inserted replaced
38071:d344b038ac96 38072:bbe95e29bdaf
31 31
32 #include "gtkplugin.h" 32 #include "gtkplugin.h"
33 #include "gtkutils.h" 33 #include "gtkutils.h"
34 34
35 #include "protocols/jabber/jabber.h" 35 #include "protocols/jabber/jabber.h"
36 #include "protocols/msn/session.h"
37 36
38 #ifdef MAX 37 #ifdef MAX
39 # undef MAX 38 # undef MAX
40 # undef MIN 39 # undef MIN
41 #endif 40 #endif
79 write(*a, "*\002", 2); 78 write(*a, "*\002", 2);
80 write(*a, &seqno, 2); 79 write(*a, &seqno, 2);
81 write(*a, &len, 2); 80 write(*a, &len, 2);
82 write(*a, txt, ntohs(len)); 81 write(*a, txt, ntohs(len));
83 purple_debug(PURPLE_DEBUG_MISC, "raw", "TOC C: %s\n", txt); 82 purple_debug(PURPLE_DEBUG_MISC, "raw", "TOC C: %s\n", txt);
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 83
92 } else if (strcmp(prpl_id, "prpl-irc") == 0) { 84 } else if (strcmp(prpl_id, "prpl-irc") == 0) {
93 write(*(int *)gc->proto_data, txt, strlen(txt)); 85 write(*(int *)gc->proto_data, txt, strlen(txt));
94 write(*(int *)gc->proto_data, "\r\n", 2); 86 write(*(int *)gc->proto_data, "\r\n", 2);
95 purple_debug(PURPLE_DEBUG_MISC, "raw", "IRC C: %s\n", txt); 87 purple_debug(PURPLE_DEBUG_MISC, "raw", "IRC C: %s\n", txt);
173 PURPLE_PRIORITY_DEFAULT, 165 PURPLE_PRIORITY_DEFAULT,
174 RAW_PLUGIN_ID, 166 RAW_PLUGIN_ID,
175 N_("Raw"), 167 N_("Raw"),
176 DISPLAY_VERSION, 168 DISPLAY_VERSION,
177 N_("Lets you send raw input to text-based protocols."), 169 N_("Lets you send raw input to text-based protocols."),
178 N_("Lets you send raw input to text-based protocols (XMPP, MSN, IRC, " 170 N_("Lets you send raw input to text-based protocols (XMPP, IRC, "
179 "TOC). Hit 'Enter' in the entry box to send. Watch the debug window."), 171 "TOC). Hit 'Enter' in the entry box to send. Watch the debug window."),
180 "Eric Warmenhoven <eric@warmenhoven.org>", 172 "Eric Warmenhoven <eric@warmenhoven.org>",
181 PURPLE_WEBSITE, 173 PURPLE_WEBSITE,
182 plugin_load, 174 plugin_load,
183 plugin_unload, 175 plugin_unload,

mercurial