comparison src/protocols/jabber/presence.c @ 10684:72a5babfa8b4

[gaim-migrate @ 12231] the cipher api that grim has been working on for ages is finally done!! big congrats and thanks to him!! lots of modified files in this commit. it builds here. moved the md5 files to src/protocols/oscar so that it continues to depend on nothing in gaim. everything else uses the new centralized cipher api. I'm not sure if src/md5.* needs to be removed or not, so I left it there. someone let me know or do it directly. someone check if these need to be added to potfiles.in and let there be much rejoicing! committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 11 Mar 2005 13:05:31 +0000
parents 6a618db0a404
children b256ce6b85b8
comparison
equal deleted inserted replaced
10683:e11f3e1599d4 10684:72a5babfa8b4
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 19 *
20 */ 20 */
21 #include "internal.h" 21 #include "internal.h"
22 22
23 #include "cipher.h"
23 #include "debug.h" 24 #include "debug.h"
24 #include "notify.h" 25 #include "notify.h"
25 #include "request.h" 26 #include "request.h"
26 #include "server.h" 27 #include "server.h"
27 #include "status.h" 28 #include "status.h"
30 #include "buddy.h" 31 #include "buddy.h"
31 #include "chat.h" 32 #include "chat.h"
32 #include "presence.h" 33 #include "presence.h"
33 #include "iq.h" 34 #include "iq.h"
34 #include "jutil.h" 35 #include "jutil.h"
35 #include "sha.h"
36 #include "xmlnode.h" 36 #include "xmlnode.h"
37 37
38 38
39 static void chats_send_presence_foreach(gpointer key, gpointer val, 39 static void chats_send_presence_foreach(gpointer key, gpointer val,
40 gpointer user_data) 40 gpointer user_data)
213 if((b = gaim_find_buddy(js->gc->account, from))) { 213 if((b = gaim_find_buddy(js->gc->account, from))) {
214 unsigned char hashval[20]; 214 unsigned char hashval[20];
215 char hash[41], *p; 215 char hash[41], *p;
216 int i; 216 int i;
217 217
218 shaBlock((unsigned char *)data, size, hashval); 218 gaim_cipher_digest_region("sha1", (guint8 *)data, size,
219 hashval, NULL);
219 p = hash; 220 p = hash;
220 for(i=0; i<20; i++, p+=2) 221 for(i=0; i<20; i++, p+=2)
221 snprintf(p, 3, "%02x", hashval[i]); 222 snprintf(p, 3, "%02x", hashval[i]);
222 gaim_blist_node_set_string((GaimBlistNode*)b, "avatar_hash", hash); 223 gaim_blist_node_set_string((GaimBlistNode*)b, "avatar_hash", hash);
223 } 224 }