libpurple/protocols/msn/session.c

branch
cpw.resiak.disconnectreason
changeset 21279
40685e1f50ca
parent 21152
2357a7a795eb
child 21503
b3cad646ba4a
equal deleted inserted replaced
21278:19f6ce8ee4ad 21279:40685e1f50ca
323 void 323 void
324 msn_session_set_error(MsnSession *session, MsnErrorType error, 324 msn_session_set_error(MsnSession *session, MsnErrorType error,
325 const char *info) 325 const char *info)
326 { 326 {
327 PurpleConnection *gc; 327 PurpleConnection *gc;
328 PurpleDisconnectReason reason; 328 PurpleConnectionError reason;
329 char *msg; 329 char *msg;
330 330
331 gc = purple_account_get_connection(session->account); 331 gc = purple_account_get_connection(session->account);
332 332
333 switch (error) 333 switch (error)
334 { 334 {
335 case MSN_ERROR_SERVCONN: 335 case MSN_ERROR_SERVCONN:
336 reason = PURPLE_REASON_NETWORK_ERROR; 336 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
337 msg = g_strdup(info); 337 msg = g_strdup(info);
338 break; 338 break;
339 case MSN_ERROR_UNSUPPORTED_PROTOCOL: 339 case MSN_ERROR_UNSUPPORTED_PROTOCOL:
340 reason = PURPLE_REASON_NETWORK_ERROR; 340 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
341 msg = g_strdup(_("Our protocol is not supported by the " 341 msg = g_strdup(_("Our protocol is not supported by the "
342 "server.")); 342 "server."));
343 break; 343 break;
344 case MSN_ERROR_HTTP_MALFORMED: 344 case MSN_ERROR_HTTP_MALFORMED:
345 reason = PURPLE_REASON_NETWORK_ERROR; 345 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
346 msg = g_strdup(_("Error parsing HTTP.")); 346 msg = g_strdup(_("Error parsing HTTP."));
347 break; 347 break;
348 case MSN_ERROR_SIGN_OTHER: 348 case MSN_ERROR_SIGN_OTHER:
349 reason = PURPLE_REASON_NAME_IN_USE; 349 reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE;
350 msg = g_strdup(_("You have signed on from another location.")); 350 msg = g_strdup(_("You have signed on from another location."));
351 if (!purple_account_get_remember_password(session->account)) 351 if (!purple_account_get_remember_password(session->account))
352 purple_account_set_password(session->account, NULL); 352 purple_account_set_password(session->account, NULL);
353 break; 353 break;
354 case MSN_ERROR_SERV_UNAVAILABLE: 354 case MSN_ERROR_SERV_UNAVAILABLE:
355 reason = PURPLE_REASON_NETWORK_ERROR; 355 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
356 msg = g_strdup(_("The MSN servers are temporarily " 356 msg = g_strdup(_("The MSN servers are temporarily "
357 "unavailable. Please wait and try " 357 "unavailable. Please wait and try "
358 "again.")); 358 "again."));
359 break; 359 break;
360 case MSN_ERROR_SERV_DOWN: 360 case MSN_ERROR_SERV_DOWN:
361 reason = PURPLE_REASON_NETWORK_ERROR; 361 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
362 msg = g_strdup(_("The MSN servers are going down " 362 msg = g_strdup(_("The MSN servers are going down "
363 "temporarily.")); 363 "temporarily."));
364 break; 364 break;
365 case MSN_ERROR_AUTH: 365 case MSN_ERROR_AUTH:
366 reason = PURPLE_REASON_AUTHENTICATION_FAILED; 366 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
367 msg = g_strdup_printf(_("Unable to authenticate: %s"), 367 msg = g_strdup_printf(_("Unable to authenticate: %s"),
368 (info == NULL ) ? 368 (info == NULL ) ?
369 _("Unknown error") : info); 369 _("Unknown error") : info);
370 break; 370 break;
371 case MSN_ERROR_BAD_BLIST: 371 case MSN_ERROR_BAD_BLIST:
372 reason = PURPLE_REASON_NETWORK_ERROR; 372 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
373 msg = g_strdup(_("Your MSN buddy list is temporarily " 373 msg = g_strdup(_("Your MSN buddy list is temporarily "
374 "unavailable. Please wait and try " 374 "unavailable. Please wait and try "
375 "again.")); 375 "again."));
376 break; 376 break;
377 default: 377 default:
378 reason = PURPLE_REASON_NETWORK_ERROR; 378 reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
379 msg = g_strdup(_("Unknown error.")); 379 msg = g_strdup(_("Unknown error."));
380 break; 380 break;
381 } 381 }
382 382
383 msn_session_disconnect(session); 383 msn_session_disconnect(session);

mercurial