pidgin/plugins/raw.c

changeset 38240
0552f69f1996
parent 37109
94d1a2589d5a
parent 38072
bbe95e29bdaf
child 38312
b339bb8d0c18
equal deleted inserted replaced
38204:7ccb54f5d342 38240:0552f69f1996
32 #include "gtk3compat.h" 32 #include "gtk3compat.h"
33 #include "gtkplugin.h" 33 #include "gtkplugin.h"
34 #include "gtkutils.h" 34 #include "gtkutils.h"
35 35
36 #include "protocols/jabber/jabber.h" 36 #include "protocols/jabber/jabber.h"
37 #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 purple_debug(PURPLE_DEBUG_MISC, "raw", "TOC C: %s\n", txt); 83 purple_debug(PURPLE_DEBUG_MISC, "raw", "TOC C: %s\n", txt);
85 84
86 } else if (strcmp(protocol_id, "prpl-msn") == 0) { 85 } else if (strcmp(prpl_id, "prpl-irc") == 0) {
87 MsnSession *session = purple_connection_get_protocol_data(gc); 86 write(*(int *)gc->proto_data, txt, strlen(txt));
88 char buf[strlen(txt) + 3]; 87 write(*(int *)gc->proto_data, "\r\n", 2);
89
90 g_snprintf(buf, sizeof(buf), "%s\r\n", txt);
91 msn_servconn_write(session->notification->servconn, buf, strlen(buf));
92
93 } else if (strcmp(protocol_id, "prpl-irc") == 0) {
94 write(*(int *)purple_connection_get_protocol_data(gc), txt, strlen(txt));
95 write(*(int *)purple_connection_get_protocol_data(gc), "\r\n", 2);
96 purple_debug(PURPLE_DEBUG_MISC, "raw", "IRC C: %s\n", txt); 88 purple_debug(PURPLE_DEBUG_MISC, "raw", "IRC C: %s\n", txt);
97 89
98 } else if (strcmp(protocol_id, "prpl-jabber") == 0) { 90 } else if (strcmp(protocol_id, "prpl-jabber") == 0) {
99 jabber_send_raw((JabberStream *)purple_connection_get_protocol_data(gc), txt, -1); 91 jabber_send_raw((JabberStream *)purple_connection_get_protocol_data(gc), txt, -1);
100 92

mercurial