summaryrefslogtreecommitdiff
path: root/plugins/Sessions
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Sessions')
-rw-r--r--plugins/Sessions/Src/SaveSessions.cpp24
-rw-r--r--plugins/Sessions/Src/Utils.cpp22
-rw-r--r--plugins/Sessions/Src/Utils.h17
3 files changed, 32 insertions, 31 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)
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp
index a6a715198e..54a3d90e08 100644
--- a/plugins/Sessions/Src/Utils.cpp
+++ b/plugins/Sessions/Src/Utils.cpp
@@ -88,28 +88,6 @@ bool LoadContactsFromMask(MCONTACT hContact, int mode, int count)
return szValue[count] == '1';
}
-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 GetInSessionOrder(MCONTACT hContact, int mode, int count)
{
char szTemp[3] = { 0, 0, 0 };
diff --git a/plugins/Sessions/Src/Utils.h b/plugins/Sessions/Src/Utils.h
index ca43ddf913..741dbf7e0b 100644
--- a/plugins/Sessions/Src/Utils.h
+++ b/plugins/Sessions/Src/Utils.h
@@ -21,24 +21,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define __UTILS_H__
void SetInSessionOrder(MCONTACT hContact, int mode, int count, int ordernum);
-void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode);
-int GetInSessionOrder(MCONTACT hContact, int mode, int count);
+int GetInSessionOrder(MCONTACT hContact, int mode, int count);
void AddSessionMark(MCONTACT hContact, int mode, char bit);
void RemoveSessionMark(MCONTACT hContact, int mode, int marknum);
void SetSessionMark(MCONTACT hContact, int mode, char bit, int marknum);
bool LoadContactsFromMask(MCONTACT hContact, int mode, int count);
-int AddToCurSession(MCONTACT hContact, LPARAM lparam);
-int DelFromCurSession(MCONTACT hContact, LPARAM lparam);
-int CheckForDuplicate(MCONTACT contact_list[], MCONTACT lparam);
+int AddToCurSession(MCONTACT hContact, LPARAM lparam);
+int DelFromCurSession(MCONTACT hContact, LPARAM lparam);
+int CheckForDuplicate(MCONTACT contact_list[], MCONTACT lparam);
BOOL ResaveSettings(char *szName, int iFirst, int iLimit, wchar_t *pszPrevSetting);
void OffsetWindow(HWND parent, HWND hwnd, int dx, int dy);
-int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char *pszSetting, int iFirstNum);
-int MarkUserDefSession(int ses_count, BYTE bCheck);
+int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char *pszSetting, int iFirstNum);
+int MarkUserDefSession(int ses_count, BYTE bCheck);
BYTE IsMarkedUserDefSession(int ses_count);
void SavePosition(HWND hWnd, char *wndName);
void LoadPosition(HWND hWnd, char *wndName);
-int CheckContactVisibility(MCONTACT hContact);
+int CheckContactVisibility(MCONTACT hContact);
void RenameUserDefSession(int ses_count, wchar_t *ptszNewName);
-int FillFavoritesMenu(HMENU hMenu, int iLimit);
+int FillFavoritesMenu(HMENU hMenu, int iLimit);
#endif // __UTILS_H__ \ No newline at end of file