-void IrcUser::setRealName(const QString &realName) {
- if (!realName.isEmpty() && _realName != realName) {
- _realName = realName;
- emit realNameSet(realName);
- }
+
+// This function is only ever called by SYNC calls from legacy cores (pre-0.13).
+// Therefore, no SYNC call is needed here.
+void IrcUser::setLastAwayMessage(const int &lastAwayMessage)
+{
+ QDateTime lastAwayMessageTime = QDateTime();
+ lastAwayMessageTime.setTimeSpec(Qt::UTC);
+#if QT_VERSION >= 0x050800
+ lastAwayMessageTime.fromSecsSinceEpoch(lastAwayMessage);
+#else
+ // toSecsSinceEpoch() was added in Qt 5.8. Manually downconvert to seconds for now.
+ // See https://doc.qt.io/qt-5/qdatetime.html#toMSecsSinceEpoch
+ lastAwayMessageTime.fromMSecsSinceEpoch(lastAwayMessage * 1000);
+#endif
+ setLastAwayMessageTime(lastAwayMessageTime);