diff options
author | Eion Robb <eion@robbmob.com> | 2011-02-21 03:28:54 +0300 |
---|---|---|
committer | Eion Robb <eion@robbmob.com> | 2011-02-21 03:28:54 +0300 |
commit | 556e81e4612f1c4187d0982b7bfb66f066c7869d (patch) | |
tree | 810a1d6a08f380e598f915b4cf1310bce29bc31f | |
parent | 475c2f3e16820954adbe5f7b208f6f80ae700797 (diff) |
Check and store protocol version and use that to decide how to sent chat messages
-rw-r--r-- | libskype.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -144,6 +144,8 @@ static GStaticMutex chat_link_mutex = G_STATIC_MUTEX_INIT; //This is used for incomming SMS status messages to be associated with a particular phone number static GHashTable *sms_convo_link_table = NULL; +static guint protocol_version = 7; + #include "debug.c" #include "skype_messaging.c" @@ -1696,6 +1698,7 @@ skype_login_part2(PurpleAccount *acct) purple_timeout_add_seconds(10, (GSourceFunc) skype_login_retry, acct); return FALSE; } + sscanf(reply, "PROTOCOL %d", &protocol_version); g_free(reply); purple_connection_update_progress(gc, _("Hide Skype"), 3, 5); @@ -1835,17 +1838,8 @@ skype_send_im(PurpleConnection *gc, const gchar *who, const gchar *message, stripped = purple_markup_strip_html(message); - if (conv == NULL || purple_conversation_get_data(conv, "chat_id") == NULL) + if (protocol_version < 5 || conv == NULL || purple_conversation_get_data(conv, "chat_id") == NULL) { - /*chat_id = g_new(char, 200); - char *temp; - temp = skype_send_message("CHAT CREATE %s", who); - sscanf(temp, "CHAT %s ", chat_id); - g_free(temp); - if (conv != NULL) - { - purple_conversation_set_data(conv, "chat_id", chat_id); - }*/ skype_send_message_nowait("MESSAGE %s %s", who, stripped); } else { chat_id = purple_conversation_get_data(conv, "chat_id"); |