Esempio n. 1
0
static void InitServices()
{
	// register sounds

	SkinAddNewSoundExT("AlertReminder", LPGENT("Alerts"), LPGENT("Reminder triggered"));
	SkinAddNewSoundExT("AlertReminder2", LPGENT("Alerts"), LPGENT("Reminder triggered (Alternative 1)"));
	SkinAddNewSoundExT("AlertReminder3", LPGENT("Alerts"), LPGENT("Reminder triggered (Alternative 2)"));

	// register menu command services

	CreateServiceFunction(MODULENAME"/MenuCommandAddNew",PluginMenuCommandAddNew);
	CreateServiceFunction(MODULENAME"/MenuCommandShowHide",PluginMenuCommandShowHide);
	CreateServiceFunction(MODULENAME"/MenuCommandViewNotes",PluginMenuCommandViewNotes);
	CreateServiceFunction(MODULENAME"/MenuCommandDeleteAll",PluginMenuCommandDeleteAll);
	CreateServiceFunction(MODULENAME"/MenuCommandBringAllFront",PluginMenuCommandAllBringFront);

	//

	CreateServiceFunction(MODULENAME"/MenuCommandNewReminder",PluginMenuCommandNewReminder);
	CreateServiceFunction(MODULENAME"/MenuCommandViewReminders",PluginMenuCommandViewReminders);
	CreateServiceFunction(MODULENAME"/MenuCommandDeleteReminders",PluginMenuCommandDeleteReminders);

	// register misc

	CreateServiceFunction(MODULENAME"/OpenTriggeredReminder",OpenTriggeredReminder);
}
Esempio n. 2
0
FacebookProto::FacebookProto(const char* proto_name,const TCHAR* username)
{
	m_iVersion = 2;
	m_szProtoName  = mir_strdup( proto_name );
	m_szModuleName = mir_strdup( proto_name );
	m_tszUserName  = mir_tstrdup( username );

	facy.parent = this;

	signon_lock_ = CreateMutex( NULL, FALSE, NULL );
	avatar_lock_ = CreateMutex( NULL, FALSE, NULL );
	log_lock_ = CreateMutex( NULL, FALSE, NULL );
	update_loop_lock_ = CreateEvent( NULL, FALSE, FALSE, NULL);
	facy.buddies_lock_ = CreateMutex( NULL, FALSE, NULL );
	facy.send_message_lock_ = CreateMutex( NULL, FALSE, NULL );
	facy.fcb_conn_lock_ = CreateMutex( NULL, FALSE, NULL );

	CreateProtoService(m_szModuleName, PS_CREATEACCMGRUI, &FacebookProto::SvcCreateAccMgrUI, this);
	CreateProtoService(m_szModuleName, PS_GETMYAWAYMSG,   &FacebookProto::GetMyAwayMsg,      this);
	CreateProtoService(m_szModuleName, PS_GETMYAVATAR,    &FacebookProto::GetMyAvatar,       this);
	CreateProtoService(m_szModuleName, PS_GETAVATARINFO,  &FacebookProto::GetAvatarInfo,     this);
	CreateProtoService(m_szModuleName, PS_GETAVATARCAPS,  &FacebookProto::GetAvatarCaps,     this);

	CreateProtoService(m_szModuleName, PS_JOINCHAT,  &FacebookProto::OnJoinChat,  this);
	CreateProtoService(m_szModuleName, PS_LEAVECHAT, &FacebookProto::OnLeaveChat, this);

	HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU,	&FacebookProto::OnBuildStatusMenu,	this);
	HookProtoEvent(ME_OPT_INITIALISE,			&FacebookProto::OnOptionsInit,		this);
	HookProtoEvent(ME_GC_EVENT,					&FacebookProto::OnChatOutgoing,		this);
	HookProtoEvent(ME_IDLE_CHANGED,             &FacebookProto::OnIdleChanged,		this);

	// Create standard network connection
	TCHAR descr[512];
	NETLIBUSER nlu = {sizeof(nlu)};
	nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
	nlu.szSettingsModule = m_szModuleName;
	char module[512];
	mir_snprintf(module,SIZEOF(module),"%sAv",m_szModuleName);
	nlu.szSettingsModule = module;
	mir_sntprintf(descr,SIZEOF(descr),TranslateT("%s server connection"),m_tszUserName);
	nlu.ptszDescriptiveName = descr;
	m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
	if(m_hNetlibUser == NULL)
		MessageBox(NULL,TranslateT("Unable to get Netlib connection for Facebook"),m_tszUserName,MB_OK);

	facy.set_handle(m_hNetlibUser);

	SkinAddNewSoundExT( "Notification", m_tszUserName, LPGENT( "Notification" ) );
	SkinAddNewSoundExT( "NewsFeed", m_tszUserName, LPGENT( "News Feed" ) );
	SkinAddNewSoundExT( "OtherEvent", m_tszUserName, LPGENT( "Other Event" ) );

	char *profile = Utils_ReplaceVars("%miranda_avatarcache%");
	def_avatar_folder_ = std::string(profile)+"\\"+m_szModuleName;
	mir_free(profile);
	hAvatarFolder_ = FoldersRegisterCustomPath(m_szModuleName, "Avatars", def_avatar_folder_.c_str());

	// Set all contacts offline -- in case we crashed
	SetAllContactStatuses( ID_STATUS_OFFLINE );
}
Esempio n. 3
0
extern "C" int __declspec(dllexport) Load(void) 
{
	mir_getLP(&pluginInfoEx);

	// initialize global variables
	InitVar();

	// load options and set defaults
	LoadOptions();

	// reset the weather data at startup for individual contacts
	EraseAllInfo();

	// load weather update data
	LoadWIData(true);

	// set status to online if "Do not display weather condition as protocol status" is enabled
	old_status = status = ID_STATUS_OFFLINE;

	// add an event on weather update and error
	hHookWeatherUpdated = CreateHookableEvent(ME_WEATHER_UPDATED);
	hHookWeatherError = CreateHookableEvent(ME_WEATHER_ERROR);

	// initialize options and network
	HookEvent(ME_OPT_INITIALISE, OptInit);
	HookEvent(ME_SYSTEM_MODULESLOADED, WeatherInit);
	HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
	HookEvent(ME_CLIST_DOUBLECLICKED, BriefInfo);
	HookEvent(ME_WEATHER_UPDATED, WeatherPopup);
	HookEvent(ME_WEATHER_ERROR, WeatherError);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, WeatherShutdown);
	HookEvent(ME_CLIST_PREBUILDCONTACTMENU, BuildContactMenu);

	hDataWindowList = WindowList_Create();
	hWindowList = WindowList_Create();

	hUpdateMutex = CreateMutex(NULL, FALSE, NULL);

	// register weather protocol
	PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
	pd.szName = WEATHERPROTONAME;
	pd.type = (opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL;
	CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);

	// initialize weather protocol services
	InitServices();

	// add sound event
	SkinAddNewSoundExT("weatherupdated", _T(WEATHERPROTONAME), LPGENT("Weather Condition Changed"));
	SkinAddNewSoundExT("weatheralert", _T(WEATHERPROTONAME), LPGENT("Weather Alert Issued"));

	// window needed for popup commands
	TCHAR SvcFunc[100];
	mir_sntprintf(SvcFunc, SIZEOF(SvcFunc), _T("%s__PopupWindow"), _T(WEATHERPROTONAME));
	hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT,
		CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
	SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
	return 0; 
}
Esempio n. 4
0
void Nudge_AddAccount(PROTOACCOUNT *proto)
{
	char str[MAXMODULELABELLENGTH + 10];
	mir_snprintf(str, "%s/Nudge", proto->szModuleName);
	HANDLE hevent = HookEvent(str, NudgeReceived);
	if (hevent == NULL)
		return;

	nProtocol++;

	// Add a specific sound per protocol
	CNudgeElement *p = new CNudgeElement();
	mir_snprintf(p->NudgeSoundname, "%s: Nudge", proto->szModuleName);

	strcpy_s(p->ProtocolName, proto->szModuleName);
	_tcscpy_s(p->AccountName, proto->tszAccountName);

	p->Load();
	p->hEvent = hevent;

	TCHAR soundDesc[MAXMODULELABELLENGTH + 10];
	mir_sntprintf(soundDesc, LPGENT("Nudge for %s"), proto->tszAccountName);
	SkinAddNewSoundExT(p->NudgeSoundname, LPGENT("Nudge"), soundDesc);

	arNudges.insert(p);
}
Esempio n. 5
0
int ModulesLoaded(WPARAM, LPARAM)
{
	HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);

	// add sounds support
	SkinAddNewSoundExT("buddyExpectatorReturn", LPGENT("BuddyExpectator"), LPGENT("Contact returned"));
	SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENT("BuddyExpectator"), LPGENT("Contact still absent"));
	SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENT("BuddyExpectator"), LPGENT("Miss you event"));
	SkinAddNewSoundExT("buddyExpectatorHide", LPGENT("BuddyExpectator"), LPGENT("Hide contact event"));

	timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours

	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded2);

	////////////////////////////////////////////////////////////////////////////

	if (options.enableMissYou) {
		HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);

		CMenuItem mi;
		SET_UID(mi, 0xc48c31d4, 0x56b6, 0x48c6, 0x8e, 0xe9, 0xe6, 0x57, 0xb5, 0x80, 0xb8, 0x1e);
		mi.flags = CMIF_TCHAR;
		mi.hIcolibItem = iconList[2].hIcolib;
		mi.position = 200000;
		mi.name.t = LPGENT("Enable Miss You");
		mi.pszService = "BuddyExpectator/actionMissYouClick";
		hContactMenu = Menu_AddContactMenuItem(&mi);
	}

	missyouactions[0].cbSize = sizeof(POPUPACTION);
	missyouactions[0].lchIcon = IcoLib_GetIcon("disabled_icon");
	mir_strcpy(missyouactions[0].lpzTitle, LPGEN("Disable Miss You"));
	missyouactions[0].wParam = missyouactions[0].lParam = 1;

	hideactions[0].cbSize = sizeof(POPUPACTION);
	hideactions[0].lchIcon = IcoLib_GetIcon("hide_icon");
	mir_strcpy(hideactions[0].lpzTitle, LPGEN("Hide contact"));
	hideactions[0].wParam = hideactions[0].lParam = 2;

	hideactions[1].cbSize = sizeof(POPUPACTION);
	hideactions[1].lchIcon = IcoLib_GetIcon("neverhide_icon");
	mir_strcpy(hideactions[1].lpzTitle, LPGEN("Never hide this contact"));
	hideactions[1].wParam = hideactions[1].lParam = 3;

	return 0;
}
Esempio n. 6
0
OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username)
{
	m_iVersion = 2;
	m_szProtoName  = mir_strdup( proto_name );
	m_szModuleName = mir_strdup( proto_name );
	m_tszUserName  = mir_tstrdup( username );

	this->facy.parent = this;

	this->signon_lock_ = CreateMutex( NULL, FALSE, NULL );
	this->log_lock_ = CreateMutex( NULL, FALSE, NULL );
	this->facy.send_message_lock_ = CreateMutex( NULL, FALSE, NULL );
	this->facy.connection_lock_ = CreateMutex( NULL, FALSE, NULL );

	// Group chats
	CreateProtoService(m_szModuleName, PS_JOINCHAT, &OmegleProto::OnJoinChat, this);
	CreateProtoService(m_szModuleName, PS_LEAVECHAT, &OmegleProto::OnLeaveChat, this);

	CreateProtoService(m_szModuleName, PS_CREATEACCMGRUI, &OmegleProto::SvcCreateAccMgrUI, this);
	
	HookProtoEvent(ME_OPT_INITIALISE, &OmegleProto::OnOptionsInit, this);
	HookProtoEvent(ME_GC_EVENT, &OmegleProto::OnChatEvent, this);

	// Create standard network connection
	TCHAR descr[512];
	NETLIBUSER nlu = {sizeof(nlu)};
	nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
	nlu.szSettingsModule = m_szModuleName;
	char module[512];
	mir_snprintf(module,SIZEOF(module),"%sAv",m_szModuleName);
	nlu.szSettingsModule = module;
	mir_sntprintf(descr,SIZEOF(descr),TranslateT("%s server connection"),m_tszUserName);
	nlu.ptszDescriptiveName = descr;
	m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
	if(m_hNetlibUser == NULL)
		MessageBox(NULL,TranslateT("Unable to get Netlib connection for Omegle"),m_tszUserName,MB_OK);

	facy.set_handle(m_hNetlibUser);

	SkinAddNewSoundExT( "StrangerTyp", m_tszUserName, LPGENT( "Stranger typing" ) );
	SkinAddNewSoundExT( "StrangerTypStop", m_tszUserName, LPGENT( "Stranger stopped typing" ) );
	SkinAddNewSoundExT( "StrangerChange", m_tszUserName, LPGENT( "Changing stranger" ) );
}
Esempio n. 7
0
OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) :
PROTO<OmegleProto>(proto_name, username)
{
	this->facy.parent = this;

	this->signon_lock_ = CreateMutex(NULL, FALSE, NULL);
	this->log_lock_ = CreateMutex(NULL, FALSE, NULL);
	this->facy.send_message_lock_ = CreateMutex(NULL, FALSE, NULL);
	this->facy.connection_lock_ = CreateMutex(NULL, FALSE, NULL);
	this->events_loop_lock_ = CreateMutex(NULL, FALSE, NULL);

	// Group chats
	CreateProtoService(PS_JOINCHAT, &OmegleProto::OnJoinChat);
	CreateProtoService(PS_LEAVECHAT, &OmegleProto::OnLeaveChat);

	CreateProtoService(PS_CREATEACCMGRUI, &OmegleProto::SvcCreateAccMgrUI);

	HookProtoEvent(ME_OPT_INITIALISE, &OmegleProto::OnOptionsInit);
	HookProtoEvent(ME_GC_EVENT, &OmegleProto::OnChatEvent);

	// Create standard network connection
	TCHAR descr[512];
	NETLIBUSER nlu = { sizeof(nlu) };
	nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
	nlu.szSettingsModule = m_szModuleName;
	mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
	nlu.ptszDescriptiveName = descr;
	m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
	if (m_hNetlibUser == NULL) {
		TCHAR error[200];
		mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
		MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
	}

	facy.set_handle(m_hNetlibUser);

	SkinAddNewSoundExT("StrangerTyp", m_tszUserName, LPGENT("Stranger is typing"));
	SkinAddNewSoundExT("StrangerTypStop", m_tszUserName, LPGENT("Stranger stopped typing"));
	SkinAddNewSoundExT("StrangerChange", m_tszUserName, LPGENT("Changing stranger"));
	SkinAddNewSoundExT("StrangerMessage", m_tszUserName, LPGENT("Receive message"));
}
Esempio n. 8
0
/**
 * Sounds initialization
 */
