mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(offlinemsg): Force offline messages to always be enabled
This commit is contained in:
parent
22362d2940
commit
d934cf372b
|
@ -98,10 +98,6 @@ void OfflineMsgEngine::deliverOfflineMsgs()
|
|||
{
|
||||
QMutexLocker ml(&mutex);
|
||||
|
||||
if (!Settings::getInstance().getFauxOfflineMessaging()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!f->isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -155,7 +155,6 @@ void Settings::loadGlobal()
|
|||
checkUpdates = s.value("checkUpdates", true).toBool();
|
||||
notifySound = s.value("notifySound", true).toBool(); // note: notifySound and busySound UI elements are now under UI settings
|
||||
busySound = s.value("busySound", false).toBool(); // page, but kept under General in settings file to be backwards compatible
|
||||
fauxOfflineMessaging = s.value("fauxOfflineMessaging", true).toBool();
|
||||
autoSaveEnabled = s.value("autoSaveEnabled", false).toBool();
|
||||
globalAutoAcceptDir = s.value("globalAutoAcceptDir",
|
||||
QStandardPaths::locate(QStandardPaths::HomeLocation, QString(),
|
||||
|
@ -436,7 +435,6 @@ void Settings::saveGlobal()
|
|||
s.setValue("checkUpdates", checkUpdates);
|
||||
s.setValue("notifySound", notifySound);
|
||||
s.setValue("busySound", busySound);
|
||||
s.setValue("fauxOfflineMessaging", fauxOfflineMessaging);
|
||||
s.setValue("autoSaveEnabled", autoSaveEnabled);
|
||||
s.setValue("autoAcceptMaxSize", static_cast<qlonglong>(autoAcceptMaxSize));
|
||||
s.setValue("globalAutoAcceptDir", globalAutoAcceptDir);
|
||||
|
@ -2062,22 +2060,6 @@ void Settings::removeFriendSettings(const ToxPk& id)
|
|||
friendLst.remove(id.getByteArray());
|
||||
}
|
||||
|
||||
bool Settings::getFauxOfflineMessaging() const
|
||||
{
|
||||
QMutexLocker locker{&bigLock};
|
||||
return fauxOfflineMessaging;
|
||||
}
|
||||
|
||||
void Settings::setFauxOfflineMessaging(bool value)
|
||||
{
|
||||
QMutexLocker locker{&bigLock};
|
||||
|
||||
if (value != fauxOfflineMessaging) {
|
||||
fauxOfflineMessaging = value;
|
||||
emit fauxOfflineMessagingChanged(fauxOfflineMessaging);
|
||||
}
|
||||
}
|
||||
|
||||
bool Settings::getCompactLayout() const
|
||||
{
|
||||
QMutexLocker locker{&bigLock};
|
||||
|
|
|
@ -225,7 +225,6 @@ signals:
|
|||
void dateFormatChanged(const QString& format);
|
||||
void statusChangeNotificationEnabledChanged(bool enabled);
|
||||
void spellCheckingEnabledChanged(bool enabled);
|
||||
void fauxOfflineMessagingChanged(bool enabled);
|
||||
|
||||
// Privacy
|
||||
void typingNotificationChanged(bool enabled);
|
||||
|
@ -516,9 +515,6 @@ public:
|
|||
SIGNAL_IMPL(Settings, autoAcceptDirChanged, const ToxPk& id, const QString& dir)
|
||||
SIGNAL_IMPL(Settings, contactNoteChanged, const ToxPk& id, const QString& note)
|
||||
|
||||
bool getFauxOfflineMessaging() const;
|
||||
void setFauxOfflineMessaging(bool value);
|
||||
|
||||
bool getCompactLayout() const;
|
||||
void setCompactLayout(bool compact);
|
||||
|
||||
|
@ -600,7 +596,6 @@ private:
|
|||
bool dontShowDhtDialog;
|
||||
|
||||
bool autoLogin;
|
||||
bool fauxOfflineMessaging;
|
||||
bool compactLayout;
|
||||
FriendListSortingMode sortingMode;
|
||||
bool groupchatPosition;
|
||||
|
|
|
@ -1141,7 +1141,7 @@ void ChatForm::SendMessageStr(QString msg)
|
|||
QString selfPk = Core::getInstance()->getSelfId().toString();
|
||||
QString pk = f->getPublicKey().toString();
|
||||
QString name = Core::getInstance()->getUsername();
|
||||
bool isSent = !Settings::getInstance().getFauxOfflineMessaging();
|
||||
bool const isSent = false; // This forces history to add it to the offline messages table
|
||||
history->addNewMessage(pk, historyPart, selfPk, timestamp, isSent, name,
|
||||
[messageSent, offMsgEngine, receipt, ma](RowId id) {
|
||||
if (messageSent) {
|
||||
|
|
|
@ -144,7 +144,6 @@ GeneralForm::GeneralForm(SettingsWidget* myParent)
|
|||
bodyUI->closeToTray->setEnabled(showSystemTray);
|
||||
|
||||
bodyUI->statusChanges->setChecked(s.getStatusChangeNotificationEnabled());
|
||||
bodyUI->cbFauxOfflineMessaging->setChecked(s.getFauxOfflineMessaging());
|
||||
|
||||
bodyUI->autoAwaySpinBox->setValue(s.getAutoAwayTime());
|
||||
bodyUI->autoSaveFilesDir->setText(s.getGlobalAutoAcceptDir());
|
||||
|
@ -217,11 +216,6 @@ void GeneralForm::on_statusChanges_stateChanged()
|
|||
Settings::getInstance().setStatusChangeNotificationEnabled(bodyUI->statusChanges->isChecked());
|
||||
}
|
||||
|
||||
void GeneralForm::on_cbFauxOfflineMessaging_stateChanged()
|
||||
{
|
||||
Settings::getInstance().setFauxOfflineMessaging(bodyUI->cbFauxOfflineMessaging->isChecked());
|
||||
}
|
||||
|
||||
void GeneralForm::on_autoAwaySpinBox_editingFinished()
|
||||
{
|
||||
int minutes = bodyUI->autoAwaySpinBox->value();
|
||||
|
|
|
@ -50,8 +50,6 @@ private slots:
|
|||
void on_autoAwaySpinBox_editingFinished();
|
||||
void on_minimizeToTray_stateChanged();
|
||||
void on_statusChanges_stateChanged();
|
||||
void on_cbFauxOfflineMessaging_stateChanged();
|
||||
|
||||
void on_autoacceptFiles_stateChanged();
|
||||
void on_maxAutoAcceptSizeMB_editingFinished();
|
||||
void on_autoSaveFilesDir_clicked();
|
||||
|
|
|
@ -222,13 +222,6 @@ instead of closing itself.</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbFauxOfflineMessaging">
|
||||
<property name="text">
|
||||
<string>Faux offline messaging</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -371,7 +364,6 @@ instead of closing itself.</string>
|
|||
<tabstop>minimizeToTray</tabstop>
|
||||
<tabstop>closeToTray</tabstop>
|
||||
<tabstop>statusChanges</tabstop>
|
||||
<tabstop>cbFauxOfflineMessaging</tabstop>
|
||||
<tabstop>autoAwaySpinBox</tabstop>
|
||||
<tabstop>autoSaveFilesDir</tabstop>
|
||||
<tabstop>autoacceptFiles</tabstop>
|
||||
|
|
Loading…
Reference in New Issue
Block a user