soc.2010.icq-tlc: 50cff06a: Removed the old way of retrieving offlin...

ivan.komarov at soc.pidgin.im ivan.komarov at soc.pidgin.im
Sun May 30 15:25:43 EDT 2010


-----------------------------------------------------------------
Revision: 50cff06ad0f282de6cb446f6fd51c7cfbd7fa85d
Ancestor: 850102c2d3b83ffb1c63bf0bb5ee384cd2fd7ec8
Author: ivan.komarov at soc.pidgin.im
Date: 2010-05-29T18:48:04
Branch: im.pidgin.soc.2010.icq-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/50cff06ad0f282de6cb446f6fd51c7cfbd7fa85d

Modified files:
        libpurple/protocols/oscar/family_icq.c
        libpurple/protocols/oscar/oscar.c
        libpurple/protocols/oscar/oscar.h

ChangeLog: 

Removed the old way of retrieving offline messages, because it is not
used anymore. The new way is to use aim_im_reqofflinemsgs()
instead of aim_icq_reqofflinemsgs().

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_icq.c	8576051188f57d3828dee9075f4aeb2d027808cc
+++ libpurple/protocols/oscar/family_icq.c	2273007a695ce8e4d523257f20195f8e8326dc80
@@ -25,76 +25,6 @@
 
 #include "oscar.h"
 
-#ifdef OLDSTYLE_ICQ_OFFLINEMSGS
-int aim_icq_reqofflinemsgs(OscarData *od)
-{
-	FlapConnection *conn;
-	ByteStream bs;
-	aim_snacid_t snacid;
-	int bslen;
-
-	if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ)))
-		return -EINVAL;
-
-	purple_debug_info("oscar", "Requesting offline messages\n");
-
-	bslen = 2 + 4 + 2 + 2;
-
-	byte_stream_new(&bs, 4 + bslen);
-
-	snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0);
-
-	/* For simplicity, don't bother using a tlvlist */
-	byte_stream_put16(&bs, 0x0001);
-	byte_stream_put16(&bs, bslen);
-
-	byte_stream_putle16(&bs, bslen - 2);
-	byte_stream_putuid(&bs, od);
-	byte_stream_putle16(&bs, 0x003c); /* I command thee. */
-	byte_stream_putle16(&bs, snacid); /* eh. */
-
-	flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs);
-
-	byte_stream_destroy(&bs);
-
-	return 0;
-}
-
-int aim_icq_ackofflinemsgs(OscarData *od)
-{
-	ByteStream bs;
-	FlapFrame *frame;
-	aim_snacid_t snacid;
-	int bslen;
-
-	if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_ICQ)))
-		return -EINVAL;
-
-	purple_debug_info("oscar", "Acknowledged receipt of offline messages\n");
-
-	bslen = 2 + 4 + 2 + 2;
-
-	byte_stream_new(&bs, 4 + bslen);
-
-	snacid = aim_cachesnac(od, SNAC_FAMILY_ICQ, 0x0002, 0x0000, NULL, 0);
-
-	/* For simplicity, don't bother using a tlvlist */
-	byte_stream_put16(&bs, 0x0001);
-	byte_stream_put16(&bs, bslen);
-
-	byte_stream_putle16(&bs, bslen - 2);
-	byte_stream_putuid(&bs, od);
-	byte_stream_putle16(&bs, 0x003e); /* I command thee. */
-	byte_stream_putle16(&bs, snacid); /* eh. */
-
-	flap_connection_send_snac(od, conn, SNAC_FAMILY_ICQ, 0x0002, 0x0000, snacid, &bs);
-
-	byte_stream_destroy(&bs);
-
-	return 0;
-}
-#endif /* OLDSTYLE_ICQ_OFFLINEMSGS */
-
 int
 aim_icq_setsecurity(OscarData *od, gboolean auth_required, gboolean webaware)
 {
@@ -522,37 +452,7 @@ icqresponse(OscarData *od, FlapConnectio
 
 	purple_debug_misc("oscar", "icq response: %d bytes, %u, 0x%04x, 0x%04x\n", cmdlen, ouruin, cmd, reqid);
 
-	if (cmd == 0x0041) { /* offline message */
-#ifdef OLDSTYLE_ICQ_OFFLINEMSGS
-		struct aim_icq_offlinemsg msg;
-		aim_rxcallback_t userfunc;
-
-		memset(&msg, 0, sizeof(msg));
-
-		msg.sender = byte_stream_getle32(&qbs);
-		msg.year = byte_stream_getle16(&qbs);
-		msg.month = byte_stream_getle8(&qbs);
-		msg.day = byte_stream_getle8(&qbs);
-		msg.hour = byte_stream_getle8(&qbs);
-		msg.minute = byte_stream_getle8(&qbs);
-		msg.type = byte_stream_getle8(&qbs);
-		msg.flags = byte_stream_getle8(&qbs);
-		msg.msglen = byte_stream_getle16(&qbs);
-		msg.msg = byte_stream_getstr(&qbs, msg.msglen);
-
-		if ((userfunc = aim_callhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_OFFLINEMSG)))
-			ret = userfunc(od, conn, frame, &msg);
-
-		g_free(msg.msg);
-
-	} else if (cmd == 0x0042) {
-		aim_rxcallback_t userfunc;
-
-		if ((userfunc = aim_callhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_OFFLINEMSGCOMPLETE)))
-			ret = userfunc(od, conn, frame);
-#endif /* OLDSTYLE_ICQ_OFFLINEMSGS */
-
-	} else if (cmd == 0x07da) { /* information */
+	if (cmd == 0x07da) { /* information */
 		guint16 subtype;
 		struct aim_icq_info *info;
 		aim_rxcallback_t userfunc;
============================================================
--- libpurple/protocols/oscar/oscar.c	eab2862612cf8346cfb4e160f97bc07ee58792c3
+++ libpurple/protocols/oscar/oscar.c	f0bbbc47e11585b1ccfab3d87c21339011be6c78
@@ -165,10 +165,6 @@ static int purple_selfinfo         (Osca
 static int purple_parse_genericerr (OscarData *, FlapConnection *, FlapFrame *, ...);
 static int purple_memrequest       (OscarData *, FlapConnection *, FlapFrame *, ...);
 static int purple_selfinfo         (OscarData *, FlapConnection *, FlapFrame *, ...);
-#ifdef OLDSTYLE_ICQ_OFFLINEMSGS
-static int purple_offlinemsg       (OscarData *, FlapConnection *, FlapFrame *, ...);
-static int purple_offlinemsgdone   (OscarData *, FlapConnection *, FlapFrame *, ...);
-#endif /* OLDSTYLE_ICQ_OFFLINEMSGS */
 static int purple_icqalias         (OscarData *, FlapConnection *, FlapFrame *, ...);
 static int purple_icqinfo          (OscarData *, FlapConnection *, FlapFrame *, ...);
 static int purple_popup            (OscarData *, FlapConnection *, FlapFrame *, ...);
@@ -1497,10 +1493,6 @@ oscar_login(PurpleAccount *account)
 	oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_CLIENTAUTORESP, purple_parse_clientauto, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_MTN, purple_parse_mtn, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_ICBM, SNAC_SUBTYPE_ICBM_ACK, purple_parse_msgack, 0);
-#ifdef OLDSTYLE_ICQ_OFFLINEMSGS
-	oscar_data_addhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_OFFLINEMSG, purple_offlinemsg, 0);
-	oscar_data_addhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_OFFLINEMSGCOMPLETE, purple_offlinemsgdone, 0);
-#endif /* OLDSTYLE_ICQ_OFFLINEMSGS */
 	oscar_data_addhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_ALIAS, purple_icqalias, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_ICQ, SNAC_SUBTYPE_ICQ_INFO, purple_icqinfo, 0);
 	oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_RIGHTSINFO, purple_parse_locaterights, 0);
