diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-12-21 17:02:13 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-12-21 17:02:13 +0000 |
commit | 376d04aedd69e3f86fa6674b74d9162e3a65510c (patch) | |
tree | b512525d721c8676afbedbb0df029267f474e212 /plugins/BasicHistory/src/EventList.cpp | |
parent | 4ff57f3585bcd7b1089405e44d4f8e3c93ff2a71 (diff) |
use core service for EVENTTYPE_AUTHREQUEST
git-svn-id: http://svn.miranda-ng.org/main/trunk@7320 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BasicHistory/src/EventList.cpp')
-rw-r--r-- | plugins/BasicHistory/src/EventList.cpp | 79 |
1 files changed, 1 insertions, 78 deletions
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 93e3440f72..a28d394d90 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -497,86 +497,9 @@ static void GetMessageDescription( DBEVENTINFO *dbei, TCHAR* buf, int cbBuf ) mir_free( msg );
}
-static void GetAuthRequestDescription( DBEVENTINFO *dbei, TCHAR* buf, int cbBuf )
-{
- std::wstring allName;
- buf[0] = 0;
- size_t pos = sizeof(DWORD)*2;
- if (pos >= dbei->cbBlob)
- return;
-
- PDWORD evDwords = (PDWORD)dbei->pBlob;
- DWORD uin = evDwords[0];
- HANDLE hContact = (HANDLE)evDwords[1];
- char* nick, *firstName, *lastName, *jid, *reason;
- nick = (char*)&evDwords[2];
- pos += strnlen_s(nick, dbei->cbBlob - pos) + 1;
- if (pos >= dbei->cbBlob)
- return;
- firstName = ( char* )dbei->pBlob + pos;
- pos += strnlen_s(firstName, dbei->cbBlob - pos) + 1;
- if (pos >= dbei->cbBlob)
- return;
- lastName = ( char* )dbei->pBlob + pos;
- pos += strnlen_s(lastName, dbei->cbBlob - pos) + 1;
- if (pos >= dbei->cbBlob)
- return;
- jid = (char*)dbei->pBlob + pos;
- pos += strnlen_s(jid, dbei->cbBlob - pos) + 1;
- if (pos >= dbei->cbBlob)
- return;
- reason = (char*)dbei->pBlob + pos;
- TCHAR *newNick, *newFirstName, *newLastName, *newJid, *newReason;
- if (dbei->flags & DBEF_UTF) {
- newNick = mir_utf8decodeT( nick );
- newFirstName = mir_utf8decodeT( firstName );
- newLastName = mir_utf8decodeT( lastName );
- newJid = mir_utf8decodeT( jid );
- newReason = mir_utf8decodeT( reason );
- }
- else {
- newNick = mir_a2t( nick );
- newFirstName = mir_a2t( firstName );
- newLastName = mir_a2t( lastName );
- newJid = mir_a2t( jid );
- newReason = mir_a2t( reason );
- }
-
- if (newFirstName[0] != 0) {
- allName += newFirstName;
- if (newLastName[0] != 0)
- allName += _T(" ");
- }
-
- if (newLastName[0] != 0)
- allName += newLastName;
- if (!allName.empty())
- allName += _T(", ");
- if (newJid[0] != 0) {
- allName += newJid;
- allName += _T(", ");
- }
-
- mir_sntprintf(buf, cbBuf, TranslateT("Authorization request by %s (%s%d): %s"),
- (newNick[0] == 0 ? (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, GCDNF_TCHAR) : newNick),
- allName.c_str(), uin, newReason);
- mir_free( newNick );
- mir_free( newFirstName );
- mir_free( newLastName );
- mir_free( newJid );
- mir_free( newReason );
-}
-
void EventList::GetObjectDescription( DBEVENTINFO *dbei, TCHAR* str, int cbStr )
{
- switch(dbei->eventType) {
- case EVENTTYPE_AUTHREQUEST:
- GetAuthRequestDescription( dbei, str, cbStr );
- break;
-
- default:
- GetMessageDescription( dbei, str, cbStr );
- }
+ GetMessageDescription( dbei, str, cbStr );
}
bool EventList::GetEventIcon(bool isMe, int eventType, int &id)
|