diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-18 20:22:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-18 20:22:53 +0000 |
commit | dda548686c0f8b0d0bf03315120132013ffa1bb0 (patch) | |
tree | 59f1ff72eb832ab22e9c15d3cae8812793a2f9af /protocols/JabberG | |
parent | a76ced5d4ff852dcbe7a96824ca1bb6dc219a1fd (diff) |
useless chat event removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@2765 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 115 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 7 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.h | 3 |
3 files changed, 55 insertions, 70 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 78542e10f0..df395a6ab2 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -120,10 +120,9 @@ int JabberGcGetStatus(JABBER_RESOURCE_STATUS *r) return JabberGcGetStatus(r->affiliation, r->role);
}
-int CJabberProto::JabberGcInit(WPARAM wParam, LPARAM)
+int CJabberProto::GcInit(JABBER_LIST_ITEM* item)
{
int i;
- JABBER_LIST_ITEM* item = (JABBER_LIST_ITEM*)wParam;
GCSESSION gcw = {0};
GCEVENT gce = {0};
@@ -196,7 +195,7 @@ void CJabberProto::GcLogCreate(JABBER_LIST_ITEM* item) if (item->bChatActive)
return;
- NotifyEventHooks(m_hInitChat, (WPARAM)item, 0);
+ GcInit(item);
}
void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, JABBER_RESOURCE_STATUS *user, TJabberGcLogInfoType type)
@@ -205,70 +204,64 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, JABBER_RESOURCE_ TCHAR buf[512] = _T("");
- switch (type)
- {
- case INFO_BAN:
- if (m_options.GcLogBans)
- {
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s in now banned."), user->resourceName);
- }
- break;
- case INFO_STATUS:
- if (m_options.GcLogStatuses)
- {
- if (user->statusMessage)
- {
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s with message: %s"),
- user->resourceName,
- CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, user->status, GSMDF_TCHAR),
- user->statusMessage);
- } else
- {
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s"),
- user->resourceName,
- CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, user->status, GSMDF_TCHAR));
- }
+ switch (type) {
+ case INFO_BAN:
+ if (m_options.GcLogBans)
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s in now banned."), user->resourceName);
+ break;
+
+ case INFO_STATUS:
+ if (m_options.GcLogStatuses) {
+ if (user->statusMessage) {
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s with message: %s"),
+ user->resourceName,
+ CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, user->status, GSMDF_TCHAR),
+ user->statusMessage);
}
- break;
- case INFO_CONFIG:
- if (m_options.GcLogConfig)
- {
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Room configuration was changed."));
+ else {
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s"),
+ user->resourceName,
+ CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, user->status, GSMDF_TCHAR));
}
- break;
- case INFO_AFFILIATION:
- if (m_options.GcLogAffiliations)
- {
- TCHAR *name = NULL;
- switch (user->affiliation)
- {
- case AFFILIATION_NONE: name = TranslateT("None"); break;
- case AFFILIATION_MEMBER: name = TranslateT("Member"); break;
- case AFFILIATION_ADMIN: name = TranslateT("Admin"); break;
- case AFFILIATION_OWNER: name = TranslateT("Owner"); break;
- case AFFILIATION_OUTCAST: name = TranslateT("Outcast"); break;
- }
- if (name) mir_sntprintf(buf, SIZEOF(buf), TranslateT("Affiliation of %s was changed to '%s'."), user->resourceName, name);
+ }
+ break;
+ case INFO_CONFIG:
+ if (m_options.GcLogConfig)
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Room configuration was changed."));
+ break;
+
+ case INFO_AFFILIATION:
+ if (m_options.GcLogAffiliations) {
+ TCHAR *name = NULL;
+ switch (user->affiliation) {
+ case AFFILIATION_NONE: name = TranslateT("None"); break;
+ case AFFILIATION_MEMBER: name = TranslateT("Member"); break;
+ case AFFILIATION_ADMIN: name = TranslateT("Admin"); break;
+ case AFFILIATION_OWNER: name = TranslateT("Owner"); break;
+ case AFFILIATION_OUTCAST: name = TranslateT("Outcast"); break;
}
- break;
- case INFO_ROLE:
- if (m_options.GcLogRoles)
- {
- TCHAR *name = NULL;
- switch (user->role)
- {
- case ROLE_NONE: name = TranslateT("None"); break;
- case ROLE_VISITOR: name = TranslateT("Visitor"); break;
- case ROLE_PARTICIPANT: name = TranslateT("Participant"); break;
- case ROLE_MODERATOR: name = TranslateT("Moderator"); break;
- }
- if (name) mir_sntprintf(buf, SIZEOF(buf), TranslateT("Role of %s was changed to '%s'."), user->resourceName, name);
+ if (name)
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Affiliation of %s was changed to '%s'."), user->resourceName, name);
+ }
+ break;
+
+ case INFO_ROLE:
+ if (m_options.GcLogRoles) {
+ TCHAR *name = NULL;
+ switch (user->role) {
+ case ROLE_NONE: name = TranslateT("None"); break;
+ case ROLE_VISITOR: name = TranslateT("Visitor"); break;
+ case ROLE_PARTICIPANT: name = TranslateT("Participant"); break;
+ case ROLE_MODERATOR: name = TranslateT("Moderator"); break;
}
- break;
+
+ if (name)
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Role of %s was changed to '%s'."), user->resourceName, name);
+ }
+ break;
}
- if (*buf)
- {
+ if (*buf) {
GCDEST gcd = { m_szModuleName, 0, 0 };
gcd.ptszID = item->jid;
GCEVENT gce = {0};
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 4aaa085b52..68d8d7bd8e 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -223,8 +223,6 @@ CJabberProto::~CJabberProto() DestroyHookableEvent(m_hEventNudge);
DestroyHookableEvent(m_hEventXStatusIconChanged);
DestroyHookableEvent(m_hEventXStatusChanged);
- if (m_hInitChat)
- DestroyHookableEvent(m_hInitChat);
CleanLastResourceMap();
@@ -295,11 +293,6 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) JHookEvent(ME_GC_EVENT, &CJabberProto::JabberGcEventHook);
JHookEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook);
-
- char szEvent[ 200 ];
- mir_snprintf(szEvent, sizeof szEvent, "%s\\ChatInit", m_szModuleName);
- m_hInitChat = CreateHookableEvent(szEvent);
- JHookEvent(szEvent, &CJabberProto::JabberGcInit);
}
if (ServiceExists(MS_MSG_ADDICON)) {
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 048e0370de..96fd2665c4 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -226,7 +226,6 @@ struct CJabberProto : public PROTO_INTERFACE, public MZeroedObject int __cdecl JabberGcEventHook(WPARAM, LPARAM);
int __cdecl JabberGcMenuHook(WPARAM, LPARAM);
- int __cdecl JabberGcInit(WPARAM, LPARAM);
// Google Shared Status
BOOL m_bGoogleSharedStatus;
@@ -441,6 +440,7 @@ struct CJabberProto : public PROTO_INTERFACE, public MZeroedObject //---- jabber_chat.cpp ---------------------------------------------------------------
+ int GcInit(JABBER_LIST_ITEM* item);
void GcLogCreate(JABBER_LIST_ITEM* item);
void GcLogUpdateMemberStatus(JABBER_LIST_ITEM* item, const TCHAR *resource, const TCHAR *nick, const TCHAR *jid, int action, HXML reason, int nStatusCode = -1);
void GcLogShowInformation(JABBER_LIST_ITEM *item, JABBER_RESOURCE_STATUS *user, TJabberGcLogInfoType type);
@@ -985,7 +985,6 @@ private: CRITICAL_SECTION m_csSerial;
unsigned int m_nSerial;
- HANDLE m_hInitChat;
HGENMENU m_hPrivacyMenuRoot;
BOOL m_menuItemsStatus;
LIST<void> m_hPrivacyMenuItems;
|