void FacebookProto::InitSounds()
{
	SkinAddNewSoundExT("Notification", m_tszUserName, LPGENT("Notification"));
	SkinAddNewSoundExT("NewsFeed", m_tszUserName, LPGENT("Newsfeed event"));
	SkinAddNewSoundExT("OtherEvent", m_tszUserName, LPGENT("Other event"));
	SkinAddNewSoundExT("Friendship", m_tszUserName, LPGENT("Friendship event"));
	SkinAddNewSoundExT("Ticker", m_tszUserName, LPGENT("Ticker event"));
	SkinAddNewSoundExT("OnThisDay", m_tszUserName, LPGENT("On this day event"));
}
Esempio n. 9
0
void InitShutdownSvc(void)
{
	/* Shutdown Dialog */
	hwndShutdownDlg = NULL;
	SkinAddNewSoundExT("AutoShutdown_Countdown", LPGENT("Alerts"), LPGENT("Automatic Shutdown Countdown"));

	/* Events */
	hEventOkToShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_OKTOSHUTDOWN);
	hEventShutdown = CreateHookableEvent(ME_AUTOSHUTDOWN_SHUTDOWN);

	/* Services */
	CreateServiceFunction(MS_AUTOSHUTDOWN_SHUTDOWN, ServiceShutdown);
	CreateServiceFunction(MS_AUTOSHUTDOWN_ISTYPEENABLED, ServiceIsTypeEnabled);
	CreateServiceFunction(MS_AUTOSHUTDOWN_GETTYPEDESCRIPTION, ServiceGetTypeDescription);
}
Esempio n. 10
0
CYahooProto::CYahooProto( const char* aProtoName, const TCHAR* aUserName ) :
	PROTO<CYahooProto>(aProtoName, aUserName),
	m_bLoggedIn( FALSE ),
	poll_loop( 0),
	m_chatrooms(3, ChatRoom::compare)
{
	m_connections = NULL;
	m_connection_tags = 0;

	logoff_buddies();

	SkinAddNewSoundExT("mail", m_tszUserName, LPGENT("New E-mail available in Inbox"));

	LoadYahooServices();
	IconsInit();
}
Esempio n. 11
0
void InitSelfSounds()
{
	// initializing self sounds for protocols
	int protoCount = 0;
	PROTOACCOUNT** protos = 0;

	Proto_EnumAccounts(&protoCount, &protos);
	for (int i = 0; i < protoCount; i++) {
		for (int j = 0; j < _countof(selfSounds); j++) {
			char namebuf[128];
			mir_snprintf(namebuf, _countof(namebuf), "%s%s", protos[i]->szModuleName, selfSounds[j].szName);

			TCHAR infobuf[256];
			mir_sntprintf(infobuf, _countof(infobuf), _T("%s [%s]"), TranslateT("Self status"), protos[i]->tszAccountName);
			SkinAddNewSoundExT(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
		}
	}
}
Esempio n. 12
0
int CVkProto::OnModulesLoaded(WPARAM, LPARAM)
{
	// Chats
	GCREGISTER gcr = { sizeof(gcr) };
	gcr.ptszDispName = m_tszUserName;
	gcr.pszModule = m_szModuleName;
	gcr.nColors = _countof(sttColors);
	gcr.pColors = sttColors;
	CallServiceSync(MS_GC_REGISTER, NULL, (LPARAM)&gcr);
	CreateProtoService(PS_LEAVECHAT, &CVkProto::OnLeaveChat);
	CreateProtoService(PS_JOINCHAT, &CVkProto::OnJoinChat);
	HookProtoEvent(ME_GC_EVENT, &CVkProto::OnChatEvent);
	HookProtoEvent(ME_GC_BUILDMENU, &CVkProto::OnGcMenuHook);
	// Other hooks
	HookProtoEvent(ME_MSG_WINDOWEVENT, &CVkProto::OnProcessSrmmEvent);
	HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CVkProto::OnDbEventRead);
	HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CVkProto::OnDbSettingChanged);
	//Sounds
	SkinAddNewSoundExT("VKNewsFeed", m_tszUserName, LPGENT("VKontakte newsfeed & notification event"));

	InitPopups();
	InitMenus();
	return 0;
}
Esempio n. 13
0
extern "C" int __declspec(dllexport) Load()
{
	mir_getLP(&pluginInfoEx);
	mir_getCLI();

	HookEvent(ME_CLIST_DOUBLECLICKED, Doubleclick);
   
	hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
	hRichEd = LoadLibrary(_T("Msftedit.dll"));

	/*TIMERS*/
	if ((db_get_dw(NULL, MODULENAME, REFRESH_KEY, TIME) != 0)) {  
		timerId = SetTimer(NULL, 0, ((db_get_dw(NULL, MODULENAME, REFRESH_KEY, TIME)) * MINUTE), timerfunc);
		db_set_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0); 
		Countdown = SetTimer(NULL, 0, MINUTE, Countdownfunc);
	}

	InitialiseGlobals();

	// register netlib handle
   char tempNdesc[50];
	mir_snprintf(tempNdesc, _countof(tempNdesc), "%s connection settings", MODULENAME);

	NETLIBUSER nlu = { sizeof(nlu) };
   nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
   nlu.szSettingsModule = MODULENAME;
   nlu.szDescriptiveName = tempNdesc;
   hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) & nlu);

	// register webview protocol
	PROTOCOLDESCRIPTOR pd = { 0 };
	pd.cbSize = sizeof(pd);
	pd.szName = MODULENAME;
	pd.type = PROTOTYPE_PROTOCOL;
	Proto_RegisterModule(&pd);

	//protocol services
	InitServices();

	//add sound event to options
	SkinAddNewSoundExT("webviewalert", _T(MODULENAME), LPGENT("Alert event"));

	//value is 1 if menu is disabled
	db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1);

	CMenuItem mi;
	mi.flags = CMIF_TCHAR;
	if ( db_get_b(NULL, MODULENAME, MENU_OFF, 0)) {
		//value is 0 if menu is enabled
		db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 0);

		/*DISABLE WEBVIEW*/
		CreateServiceFunction("DisableWebview", AutoUpdateMCmd);

		mi.root = Menu_CreateRoot(MO_MAIN, _T(MODULENAME), 20200001);
		mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
		if (db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
			mi.name.t = LPGENT("Auto update disabled");
		else
			mi.name.t = LPGENT("Auto update enabled"); 

		mi.pszService = "DisableWebview";
		hMenuItem1 = Menu_AddMainMenuItem(&mi);

		// Update all webview contacts
		CreateServiceFunction("UpdateAll", UpdateAllMenuCommand);
		mi.position = 500090002;
		mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
		mi.name.t = LPGENT("Update all Webview sites");
		mi.pszService = "UpdateAll";
		Menu_AddMainMenuItem(&mi);

		// Mark All Webview Sites As Read
		CreateServiceFunction("MarkAllSitesRead", MarkAllReadMenuCommand);
		mi.position = 500090099;
		mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_MARKALLREAD));
		mi.name.t = LPGENT("Mark all Webview sites as read");
		mi.pszService = "MarkAllSitesRead";
		Menu_AddMainMenuItem(&mi);

		// open cache directory
		CreateServiceFunction("OpenCacheFolder", OpenCacheDir);
		mi.position = 500090099;
		mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_FOLDER));
		mi.name.t = LPGENT("Open cache folder");
		mi.pszService = "OpenCacheFolder";
		Menu_AddMainMenuItem(&mi);

		// Countdown test
		CreateServiceFunction("Countdown", CountdownMenuCommand);
		mi.flags |= CMIF_KEEPUNTRANSLATED;
		TCHAR countername[100];
		mir_sntprintf(countername, _countof(countername), TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
		mi.position = 600090099;
		mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
		mi.name.t = countername;
		mi.pszService = "Countdown";
		hMenuItemCountdown = Menu_AddMainMenuItem(&mi);
	}

	// contact menu
	mi.flags = CMIF_TCHAR;

	CreateServiceFunction("Open web page", WebsiteMenuCommand);
	mi.position = 100;
	mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_URL));
	mi.pszService = "Open web page";
	mi.name.t = LPGENT("Open web page");
	Menu_AddContactMenuItem(&mi, MODULENAME);

	CreateServiceFunction("OpenClose Window", DataWndMenuCommand);
	mi.pszService = "OpenClose Window";
	mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SHOW_HIDE));
	mi.name.t = LPGENT("Open/Close window");
	Menu_AddContactMenuItem(&mi, MODULENAME);

	mi.position = 2222220;
	mi.pszService = "UpdateData";
	mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATE));
	mi.name.t = LPGENT("Update data");
	Menu_AddContactMenuItem(&mi, MODULENAME);

	CreateServiceFunction("ContactOptions", CntOptionsMenuCommand);
	mi.pszService = "ContactOptions";
	mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_OPTIONS));
	mi.name.t = LPGENT("Contact options");
	Menu_AddContactMenuItem(&mi, MODULENAME);

	CreateServiceFunction("ContactAlertOpts", CntAlertMenuCommand);
	mi.pszService = "ContactAlertOpts";
	mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ALERT));
	mi.name.t = LPGENT("Contact alert options");
	Menu_AddContactMenuItem(&mi, MODULENAME);

	CreateServiceFunction("PingWebsite", PingWebsiteMenuCommand);
	mi.pszService = "PingWebsite";
	mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_PING));
	mi.name.t = LPGENT("Ping web site");
	Menu_AddContactMenuItem(&mi, MODULENAME);

	CreateServiceFunction("StopDataProcessing", StpPrcssMenuCommand);
	mi.pszService = "StopDataProcessing";
	mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_STOP));
	mi.name.t = LPGENT("Stop data processing");
	Menu_AddContactMenuItem(&mi, MODULENAME);

	hWindowList = WindowList_Create();

	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, DBSettingChanged);
	HookEvent(ME_DB_CONTACT_DELETED, SiteDeleted);

	db_set_b(NULL, MODULENAME, HAS_CRASHED_KEY, 1);
	return 0;
}
Esempio n. 14
0
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
	pluginLink=link;

	if(mir_getMMI(&mmi))
	{
		MessageBox(NULL,_T("Avatar History"),_T("Miranda Memory manager not initialized, plugin cannot load.\nPlease update Miranda IM to the latest version."),MB_OK | MB_TOPMOST);
		return 1;
	}
	if(mir_getUTFI(&utfi))
	{
		MessageBox(NULL,_T("Avatar History"),_T("Miranda UTF8 interface not initialized, plugin cannot load.\nPlease update Miranda IM to the latest version."),MB_OK | MB_TOPMOST);
		return 1;
	}
	mir_getLP(&pluginInfo);

	// Is first run?
	if (DBGetContactSettingByte(NULL, MODULE_NAME, "FirstRun", 1))
	{
		// Show dialog
		int ret = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FIRST_RUN), NULL, FirstRunDlgProc, 0);
		if (ret == 0)
			return -1;

		// Write settings

		DBWriteContactSettingByte(NULL, MODULE_NAME, "LogToDisk", 1);

		if (ret == IDC_MIR_SAME)
			DBWriteContactSettingByte(NULL, MODULE_NAME, "LogKeepSameFolder", 1);
		else
			DBWriteContactSettingByte(NULL, MODULE_NAME, "LogKeepSameFolder", 0);

		if (ret == IDC_MIR_SHORT || ret == IDC_SHORT || ret == IDC_DUP)
			DBWriteContactSettingByte(NULL, MODULE_NAME, "LogPerContactFolders", 1);
		else
			DBWriteContactSettingByte(NULL, MODULE_NAME, "LogPerContactFolders", 0);

		if (ret == IDC_DUP)
			DBWriteContactSettingByte(NULL, MODULE_NAME, "StoreAsHash", 0);
		else
			DBWriteContactSettingByte(NULL, MODULE_NAME, "StoreAsHash", 1);

		if (ret == IDC_MIR_SAME || ret == IDC_MIR_PROTO || ret == IDC_MIR_SHORT)
			DBWriteContactSettingByte(NULL, MODULE_NAME, "LogToHistory", 1);
		else
			DBWriteContactSettingByte(NULL, MODULE_NAME, "LogToHistory", 0);

		DBWriteContactSettingByte(NULL, MODULE_NAME, "FirstRun", 0);
	}

	LoadOptions();

	hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
	hHooks[1] = HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
	hHooks[3] = HookEvent(ME_OPT_INITIALISE, OptInit);
	hHooks[4] = HookEvent(ME_SKIN2_ICONSCHANGED, IcoLibIconsChanged);
	hHooks[5] = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu);

	hServices[0] = CreateServiceFunction(MS_AVATARHISTORY_ENABLED, IsEnabled);
	hServices[1] = CreateServiceFunction(MS_AVATARHISTORY_GET_CACHED_AVATAR, GetCachedAvatar);

	if(CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath) != 0)
		_tcscpy(profilePath, _T(".")); // Failed, use current dir

	SkinAddNewSoundExT("avatar_changed",LPGENT("Avatar History"),LPGENT("Contact changed avatar"));
	SkinAddNewSoundExT("avatar_removed",LPGENT("Avatar History"),LPGENT("Contact removed avatar"));

	hAvatarWindowsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);

	SetupIcoLib();
	InitMenuItem();

	return 0;
}
Esempio n. 15
0
CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
	contList(10, CompareLists),
	grpList(10, CompareId),
	sttThreads(10, PtrKeySortT),
	sessionList(10, PtrKeySortT),
	dcList(10, PtrKeySortT),
	msgQueueList(1),
	msgCache(5, CompareId)
{
	char path[MAX_PATH];

	m_iVersion = 2;
	m_tszUserName = mir_tstrdup(aUserName);
	m_szModuleName = mir_strdup(aProtoName);
	m_szProtoName = mir_strdup(aProtoName);
	_strlwr(m_szProtoName);
	m_szProtoName[0] = (char)toupper(m_szProtoName[0]);

	mir_snprintf(path, sizeof(path), "%s/Status", m_szModuleName);
	MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);

	mir_snprintf(path, sizeof(path), "%s/IdleTS", m_szModuleName);
	MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);

	mir_snprintf(path, sizeof(path), "%s/p2pMsgId", m_szModuleName);
	MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);

	mir_snprintf(path, sizeof(path), "%s/MobileEnabled", m_szModuleName);
	MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);

	mir_snprintf(path, sizeof(path), "%s/MobileAllowed", m_szModuleName);
	MSN_CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)path);

	// Protocol services and events...
	hMSNNudge = CreateProtoEvent("/Nudge");

	CreateProtoService(PS_CREATEACCMGRUI,        &CMsnProto::SvcCreateAccMgrUI);

	CreateProtoService(PS_GETAVATARINFOT,        &CMsnProto::GetAvatarInfo);
	CreateProtoService(PS_GETMYAWAYMSG,          &CMsnProto::GetMyAwayMsg);

	CreateProtoService(PS_LEAVECHAT,             &CMsnProto::OnLeaveChat);

	CreateProtoService(PS_GETMYAVATART,          &CMsnProto::GetAvatar);
	CreateProtoService(PS_SETMYAVATART,          &CMsnProto::SetAvatar);
	CreateProtoService(PS_GETAVATARCAPS,         &CMsnProto::GetAvatarCaps);

	CreateProtoService(PS_GET_LISTENINGTO,       &CMsnProto::GetCurrentMedia);
	CreateProtoService(PS_SET_LISTENINGTO,       &CMsnProto::SetCurrentMedia);

	CreateProtoService(PS_SETMYNICKNAME,         &CMsnProto::SetNickName);
	CreateProtoService(MSN_SEND_NUDGE,           &CMsnProto::SendNudge);

	CreateProtoService(MSN_GETUNREAD_EMAILCOUNT, &CMsnProto::GetUnreadEmailCount);

	// service to get from protocol chat buddy info
