Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From a85015dfee93ff75467cd34f06e27f5fb9c56fe7 Mon Sep 17 00:00:00 2001
- From: Devid Antonio Filoni <devidfil@gmail.com>
- Date: Sun, 12 Jul 2009 11:53:33 +0200
- Subject: [PATCH] pn_oim.c: improve process_body_send
- ---
- pn_oim.c | 13 ++++++++-----
- 1 files changed, 8 insertions(+), 5 deletions(-)
- diff --git a/pn_oim.c b/pn_oim.c
- index c72c885..e9d3fcb 100644
- --- a/pn_oim.c
- +++ b/pn_oim.c
- @@ -505,12 +505,13 @@ process_body_send (OimRequest *oim_request,
- cur = strstr (body, "<LockKeyChallenge ");
- if (cur)
- {
- - gsize lockkey_len;
- - gchar *lockkey;
- + gchar *lockkey, *end;
- - lockkey_len = strlen (cur) - 67 - strlen (strstr ((const char*) body, "</LockKeyChallenge>"));
- - lockkey = malloc (lockkey_len);
- - strncpy (lockkey, cur + 67, lockkey_len);
- + cur = strchr (cur, '>') + 1;
- + end = strchr (cur, '<');
- + lockkey = g_strndup (cur, end - cur);
- +
- + pn_error ("lockkey=[%s]", lockkey);
- pn_handle_challenge (lockkey, "PROD01065C%ZFN6F", "O4BG@C7BWLYQX?5G", oim_request->oim_session->lockkey);
- @@ -530,6 +531,8 @@ process_body_send (OimRequest *oim_request,
- error = _("The following message wasn't sent because the system is unavailable. This normally happens when the user is blocked or does not exist.");
- else if (strstr (body, "q0:SenderThrottleLimitExceeded"))
- error = _("The following message wasn't sent because you've sent messages too quickly.");
- + else if (strstr (body, "q0:MessageTooLarge"))
- + error = _("The following message wasn't sent because it's too large.");
- else
- return;
- --
- 1.6.3.3
Add Comment
Please, Sign In to add comment