summaryrefslogtreecommitdiff
path: root/messages.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-10-28 22:42:50 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-10-28 22:42:50 +0300
commitc8e55d6a751f587930ab2589f55584973b446bb0 (patch)
treea31baa8348d3eb97d83224382f40b5942efba59b /messages.cpp
parent66ca1334996fac1e76b1830b00a7a8d42ddb8e42 (diff)
cleanup
Diffstat (limited to 'messages.cpp')
-rw-r--r--messages.cpp49
1 files changed, 6 insertions, 43 deletions
diff --git a/messages.cpp b/messages.cpp
index 1727bfc..a026bcc 100644
--- a/messages.cpp
+++ b/messages.cpp
@@ -36,9 +36,6 @@ int RecvMsgSvc(WPARAM w, LPARAM l)
return CallService(MS_PROTO_CHAINRECV, w, l);
HANDLE hContact = ccs->hContact;
-// if(isProtoMetaContacts(hContact))
-// hContact = metaGetMostOnline(hContact);
-
{ //check for gpg related data
wstring str = toUTF16(msg);
@@ -289,7 +286,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l)
char *tmp = new char [str.length()+1];
strcpy(tmp, str.c_str());
pre->szMessage = tmp;
- return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); //TODO: add event for metacontact
+ return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs);
}
}
}
@@ -321,7 +318,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l)
str.insert(0, "Received unencrypted message:\n");
debuglog<<"info: Failed to decrypt GPG encrypted message.\n";
pre->szMessage = mir_strdup(str.c_str());
- return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); //TODO: add event for metacontact
+ return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs);
}
else
{
@@ -338,10 +335,9 @@ int RecvMsgSvc(WPARAM w, LPARAM l)
HistoryLog(hContact, msg, EVENTTYPE_MESSAGE, DBEF_UTF);
HistoryLog(metaGetContact(hContact), msg, EVENTTYPE_MESSAGE, DBEF_UTF);
mir_free(msg);
-// return returnNoError(hContact);
return 1;
}
- return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); //TODO: add event for metacontact
+ return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs);
}
}
}
@@ -354,22 +350,16 @@ int RecvMsgSvc(WPARAM w, LPARAM l)
HistoryLog(hContact, msg, EVENTTYPE_MESSAGE, DBEF_UTF);
HistoryLog(metaGetContact(hContact), msg, EVENTTYPE_MESSAGE, DBEF_UTF);
mir_free(msg);
-// return returnNoError(hContact);
return 1;
}
wstring str = toUTF16(msg);
mir_free((void**)pre->szMessage);
pre->szMessage = mir_strdup(toUTF8(str).c_str());
- return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs); //TODO: add event for metacontact
+ return CallService(MS_PROTO_CHAINRECV, w, (LPARAM)ccs);
}
return CallService(MS_PROTO_CHAINRECV, w, l);
}
-/*struct handle_plus_string
-{
- string *str;
- HANDLE hContact;
-};*/
-//list<handle_plus_string*> msgs_to_ignore;
+
int SendMsgSvc(WPARAM w, LPARAM l)
{
CCSDATA *ccs = (CCSDATA*)l;
@@ -384,15 +374,9 @@ int SendMsgSvc(WPARAM w, LPARAM l)
HANDLE hContact = ccs->hContact;
if(metaIsProtoMetaContacts(hContact))
{
-// string str_event = (char*)ccs->lParam;
-// handle_plus_string *hps = new handle_plus_string;
-// hps->str = new string(str_event);
hcontact_data[ccs->hContact].msgs_to_ignore.push_back((char*)ccs->lParam);
-// hps->hContact = ccs->hContact;
-// msgs_to_ignore.push_back(hps);
return CallService(MS_PROTO_CHAINSEND, w, l);
}
-// hContact = metaGetCurrent(hContact);
if(!DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0))
return CallService(MS_PROTO_CHAINSEND, w, l);
@@ -517,10 +501,6 @@ int SendMsgSvc(WPARAM w, LPARAM l)
if(metaIsSubcontact(hContact))
{ //dirty hack to avoid metacontacts problem ..., this also broke filters chain
string str_event = (char*)ccs->lParam;
-// handle_plus_string *hps = new handle_plus_string;
-// hps->str = new string(str_event);
-// hps->hContact = hContact;
-// msgs_to_ignore.push_back(hps);
if(bAppendTags)
{
str_event.insert(0, toUTF8(outopentag));
@@ -528,15 +508,12 @@ int SendMsgSvc(WPARAM w, LPARAM l)
}
HistoryLog(hContact, (char*)str_event.c_str(), EVENTTYPE_MESSAGE, DBEF_SENT | DBEF_UTF);
HistoryLog(metaGetContact(hContact), (char*)str_event.c_str(), EVENTTYPE_MESSAGE, DBEF_SENT | DBEF_UTF);
-// hcontact_data[hContact].msgs_to_ignore.push_back((char*)ccs->lParam);
hcontact_data[metaGetContact(hContact)].msgs_to_ignore.push_back((char*)ccs->lParam);
hcontact_data[metaGetContact(hContact)].msgs_to_ignore.push_back((char*)ccs->lParam); //hmm, twice ? metacontacts !! %)
-// DBWriteContactSettingByte(metaGetContact(hContact), szGPGModuleName, "MsgsForTagging", DBGetContactSettingByte(metaGetContact(hContact), szGPGModuleName, "MsgsForTagging", 0) + 1);
CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)toUTF8(str).c_str());
return returnNoError(hContact);
}
if(bAppendTags)
-// DBWriteContactSettingByte(hContact, szGPGModuleName, "MsgsForTagging", DBGetContactSettingByte(hContact, szGPGModuleName, "MsgsForTagging", 0) + 1);
hcontact_data[hContact].msgs_to_tag.push_back((char*)ccs->lParam);
ccs->lParam = (LPARAM)mir_strdup(toUTF8(str).c_str());
}
@@ -545,7 +522,7 @@ int SendMsgSvc(WPARAM w, LPARAM l)
}
int HookSendMsg(WPARAM w, LPARAM l)
-{
+{ //TODO: implement additional filtering for metacontacts data...
if(!l)
return 0;
DBEVENTINFO * dbei = (DBEVENTINFO*)l;
@@ -606,20 +583,6 @@ int HookSendMsg(WPARAM w, LPARAM l)
}
}
}
-/* BYTE Msgs = DBGetContactSettingByte(hContact, szGPGModuleName, "MsgsForTagging", 0);
- if(!Msgs)
- return 0;
- {
- char *msg = (char*)dbei->pBlob;
- wstring str = toUTF16(msg);
- str.insert(0, outopentag);
- str.append(outclosetag);
- char *msg2 = mir_strdup(toUTF8(str).c_str());
- mir_free(dbei->pBlob);
- dbei->pBlob = (PBYTE)msg2;
- dbei->cbBlob = strlen(msg2)+1;
- DBWriteContactSettingByte(hContact, szGPGModuleName, "MsgsForTagging", Msgs - 1);
- }*/
}
if((dbei->eventType == EVENTTYPE_MESSAGE) && !(dbei->flags & DBEF_SENT) && metaIsProtoMetaContacts((HANDLE)w))
{