diff options
author | John Bailey <rekkanoryo@rekkanoryo.org> | 2009-10-31 17:52:54 +0000 |
---|---|---|
committer | John Bailey <rekkanoryo@rekkanoryo.org> | 2009-10-31 17:52:54 +0000 |
commit | 631931fe640b45c0bf623406f101cffb62a19906 (patch) | |
tree | 89f82be2050568a05d57320430137deeeb07e82b /libpurple/protocols/jabber/jingle/session.c | |
parent | 4bfaae6f20ad3a8305457b4169ec6db8192bfdda (diff) | |
parent | cb3d8a82a3a2c1c3525be5da071e0f70197c59e6 (diff) | |
download | pidgin-631931fe640b45c0bf623406f101cffb62a19906.tar.gz |
propagate from branch 'im.pidgin.pidgin' (head e8995c6648becc2478de4dc29691d4c95d90d27b)
to branch 'im.pidgin.pidgin.next.minor' (head 06ed2b4fb291addacb5f426f401275e6acb050d2)
Diffstat (limited to 'libpurple/protocols/jabber/jingle/session.c')
-rw-r--r-- | libpurple/protocols/jabber/jingle/session.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/libpurple/protocols/jabber/jingle/session.c b/libpurple/protocols/jabber/jingle/session.c index ef79258f28..0ef00d3f34 100644 --- a/libpurple/protocols/jabber/jingle/session.c +++ b/libpurple/protocols/jabber/jingle/session.c @@ -367,7 +367,6 @@ jingle_session_find_by_sid(JabberStream *js, const gchar *sid) g_hash_table_lookup(js->sessions, sid) : NULL; } -#if GLIB_CHECK_VERSION(2,4,0) static gboolean find_by_jid_ghr(gpointer key, gpointer value, gpointer user_data) { @@ -387,58 +386,12 @@ static gboolean find_by_jid_ghr(gpointer key, return FALSE; } -#else /* GLIB_CHECK_VERSION 2.4.0 */ - -/* Ugly code; g_hash_table_find version above is much nicer */ -struct session_find_jid -{ - const gchar *jid; - JingleSession *ret; - gboolean use_bare; -}; - -static void find_by_jid_ghr(gpointer key, gpointer value, gpointer user_data) -{ - JingleSession *session = (JingleSession *)value; - struct session_find_jid *data = user_data; - gchar *remote_jid; - gchar *cmp_jid; - - if (data->ret != NULL) - return; - - remote_jid = jingle_session_get_remote_jid(session); - cmp_jid = data->use_bare ? jabber_get_bare_jid(remote_jid) - : g_strdup(remote_jid); - g_free(remote_jid); - - if (g_str_equal(data->jid, cmp_jid)) - data->ret = session; - - g_free(cmp_jid); -} -#endif /* GLIB_CHECK_VERSION 2.4.0 */ - JingleSession * jingle_session_find_by_jid(JabberStream *js, const gchar *jid) { -#if GLIB_CHECK_VERSION(2,4,0) return js->sessions != NULL ? g_hash_table_find(js->sessions, find_by_jid_ghr, (gpointer)jid) : NULL; -#else - struct session_find_jid data; - - if (js->sessions == NULL) - return NULL; - - data.jid = jid; - data.ret = NULL; - data.use_bare = g_utf8_strchr(jid, -1, '/') == NULL; - - g_hash_table_foreach(js->sessions, find_by_jid_ghr, &data); - return data.ret; -#endif } static xmlnode * |