im.pidgin.pidgin: b172eef76780c71c49e3d4afc89bf3a043f692a8

markdoliner at pidgin.im markdoliner at pidgin.im
Thu Feb 28 03:20:58 EST 2008


-----------------------------------------------------------------
Revision: b172eef76780c71c49e3d4afc89bf3a043f692a8
Ancestor: 77c9ccd225ed49e37259c43a457a37245482706e
Author: markdoliner at pidgin.im
Date: 2008-02-28T08:15:27
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b172eef76780c71c49e3d4afc89bf3a043f692a8

Modified files:
        libpurple/protocols/oscar/family_icbm.c
        libpurple/protocols/oscar/oscar.c

ChangeLog: 

* Don't flag outgoing oscar messages as "offline deliverable" if the
  message is an auto-reply.  Fixes #4941.
* Don't flag outgoing oscar messages as "offline deliverable" if the
  destination user is a cell phone or if we know that the destination
  user is currently online

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_icbm.c	8e6c3080d5c77f8fd82bc13bc1e23662cc43a384
+++ libpurple/protocols/oscar/family_icbm.c	28f68371090128f88aa0851dd5e57bf91ce5ea09
@@ -372,15 +372,18 @@ int aim_im_sendch1_ext(OscarData *od, st
 	if (args->flags & AIM_IMFLAGS_AWAY) {
 		byte_stream_put16(&data, 0x0004);
 		byte_stream_put16(&data, 0x0000);
-	} else if (args->flags & AIM_IMFLAGS_ACK) {
-		/* Set the Request Acknowledge flag */
-		byte_stream_put16(&data, 0x0003);
-		byte_stream_put16(&data, 0x0000);
-	}
+	} else {
+		if (args->flags & AIM_IMFLAGS_ACK) {
+			/* Set the Request Acknowledge flag */
+			byte_stream_put16(&data, 0x0003);
+			byte_stream_put16(&data, 0x0000);
+		}
 
-	if (args->flags & AIM_IMFLAGS_OFFLINE) {
-		byte_stream_put16(&data, 0x0006);
-		byte_stream_put16(&data, 0x0000);
+		if (args->flags & AIM_IMFLAGS_OFFLINE) {
+			/* Allow this message to be queued as an offline message */
+			byte_stream_put16(&data, 0x0006);
+			byte_stream_put16(&data, 0x0000);
+		}
 	}
 
 	/*
============================================================
--- libpurple/protocols/oscar/oscar.c	e3e4d4bae3c68d1a29c3189a993257f5929a026a
+++ libpurple/protocols/oscar/oscar.c	cf07fb6618ba0ae0e09b4ea82a1bf94f39367e29
@@ -4225,13 +4225,15 @@ oscar_send_im(PurpleConnection *gc, cons
 	PeerConnection *conn;
 	int ret;
 	char *tmp1, *tmp2;
-	gboolean is_html;
+	gboolean is_sms, is_html;
 
 	od = (OscarData *)gc->proto_data;
 	account = purple_connection_get_account(gc);
 	ret = 0;
 
-	if (od->icq && aim_snvalid_sms(name)) {
+	is_sms = aim_snvalid_sms(name);
+
+	if (od->icq && is_sms) {
 		/*
 		 * We're sending to a phone number and this is ICQ,
 		 * so send the message as an SMS using aim_icq_sendsms()
@@ -4257,6 +4259,7 @@ oscar_send_im(PurpleConnection *gc, cons
 		struct aim_sendimext_args args;
 		PurpleConversation *conv;
 		PurpleStoredImage *img;
+		PurpleBuddy *buddy;
 
 		conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, account);
 
@@ -4266,13 +4269,19 @@ oscar_send_im(PurpleConnection *gc, cons
 			                        "You must be Direct Connected to send IM Images."),
 			                        PURPLE_MESSAGE_ERROR, time(NULL));
 
+		buddy = purple_find_buddy(gc->account, name);
+
 		bi = g_hash_table_lookup(od->buddyinfo, purple_normalize(account, name));
 		if (!bi) {
 			bi = g_new0(struct buddyinfo, 1);
 			g_hash_table_insert(od->buddyinfo, g_strdup(purple_normalize(account, name)), bi);
 		}
 
-		args.flags = AIM_IMFLAGS_ACK | AIM_IMFLAGS_CUSTOMFEATURES | AIM_IMFLAGS_OFFLINE;
+		args.flags = AIM_IMFLAGS_ACK | AIM_IMFLAGS_CUSTOMFEATURES;
+
+		if (!is_sms && (!buddy || !PURPLE_BUDDY_IS_ONLINE(buddy)))
+			args.flags |= AIM_IMFLAGS_OFFLINE;
+
 		if (od->icq) {
 			/* We have to present different "features" (whose meaning
 			   is unclear and are merely a result of protocol inspection)
@@ -4281,7 +4290,6 @@ oscar_send_im(PurpleConnection *gc, cons
 			   encoded" (and instead, assumes them to be UTF-8).
 			   For more details, see SF issue 1179452.
 			*/
-			PurpleBuddy *buddy = purple_find_buddy(gc->account, name);
 			if (buddy && PURPLE_BUDDY_IS_ONLINE(buddy)) {
 				args.features = features_icq;
 				args.featureslen = sizeof(features_icq);


More information about the Commits mailing list