summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-07-09 14:08:57 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-07-09 14:08:57 (GMT)
commita96419df01b462c1ab047bdde6f2b2797a444870 (patch)
treeb7becdc001863740197c7433f18259341103a07a /Swift
parentcc1fb8f1402747ab2969439de80148ec46bf2aee (diff)
downloadswift-a96419df01b462c1ab047bdde6f2b2797a444870.zip
swift-a96419df01b462c1ab047bdde6f2b2797a444870.tar.bz2
Prune the recent chats
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 5173a6f..dbba9a5 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -103,11 +103,15 @@ ChatsManager::~ChatsManager() {
void ChatsManager::saveRecents() {
std::string recents;
+ int i = 1;
foreach (ChatListWindow::Chat chat, recentChats_) {
std::vector<std::string> activity;
boost::split(activity, chat.activity, boost::is_any_of("\t\n"));
std::string recent = chat.jid.toString() + "\t" + activity[0] + "\t" + (chat.isMUC ? "true" : "false") + "\t" + chat.nick;
recents += recent + "\n";
+ if (i++ > 25) {
+ break;
+ }
}
profileSettings_->storeString(RECENT_CHATS, recents);
}