Changeset 6e74911 for protocols/msn/msn.c
- Timestamp:
- 2015-03-15T14:41:47Z (10 years ago)
- Children:
- c5a1502
- Parents:
- ffa5b70
- git-author:
- dequis <dx@…> (09-03-15 10:14:58)
- git-committer:
- dequis <dx@…> (15-03-15 14:41:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
rffa5b70 r6e74911 178 178 static void msn_set_away(struct im_connection *ic, char *state, char *message) 179 179 { 180 //char *uux;181 180 struct msn_data *md = ic->proto_data; 181 char *nick, *psm, *idle, *statecode, *body, *buf; 182 182 183 183 if (state == NULL) { … … 187 187 } 188 188 189 if (!msn_ns_write(ic, -1, "CHG %d %s %d:%02d\r\n", ++md->trId, md->away_state->code, MSN_CAP1, MSN_CAP2)) { 190 return; 191 } 192 193 uux = g_markup_printf_escaped("<EndpointData><Capabilities>%d:%02d" 194 "</Capabilities></EndpointData>", 195 MSN_CAP1, MSN_CAP2); 196 msn_ns_write(ic, -1, "UUX %d %zd\r\n%s", ++md->trId, strlen(uux), uux); 197 g_free(uux); 198 199 uux = g_markup_printf_escaped("<PrivateEndpointData><EpName>%s</EpName>" 200 "<Idle>%s</Idle><ClientType>%d</ClientType>" 201 "<State>%s</State></PrivateEndpointData>", 202 md->uuid, 203 strcmp(md->away_state->code, "IDL") ? "false" : "true", 204 1, /* ? */ 205 md->away_state->code); 206 msn_ns_write(ic, -1, "UUX %d %zd\r\n%s", ++md->trId, strlen(uux), uux); 207 g_free(uux); 208 209 uux = g_markup_printf_escaped("<Data><DDP></DDP><PSM>%s</PSM>" 210 "<CurrentMedia></CurrentMedia>" 211 "<MachineGuid>%s</MachineGuid></Data>", 212 message ? message : "", md->uuid); 213 msn_ns_write(ic, -1, "UUX %d %zd\r\n%s", ++md->trId, strlen(uux), uux); 214 g_free(uux); 189 statecode = (char *) md->away_state->code; 190 nick = set_getstr(&ic->acc->set, "display_name"); 191 psm = message ? message : ""; 192 idle = strcmp(statecode, "IDL") ? "false" : "true"; 193 194 body = g_markup_printf_escaped(MSN_PUT_USER_BODY, 195 nick, psm, psm, md->uuid, statecode, md->uuid, idle, statecode, 196 MSN_CAP1, MSN_CAP2, MSN_CAP1, MSN_CAP2 197 ); 198 199 buf = g_strdup_printf(MSN_PUT_HEADERS, ic->acc->user, ic->acc->user, md->uuid, 200 "/user", "application/user+xml", 201 strlen(body), body); 202 msn_ns_write(ic, -1, "PUT %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 203 204 g_free(buf); 205 g_free(body); 215 206 } 216 207
Note: See TracChangeset
for help on using the changeset viewer.