//	CreateProtoService(MS_GC_PROTO_GETTOOLTIPTEXT, &CMsnProto::GCGetToolTipText);

	HookProtoEvent(ME_MSG_WINDOWPOPUP,           &CMsnProto::OnWindowPopup);
//	HookProtoEvent(ME_MSG_WINDOWEVENT,           &CMsnProto::OnWindowEvent);
	HookProtoEvent(ME_CLIST_GROUPCHANGE,         &CMsnProto::OnGroupChange);
	HookProtoEvent(ME_OPT_INITIALISE,            &CMsnProto::OnOptionsInit);
	HookProtoEvent(ME_CLIST_DOUBLECLICKED,       &CMsnProto::OnContactDoubleClicked);
	
	LoadOptions();

	HANDLE hContact = (HANDLE)MSN_CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
	while (hContact != NULL) 
	{
		if (MSN_IsMyContact(hContact))
		{
			deleteSetting(hContact, "Status");
			deleteSetting(hContact, "IdleTS");
			deleteSetting(hContact, "p2pMsgId");
			deleteSetting(hContact, "AccList");
//			DBDeleteContactSetting(hContact, "CList", "StatusMsg");
		}
		hContact = (HANDLE)MSN_CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0);
	}
	deleteSetting(NULL, "MobileEnabled");
	deleteSetting(NULL, "MobileAllowed");

	if (getStaticString(NULL, "LoginServer", path, sizeof(path)) == 0 &&
		(strcmp(path, MSN_DEFAULT_LOGIN_SERVER) == 0 ||
		strcmp(path, MSN_DEFAULT_GATEWAY) == 0))
		deleteSetting(NULL, "LoginServer");

	if (MyOptions.SlowSend)
	{
		if (DBGetContactSettingDword(NULL, "SRMsg", "MessageTimeout", 10000) < 60000) 
			DBWriteContactSettingDword(NULL, "SRMsg", "MessageTimeout", 60000);
		if (DBGetContactSettingDword(NULL, "SRMM", "MessageTimeout", 10000) < 60000) 
			DBWriteContactSettingDword(NULL, "SRMM", "MessageTimeout", 60000);
	}

	mailsoundname = (char*)mir_alloc(64);
	mir_snprintf(mailsoundname, 64, "%s:Hotmail", m_szModuleName);
	SkinAddNewSoundExT(mailsoundname, m_tszUserName, LPGENT("Live Mail"));

	alertsoundname = (char*)mir_alloc(64);
	mir_snprintf(alertsoundname, 64, "%s:Alerts", m_szModuleName);
	SkinAddNewSoundExT(alertsoundname, m_tszUserName, LPGENT("Live Alert"));

	m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;

	MSN_InitThreads();
	Lists_Init();
	MsgQueue_Init();
	P2pSessions_Init();
	InitCustomFolders();

	TCHAR szBuffer[MAX_PATH]; 
	char  szDbsettings[64];

	NETLIBUSER nlu1 = {0};
	nlu1.cbSize = sizeof(nlu1);
	nlu1.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
	nlu1.szSettingsModule = szDbsettings;
	nlu1.ptszDescriptiveName = szBuffer;

	mir_snprintf(szDbsettings, sizeof(szDbsettings), "%s_HTTPS", m_szModuleName);
	mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin HTTPS connections"), m_tszUserName);
	hNetlibUserHttps = (HANDLE)MSN_CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);

	NETLIBUSER nlu = {0};
	nlu.cbSize = sizeof(nlu);
	nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
	nlu.szSettingsModule = m_szModuleName;
	nlu.ptszDescriptiveName = szBuffer;

	nlu.szHttpGatewayUserAgent = (char*)MSN_USER_AGENT;
	nlu.pfnHttpGatewayInit = msn_httpGatewayInit;
	nlu.pfnHttpGatewayWrapSend = msn_httpGatewayWrapSend;
	nlu.pfnHttpGatewayUnwrapRecv = msn_httpGatewayUnwrapRecv;

	mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin connections"), m_tszUserName);
	hNetlibUser = (HANDLE)MSN_CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
}
Esempio n. 16
0
CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) :
	PROTO<CMsnProto>(aProtoName, aUserName),
	m_arContacts(10, CompareLists),
	m_arGroups(10, CompareId),
	m_arThreads(10, PtrKeySortT),
	m_arGCThreads(10, PtrKeySortT),
