Example #1
0
INT_PTR __cdecl Service_GPGsetKey(WPARAM wParam, LPARAM lParam)
{
	bool del = true;
	if (bGPGloaded && bGPGkeyrings) {
		char szKeyID[128]; szKeyID[0] = '\0';
		gpg_select_keyid(GetForegroundWindow(), szKeyID);
		if (szKeyID[0]) {
			db_set_s(wParam, MODULENAME, "gpg", szKeyID);
			del = false;
		}
	}

	if (del)
		Service_GPGdelKey(wParam, lParam);
	else {
		pUinKey ptr = getUinKey(wParam);
		cpp_delete_context(ptr->cntx); ptr->cntx = 0;
	}
	ShowStatusIconNotify(wParam);
	return 1;
}
Example #2
0
INT_PTR __cdecl Service_GPGsetKey(WPARAM wParam, LPARAM lParam) {

    BOOL del = true;
    if(bGPGloaded && bGPGkeyrings) {
        char szKeyID[128];
        szKeyID[0]='\0';
        gpg_select_keyid(GetForegroundWindow(),szKeyID);
        if(szKeyID[0]) {
            DBWriteContactSettingString((HANDLE)wParam,szModuleName,"gpg",szKeyID);
            del = false;
        }
    }

    if(del) Service_GPGdelKey(wParam,lParam);
    else {
        pUinKey ptr = getUinKey((HANDLE)wParam);
        cpp_delete_context(ptr->cntx);
        ptr->cntx=0;
    }
    ShowStatusIconNotify((HANDLE)wParam);
    return 1;
}