-void IrcUser::setHost(const QString &host) {
- so_sync(so_arg_cast(host));
- if(!host.isEmpty() && _host != host) {
- _host = host;
- emit hostSet(host);
- }
+
+// 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);