From 3a57283476de7d29d6652145336dc03964d5659c Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Fri, 24 Sep 2010 12:11:49 +0100
Subject: Don't overwrite date changes with presence changes


diff --git a/Swift/Controllers/Chat/ChatController.h b/Swift/Controllers/Chat/ChatController.h
index d44e0bf..6cb1443 100644
--- a/Swift/Controllers/Chat/ChatController.h
+++ b/Swift/Controllers/Chat/ChatController.h
@@ -32,6 +32,7 @@ namespace Swift {
 			String senderDisplayNameFromMessage(const JID& from);
 			virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message>) const;
 			void handleStanzaAcked(boost::shared_ptr<Stanza> stanza);
+			void dayTicked() {lastWasPresence_ = false;}
 
 		private:
 			NickResolver* nickResolver_;
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp
index 177cdf0..9619722 100644
--- a/Swift/Controllers/Chat/ChatControllerBase.cpp
+++ b/Swift/Controllers/Chat/ChatControllerBase.cpp
@@ -50,6 +50,7 @@ void ChatControllerBase::handleDayChangeTick() {
 	dateChangeTimer_->stop();
 	boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
 	chatWindow_->addSystemMessage("The day is now " + String(boost::posix_time::to_iso_extended_string(now)).getSubstring(0,10));
+	dayTicked();
 	createDayChangeTimer();
 }
 
diff --git a/Swift/Controllers/Chat/ChatControllerBase.h b/Swift/Controllers/Chat/ChatControllerBase.h
index fdc4381..fba173d 100644
--- a/Swift/Controllers/Chat/ChatControllerBase.h
+++ b/Swift/Controllers/Chat/ChatControllerBase.h
@@ -59,6 +59,7 @@ namespace Swift {
 			virtual void preSendMessageRequest(boost::shared_ptr<Message>) {};
 			virtual bool isFromContact(const JID& from);
 			virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message>) const = 0;
+			virtual void dayTicked() {};
 
 		private:
 			void createDayChangeTimer();
diff --git a/Swift/Controllers/Chat/MUCController.h b/Swift/Controllers/Chat/MUCController.h
index c922e83..3f226ef 100644
--- a/Swift/Controllers/Chat/MUCController.h
+++ b/Swift/Controllers/Chat/MUCController.h
@@ -75,6 +75,7 @@ namespace Swift {
 			bool messageTargetsMe(boost::shared_ptr<Message> message);
 			void updateJoinParts();
 			bool shouldUpdateJoinParts();
+			void dayTicked() {lastWasPresence_ = false;}
 		private:
 			MUC* muc_;
 			UIEventStream* events_;
-- 
cgit v0.10.2-6-g49f6