#ifdef OBSOLETE
	m_arSessions(10, PtrKeySortT),
	m_arDirect(10, PtrKeySortT),
#endif
	lsMessageQueue(1),
	lsAvatarQueue(1),
	msgCache(5, CompareId),
	authContactToken("authContact", "service::contacts.msn.com::MBI_SSL"),
	authStorageToken("authStorage", "service::storage.msn.com::MBI_SSL"),
	authSSLToken("authSSL", "service::ssl.live.com::MBI_SSL"),
	authSkypeComToken("authSkypeCom", "service::skype.com::MBI_SSL"),
	authStrToken("authStr", "service::chatservice.live.com::MBI_SSL", true),
	authSkypeToken("authSkype")
{
	db_set_resident(m_szModuleName, "IdleTS");
	db_set_resident(m_szModuleName, "p2pMsgId");
	db_set_resident(m_szModuleName, "MobileEnabled");
	db_set_resident(m_szModuleName, "MobileAllowed");

	// Initialize tokens
	authContactToken.Init(this);
	authStorageToken.Init(this);
	authSSLToken.Init(this);
	authSkypeComToken.Init(this);
	authStrToken.Init(this);
	authSkypeToken.Init(this);
	LoadAuthTokensDB();

	// Protocol services and events...

	CreateProtoService(PS_CREATEACCMGRUI, &CMsnProto::SvcCreateAccMgrUI);

	CreateProtoService(PS_GETAVATARINFO, &CMsnProto::GetAvatarInfo);
	CreateProtoService(PS_GETMYAWAYMSG, &CMsnProto::GetMyAwayMsg);

	CreateProtoService(PS_LEAVECHAT, &CMsnProto::OnLeaveChat);

	CreateProtoService(PS_GETMYAVATAR, &CMsnProto::GetAvatar);
	CreateProtoService(PS_SETMYAVATAR, &CMsnProto::SetAvatar);
	CreateProtoService(PS_GETAVATARCAPS, &CMsnProto::GetAvatarCaps);

	CreateProtoService(PS_SETMYNICKNAME, &CMsnProto::SetNickName);
#ifdef OBSOLETE
	CreateProtoService(PS_GET_LISTENINGTO, &CMsnProto::GetCurrentMedia);
	CreateProtoService(PS_SET_LISTENINGTO, &CMsnProto::SetCurrentMedia);

	MsgQueue_Init();
#endif

	hMSNNudge = CreateProtoEvent("/Nudge");
	CreateProtoService(PS_SEND_NUDGE, &CMsnProto::SendNudge);

	CreateProtoService(PS_GETUNREADEMAILCOUNT, &CMsnProto::GetUnreadEmailCount);

	// event hooks
	HookProtoEvent(ME_MSG_WINDOWPOPUP, &CMsnProto::OnWindowPopup);
	HookProtoEvent(ME_CLIST_GROUPCHANGE, &CMsnProto::OnGroupChange);
	HookProtoEvent(ME_OPT_INITIALISE, &CMsnProto::OnOptionsInit);
	HookProtoEvent(ME_CLIST_DOUBLECLICKED, &CMsnProto::OnContactDoubleClicked);

	LoadOptions();

	for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
		delSetting(hContact, "Status");
		delSetting(hContact, "IdleTS");
		delSetting(hContact, "p2pMsgId");
		delSetting(hContact, "AccList");
	}
	delSetting("MobileEnabled");
	delSetting("MobileAllowed");

	char path[MAX_PATH];
	if (db_get_static(NULL, m_szModuleName, "LoginServer", path, sizeof(path)) == 0 &&
		(mir_strcmp(path, MSN_DEFAULT_LOGIN_SERVER) == 0 ||
		mir_strcmp(path, MSN_DEFAULT_GATEWAY) == 0))
		delSetting("LoginServer");

	if (MyOptions.SlowSend) {
		if (db_get_dw(NULL, "SRMsg", "MessageTimeout", 10000) < 60000)
			db_set_dw(NULL, "SRMsg", "MessageTimeout", 60000);
		if (db_get_dw(NULL, "SRMM", "MessageTimeout", 10000) < 60000)
			db_set_dw(NULL, "SRMM", "MessageTimeout", 60000);
	}

	mailsoundname = (char*)mir_alloc(64);
	mir_snprintf(mailsoundname, 64, "%s:Hotmail", m_szModuleName);
	SkinAddNewSoundExT(mailsoundname, m_tszUserName, LPGENT("Live Mail"));

	alertsoundname = (char*)mir_alloc(64);
	mir_snprintf(alertsoundname, 64, "%s:Alerts", m_szModuleName);
	SkinAddNewSoundExT(alertsoundname, m_tszUserName, LPGENT("Live Alert"));

	AvatarQueue_Init();
	InitCustomFolders();

	TCHAR szBuffer[MAX_PATH];
	char  szDbsettings[64];

	NETLIBUSER nlu1 = { 0 };
	nlu1.cbSize = sizeof(nlu1);
	nlu1.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
	nlu1.szSettingsModule = szDbsettings;
	nlu1.ptszDescriptiveName = szBuffer;

	mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
	mir_sntprintf(szBuffer, TranslateT("%s plugin HTTPS connections"), m_tszUserName);
	hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);

	NETLIBUSER nlu = { 0 };
	nlu.cbSize = sizeof(nlu);
	nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
	nlu.szSettingsModule = m_szModuleName;
	nlu.ptszDescriptiveName = szBuffer;

	nlu.szHttpGatewayUserAgent = (char*)MSN_USER_AGENT;
	nlu.pfnHttpGatewayInit = msn_httpGatewayInit;
	nlu.pfnHttpGatewayWrapSend = msn_httpGatewayWrapSend;
	nlu.pfnHttpGatewayUnwrapRecv = msn_httpGatewayUnwrapRecv;

	mir_sntprintf(szBuffer, TranslateT("%s plugin connections"), m_tszUserName);
	m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);

	m_DisplayNameCache = NULL;
}
Esempio n. 17
0
int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
	HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
	HookEvent(ME_TTB_MODULELOADED, OnTopToolBarModuleLoaded);
	
	SkinAddNewSoundExT(BIRTHDAY_NEAR_SOUND, LPGENT("WhenWasIt"), LPGENT("Birthday near"));
	SkinAddNewSoundExT(BIRTHDAY_TODAY_SOUND, LPGENT("WhenWasIt"), LPGENT("Birthday today"));
	
	UpdateTimers();

	CLISTMENUITEM cl = { sizeof(cl) };
	cl.position = 10000000;
	cl.pszPopupName = LPGEN("Birthdays (When Was It)");

	cl.pszService = MS_WWI_CHECK_BIRTHDAYS;
	cl.icolibItem = hCheckMenu;
	cl.pszName = LPGEN("Check for birthdays");
	hmCheckBirthdays = Menu_AddMainMenuItem(&cl);
	
	cl.pszService = MS_WWI_LIST_SHOW;
	cl.pszName = LPGEN("Birthday list");
	cl.icolibItem = hListMenu;
	hmBirthdayList = Menu_AddMainMenuItem(&cl);
	
	cl.pszService = MS_WWI_REFRESH_USERDETAILS;
	cl.position = 10100000;
	cl.pszName = LPGEN("Refresh user details");
	cl.icolibItem = hRefreshUserDetails;
	hmRefreshDetails = Menu_AddMainMenuItem(&cl);
	
	cl.pszService = MS_WWI_IMPORT_BIRTHDAYS;
	cl.position = 10200000;
	cl.pszName = LPGEN("Import birthdays");
	cl.icolibItem = hImportBirthdays;
	hmImportBirthdays = Menu_AddMainMenuItem(&cl);
	
	cl.pszService = MS_WWI_EXPORT_BIRTHDAYS;
	cl.pszName = LPGEN("Export birthdays");
	cl.icolibItem = hExportBirthdays;
	hmExportBirthdays = Menu_AddMainMenuItem(&cl);
	
	cl.pszService = MS_WWI_ADD_BIRTHDAY;
	cl.position = 10000000;
	cl.icolibItem = hAddBirthdayContact;
	cl.pszName = LPGEN("Add/change user &birthday");
	hmAddChangeBirthday = Menu_AddContactMenuItem(&cl);

	// Register hotkeys
	HOTKEYDESC hotkey = { sizeof(hotkey) };
	hotkey.pszSection = LPGEN("Birthdays");

	hotkey.pszName = "wwi_birthday_list";
	hotkey.pszDescription = LPGEN("Birthday list");
	hotkey.pszService = MS_WWI_LIST_SHOW;
	Hotkey_Register(&hotkey);
		
	hotkey.pszName = "wwi_check_birthdays";
	hotkey.pszDescription = LPGEN("Check for birthdays");
	hotkey.pszService = MS_WWI_CHECK_BIRTHDAYS;
	Hotkey_Register(&hotkey);
	
	return 0;
}
Esempio n. 18
0
/**
 * Sounds initialization
 */
