summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_events.cpp
blob: 9454085f55dda556d672d173a23f52ad9836020a (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
#include "stdafx.h"

int CToxProto::OnModulesLoaded(WPARAM, LPARAM)
{
	CToxProto::InitIcons();
	CToxProto::InitMenus();

	hProfileFolderPath = FoldersRegisterCustomPathT("Tox", "ProfilesFolder", MIRANDA_USERDATAT, TranslateT("Profiles folder"));

	if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE))
	{
		CreateServiceFunction(MODULE "/ParseUri", CToxProto::ParseToxUri);
		AssocMgr_AddNewUrlTypeT("tox:", TranslateT("Tox URI scheme"), g_hInstance, IDI_TOX, MODULE "/ParseUri", 0);
	}

	return 0;
}

void CToxProto::InitCustomDbEvents()
{
	DBEVENTTYPEDESCR dbEventType = { sizeof(dbEventType) };
	dbEventType.module = m_szModuleName;
	dbEventType.flags = DETF_HISTORY | DETF_MSGWINDOW;

	dbEventType.eventType = DB_EVENT_ACTION;
	dbEventType.descr = Translate("Action");
	DbEvent_RegisterType(&dbEventType);

	dbEventType.eventType = DB_EVENT_CALL;
	dbEventType.descr = Translate("Call");
	dbEventType.eventIcon = GetIconHandle(IDI_AUDIO_START);
	DbEvent_RegisterType(&dbEventType);
}