Mercurial > pidgin
comparison src/protocols/msn/command.c @ 19784:bc30c6270d9f
[gaim-migrate @ 16473]
add the Framework of SOAP request
Now can retrieve the Contact via SOAP Request.
so many bug still exist!
commited by MaYuan<mayuan2006@gmail.com>
committer: Ethan Blanton <elb@pidgin.im>
| author | Ma Yuan <mayuan2006@gmail.com> |
|---|---|
| date | Sun, 09 Jul 2006 16:48:25 +0000 |
| parents | 995aea35b05c |
| children | 852b32710df0 |
comparison
equal
deleted
inserted
replaced
| 19783:995aea35b05c | 19784:bc30c6270d9f |
|---|---|
| 40 * check the command is the command with payload content | 40 * check the command is the command with payload content |
| 41 * if it is return TRUE | 41 * if it is return TRUE |
| 42 * else return FALSE | 42 * else return FALSE |
| 43 */ | 43 */ |
| 44 static gboolean | 44 static gboolean |
| 45 isPayloadCmd(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,"MSG")) || | 49 (!strcmp(str,"MSG")) || |
| 50 (!strcmp(str,"QRY")) || | 50 (!strcmp(str,"QRY")) || |
| 58 | 58 |
| 59 return FALSE; | 59 return FALSE; |
| 60 } | 60 } |
| 61 | 61 |
| 62 /*get the payload positon*/ | 62 /*get the payload positon*/ |
| 63 int getPayloadPosition(char *str) | 63 int msn_get_payload_position(char *str) |
| 64 { | 64 { |
| 65 /*because MSG has "MSG hotmail hotmail [payload length]"*/ | 65 /*because MSG has "MSG hotmail hotmail [payload length]"*/ |
| 66 if(!(strcmp(str,"MSG"))){ | 66 if(!(strcmp(str,"MSG"))){ |
| 67 return 2; | 67 return 2; |
| 68 } | 68 } |
| 70 } | 70 } |
| 71 /* | 71 /* |
| 72 * set command Payload length | 72 * set command Payload length |
| 73 */ | 73 */ |
| 74 int | 74 int |
| 75 setPayloadLen(MsnCommand *cmd) | 75 msn_set_payload_len(MsnCommand *cmd) |
| 76 { | 76 { |
| 77 char * param; | 77 char * param; |
| 78 | 78 |
| 79 if(isPayloadCmd(cmd->command)){ | 79 if(msn_check_payload_cmd(cmd->command)){ |
| 80 if(!(strcmp(cmd->command,"MSG"))){ | 80 if(!(strcmp(cmd->command,"MSG"))){ |
| 81 param = cmd->params[2]; | 81 param = cmd->params[2]; |
| 82 }else{ | 82 }else{ |
| 83 param = cmd->params[1]; | 83 param = cmd->params[1]; |
| 84 } | 84 } |
| 119 }else{ | 119 }else{ |
| 120 cmd->trId = 0; | 120 cmd->trId = 0; |
| 121 } | 121 } |
| 122 | 122 |
| 123 /*add payload Length checking*/ | 123 /*add payload Length checking*/ |
| 124 setPayloadLen(cmd); | 124 msn_set_payload_len(cmd); |
| 125 gaim_debug_info("MaYuan","get payload len:%d\n",cmd->payload_len); | 125 gaim_debug_info("MaYuan","get payload len:%d\n",cmd->payload_len); |
| 126 | 126 |
| 127 msn_command_ref(cmd); | 127 msn_command_ref(cmd); |
| 128 | 128 |
| 129 return cmd; | 129 return cmd; |
