Changeset bc090f0
- Timestamp:
- 2010-03-20T22:42:59Z (15 years ago)
- Branches:
- master
- Children:
- ee6cc94
- Parents:
- ffb6dea
- Location:
- protocols/msn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/sb.c
rffb6dea rbc090f0 607 607 const struct msn_status_code *err = msn_status_by_number( num ); 608 608 609 /* If the person is offline, send an offline message instead, 610 and don't report an error. */ 609 611 if( num == 217 ) 610 { 611 GSList *l; 612 613 for( l = sb->msgq; l; l = l->next ) 614 { 615 struct msn_message *m = l->data; 616 msn_soap_oim_send( ic, m->who, m->text ); 617 } 618 } 619 620 imcb_error( ic, "Error reported by switchboard server: %s", err->text ); 612 msn_soap_oim_send_queue( ic, &sb->msgq ); 613 else 614 imcb_error( ic, "Error reported by switchboard server: %s", err->text ); 621 615 622 616 if( err->flags & STATUS_SB_FATAL ) -
protocols/msn/soap.c
rffb6dea rbc090f0 57 57 }; 58 58 59 struct msn_soap_oim_send_data60 {61 char *to;62 char *msg;63 int number;64 int need_retry;65 };66 67 59 static int msn_soap_send_request( struct msn_soap_req_data *req ); 68 60 … … 139 131 } 140 132 133 134 /* oim_send: Sending offline messages */ 135 136 struct msn_soap_oim_send_data 137 { 138 char *to; 139 char *msg; 140 int number; 141 int need_retry; 142 }; 143 141 144 static int msn_soap_oim_build_request( struct msn_soap_req_data *soap_req ) 142 145 { … … 183 186 struct msn_soap_oim_send_data *oim = soap_req->data; 184 187 185 if( soap_req->http_req->status_code == 500 && oim->need_retry )188 if( soap_req->http_req->status_code == 500 && oim->need_retry && soap_req->ttl > 0 ) 186 189 { 187 190 oim->need_retry = 0; … … 189 192 } 190 193 else if( soap_req->http_req->status_code == 200 ) 194 { 195 imcb_log( soap_req->ic, "Offline message successfully delivered to %s", oim->to ); 191 196 return MSN_SOAP_OK; 197 } 192 198 else 199 { 200 imcb_log( soap_req->ic, "Failed to deliver offline message to %s:\n%s", oim->to, oim->msg ); 193 201 return MSN_SOAP_ABORT; 202 } 194 203 } 195 204 … … 219 228 msn_soap_oim_free_data ); 220 229 } 230 231 int msn_soap_oim_send_queue( struct im_connection *ic, GSList **msgq ) 232 { 233 GSList *l; 234 char *n = NULL; 235 236 for( l = *msgq; l; l = l->next ) 237 { 238 struct msn_message *m = l->data; 239 240 if( n == NULL ) 241 n = m->who; 242 if( strcmp( n, m->who ) == 0 ) 243 msn_soap_oim_send( ic, m->who, m->text ); 244 } 245 246 while( *msgq != NULL ) 247 { 248 struct msn_message *m = (*msgq)->data; 249 250 g_free( m->who ); 251 g_free( m->text ); 252 g_free( m ); 253 254 *msgq = g_slist_remove( *msgq, m ); 255 } 256 } -
protocols/msn/soap.h
rffb6dea rbc090f0 83 83 84 84 int msn_soap_oim_send( struct im_connection *ic, const char *to, const char *msg ); 85 int msn_soap_oim_send_queue( struct im_connection *ic, GSList **msgq ); 85 86 86 87 #endif /* __SOAP_H__ */
Note: See TracChangeset
for help on using the changeset viewer.