gobjectification: c6a408f4: Fix XMPP compile.
qulogic at pidgin.im
qulogic at pidgin.im
Sat Dec 13 22:19:11 EST 2008
-----------------------------------------------------------------
Revision: c6a408f4d5f71ad3da71b39d9442b347fddf1f78
Ancestor: 4d19541a3185c246ad1b22649611afa17045ecf7
Author: qulogic at pidgin.im
Date: 2008-12-14T00:10:27
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/c6a408f4d5f71ad3da71b39d9442b347fddf1f78
Modified files:
libpurple/protocols/jabber/auth.c
libpurple/protocols/jabber/buddy.c
libpurple/protocols/jabber/jutil.c
ChangeLog:
Fix XMPP compile.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth.c 652f308adada2168feb2dd40b196813f86eb87ec
+++ libpurple/protocols/jabber/auth.c b1551da31996233ee06a03da30c08e4f3298a3ff
@@ -27,7 +27,6 @@
#include "hmaccipher.h"
#include "md5cipher.h"
#include "request.h"
-#include "sha1cipher.h"
#include "sslconn.h"
#include "util.h"
#include "xmlnode.h"
============================================================
--- libpurple/protocols/jabber/buddy.c 27caba96c7db8dc30ecc84651974fc408a4f1dba
+++ libpurple/protocols/jabber/buddy.c c3726f4508bd72610fe20b6a68c869444752f35c
@@ -23,7 +23,6 @@
#include "imgstore.h"
#include "prpl.h"
#include "notify.h"
-#include "sha1cipher.h"
#include "request.h"
#include "util.h"
#include "xmlnode.h"
@@ -1199,6 +1198,7 @@ static void jabber_vcard_parse(JabberStr
PurpleBuddy *b;
JabberBuddyInfo *jbi = data;
PurpleNotifyUserInfo *user_info;
+ PurpleAccount *account;
from = xmlnode_get_attrib(packet, "from");
id = xmlnode_get_attrib(packet, "id");
@@ -1219,7 +1219,8 @@ static void jabber_vcard_parse(JabberStr
user_info = jbi->user_info;
bare_jid = jabber_get_bare_jid(from);
- b = purple_find_buddy(purple_connection_get_account(js->gc), bare_jid);
+ account = purple_connection_get_account(js->gc);
+ b = purple_find_buddy(account, bare_jid);
if((vcard = xmlnode_get_child(packet, "vCard")) ||
(vcard = xmlnode_get_child_with_namespace(packet, "query", "vcard-temp"))) {
@@ -1399,7 +1400,7 @@ static void jabber_vcard_parse(JabberStr
purple_notify_user_info_add_pair(user_info, (photo ? _("Photo") : _("Logo")), img_text);
hash = jabber_calculate_data_sha1sum(data, size);
- purple_buddy_icons_set_for_user(js->gc->account, bare_jid,
+ purple_buddy_icons_set_for_user(account, bare_jid,
data, size, hash);
g_free(hash);
g_free(img_text);
============================================================
--- libpurple/protocols/jabber/jutil.c 586ab9851e177b03884c94ff3ff722884bd6d59a
+++ libpurple/protocols/jabber/jutil.c 1260019da4da38a70a7e725309470fd2e7dcefd9
@@ -20,10 +20,10 @@
*/
#include "internal.h"
#include "account.h"
-#include "cipher.h"
#include "conversation.h"
#include "debug.h"
#include "server.h"
+#include "sha1cipher.h"
#include "util.h"
#include "xmlnode.h"
@@ -242,24 +242,24 @@ jabber_calculate_data_sha1sum(gconstpoin
char *
jabber_calculate_data_sha1sum(gconstpointer data, size_t len)
{
- PurpleCipherContext *context;
+ PurpleCipher *sha1;
static gchar digest[41];
- context = purple_cipher_context_new_by_name("sha1", NULL);
- if (context == NULL)
+ sha1 = purple_sha1_cipher_new();
+ if (sha1 == NULL)
{
purple_debug_error("jabber", "Could not find sha1 cipher\n");
g_return_val_if_reached(NULL);
}
/* Hash the data */
- purple_cipher_context_append(context, data, len);
- if (!purple_cipher_context_digest_to_str(context, sizeof(digest), digest, NULL))
+ purple_cipher_append(sha1, data, len);
+ if (!purple_cipher_digest_to_str(sha1, sizeof(digest), digest, NULL))
{
purple_debug_error("jabber", "Failed to get SHA-1 digest.\n");
g_return_val_if_reached(NULL);
}
- purple_cipher_context_destroy(context);
+ g_object_unref(G_OBJECT(sha1));
return g_strdup(digest);
}
More information about the Commits
mailing list