@@ -3980,9 +3972,6 @@ static int purple_bosrights(OscarData *o
 	aim_srv_setidle(od, !purple_presence_is_idle(presence) ? 0 : time(NULL) - purple_presence_get_idle_time(presence));
 
 	if (od->icq) {
-#ifdef OLDSTYLE_ICQ_OFFLINEMSGS
-		aim_icq_reqofflinemsgs(od);
-#endif
 		oscar_set_extendedstatus(gc);
 		aim_icq_setsecurity(od,
 			purple_account_get_bool(account, "authorization", OSCAR_DEFAULT_AUTHORIZATION),
@@ -4015,37 +4004,6 @@ static int purple_bosrights(OscarData *o
 	return 1;
 }
 
-#ifdef OLDSTYLE_ICQ_OFFLINEMSGS
-static int purple_offlinemsg(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) {
-	va_list ap;
-	struct aim_icq_offlinemsg *msg;
-	struct aim_incomingim_ch4_args args;
-	time_t t;
-
-	va_start(ap, fr);
-	msg = va_arg(ap, struct aim_icq_offlinemsg *);
-	va_end(ap);
-
-	purple_debug_info("oscar",
-			   "Received offline message.  Converting to channel 4 ICBM...\n");
-	args.uin = msg->sender;
-	args.type = msg->type;
-	args.flags = msg->flags;
-	args.msglen = msg->msglen;
-	args.msg = msg->msg;
-	t = purple_time_build(msg->year, msg->month, msg->day, msg->hour, msg->minute, 0);
-	incomingim_chan4(od, conn, NULL, &args, t);
-
-	return 1;
-}
-
-static int purple_offlinemsgdone(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...)
-{
-	aim_icq_ackofflinemsgs(od);
-	return 1;
-}
-#endif /* OLDSTYLE_ICQ_OFFLINEMSGS */
-
 static int purple_icqinfo(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...)
 {
 	PurpleConnection *gc;
============================================================
--- libpurple/protocols/oscar/oscar.h	271b819e904b536e55d2f895df21d7f4b5d1337d
+++ libpurple/protocols/oscar/oscar.h	30a3c98a2b417c6755440b3968b97b4034c032c9
@@ -1342,19 +1342,6 @@ int aim_ssi_delicon(OscarData *od);
 #define AIM_ICQ_INFO_UNKNOWN	0x100
 #define AIM_ICQ_INFO_HAVEALL	0x1ff
 
-#ifdef OLDSTYLE_ICQ_OFFLINEMSGS
-struct aim_icq_offlinemsg
-{
-	guint32 sender;
-	guint16 year;
-	guint8 month, day, hour, minute;
-	guint8 type;
-	guint8 flags;
-	char *msg;
-	int msglen;
-};
-#endif /* OLDSTYLE_ICQ_OFFLINEMSGS */
-
 struct aim_icq_info
 {
 	guint16 reqid;
@@ -1421,10 +1408,6 @@ struct aim_icq_info
 	char *auth_request_reason;
 };
 
-#ifdef OLDSTYLE_ICQ_OFFLINEMSGS
-int aim_icq_reqofflinemsgs(OscarData *od);
-int aim_icq_ackofflinemsgs(OscarData *od);
-#endif
 int aim_icq_setsecurity(OscarData *od, gboolean auth_required, gboolean webaware);
 int aim_icq_changepasswd(OscarData *od, const char *passwd);
 int aim_icq_getsimpleinfo(OscarData *od, const char *uin);


More information about the Commits mailing list