Mercurial > pidgin
comparison src/protocols/msn/state.c @ 19818:2e078c892e0b
[gaim-migrate @ 17003]
add the PSM processing
need to store the PSM info to XML.
Thanks for Chris <ukdrizzle@yahoo.co.uk> 's code!
committed by MaYuan<mayuan2006@gmail.com>
committer: Ethan Blanton <elb@pidgin.im>
author | Ma Yuan <mayuan2006@gmail.com> |
---|---|
date | Wed, 23 Aug 2006 15:07:17 +0000 |
parents | 3a15b4e5c336 |
children | bf8fb36097ee |
comparison
equal
deleted
inserted
replaced
19817:cf0611260c6b | 19818:2e078c892e0b |
---|---|
76 } | 76 } |
77 xmlnode_insert_child(dataNode,guidNode); | 77 xmlnode_insert_child(dataNode,guidNode); |
78 | 78 |
79 result = xmlnode_to_str(dataNode,&length); | 79 result = xmlnode_to_str(dataNode,&length); |
80 return result; | 80 return result; |
81 } | |
82 | |
83 /*get the PSM info from the XML string*/ | |
84 const char * | |
85 msn_get_psm(char *xml_str,gsize len) | |
86 { | |
87 xmlnode *payloadNode, *psmNode; | |
88 char *psm_str,*psm; | |
89 | |
90 payloadNode = xmlnode_from_str(xml_str, len); | |
91 if (!payloadNode){ | |
92 gaim_debug_error("MaYuan","PSM XML parse Error!\n"); | |
93 return NULL; | |
94 } | |
95 psmNode = xmlnode_get_child(payloadNode, "PSM"); | |
96 if (!psmNode){ | |
97 gaim_debug_info("Ma Yuan","No PSM status Node"); | |
98 g_free(payloadNode); | |
99 return NULL; | |
100 } | |
101 psm_str = xmlnode_get_data(psmNode); | |
102 gaim_debug_info("Ma Yuan","got PSM {%s}\n", psm_str); | |
103 psm = g_strdup(psm_str); | |
104 | |
105 g_free(psmNode); | |
106 g_free(payloadNode); | |
107 | |
108 return psm; | |
81 } | 109 } |
82 | 110 |
83 void | 111 void |
84 msn_set_psm(MsnSession *session) | 112 msn_set_psm(MsnSession *session) |
85 { | 113 { |