void FacebookProto::InitSounds()
{
	SkinAddNewSoundExT("Notification", m_tszUserName, LPGENT("Notification"));
	SkinAddNewSoundExT("NewsFeed", m_tszUserName, LPGENT("News Feed"));
	SkinAddNewSoundExT("OtherEvent", m_tszUserName, LPGENT("Other Event"));
}
Esempio n. 19
0
extern "C" __declspec(dllexport) int Load(void)
{
	mir_getLP(&pluginInfo);

	CoInitialize(NULL);

	// Is first run?
	if ( db_get_b(NULL, MODULE_NAME, "FirstRun", 1)) {
		// Show dialog
		int ret = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FIRST_RUN), NULL, FirstRunDlgProc, 0);
		if (ret == 0)
			return -1;

		// Write settings

		db_set_b(NULL, MODULE_NAME, "LogToDisk", 1);

		if (ret == IDC_MIR_SAME)
			db_set_b(NULL, MODULE_NAME, "LogKeepSameFolder", 1);
		else
			db_set_b(NULL, MODULE_NAME, "LogKeepSameFolder", 0);

		if (ret == IDC_MIR_SHORT || ret == IDC_SHORT || ret == IDC_DUP)
			db_set_b(NULL, MODULE_NAME, "LogPerContactFolders", 1);
		else
			db_set_b(NULL, MODULE_NAME, "LogPerContactFolders", 0);

		if (ret == IDC_DUP)
			db_set_b(NULL, MODULE_NAME, "StoreAsHash", 0);
		else
			db_set_b(NULL, MODULE_NAME, "StoreAsHash", 1);

		if (ret == IDC_MIR_SAME || ret == IDC_MIR_PROTO || ret == IDC_MIR_SHORT)
			db_set_b(NULL, MODULE_NAME, "LogToHistory", 1);
		else
			db_set_b(NULL, MODULE_NAME, "LogToHistory", 0);

		db_set_b(NULL, MODULE_NAME, "FirstRun", 0);
	}

	LoadOptions();

	HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
	HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
	HookEvent(ME_OPT_INITIALISE, OptInit);
	HookEvent(ME_SKIN2_ICONSCHANGED, IcoLibIconsChanged);
	HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu);

	CreateServiceFunction(MS_AVATARHISTORY_ENABLED, IsEnabled);
	CreateServiceFunction(MS_AVATARHISTORY_GET_CACHED_AVATAR, GetCachedAvatar);

	if (CallService(MS_DB_GETPROFILEPATHT, MAX_PATH, (LPARAM)profilePath) != 0)
		_tcscpy(profilePath, _T(".")); // Failed, use current dir

	SkinAddNewSoundExT("avatar_changed",LPGENT("Avatar History"),LPGENT("Contact changed avatar"));
	SkinAddNewSoundExT("avatar_removed",LPGENT("Avatar History"),LPGENT("Contact removed avatar"));

	hAvatarWindowsList = WindowList_Create();

	SetupIcoLib();
	InitMenuItem();
	return 0;
}