summaryrefslogtreecommitdiff
path: root/plugins/MirOTR/src/options.h
blob: 440cc5f32af418712968183f732adb68de67dbaf (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef _OPTIONS_INC
#define _OPTIONS_INC

#define PRIVATE_KEY_FILENAME "otr.private_key"
#define FINGERPRINT_STORE_FILENAME "otr.fingerprints"
#define INSTAG_FILENAME "otr.instag"

extern char g_fingerprint_store_filename[MAX_PATH];
extern char g_private_key_filename[MAX_PATH];
extern char g_instag_filename[MAX_PATH];

#define CONTACT_DEFAULT_POLICY 	0xFFFF

typedef enum {ED_POP, ED_BAL, ED_MB} ErrorDisplay;

#define OPTIONS_PREFIXLEN 64
#define OPTIONS_DEFAULT_PREFIX "OTR: "
//#define OPTIONS_DEFAULT_PREFIX "?OTR? "

typedef struct {
	OtrlPolicy default_policy;
	ErrorDisplay err_method;
	bool prefix_messages;
	bool msg_inline;
	bool msg_popup;
	char prefix[OPTIONS_PREFIXLEN];

	bool delete_history;
	bool delete_systeminfo;
	bool autoshow_verify;
	
	bool end_offline, end_window_close;

	// temporary options
	bool bHavePopups, bHaveSecureIM, bHaveButtonsBar;

} Options;

extern Options options;

#define WMU_REFRESHLIST			(WM_USER + 241)
#define WMU_REFRESHPROTOLIST	(WM_USER + 242)
#define CONTACT_DEFAULT_POLICY 	0xFFFF

#include <map>
enum HTMLConvSetting {
	HTMLCONV_DISABLE,
	HTMLCONV_ENABLE
};
struct CONTACT_DATA {
	OtrlPolicy policy;
	int htmlconv;
};
typedef std::map<MCONTACT, CONTACT_DATA> ContactPolicyMap;
typedef enum {FPM_VERIFY, FPM_NOTRUST, FPM_DELETE } FPModify;
typedef std::map<Fingerprint*, FPModify> FPModifyMap;

int OptInit(WPARAM wParam, LPARAM lParam);

void LoadOptions();
void SaveOptions();
extern "C" int OpenOptions(WPARAM wParam, LPARAM lParam);
void InitOptions();
void DeinitOptions();

void ReadPrivkeyFiles();

static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);

#endif