summaryrefslogtreecommitdiff
path: root/plugins/Sessions/Src/SaveSessions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Sessions/Src/SaveSessions.cpp')
-rw-r--r--plugins/Sessions/Src/SaveSessions.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/Sessions/Src/SaveSessions.cpp b/plugins/Sessions/Src/SaveSessions.cpp
index b715cfd502..04f7bb155e 100644
--- a/plugins/Sessions/Src/SaveSessions.cpp
+++ b/plugins/Sessions/Src/SaveSessions.cpp
@@ -75,6 +75,30 @@ static int SaveUserSessionName(MCONTACT *pSession, wchar_t *szUSessionName)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode)
+{
+ char buf[100];
+ mir_snprintf(buf, "%02u", ordernum);
+
+ if (mode == 0) {
+ CMStringA szValue(g_plugin.getMStringA(hContact, "LastSessionsOrder"));
+ if (writemode == 0 && szValue.IsEmpty())
+ return;
+
+ szValue.Insert(0, buf);
+ szValue.Truncate(g_ses_limit * 2);
+ g_plugin.setString(hContact, "LastSessionsOrder", szValue);
+ }
+ else if (mode == 1) {
+ CMStringA szValue(g_plugin.getMStringA(hContact, "UserSessionsOrder"));
+ szValue.Insert(0, buf);
+ szValue.Truncate(g_ses_count * 2);
+ g_plugin.setString(hContact, "UserSessionsOrder", szValue);
+ }
+}
+
int SaveSessionHandles(MCONTACT *pSession, bool bNewSession)
{
if (pSession[0] == 0)