pidgin: f01c542d: jabber: Add abstraction functions for ad...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Mon Nov 1 22:01:02 EDT 2010
----------------------------------------------------------------------
Revision: f01c542dc4811778ea9ae719b9b621eff9c6350b
Parent: 9a32a30182d8a7b5baa400810eac0db2795cc0c4
Author: eion at robbmob.com
Date: 10/31/10 23:40:14
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f01c542dc4811778ea9ae719b9b621eff9c6350b
Changelog:
jabber: Add abstraction functions for adding/removing auth mechs. Closes #12715
Slight modification from me to g_slist_remove. If it breaks, blame him.
Changes against parent 9a32a30182d8a7b5baa400810eac0db2795cc0c4
patched libpurple/protocols/jabber/auth.c
patched libpurple/protocols/jabber/auth.h
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth.c 8bbd39c21dc1df5ca43ebf50f24777174713981b
+++ libpurple/protocols/jabber/auth.c bec1a5293c6078d9a9cef298a53403f114b3e034
@@ -502,20 +502,30 @@ static gint compare_mech(gconstpointer a
return 0;
}
+void jabber_auth_add_mech(JabberSaslMech *mech)
+{
+ auth_mechs = g_slist_insert_sorted(auth_mechs, mech, compare_mech);
+}
+
+void jabber_auth_remove_mech(JabberSaslMech *mech)
+{
+ auth_mechs = g_slist_remove(auth_mechs, mech);
+}
+
void jabber_auth_init(void)
{
JabberSaslMech **tmp;
gint count, i;
- auth_mechs = g_slist_insert_sorted(auth_mechs, jabber_auth_get_plain_mech(), compare_mech);
- auth_mechs = g_slist_insert_sorted(auth_mechs, jabber_auth_get_digest_md5_mech(), compare_mech);
+ jabber_auth_add_mech(jabber_auth_get_plain_mech());
+ jabber_auth_add_mech(jabber_auth_get_digest_md5_mech());
#ifdef HAVE_CYRUS_SASL
- auth_mechs = g_slist_insert_sorted(auth_mechs, jabber_auth_get_cyrus_mech(), compare_mech);
+ jabber_auth_add_mech(jabber_auth_get_cyrus_mech());
#endif
tmp = jabber_auth_get_scram_mechs(&count);
for (i = 0; i < count; ++i)
- auth_mechs = g_slist_insert_sorted(auth_mechs, tmp[i], compare_mech);
+ jabber_auth_add_mech(tmp[i]);
}
void jabber_auth_uninit(void)
============================================================
--- libpurple/protocols/jabber/auth.h 6d90cee7211707669e36c0a25f003c8e0c7c5bc3
+++ libpurple/protocols/jabber/auth.h af67b277a074a6c9f7ad0527733a1ee9cfe07f6e
@@ -58,6 +58,9 @@ JabberSaslMech *jabber_auth_get_cyrus_me
JabberSaslMech *jabber_auth_get_cyrus_mech(void);
#endif
+void jabber_auth_add_mech(JabberSaslMech *);
+void jabber_auth_remove_mech(JabberSaslMech *);
+
void jabber_auth_init(void);
void jabber_auth_uninit(void);
More information about the Commits
mailing list