summaryrefslogtreecommitdiff
path: root/plugins/MirOTR/src/utils.h
blob: aec0e4a01afad530777e8193d0c5ebe4feca215b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#ifndef __HEADER_UTILS_H
#define __HEADER_UTILS_H
#include "stdafx.h"


void lib_cs_lock();

MCONTACT find_contact(const char* userid, const char* protocol);
ConnContext * otrl_context_find_miranda(OtrlUserState us, MCONTACT hContact);

typedef enum {
	TRUST_NOT_PRIVATE,
	TRUST_FINISHED,
	TRUST_UNVERIFIED,
	TRUST_PRIVATE
} TrustLevel;
TrustLevel otr_context_get_trust(ConnContext *context);
void VerifyFingerprint(ConnContext *context, bool verify);
void VerifyFingerprintMessage(ConnContext *context, bool verify);

void otrl_privkey_hash_to_humanT(wchar_t human[45], const unsigned char hash[20]);

char* contact_get_id(MCONTACT hContact, bool bNameOnError=true);
__inline const char* contact_get_account(MCONTACT hContact);
extern __inline const wchar_t* contact_get_nameT(MCONTACT hContact);

wchar_t* ProtoGetNickname(const char* proto);

void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MCONTACT hContact = NULL);
void ShowWarning(wchar_t* msg);
void ShowError(wchar_t* msg);
void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact = NULL);
void ShowWarningUtf(char* msg);
void ShowErrorUtf(char* msg);

void ShowMessageInline(const MCONTACT hContact, const wchar_t *msg);
void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg);

void ShowMessage(const MCONTACT hContact, const wchar_t *msg);
void ShowMessageUtf(const MCONTACT hContact, const char *msg);

const wchar_t *policy_to_string(OtrlPolicy policy);
OtrlPolicy policy_from_string(const wchar_t *polstring);

#endif