diff options
author | George Hazan <ghazan@miranda.im> | 2021-03-29 20:22:11 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-03-29 20:22:11 +0300 |
commit | 2b8b769b36b5bad2bda27d9ebd6f10ab8bd958e8 (patch) | |
tree | ea18d8f5c734723d2899842896ae5e60d901968c /plugins/Sessions/Src/SaveSessions.cpp | |
parent | 9095d273ba1716fa842c3ce2d81fef0cb22ffc80 (diff) |
code reordering
Diffstat (limited to 'plugins/Sessions/Src/SaveSessions.cpp')
-rw-r--r-- | plugins/Sessions/Src/SaveSessions.cpp | 24 |
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) |