| 925 yahoo_update_status(gc, from, f); |
925 yahoo_update_status(gc, from, f); |
| 926 } |
926 } |
| 927 } else if (!g_ascii_strncasecmp(msg, "WEBCAMINVITE", strlen("WEBCAMINVITE"))) { |
927 } else if (!g_ascii_strncasecmp(msg, "WEBCAMINVITE", strlen("WEBCAMINVITE"))) { |
| 928 PurpleIMConversation *im = purple_conversations_find_im_with_account(from, account); |
928 PurpleIMConversation *im = purple_conversations_find_im_with_account(from, account); |
| 929 char *buf = g_strdup_printf(_("%s has sent you a webcam invite, which is not yet supported."), from); |
929 char *buf = g_strdup_printf(_("%s has sent you a webcam invite, which is not yet supported."), from); |
| 930 purple_conversation_write(PURPLE_CONVERSATION(im), NULL, buf, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NOTIFY, time(NULL)); |
930 purple_conversation_write_system_message(PURPLE_CONVERSATION(im), |
| |
931 buf, PURPLE_MESSAGE_NOTIFY); |
| 931 g_free(buf); |
932 g_free(buf); |
| 932 } |
933 } |
| 933 } |
934 } |
| 934 |
935 |
| 935 |
936 |
| 997 if (server_msg) { |
998 if (server_msg) { |
| 998 PurpleIMConversation *im; |
999 PurpleIMConversation *im; |
| 999 im = purple_conversations_find_im_with_account(sms->from, account); |
1000 im = purple_conversations_find_im_with_account(sms->from, account); |
| 1000 if (im == NULL) |
1001 if (im == NULL) |
| 1001 im = purple_im_conversation_new(account, sms->from); |
1002 im = purple_im_conversation_new(account, sms->from); |
| 1002 purple_conversation_write(PURPLE_CONVERSATION(im), NULL, server_msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); |
1003 purple_conversation_write_system_message(PURPLE_CONVERSATION(im), |
| |
1004 server_msg, 0); |
| 1003 } |
1005 } |
| 1004 else { |
1006 else { |
| 1005 purple_notify_error(gc, NULL, |
1007 purple_notify_error(gc, NULL, |
| 1006 _("Your SMS was not delivered"), NULL, |
1008 _("Your SMS was not delivered"), NULL, |
| 1007 purple_request_cpar_from_connection(gc)); |
1009 purple_request_cpar_from_connection(gc)); |
| 4471 char *carrier = NULL; |
4473 char *carrier = NULL; |
| 4472 PurpleAccount *account = purple_connection_get_account(gc); |
4474 PurpleAccount *account = purple_connection_get_account(gc); |
| 4473 PurpleIMConversation *im = purple_conversations_find_im_with_account(sms_cb_data->who, account); |
4475 PurpleIMConversation *im = purple_conversations_find_im_with_account(sms_cb_data->who, account); |
| 4474 |
4476 |
| 4475 if (!purple_http_response_is_successful(response)) { |
4477 if (!purple_http_response_is_successful(response)) { |
| 4476 purple_conversation_write(PURPLE_CONVERSATION(im), NULL, |
4478 purple_conversation_write_system_message(PURPLE_CONVERSATION(im), |
| 4477 _("Can't send SMS. Unable to obtain mobile carrier."), PURPLE_MESSAGE_SYSTEM, time(NULL)); |
4479 _("Can't send SMS. Unable to obtain mobile carrier."), 0); |
| 4478 |
4480 |
| 4479 g_free(sms_cb_data->who); |
4481 g_free(sms_cb_data->who); |
| 4480 g_free(sms_cb_data->what); |
4482 g_free(sms_cb_data->what); |
| 4481 g_free(sms_cb_data); |
4483 g_free(sms_cb_data); |
| 4482 return ; |
4484 return ; |
| 4501 yahoo_send_im(sms_cb_data->gc, purple_message_new(sms_cb_data->who, |
4503 yahoo_send_im(sms_cb_data->gc, purple_message_new(sms_cb_data->who, |
| 4502 sms_cb_data->what, PURPLE_MESSAGE_SEND)); |
4504 sms_cb_data->what, PURPLE_MESSAGE_SEND)); |
| 4503 } else { |
4505 } else { |
| 4504 g_hash_table_insert(yd->sms_carrier, |
4506 g_hash_table_insert(yd->sms_carrier, |
| 4505 g_strdup_printf("+%s", mobile_no), g_strdup("Unknown")); |
4507 g_strdup_printf("+%s", mobile_no), g_strdup("Unknown")); |
| 4506 purple_conversation_write(PURPLE_CONVERSATION(im), NULL, |
4508 purple_conversation_write_system_message(PURPLE_CONVERSATION(im), |
| 4507 _("Can't send SMS. Unknown mobile carrier."), |
4509 _("Can't send SMS. Unknown mobile carrier."), 0); |
| 4508 PURPLE_MESSAGE_SYSTEM, time(NULL)); |
|
| 4509 } |
4510 } |
| 4510 |
4511 |
| 4511 purple_xmlnode_free(validate_data_child); |
4512 purple_xmlnode_free(validate_data_child); |
| 4512 purple_xmlnode_free(validate_data_root); |
4513 purple_xmlnode_free(validate_data_root); |
| 4513 g_free(sms_cb_data->who); |
4514 g_free(sms_cb_data->who); |
| 4608 sms_cb_data = g_malloc(sizeof(struct yahoo_sms_carrier_cb_data)); |
4609 sms_cb_data = g_malloc(sizeof(struct yahoo_sms_carrier_cb_data)); |
| 4609 sms_cb_data->gc = gc; |
4610 sms_cb_data->gc = gc; |
| 4610 sms_cb_data->who = g_strdup(who); |
4611 sms_cb_data->who = g_strdup(who); |
| 4611 sms_cb_data->what = g_strdup(purple_message_get_contents(pmsg)); |
4612 sms_cb_data->what = g_strdup(purple_message_get_contents(pmsg)); |
| 4612 |
4613 |
| 4613 purple_conversation_write(PURPLE_CONVERSATION(im), NULL, _("Getting mobile carrier to send the SMS."), PURPLE_MESSAGE_SYSTEM, time(NULL)); |
4614 purple_conversation_write_system_message(PURPLE_CONVERSATION(im), |
| |
4615 _("Getting mobile carrier to send the SMS."), 0); |
| 4614 |
4616 |
| 4615 yahoo_get_sms_carrier(gc, sms_cb_data); |
4617 yahoo_get_sms_carrier(gc, sms_cb_data); |
| 4616 |
4618 |
| 4617 g_free(msg); |
4619 g_free(msg); |
| 4618 g_free(msg2); |
4620 g_free(msg2); |
| 4619 return ret; |
4621 return ret; |
| 4620 } |
4622 } |
| 4621 else if( strcmp(carrier,"Unknown") == 0 ) { |
4623 else if( strcmp(carrier,"Unknown") == 0 ) { |
| 4622 purple_conversation_write(PURPLE_CONVERSATION(im), NULL, _("Can't send SMS. Unknown mobile carrier."), PURPLE_MESSAGE_SYSTEM, time(NULL)); |
4624 purple_conversation_write_system_message(PURPLE_CONVERSATION(im), |
| |
4625 _("Can't send SMS. Unknown mobile carrier."), 0); |
| 4623 |
4626 |
| 4624 g_free(msg); |
4627 g_free(msg); |
| 4625 g_free(msg2); |
4628 g_free(msg2); |
| 4626 return -1; |
4629 return -1; |
| 4627 } |
4630 } |