diff options
Diffstat (limited to 'otr/dllmain.cpp')
-rw-r--r-- | otr/dllmain.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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];
|