diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-08 15:51:52 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-08 15:51:52 +0000 |
commit | 6941b13721285765d6b8df94c1c87d4f78b8be68 (patch) | |
tree | a388bc8c059fe4e1550b9bdbb1a6f66d065f57af /plugins/MirandaG15/src | |
parent | 78f56932d0c04a7b6d3b27fd98ffce64639a1953 (diff) |
chat structures slightly cleaned (no changes so far)
git-svn-id: http://svn.miranda-ng.org/main/trunk@7547 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirandaG15/src')
-rw-r--r-- | plugins/MirandaG15/src/CAppletManager.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index ea1739bb24..d586923033 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -843,8 +843,8 @@ void CAppletManager::SendTypingNotification(HANDLE hContact,bool bEnable) //************************************************************************
HANDLE CAppletManager::SendMessageToContact(HANDLE hContact,tstring strMessage)
{
- string strAscii = toNarrowString(strMessage);
- int bufSize = lstrlenA(strAscii.c_str())+1;
+ tstring strAscii = _A2T(toNarrowString(strMessage).c_str());
+ int bufSize = lstrlen(strAscii.c_str())+1;
SMessageJob *pJob = new SMessageJob();
pJob->dwTimestamp = GetTickCount();
pJob->hContact = hContact;
@@ -857,31 +857,24 @@ HANDLE CAppletManager::SendMessageToContact(HANDLE hContact,tstring strMessage) if(pIRCCon && db_get_b(hContact, szProto, "ChatRoom", 0) != 0)
{
GCDEST gcd = {0};
- GCEVENT gce = {0};
DBVARIANT dbv;
- if (!db_get((HANDLE)hContact, szProto, "Nick", &dbv) && dbv.type == DBVT_ASCIIZ )
- gcd.pszID = dbv.pszVal;
+ if (!db_get_ts((HANDLE)hContact, szProto, "Nick", &dbv))
+ gcd.ptszID = dbv.ptszVal;
else
return NULL;
- string strID = string(gcd.pszID) + " - " + toNarrowString(pIRCCon->strNetwork).c_str();
- gcd.pszID = (char*)strID.c_str();
+ tstring strID = tstring(gcd.ptszID) + _T(" - ") + tstring(_A2T(toNarrowString(pIRCCon->strNetwork).c_str()));
+ gcd.ptszID = (LPTSTR)strID.c_str();
gcd.pszModule = szProto;
gcd.iType = GC_EVENT_SENDMESSAGE;
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.pszStatus = "";
- // gce.bAddToLog = true;
- gce.pszUserInfo = NULL;
-
- gce.pszText = (char *)strAscii.c_str();
-
- gce.dwItemData = NULL;
+ GCEVENT gce = { sizeof(gce), &gcd };
+ gce.dwFlags = GC_TCHAR;
+ gce.ptszStatus = _T("");
+ gce.ptszText = (LPTSTR)strAscii.c_str();
gce.time = time(NULL);
gce.bIsMe = true;
-
CallService(MS_GC_EVENT, NULL, (LPARAM) &gce);
pJob->hEvent = NULL;
@@ -928,7 +921,6 @@ HANDLE CAppletManager::SendMessageToContact(HANDLE hContact,tstring strMessage) CAppletManager::GetInstance()->AddMessageJob(pJob);
}
-
return pJob->hEvent;
}
@@ -1279,7 +1271,7 @@ int CAppletManager::HookChatInbound(WPARAM wParam,LPARAM lParam) if(gce == NULL || gcd == NULL)
TRACE(_T("<< [%s] skipping invalid IRC event\n"));
- TRACE(_T("<< [%s:%s] IRC event %04X\n"),toTstring(gcd->pszModule).c_str(),toTstring(gcd->pszID).c_str(),gcd->iType);
+ TRACE(_T("<< [%s:%s] IRC event %04X\n"),toTstring(gcd->pszModule).c_str(), gcd->ptszID, gcd->iType);
// get the matching irc connection entry
CIRCConnection *pIRCCon = CAppletManager::GetInstance()->GetIRCConnection(toTstring(gcd->pszModule));
|