| 70 |
70 |
| 71 protocol_id = purple_account_get_protocol_id(account); |
71 protocol_id = purple_account_get_protocol_id(account); |
| 72 |
72 |
| 73 purple_debug_misc("raw", "protocol_id = %s\n", protocol_id); |
73 purple_debug_misc("raw", "protocol_id = %s\n", protocol_id); |
| 74 |
74 |
| 75 if (strcmp(protocol_id, "prpl-toc") == 0) { |
75 if (strcmp(protocol_id, "toc") == 0) { |
| 76 int *a = (int *)gc->proto_data; |
76 int *a = (int *)gc->proto_data; |
| 77 unsigned short seqno = htons(a[1]++ & 0xffff); |
77 unsigned short seqno = htons(a[1]++ & 0xffff); |
| 78 unsigned short len = htons(strlen(txt) + 1); |
78 unsigned short len = htons(strlen(txt) + 1); |
| 79 write(*a, "*\002", 2); |
79 write(*a, "*\002", 2); |
| 80 write(*a, &seqno, 2); |
80 write(*a, &seqno, 2); |
| 81 write(*a, &len, 2); |
81 write(*a, &len, 2); |
| 82 write(*a, txt, ntohs(len)); |
82 write(*a, txt, ntohs(len)); |
| 83 purple_debug(PURPLE_DEBUG_MISC, "raw", "TOC C: %s\n", txt); |
83 purple_debug(PURPLE_DEBUG_MISC, "raw", "TOC C: %s\n", txt); |
| 84 |
84 |
| 85 } else if (strcmp(protocol_id, "prpl-msn") == 0) { |
85 } else if (strcmp(protocol_id, "msn") == 0) { |
| 86 MsnSession *session = gc->proto_data; |
86 MsnSession *session = gc->proto_data; |
| 87 char buf[strlen(txt) + 3]; |
87 char buf[strlen(txt) + 3]; |
| 88 |
88 |
| 89 g_snprintf(buf, sizeof(buf), "%s\r\n", txt); |
89 g_snprintf(buf, sizeof(buf), "%s\r\n", txt); |
| 90 msn_servconn_write(session->notification->servconn, buf, strlen(buf)); |
90 msn_servconn_write(session->notification->servconn, buf, strlen(buf)); |
| 91 |
91 |
| 92 } else if (strcmp(protocol_id, "prpl-irc") == 0) { |
92 } else if (strcmp(protocol_id, "irc") == 0) { |
| 93 write(*(int *)gc->proto_data, txt, strlen(txt)); |
93 write(*(int *)gc->proto_data, txt, strlen(txt)); |
| 94 write(*(int *)gc->proto_data, "\r\n", 2); |
94 write(*(int *)gc->proto_data, "\r\n", 2); |
| 95 purple_debug(PURPLE_DEBUG_MISC, "raw", "IRC C: %s\n", txt); |
95 purple_debug(PURPLE_DEBUG_MISC, "raw", "IRC C: %s\n", txt); |
| 96 |
96 |
| 97 } else if (strcmp(protocol_id, "prpl-jabber") == 0) { |
97 } else if (strcmp(protocol_id, "jabber") == 0) { |
| 98 jabber_send_raw((JabberStream *)gc->proto_data, txt, -1); |
98 jabber_send_raw((JabberStream *)gc->proto_data, txt, -1); |
| 99 |
99 |
| 100 } else { |
100 } else { |
| 101 purple_debug_error("raw", "Unknown protocol ID %s\n", protocol_id); |
101 purple_debug_error("raw", "Unknown protocol ID %s\n", protocol_id); |
| 102 } |
102 } |