summaryrefslogtreecommitdiff
path: root/plugins/WinterSpeak
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 14:24:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 14:24:12 +0000
commit83310365c69bd40365ee0ae0e16c99c28e24cd0b (patch)
tree10ac18bfdc3fcf0fd62a5aba3ccb5dedffa2e410 /plugins/WinterSpeak
parentd68cd04d6f7b997692476b531bdc30f546a50efd (diff)
- 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
Diffstat (limited to 'plugins/WinterSpeak')
-rw-r--r--plugins/WinterSpeak/src/SpeakAnnounce.cpp2
-rw-r--r--plugins/WinterSpeak/src/SpeakConfig.cpp67
2 files changed, 34 insertions, 35 deletions
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp
index 0de3c7c0c1..4a7ca4de9b 100644
--- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp
+++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp
@@ -23,7 +23,7 @@ void SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, MCONTACT
return;
// check if we just connected, and want to suppress status changes
- if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) && m_protocol_info.isDisabled((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)user, 0)))
+ if (!m_db.getStatusFlag(AnnounceDatabase::StatusFlag_SuppressConnect) && m_protocol_info.isDisabled(GetContactProto(user)))
return;
bool speak = false;
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