comparison src/protocols/msn/command.c @ 19786:23258253c7a0

[gaim-migrate @ 16546] can login sucessfully Other's can see the online status Can chat with gaim. Some bug exist! will crash Some Problem existed on group management committed by MaYuan<mayuan2006@gmail.com> committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Sun, 23 Jul 2006 09:19:12 +0000
parents 852b32710df0
children da3f8f7ec3ce
comparison
equal deleted inserted replaced
19785:852b32710df0 19786:23258253c7a0
44 static gboolean 44 static gboolean
45 msn_check_payload_cmd(char *str) 45 msn_check_payload_cmd(char *str)
46 { 46 {
47 if( (!strcmp(str,"ADL")) || 47 if( (!strcmp(str,"ADL")) ||
48 (!strcmp(str,"GCF")) || 48 (!strcmp(str,"GCF")) ||
49 (!strcmp(str,"SG")) ||
49 (!strcmp(str,"MSG")) || 50 (!strcmp(str,"MSG")) ||
50 (!strcmp(str,"RML")) || 51 (!strcmp(str,"RML")) ||
51 (!strcmp(str,"UBX")) || 52 (!strcmp(str,"UBX")) ||
52 (!strcmp(str,"UBN")) || 53 (!strcmp(str,"UBN")) ||
53 (!strcmp(str,"UUN")) || 54 (!strcmp(str,"UUN")) ||
60 61
61 /*get the payload positon*/ 62 /*get the payload positon*/
62 int msn_get_payload_position(char *str) 63 int msn_get_payload_position(char *str)
63 { 64 {
64 /*because MSG has "MSG hotmail hotmail [payload length]"*/ 65 /*because MSG has "MSG hotmail hotmail [payload length]"*/
65 if(!(strcmp(str,"MSG"))){ 66 if(!(strcmp(str,"MSG"))|| (!strcmp(str,"UBX")) ){
66 return 2; 67 return 2;
67 } 68 }
69
68 return 1; 70 return 1;
69 } 71 }
72
70 /* 73 /*
71 * set command Payload length 74 * set command Payload length
72 */ 75 */
73 int 76 int
74 msn_set_payload_len(MsnCommand *cmd) 77 msn_set_payload_len(MsnCommand *cmd)
75 { 78 {
76 char * param; 79 char * param;
77 80
78 if(msn_check_payload_cmd(cmd->command)){ 81 if(msn_check_payload_cmd(cmd->command)){
82 param = cmd->params[msn_get_payload_position(cmd->command)];
83 #if 0
79 if(!(strcmp(cmd->command,"MSG"))){ 84 if(!(strcmp(cmd->command,"MSG"))){
80 param = cmd->params[2]; 85 param = cmd->params[2];
81 }else{ 86 }else{
82 param = cmd->params[1]; 87 param = cmd->params[1];
83 } 88 }
89 #endif
84 cmd->payload_len = is_num(param) ? atoi(param) : 0; 90 cmd->payload_len = is_num(param) ? atoi(param) : 0;
85 }else{ 91 }else{
86 cmd->payload_len = 0; 92 cmd->payload_len = 0;
87 } 93 }
88 return 0; 94 return 0;