diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-20 05:05:22 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-20 05:05:22 +0000 |
commit | ff9b6a420680da7084ea0c5e644c45ef212d7b9b (patch) | |
tree | 85397ddb4e831b36c8e900b6e131f1c9db9ee08e | |
parent | 77d2929512ff62e421e9bfee659cc86973fc7df7 (diff) |
reverted some formatting changes
git-svn-id: http://svn.miranda-ng.org/main/trunk@493 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/MirOTR/MirOTR/dbfilter.cpp | 20 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/entities.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/options.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/otr.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/stdafx.h | 11 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/svcs_menu.cpp | 12 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/svcs_proto.cpp | 14 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/svcs_srmm.cpp | 14 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/utils.cpp | 2 |
9 files changed, 39 insertions, 46 deletions
diff --git a/plugins/MirOTR/MirOTR/dbfilter.cpp b/plugins/MirOTR/MirOTR/dbfilter.cpp index bfc2f80e9d..aab60e18e5 100644 --- a/plugins/MirOTR/MirOTR/dbfilter.cpp +++ b/plugins/MirOTR/MirOTR/dbfilter.cpp @@ -25,7 +25,7 @@ VOID CALLBACK DeleteTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi next = DeleteEvents.first;
while (current = next) {
if (difftime(time(0), current->timestamp) < 1) break;
- if(!CallService(MS_DB_EVENT_GET, (WPARAM)current->hDbEvent, (LPARAM)&info)) // && info.flags&DBEF_READ)
+ if (!CallService(MS_DB_EVENT_GET, (WPARAM)current->hDbEvent, (LPARAM)&info)) // && info.flags&DBEF_READ)
{
CallService(MS_DB_EVENT_DELETE, (WPARAM)current->hContact, (LPARAM)current->hDbEvent);
next = current->next;
@@ -44,7 +44,7 @@ VOID CALLBACK DeleteTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTi // add prefix to sent messages
int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) {
- if(!options.prefix_messages || !lParam) return 0;
+ if (!options.prefix_messages || !lParam) return 0;
HANDLE hContact = (HANDLE)wParam;
DBEVENTINFO *dbei = (DBEVENTINFO *)lParam;
if ((dbei->eventType != EVENTTYPE_MESSAGE) || !(dbei->flags & DBEF_SENT) || (dbei->flags & DBEF_OTR_PREFIXED))
@@ -53,21 +53,21 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { return 0; // just to be safe
const char *proto = contact_get_proto(hContact);
- if(!proto ) return 0;
+ if (!proto ) return 0;
if (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1)
return 0;
if(g_metaproto && strcmp(proto, g_metaproto) == 0) {
hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
- if(!hContact) return 0;
+ if (!hContact) return 0;
proto = contact_get_proto(hContact);
- if(!proto ) return 0;
+ if (!proto ) return 0;
}
ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
bool encrypted = otr_context_get_trust(context) != TRUST_NOT_PRIVATE;
- if(!encrypted) return 0;
+ if (!encrypted) return 0;
DBEVENTINFO my_dbei = *dbei; // copy the other event
@@ -178,7 +178,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { }
int OnDatabaseEventAdded(WPARAM wParam, LPARAM lParam) {
- if(!options.delete_history) return 0;
+ if (!options.delete_history) return 0;
DBEVENTINFO info = {0};
info.cbSize = sizeof(info);
@@ -189,7 +189,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { static DWORD len = strlen(prefix);
info.cbBlob = lenutf*2;
info.pBlob = (PBYTE)mir_alloc(info.cbBlob);
- if(!CallService(MS_DB_EVENT_GET, (WPARAM)lParam, (LPARAM)&info)) {
+ if (!CallService(MS_DB_EVENT_GET, (WPARAM)lParam, (LPARAM)&info)) {
if(info.eventType == EVENTTYPE_MESSAGE) {
HANDLE hContact = (HANDLE)wParam, hSub;
if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService
@@ -249,13 +249,13 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) { }
if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
- if(!options.bHaveSRMMIcons) return 0;
+ if (!options.bHaveSRMMIcons) return 0;
HANDLE hContact = mwd->hContact, hTemp;
if(options.bHaveMetaContacts && (hTemp = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
hContact = hTemp;
- if(!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
+ if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
return 0;
lib_cs_lock();
diff --git a/plugins/MirOTR/MirOTR/entities.cpp b/plugins/MirOTR/MirOTR/entities.cpp index ce11fe3bec..ae2335bc01 100644 --- a/plugins/MirOTR/MirOTR/entities.cpp +++ b/plugins/MirOTR/MirOTR/entities.cpp @@ -327,7 +327,7 @@ static _Bool parse_entity(const char *current, char **to, const char **from, size_t maxlen) { const char *end = (const char *)memchr(current, ';', maxlen); - if(!end) return 0; + if (!end) return 0; if(current[1] == '#') { @@ -367,7 +367,7 @@ static _Bool parse_entity(const char *current, char **to, size_t decode_html_entities_utf8(char *dest, const char *src, size_t len) { - if(!src) src = dest; + if (!src) src = dest; char *to = dest; const char *from = src; diff --git a/plugins/MirOTR/MirOTR/options.cpp b/plugins/MirOTR/MirOTR/options.cpp index b89fbac643..dd2ab9a76b 100644 --- a/plugins/MirOTR/MirOTR/options.cpp +++ b/plugins/MirOTR/MirOTR/options.cpp @@ -88,7 +88,7 @@ void LoadOptions() { options.autoshow_verify = (DBGetContactSettingByte(0, MODULENAME, "AutoShowVerify", 1) == 1);
DBVARIANT dbv;
- if(!DBGetContactSettingUTF8String(0, MODULENAME, "Prefix", &dbv)) {
+ if (!DBGetContactSettingUTF8String(0, MODULENAME, "Prefix", &dbv)) {
strncpy(options.prefix, dbv.pszVal, OPTIONS_PREFIXLEN);
options.prefix[OPTIONS_PREFIXLEN-1] = 0;
DBFreeVariant(&dbv);
@@ -360,7 +360,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP // subitem members of the structure are valid.
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT;
-
+
lvc.iSubItem = 0;
lvc.pszText = TranslateT(LANG_PROTO);
lvc.cx = 85; // width of column in pixels
diff --git a/plugins/MirOTR/MirOTR/otr.cpp b/plugins/MirOTR/MirOTR/otr.cpp index c094314d56..dfc5575fa4 100644 --- a/plugins/MirOTR/MirOTR/otr.cpp +++ b/plugins/MirOTR/MirOTR/otr.cpp @@ -268,7 +268,7 @@ extern "C" { TCHAR buff[512];
mir_sntprintf(buff, 512, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT((HANDLE)opdata));
//MessageBox(0, buff, Translate("OTR Information"), MB_OK);
- if(!Miranda_Terminated()) {
+ if (!Miranda_Terminated()) {
ShowMessage((HANDLE)opdata, buff);
}
@@ -283,7 +283,7 @@ extern "C" { TrustLevel trusted = otr_context_get_trust(context);
SetEncryptionStatus((HANDLE)opdata, trusted);
TCHAR buff[1024];
- if(!is_reply) {
+ if (!is_reply) {
if(trusted == TRUST_PRIVATE) {
mir_sntprintf(buff, 1024, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT((HANDLE)opdata));
} else if (trusted == TRUST_UNVERIFIED) {
diff --git a/plugins/MirOTR/MirOTR/stdafx.h b/plugins/MirOTR/MirOTR/stdafx.h index ea4dbe4a9c..3284939f41 100644 --- a/plugins/MirOTR/MirOTR/stdafx.h +++ b/plugins/MirOTR/MirOTR/stdafx.h @@ -74,15 +74,8 @@ extern "C" { // modified manual policy - so that users set to 'opportunistic' will automatically start OTR with users set to 'manual'
#define OTRL_POLICY_MANUAL_MOD (OTRL_POLICY_MANUAL | OTRL_POLICY_WHITESPACE_START_AKE | OTRL_POLICY_ERROR_START_AKE)
-// {030F37D6-DD32-434d-BC64-5B6541EB9299}
-static const MUUID MIID_OTR = { 0x30f37d6, 0xdd32, 0x434d, { 0xbc, 0x64, 0x5b, 0x65, 0x41, 0xeb, 0x92, 0x99 } };
-#ifdef _UNICODE
- // {12D8FAAD-78AB-4e3c-9854-320E9EA5CC9F}
- static const MUUID MIID_OTRPLUGIN = { 0x12d8faad, 0x78ab, 0x4e3c, { 0x98, 0x54, 0x32, 0xe, 0x9e, 0xa5, 0xcc, 0x9f } };
-#else
- // {16E2E7B0-D398-4ea8-A5CC-A0F3689C7608}
- static const MUUID MIID_OTRPLUGIN = { 0x16e2e7b0, 0xd398, 0x4ea8, { 0xa5, 0xcc, 0xa0, 0xf3, 0x68, 0x9c, 0x76, 0x8 } };
-#endif
+// {12D8FAAD-78AB-4e3c-9854-320E9EA5CC9F}
+static const MUUID MIID_OTRPLUGIN = { 0x12d8faad, 0x78ab, 0x4e3c, { 0x98, 0x54, 0x32, 0xe, 0x9e, 0xa5, 0xcc, 0x9f } };
#define MODULENAME "MirOTR"
diff --git a/plugins/MirOTR/MirOTR/svcs_menu.cpp b/plugins/MirOTR/MirOTR/svcs_menu.cpp index b0e542dde1..76b0a07817 100644 --- a/plugins/MirOTR/MirOTR/svcs_menu.cpp +++ b/plugins/MirOTR/MirOTR/svcs_menu.cpp @@ -9,9 +9,9 @@ HANDLE hMenuBuildEvent, hStopItem, hStartItem; int StartOTR(HANDLE hContact) {
const char *proto = contact_get_proto(hContact);
- if(!proto) return 1; // error
+ if (!proto) return 1; // error
char *uname = contact_get_id(hContact);
- if(!uname) return 1; // error
+ if (!uname) return 1; // error
DWORD pol = DBGetContactSettingDword(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
if(pol == CONTACT_DEFAULT_POLICY) pol = options.default_policy;
@@ -74,9 +74,9 @@ int otr_disconnect_contact(HANDLE hContact) { }
const char *proto = contact_get_proto(hContact);
- if(!proto) return 1; // error
+ if (!proto) return 1; // error
char *uname = contact_get_id(hContact);
- if(!uname) return 1; // error
+ if (!uname) return 1; // error
lib_cs_lock();
otrl_message_disconnect(otr_user_state, &ops, hContact, proto, proto, uname);
@@ -164,14 +164,14 @@ int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { const char *proto = contact_get_proto(hContact);
DWORD pol = CONTACT_DEFAULT_POLICY;
- if(!proto || DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1) {
+ if (!proto || DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1) {
goto hide_all;
}
if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) {
// make menu act as per most online subcontact
hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
- if(!hContact)
+ if (!hContact)
goto hide_all;
proto = contact_get_proto(hContact);
}
diff --git a/plugins/MirOTR/MirOTR/svcs_proto.cpp b/plugins/MirOTR/MirOTR/svcs_proto.cpp index 5ea6055908..89f2473597 100644 --- a/plugins/MirOTR/MirOTR/svcs_proto.cpp +++ b/plugins/MirOTR/MirOTR/svcs_proto.cpp @@ -9,7 +9,7 @@ //TODO: Social-Millionaire-Dialoge
INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
- if(!lParam) return 0;
+ if (!lParam) return 0;
CCSDATA *ccs = (CCSDATA *) lParam;
@@ -21,7 +21,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) // bypass for metacontacts
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
- if(!proto || !ccs->hContact) return 1; // error
+ if (!proto || !ccs->hContact) return 1; // error
gcry_error_t err;
char *newmessage = 0;
@@ -40,7 +40,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ } else {
oldmessage_utf = mir_utf8encode(oldmessage);
}
- if(!oldmessage_utf) return 1;
+ if (!oldmessage_utf) return 1;
// don't filter OTR messages being sent (OTR messages should only happen *after* the otrl_message_sending call below)
if(strncmp(oldmessage_utf, "?OTR", 4) == 0) {
@@ -128,7 +128,7 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){ }
INT_PTR SVC_OTRSendMessageW(WPARAM wParam, LPARAM lParam){
- if(!lParam) return 0;
+ if (!lParam) return 0;
CCSDATA *ccs = (CCSDATA *) lParam;
if (!(ccs->wParam & PREF_UTF)) ccs->wParam |= PREF_UNICODE;
@@ -159,7 +159,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){ }
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
- if(!proto)
+ if (!proto)
return 1; //error
else if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) // bypass for metacontacts
return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
@@ -176,7 +176,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){ } else {
oldmessage_utf = mir_utf8encode(oldmessage);
}
- if(!oldmessage_utf) return 1;
+ if (!oldmessage_utf) return 1;
char *newmessage = NULL;
@@ -194,7 +194,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){ lib_cs_unlock();
mir_free(uname);
- if( !(pre->flags & PREF_UTF)) mir_free(oldmessage_utf);
+ if ( !(pre->flags & PREF_UTF)) mir_free(oldmessage_utf);
oldmessage_utf = NULL;
diff --git a/plugins/MirOTR/MirOTR/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/svcs_srmm.cpp index e37ee9db51..595045c301 100644 --- a/plugins/MirOTR/MirOTR/svcs_srmm.cpp +++ b/plugins/MirOTR/MirOTR/svcs_srmm.cpp @@ -14,13 +14,13 @@ BBButton OTRButton; // }
//
// if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
-// if(!options.bHaveSRMMIcons) return 0;
+// if (!options.bHaveSRMMIcons) return 0;
//
// HANDLE hContact = mwd->hContact, hTemp;
// if(options.bHaveMetaContacts && (hTemp = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
// hContact = hTemp;
//
-// if(!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
+// if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
// return 0;
//
// lib_cs_lock();
@@ -37,7 +37,7 @@ int SVC_IconPressed(WPARAM wParam, LPARAM lParam) { StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if(sicd->cbSize < (int)sizeof(StatusIconClickData))
return 0;
-
+
if(strcmp(sicd->szModule, MODULENAME) == 0) {
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
if(proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0))
@@ -87,11 +87,11 @@ int SVC_IconPressed(WPARAM wParam, LPARAM lParam) { minfo.hbmpItem = bmpIconNotSecure;
minfo.dwTypeData = TranslateT(LANG_STATUS_DISABLED);
}
-
+
SelectObject(hdc, old);
DeleteDC(hdc);
ReleaseDC(wnd, dc);
-
+
SetMenuItemInfo(hMenu, IDM_OTR_STATUS, FALSE, &minfo);
minfo.fMask = MIIM_STATE|MIIM_BITMAP;
@@ -148,7 +148,7 @@ void SetEncryptionStatus(HANDLE hContact, TrustLevel level) { char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
bool chat_room = (proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0));
- // if(!chat_room) DBWriteContactSettingByte(hContact, MODULENAME, "Encrypted", (encrypted ? 1 : 0));
+ // if (!chat_room) DBWriteContactSettingByte(hContact, MODULENAME, "Encrypted", (encrypted ? 1 : 0));
if(options.bHaveSRMMIcons || options.bHaveButtonsBar) {
//strcat(dbg_msg, "\nchanging icon");
@@ -197,7 +197,7 @@ void SetEncryptionStatus(HANDLE hContact, TrustLevel level) { if (options.bHaveButtonsBar) CallService(MS_BB_SETBUTTONSTATE, (WPARAM)hContact, (LPARAM)&button);
db_dword_set(hContact, MODULENAME, "TrustLevel", level);
- if(!chat_room && options.bHaveMetaContacts) {
+ if (!chat_room && options.bHaveMetaContacts) {
HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
HANDLE hMostOnline = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
if(hMeta && hContact == hMostOnline) {
diff --git a/plugins/MirOTR/MirOTR/utils.cpp b/plugins/MirOTR/MirOTR/utils.cpp index 3d3a50506e..2b592742d4 100644 --- a/plugins/MirOTR/MirOTR/utils.cpp +++ b/plugins/MirOTR/MirOTR/utils.cpp @@ -370,7 +370,7 @@ bool GetEncryptionStatus(HANDLE hContact) { char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
bool chat_room = (proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0));
- if(!chat_room) {
+ if (!chat_room) {
if (options.bHaveMetaContacts) {
HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
if(hMeta && hContact == (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0)) {
|