summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2013-03-08 16:10:12 (GMT)
committerSwift Review <review@swift.im>2013-03-09 18:49:39 (GMT)
commita069a0df0f51a948a86e34d99f952a33eecd97ba (patch)
treeef1fa153fab0b8e4db6893d26148914930025492 /Swift/Controllers
parent58a460f442dd85a351cc19edaf390936836dfe1a (diff)
downloadswift-a069a0df0f51a948a86e34d99f952a33eecd97ba.zip
swift-a069a0df0f51a948a86e34d99f952a33eecd97ba.tar.bz2
Show idle time as local time in the UI.
Change-Id: I4aabcd0dfd35fe06ff239dd0fb5f35c57226f461 License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Chat/ChatController.cpp5
-rw-r--r--Swift/Controllers/Roster/ContactRosterItem.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp
index 2d2d941..3c0e933 100644
--- a/Swift/Controllers/Chat/ChatController.cpp
+++ b/Swift/Controllers/Chat/ChatController.cpp
@@ -24,6 +24,7 @@
#include <Swift/Controllers/StatusUtil.h>
#include <Swiften/Disco/EntityCapsProvider.h>
#include <Swiften/Base/foreach.h>
+#include <Swiften/Base/DateTime.h>
#include <Swift/Controllers/UIEvents/UIEventStream.h>
#include <Swift/Controllers/UIEvents/SendFileUIEvent.h>
#include <Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h>
@@ -65,7 +66,7 @@ ChatController::ChatController(const JID& self, StanzaChannel* stanzaChannel, IQ
}
Idle::ref idle;
if (theirPresence && (idle = theirPresence->getPayload<Idle>())) {
- startMessage += QT_TRANSLATE_NOOP("", ", who has been idle since ") + boost::posix_time::to_simple_string(idle->getSince());
+ startMessage += str(format(QT_TRANSLATE_NOOP("", ", who has been idle since %1%")) % dateTimeToLocalString(idle->getSince()));
}
startMessage += ": " + statusShowTypeToFriendlyName(theirPresence ? theirPresence->getShow() : StatusShow::None);
if (theirPresence && !theirPresence->getStatus().empty()) {
@@ -342,7 +343,7 @@ std::string ChatController::getStatusChangeString(boost::shared_ptr<Presence> pr
}
Idle::ref idle;
if ((idle = presence->getPayload<Idle>())) {
- response += QT_TRANSLATE_NOOP("", " and has been idle since ") + boost::posix_time::to_simple_string(idle->getSince());
+ response += str(format(QT_TRANSLATE_NOOP("", " and has been idle since %1%")) % dateTimeToLocalString(idle->getSince()));
}
if (!response.empty()) {
diff --git a/Swift/Controllers/Roster/ContactRosterItem.cpp b/Swift/Controllers/Roster/ContactRosterItem.cpp
index d2edfe7..f301552 100644
--- a/Swift/Controllers/Roster/ContactRosterItem.cpp
+++ b/Swift/Controllers/Roster/ContactRosterItem.cpp
@@ -8,6 +8,7 @@
#include "Swift/Controllers/Roster/GroupRosterItem.h"
#include <Swiften/Base/foreach.h>
+#include <Swiften/Base/DateTime.h>
#include <Swiften/Elements/Idle.h>
#include <boost/date_time/posix_time/posix_time.hpp>
@@ -47,7 +48,7 @@ std::string ContactRosterItem::getIdleText() const {
if (!idle || idle->getSince().is_not_a_date_time()) {
return "";
} else {
- return boost::posix_time::to_simple_string(idle->getSince());
+ return dateTimeToLocalString(idle->getSince());
}
}