From d4bc2d90d88527f434f910b9821c145394434d71 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 16 May 2010 10:46:27 +0100 Subject: Handle AIM_CAPS_ICQRTF messages (sometimes sent by certain mobile clients). Not sure if this needs any stripping but I guess we'll find out. --- protocols/oscar/oscar.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'protocols/oscar') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 00c5e5ef..9f568c44 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -1029,16 +1029,20 @@ static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_ *exch = args->info.chat.roominfo.exchange; m = g_list_append(m, exch); - g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", name, userinfo->sn, args->msg ); + g_snprintf(txt, 1024, "Got an invitation to chatroom %s from %s: %s", name, userinfo->sn, args->msg); inv->ic = ic; inv->exchange = *exch; inv->name = g_strdup(name); - imcb_ask( ic, txt, inv, oscar_accept_chat, oscar_reject_chat); + imcb_ask(ic, txt, inv, oscar_accept_chat, oscar_reject_chat); if (name) g_free(name); + } else if (args->reqclass & AIM_CAPS_ICQRTF) { + // TODO: constify + char *text = g_strdup(args->info.rtfmsg.rtfmsg); + imcb_buddy_msg(ic, normalize(userinfo->sn), text, 0, 0); } return 1; -- cgit v1.2.3 From 2334048eaa9ab26fcdab781dbfb1bacb1c01ba8d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 16 May 2010 10:50:57 +0100 Subject: Oi, don't leak that precious memory! --- protocols/oscar/oscar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'protocols/oscar') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 9f568c44..9f33f320 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -1041,7 +1041,8 @@ static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_ g_free(name); } else if (args->reqclass & AIM_CAPS_ICQRTF) { // TODO: constify - char *text = g_strdup(args->info.rtfmsg.rtfmsg); + char text[strlen(args->info.rtfmsg.rtfmsg)+1]; + strncpy(text, args->info.rtfmsg.rtfmsg, sizeof(text)); imcb_buddy_msg(ic, normalize(userinfo->sn), text, 0, 0); } -- cgit v1.2.3 From 3dc6d86076dbea16c313bb87aa2f37166f289a8e Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 2 Jun 2010 09:47:18 +0100 Subject: Disable old-style ICQ authentication. It looks like AOL or whoever is slowly taking down support for it. Just to be sure, it can be re-enabled with a setting, I'll remove that after the next release. --- protocols/oscar/auth.c | 3 ++- protocols/oscar/oscar.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'protocols/oscar') diff --git a/protocols/oscar/auth.c b/protocols/oscar/auth.c index eb6a9d64..0f7c8d0f 100644 --- a/protocols/oscar/auth.c +++ b/protocols/oscar/auth.c @@ -119,11 +119,12 @@ int aim_request_login(aim_session_t *sess, aim_conn_t *conn, const char *sn) aim_frame_t *fr; aim_snacid_t snacid; aim_tlvlist_t *tl = NULL; + struct im_connection *ic = sess->aux_data; if (!sess || !conn || !sn) return -EINVAL; - if ((sn[0] >= '0') && (sn[0] <= '9')) + if (isdigit(sn[0]) && set_getbool(&ic->acc->set, "old_icq_auth")) return goddamnicq(sess, conn, sn); sess->flags |= AIM_SESS_FLAGS_SNACLOGIN; diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 9f33f320..9602a496 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -373,6 +373,7 @@ static void oscar_init(account_t *acc) if (isdigit(acc->user[0])) { set_add(&acc->set, "ignore_auth_requests", "false", set_eval_bool, acc); + set_add(&acc->set, "old_icq_auth", "false", set_eval_bool, acc); } s = set_add(&acc->set, "server", AIM_DEFAULT_LOGIN_SERVER, set_eval_account, acc); -- cgit v1.2.3