From 83310365c69bd40365ee0ae0e16c99c28e24cd0b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 14:24:12 +0000 Subject: - all static protocol services replaced with functions; - m_protomod.h removed as useless git-svn-id: http://svn.miranda-ng.org/main/trunk@14260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WinterSpeak/src/SpeakConfig.cpp | 67 ++++++++++++++++----------------- 1 file changed, 33 insertions(+), 34 deletions(-) (limited to 'plugins/WinterSpeak/src/SpeakConfig.cpp') diff --git a/plugins/WinterSpeak/src/SpeakConfig.cpp b/plugins/WinterSpeak/src/SpeakConfig.cpp index 20b86b05f2..11b7d249b6 100644 --- a/plugins/WinterSpeak/src/SpeakConfig.cpp +++ b/plugins/WinterSpeak/src/SpeakConfig.cpp @@ -50,40 +50,39 @@ bool SpeakConfig::say(const std::wstring &sentence, MCONTACT user, bool message) if (NULL != user) { // get the status of the protocol of this user - const char *protocol = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)user, 0); - - switch (CallProtoService(protocol, PS_GETSTATUS, 0, 0)) - { - case ID_STATUS_ONLINE: - active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online); - break; - case ID_STATUS_AWAY: - active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Away); - break; - case ID_STATUS_DND: - active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd); - break; - case ID_STATUS_NA: - active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na); - break; - case ID_STATUS_OCCUPIED: - active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied); - break; - case ID_STATUS_FREECHAT: - active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat); - break; - case ID_STATUS_INVISIBLE: - active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible); - break; - case ID_STATUS_OFFLINE: - // if we are offline for this protocol, then don't speak the - // sentence this is so we don't announce users offline status if - // we are disconnected. - active = false; - break; - default: - active = false; - break; + const char *protocol = GetContactProto(user); + + switch (CallProtoService(protocol, PS_GETSTATUS, 0, 0)) { + case ID_STATUS_ONLINE: + active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Online); + break; + case ID_STATUS_AWAY: + active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Away); + break; + case ID_STATUS_DND: + active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Dnd); + break; + case ID_STATUS_NA: + active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Na); + break; + case ID_STATUS_OCCUPIED: + active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Occupied); + break; + case ID_STATUS_FREECHAT: + active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_FreeForChat); + break; + case ID_STATUS_INVISIBLE: + active = m_db.getActiveFlag(ConfigDatabase::ActiveFlag_Invisible); + break; + case ID_STATUS_OFFLINE: + // if we are offline for this protocol, then don't speak the + // sentence this is so we don't announce users offline status if + // we are disconnected. + active = false; + break; + default: + active = false; + break; } // if its a user say, then check the users status -- cgit v1.2.3