summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp12
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp38
2 files changed, 24 insertions, 26 deletions
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index efe43115c4..9d97e205b9 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -285,13 +285,13 @@ int CSStatusChange(WPARAM wParam, LPARAM lParam) // CommonStatus plugins (Startu
LogMessage("ME_CS_STATUSCHANGEEX event:");
for (int i = 0; i < lParam; i++) {
- LogMessage("%d: cbSize=%d, szProto=%s, status=%d, lastStatus=%d, szMsg:",
- i + 1, ps[i]->cbSize, ps[i]->szName ? (char*)ps[i]->szName : "NULL", ps[i]->status, ps[i]->lastStatus, ps[i]->szMsg ? ps[i]->szMsg : L"NULL");
- if (ps[i]->status != ID_STATUS_DISABLED) {
- if (ps[i]->status != ID_STATUS_CURRENT)
- g_ProtoStates[ps[i]->szName].m_status = (ps[i]->status == ID_STATUS_LAST) ? ps[i]->lastStatus : ps[i]->status;
+ LogMessage("%d: szProto=%s, status=%d, lastStatus=%d, szMsg:",
+ i + 1, ps[i]->m_szName ? (char*)ps[i]->m_szName : "NULL", ps[i]->m_status, ps[i]->m_lastStatus, ps[i]->m_szMsg ? ps[i]->m_szMsg : L"NULL");
+ if (ps[i]->m_status != ID_STATUS_DISABLED) {
+ if (ps[i]->m_status != ID_STATUS_CURRENT)
+ g_ProtoStates[ps[i]->m_szName].m_status = (ps[i]->m_status == ID_STATUS_LAST) ? ps[i]->m_lastStatus : ps[i]->m_status;
- CProtoSettings(ps[i]->szName).SetMsgFormat(SMF_TEMPORARY, ps[i]->szMsg ? ps[i]->szMsg : CProtoSettings(ps[i]->szName).GetMsgFormat(GMF_LASTORDEFAULT));
+ CProtoSettings(ps[i]->m_szName).SetMsgFormat(SMF_TEMPORARY, ps[i]->m_szMsg ? ps[i]->m_szMsg : CProtoSettings(ps[i]->m_szName).GetMsgFormat(GMF_LASTORDEFAULT));
}
}
return 0;
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index 7f64a3b6eb..48b7a21ecd 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -1499,30 +1499,28 @@ static int CSStatusChange(WPARAM wParam, LPARAM)
CSProtoCount = CallService(MS_CS_GETPROTOCOUNT, 0, 0);
for (int i = 0; i < CSProtoCount; ++i)
{
- if (ps[i]->szName == NULL || !*ps[i]->szName) continue;
- if (ps[i]->status == ID_STATUS_IDLE)
- status_mode = ps[i]->lastStatus;
- else if (ps[i]->status == ID_STATUS_CURRENT)
- status_mode = CallProtoService(ps[i]->szName, PS_GETSTATUS, 0, 0);
+ if (ps[i]->m_szName == NULL || !*ps[i]->m_szName) continue;
+ if (ps[i]->m_status == ID_STATUS_IDLE)
+ status_mode = ps[i]->m_lastStatus;
+ else if (ps[i]->m_status == ID_STATUS_CURRENT)
+ status_mode = CallProtoService(ps[i]->m_szName, PS_GETSTATUS, 0, 0);
else
- status_mode = ps[i]->status;
+ status_mode = ps[i]->m_status;
- SaveStatusAsCurrent(ps[i]->szName, status_mode);
+ SaveStatusAsCurrent(ps[i]->m_szName, status_mode);
#ifdef _DEBUG
- log2file("CSStatusChange(): Set %s status for %s.", StatusModeToDbSetting(status_mode, ""), ps[i]->szName);
+ log2file("CSStatusChange(): Set %s status for %s.", StatusModeToDbSetting(status_mode, ""), ps[i]->m_szName);
#endif
// TODO SaveMessageToDB also when NULL?
- if (ps[i]->szMsg)
+ if (ps[i]->m_szMsg)
{
char buff[80];
bool found = false;
-
- wchar_t *szMsgW = mir_wstrdup(ps[i]->szMsg);
-
+ wchar_t *szMsgW = mir_wstrdup(ps[i]->m_szMsg);
#ifdef _DEBUG
- log2file("CSStatusChange(): Set \"%s\" status message for %s.", ps[i]->szMsg, ps[i]->szName);
+ log2file("CSStatusChange(): Set \"%s\" status message for %s.", ps[i]->m_szMsg, ps[i]->m_szName);
#endif
int max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (int j = 1; j <= max_hist_msgs; j++)
@@ -1534,7 +1532,7 @@ static int CSStatusChange(WPARAM wParam, LPARAM)
if (!mir_wstrcmp(tszStatusMsg, szMsgW))
{
found = true;
- mir_snprintf(szSetting, "Last%sMsg", ps[i]->szName);
+ mir_snprintf(szSetting, "Last%sMsg", ps[i]->m_szName);
db_set_s(NULL, "SimpleStatusMsg", szSetting, buff);
mir_free(tszStatusMsg);
break;
@@ -1546,19 +1544,19 @@ static int CSStatusChange(WPARAM wParam, LPARAM)
if (!found)
{
- mir_snprintf(buff, "FCur%sMsg", ps[i]->szName);
- mir_snprintf(szSetting, "Last%sMsg", ps[i]->szName);
+ mir_snprintf(buff, "FCur%sMsg", ps[i]->m_szName);
+ mir_snprintf(szSetting, "Last%sMsg", ps[i]->m_szName);
db_set_s(NULL, "SimpleStatusMsg", szSetting, buff);
}
- mir_snprintf(szSetting, "%sMsg", ps[i]->szName);
+ mir_snprintf(szSetting, "%sMsg", ps[i]->m_szName);
db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status_mode, szSetting), szMsgW);
- msg = InsertVarsIntoMsg(szMsgW, ps[i]->szName, status_mode, NULL);
- SaveMessageToDB(ps[i]->szName, szMsgW, TRUE);
+ msg = InsertVarsIntoMsg(szMsgW, ps[i]->m_szName, status_mode, NULL);
+ SaveMessageToDB(ps[i]->m_szName, szMsgW, TRUE);
mir_free(szMsgW);
- SaveMessageToDB(ps[i]->szName, msg, FALSE);
+ SaveMessageToDB(ps[i]->m_szName, msg, FALSE);
mir_free(msg);
}
}