adium/adium

Added the second meanwhile groupchat fix patch.
adium-1.5.4
2012-09-23, Thijs Alkemade
b2d9af334529
Parents 2f86166a0e51
Children 4f86300f2555
Added the second meanwhile groupchat fix patch.

Refs #16114
--- a/Dependencies/build.sh Tue Sep 18 20:43:09 2012 +0200
+++ b/Dependencies/build.sh Sun Sep 23 23:10:54 2012 +0200
@@ -162,8 +162,8 @@
eval `$DEVELOPER/usr/bin/pump --startup`
else
# Try to find the right gcc, even when XCode4 is installed
- export CC="gcc"
- export CXX="gcc"
+ export CC="xcrun clang"
+ export CXX="xcrun clang"
export CCAS="$CC"
export OBJC="$CC"
fi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Dependencies/patches/Meanwhile-session.c.diff Sun Sep 23 23:10:54 2012 +0200
@@ -0,0 +1,11 @@
+--- src/session.c.orig 2005-12-15 21:11:47.000000000 +0100
++++ src/session.c 2012-09-23 22:55:56.000000000 +0200
+@@ -454,6 +454,8 @@
+
+ g_info("Sametime server version (major/minor): 0x%x / 0x%x", msg->major, msg->minor);
+
++ g_info("Sametime server version (major/minor): 0x%x / 0x%x", msg->major, msg->minor);
++
+ /* compose the login message */
+ log = (struct mwMsgLogin *) mwMessage_new(mwMessage_LOGIN);
+ log->login_type = GUINT(property_get(s, mwSession_CLIENT_TYPE_ID));
--- a/Dependencies/patches/Meanwhile-srvc_place.c.diff Tue Sep 18 20:43:09 2012 +0200
+++ b/Dependencies/patches/Meanwhile-srvc_place.c.diff Sun Sep 23 23:10:54 2012 +0200
@@ -1,6 +1,23 @@
---- src/srvc_place.c 2005-11-21 10:30:46.000000000 -0800
-+++ src/srvc_place.c 2012-08-15 09:07:37.000000000 -0700
-@@ -165,6 +165,7 @@
+--- src/srvc_place.c 2005-12-02 18:00:29.000000000 -0800
++++ src/srvc_place.c 2012-08-21 19:39:32.000000000 -0700
+@@ -39,6 +39,16 @@
+ #define PROTOCOL_TYPE 0x00
+ #define PROTOCOL_VER 0x05
+
++/*
++ As of Sametime ~v8.5, there's a slightly different group chat invite message.
++ This identifies the earliest server version using the new format. Currently,
++ it's set for 8.5.1. If other people are having issues, we'll need to decrease
++ this to their version.
++*/
++#define NEW_FORMAT_SERVER_VER_MAJOR 0x001e
++#define NEW_FORMAT_SERVER_VER_MINOR 0x213f
++
++#define GUINT(val) (GPOINTER_TO_UINT((val)))
+
+ enum incoming_msg {
+ msg_in_JOIN_RESPONSE = 0x0000, /* ? */
+@@ -165,6 +175,7 @@
guint16 login_type;
guint32 unknown_a;
guint32 unknown_b;
@@ -8,7 +25,7 @@
};
-@@ -189,6 +190,7 @@
+@@ -189,6 +200,7 @@
mwIdBlock_clear(&p->idb);
g_free(p->login_id);
g_free(p->name);
@@ -16,21 +33,50 @@
g_free(p);
}
-@@ -394,6 +396,8 @@
+@@ -394,6 +406,9 @@
guint16_get(b, &pm->login_type);
guint32_get(b, &pm->unknown_a);
guint32_get(b, &pm->unknown_b);
-+ //TODO: Since the Notes upgrade, an extra name string is sent to recv_SECTION_LIST(). It might be sent here,
-+ // but since we're only parsing one user, it probably doesn't matter here.
++ /* TODO: Since the Notes upgrade, an extra name string is sent to
++ recv_SECTION_LIST(). It might be sent here, but since we're only
++ parsing one user, it probably doesn't matter here. */
PUT_MEMBER(place, pm);
if(srvc->handler && srvc->handler->peerJoined)
-@@ -544,6 +548,7 @@
- guint16_get(b, &m->login_type);
+@@ -519,8 +534,18 @@
+
+ static int recv_SECTION_LIST(struct mwPlace *place,
+ struct mwGetBuffer *b) {
+- int ret = 0;
++ int ret = 0, major, minor;
+ guint32 sec, count;
++ struct mwSession *session;
++ gboolean newMsgFormat;
++
++ /* Check the server version to see if the message uses the new format */
++ session = mwService_getSession(MW_SERVICE(place->service));
++ major = GUINT(mwSession_getProperty(session, mwSession_SERVER_VER_MAJOR));
++ minor = GUINT(mwSession_getProperty(session, mwSession_SERVER_VER_MINOR));
++ newMsgFormat = (major == NEW_FORMAT_SERVER_VER_MAJOR
++ && minor >= NEW_FORMAT_SERVER_VER_MINOR)
++ || major > NEW_FORMAT_SERVER_VER_MAJOR;
+
+ mwGetBuffer_advance(b, 4);
+ guint32_get(b, &sec);
+@@ -545,6 +570,10 @@
guint32_get(b, &m->unknown_a);
guint32_get(b, &m->unknown_b);
-+ mwString_get(b, &m->extraname); //new in Notes upgrade, the name appears again at the end now
++ if(newMsgFormat) {
++ mwString_get(b, &m->extraname);
++ }
++
PUT_MEMBER(place, m);
}
-
+
+@@ -1072,4 +1101,4 @@
+ void mwPlace_removeClientData(struct mwPlace *place) {
+ g_return_if_fail(place != NULL);
+ mw_datum_clear(&place->client_data);
+-}
++}
--- a/Dependencies/phases/build_dependencies.sh Tue Sep 18 20:43:09 2012 +0200
+++ b/Dependencies/phases/build_dependencies.sh Sun Sep 23 23:10:54 2012 +0200
@@ -144,6 +144,7 @@
# Fixes accepting group chat invites from the standard Sametime client.
# Thanks to Jere Krischel and Jonathan Rice.
fwdpatch "$ROOTDIR/patches/Meanwhile-srvc_place.c.diff" -p0 || true
+ fwdpatch "$ROOTDIR/patches/Meanwhile-session.c.diff" -p0 || true
if needsconfigure $@; then
(
@@ -178,6 +179,7 @@
revpatch "$ROOTDIR/patches/Meanwhile-common.c.diff" -p0
revpatch "$ROOTDIR/patches/Meanwhile-srvc_ft.c.diff" -p0
revpatch "$ROOTDIR/patches/Meanwhile-srvc_place.c.diff" -p0
+ revpatch "$ROOTDIR/patches/Meanwhile-session.c.diff" -p0
quiet popd
}