summaryrefslogtreecommitdiff
path: root/plugins/SkypeStatusChange/src/stdafx.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SkypeStatusChange/src/stdafx.h')
-rw-r--r--plugins/SkypeStatusChange/src/stdafx.h80
1 files changed, 23 insertions, 57 deletions
diff --git a/plugins/SkypeStatusChange/src/stdafx.h b/plugins/SkypeStatusChange/src/stdafx.h
index 97c4d1e730..3a9b5d8242 100644
--- a/plugins/SkypeStatusChange/src/stdafx.h
+++ b/plugins/SkypeStatusChange/src/stdafx.h
@@ -14,15 +14,25 @@
#include <m_langpack.h>
#include <m_utils.h>
+struct PrevStatus
+{
+ PrevStatus(const char *_proto, int _status) :
+ szProto(mir_strdup(_proto)),
+ iStatus(_status)
+ {}
+
+ ptrA szProto;
+ int iStatus;
+};
+
struct CMPlugin : public PLUGIN<CMPlugin>
{
CMPlugin();
+ CMOption<bool> bSyncStatusMsg, bSyncStatusState;
+
int Load() override;
-};
-class COptions
-{
enum
{
cssOnline = 0x00000001,
@@ -53,43 +63,21 @@ class COptions
return 0;
}
- struct PrevStatus
- {
- PrevStatus(const char *_proto, int _status) :
- szProto(mir_strdup(_proto)),
- iStatus(_status)
- {
- }
-
- ptrA szProto;
- int iStatus;
- };
-
OBJLIST<PrevStatus> m_aProtocol2Status;
- static int CompareStatuses(const PrevStatus *p1, const PrevStatus *p2)
- {
- return mir_strcmp(p1->szProto, p2->szProto);
- }
-
-public:
- COptions() :
- m_aProtocol2Status(3, CompareStatuses)
- {
- }
- bool IsProtocolExcluded(const char* pszProtocol)const
+ bool IsProtocolExcluded(const char *pszProtocol)const
{
uint32_t dwSettings = db_get_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", 0);
- return ((dwSettings&cssAll) ? true : false);
+ return ((dwSettings & cssAll) ? true : false);
}
- bool IsProtocolStatusExcluded(const char* pszProtocol, int nStatus)const
+ bool IsProtocolStatusExcluded(const char *pszProtocol, int nStatus)const
{
uint32_t dwSettings = db_get_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", 0);
- return ((dwSettings&Status2Flag(nStatus)) ? true : false);
+ return ((dwSettings & Status2Flag(nStatus)) ? true : false);
}
- void ExcludeProtocol(const char* pszProtocol, bool bExclude)
+ void ExcludeProtocol(const char *pszProtocol, bool bExclude)
{
uint32_t dwSettings = db_get_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", 0);
if (bExclude)
@@ -100,7 +88,7 @@ public:
db_set_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", dwSettings);
}
- void ExcludeProtocolStatus(const char* pszProtocol, int nStatus, bool bExclude)
+ void ExcludeProtocolStatus(const char *pszProtocol, int nStatus, bool bExclude)
{
uint32_t dwSettings = db_get_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", 0);
if (bExclude)
@@ -111,29 +99,9 @@ public:
db_set_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", dwSettings);
}
- bool GetSyncStatusMsgFlag() const
- {
- return g_plugin.getBool("SyncStatusMsg");
- }
-
- bool GetSyncStatusStateFlag() const
- {
- return g_plugin.getBool("SyncStatusState");
- }
-
- void SetSyncStatusMsgFlag(bool b)
+ bool GetPreviousStatus(const char *pszProtocol, int &nStatus)const
{
- g_plugin.setByte("SyncStatusMsg", b);
- }
-
- void SetSyncStatusStateFlag(bool b)
- {
- g_plugin.setByte("SyncStatusState", b);
- }
-
- bool GetPreviousStatus(const char* pszProtocol, int& nStatus)const
- {
- int i = m_aProtocol2Status.getIndex((PrevStatus*)&pszProtocol);
+ int i = m_aProtocol2Status.getIndex((PrevStatus *)&pszProtocol);
if (i != -1) {
nStatus = m_aProtocol2Status[i].iStatus;
return true;
@@ -142,9 +110,9 @@ public:
return false;
}
- void SetPreviousStatus(const char* pszProtocol, int nStatus)
+ void SetPreviousStatus(const char *pszProtocol, int nStatus)
{
- int i = m_aProtocol2Status.getIndex((PrevStatus*)&pszProtocol);
+ int i = m_aProtocol2Status.getIndex((PrevStatus *)&pszProtocol);
if (i != -1)
m_aProtocol2Status[i].iStatus = nStatus;
else
@@ -152,8 +120,6 @@ public:
}
};
-extern COptions g_Options;
-
/////////////////////////////////////////////////////////////////////////////////////////
struct CMirandaStatus2SkypeStatus