From bd39a0d0ea64bec7b0025d80adb2d1ee8357bea6 Mon Sep 17 00:00:00 2001 From: sje Date: Fri, 16 Feb 2007 03:26:31 +0000 Subject: fix folders implementation show user fingerprints in options git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@122 4f64403b-2f21-0410-a795-97e2b3489a10 --- otr/dllmain.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'otr/dllmain.cpp') diff --git a/otr/dllmain.cpp b/otr/dllmain.cpp index 9fed847..4f19e47 100644 --- a/otr/dllmain.cpp +++ b/otr/dllmain.cpp @@ -74,6 +74,25 @@ HANDLE get_contact(const char *protocol, const char *disp_name) { return 0; } +bool GetFingerprint(HANDLE hContact, char buff[45]) { + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + char *uname = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0); + if(proto == 0 || uname == 0) return false; + + ConnContext *context = otrl_context_find(otr_user_state, uname, MODULE, proto, FALSE, 0, 0, 0); + if(context == 0) return false; + + if(context->active_fingerprint != 0) { + otrl_privkey_hash_to_human(buff, context->active_fingerprint->fingerprint); + return true; + } else if(context->fingerprint_root.next != 0){ + otrl_privkey_hash_to_human(buff, context->fingerprint_root.next->fingerprint); + return true; + } + + return false; +} + // wish there was an EVENTTYPE_INLINEMSG :) void ShowMessageInline(const HANDLE hContact, const char *msg) { char buff[1024]; -- cgit v1.2.3