Skip to content

Instantly share code, notes, and snippets.

@jhkrischel
Created August 15, 2012 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhkrischel/b71c4d570832d9a2dda0 to your computer and use it in GitHub Desktop.
Save jhkrischel/b71c4d570832d9a2dda0 to your computer and use it in GitHub Desktop.
Meanwhile-srvc_place.c.diff for Adium - place in Dependencies/patches/
--- 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;
+ char *extraname;
};
@@ -189,6 +200,7 @@
mwIdBlock_clear(&p->idb);
g_free(p->login_id);
g_free(p->name);
+ g_free(p->extraname);
g_free(p);
}
@@ -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. */
PUT_MEMBER(place, pm);
if(srvc->handler && srvc->handler->peerJoined)
@@ -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);
+ 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);
-}
+}
@jhkrischel
Copy link
Author

Big shout out to Jonathan Rice for actually figuring this patch out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment