comparison libpurple/protocols/msn/cmdproc.c @ 19797:60bc06498746

Committing khc's msnp14 changes from Trac Ticket #148. --rlaager committer: Richard Laager <rlaager@wiktel.com>
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 15 Apr 2007 04:12:27 +0000
parents 32c366eeeb99
children 6f986caeab59
comparison
equal deleted inserted replaced
16121:6167ee79ecd0 19797:60bc06498746
87 len = strlen(command); 87 len = strlen(command);
88 show = g_strdup(command); 88 show = g_strdup(command);
89 89
90 tmp = (incoming) ? 'S' : 'C'; 90 tmp = (incoming) ? 'S' : 'C';
91 91
92 if ((show[len - 1] == '\n') && (show[len - 2] == '\r')) 92 if ((show[len - 1] == '\n') && (show[len - 2] == '\r')){
93 {
94 show[len - 2] = '\0'; 93 show[len - 2] = '\0';
95 } 94 }
96 95
97 purple_debug_misc("msn", "%c: %s %03d: %s\n", tmp, 96 purple_debug_misc("msn", "%c: %s %03d: %s\n", tmp,
98 names[servconn->type], servconn->num, show); 97 names[servconn->type], servconn->num, show);
125 124
126 if (trans->callbacks == NULL) 125 if (trans->callbacks == NULL)
127 trans->callbacks = g_hash_table_lookup(cmdproc->cbs_table->cmds, 126 trans->callbacks = g_hash_table_lookup(cmdproc->cbs_table->cmds,
128 trans->command); 127 trans->command);
129 128
130 if (trans->payload != NULL) 129 if (trans->payload != NULL){
131 {
132 data = g_realloc(data, len + trans->payload_len); 130 data = g_realloc(data, len + trans->payload_len);
133 memcpy(data + len, trans->payload, trans->payload_len); 131 memcpy(data + len, trans->payload, trans->payload_len);
134 len += trans->payload_len; 132 len += trans->payload_len;
135 } 133 }
136 134
137 msn_servconn_write(servconn, data, len); 135 msn_servconn_write(servconn, data, len);
136 // purple_debug_info("<<","%s\n",data);
138 137
139 g_free(data); 138 g_free(data);
140 } 139 }
141 140
142 void 141 void
226 void 225 void
227 msn_cmdproc_process_msg(MsnCmdProc *cmdproc, MsnMessage *msg) 226 msn_cmdproc_process_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
228 { 227 {
229 MsnMsgTypeCb cb; 228 MsnMsgTypeCb cb;
230 229
231 if (msn_message_get_content_type(msg) == NULL) 230 if (msn_message_get_content_type(msg) == NULL){
232 {
233 purple_debug_misc("msn", "failed to find message content\n"); 231 purple_debug_misc("msn", "failed to find message content\n");
234 return; 232 return;
235 } 233 }
236 234
237 cb = g_hash_table_lookup(cmdproc->cbs_table->msgs, 235 cb = g_hash_table_lookup(cmdproc->cbs_table->msgs,
238 msn_message_get_content_type(msg)); 236 msn_message_get_content_type(msg));
239 237
240 if (cb == NULL) 238 if (cb == NULL){
241 {
242 purple_debug_warning("msn", "Unhandled content-type '%s'\n", 239 purple_debug_warning("msn", "Unhandled content-type '%s'\n",
243 msn_message_get_content_type(msg)); 240 msn_message_get_content_type(msg));
244 241
245 return; 242 return;
246 } 243 }