Add signal/slot for decryption changes in last patch
This commit is contained in:
parent
a4c280a4f9
commit
b298f01d92
@ -153,6 +153,7 @@ signals:
|
|||||||
|
|
||||||
void updateGroupsInfo(const mtx::responses::JoinedGroups &groups);
|
void updateGroupsInfo(const mtx::responses::JoinedGroups &groups);
|
||||||
void themeChanged();
|
void themeChanged();
|
||||||
|
void decryptSidebarChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showUnreadMessageNotification(int count);
|
void showUnreadMessageNotification(int count);
|
||||||
|
@ -117,6 +117,10 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
userSettingsPage_, SIGNAL(trayOptionChanged(bool)), trayIcon_, SLOT(setVisible(bool)));
|
userSettingsPage_, SIGNAL(trayOptionChanged(bool)), trayIcon_, SLOT(setVisible(bool)));
|
||||||
connect(
|
connect(
|
||||||
userSettingsPage_, &UserSettingsPage::themeChanged, chat_page_, &ChatPage::themeChanged);
|
userSettingsPage_, &UserSettingsPage::themeChanged, chat_page_, &ChatPage::themeChanged);
|
||||||
|
connect(userSettingsPage_,
|
||||||
|
&UserSettingsPage::decryptSidebarChanged,
|
||||||
|
chat_page_,
|
||||||
|
&ChatPage::decryptSidebarChanged);
|
||||||
connect(trayIcon_,
|
connect(trayIcon_,
|
||||||
SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
|
||||||
this,
|
this,
|
||||||
|
@ -184,7 +184,7 @@ encrypt_group_message(const std::string &room_id, const std::string &device_id,
|
|||||||
data.relates_to = relation;
|
data.relates_to = relation;
|
||||||
|
|
||||||
auto message_index = olm_outbound_group_session_message_index(res.session);
|
auto message_index = olm_outbound_group_session_message_index(res.session);
|
||||||
nhlog::crypto()->info("next message_index {}", message_index);
|
nhlog::crypto()->debug("next message_index {}", message_index);
|
||||||
|
|
||||||
// We need to re-pickle the session after we send a message to save the new message_index.
|
// We need to re-pickle the session after we send a message to save the new message_index.
|
||||||
cache::updateOutboundMegolmSession(room_id, message_index);
|
cache::updateOutboundMegolmSession(room_id, message_index);
|
||||||
|
@ -432,6 +432,7 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
|
|||||||
|
|
||||||
connect(decryptSidebar_, &Toggle::toggled, this, [this](bool isDisabled) {
|
connect(decryptSidebar_, &Toggle::toggled, this, [this](bool isDisabled) {
|
||||||
settings_->setDecryptSidebar(!isDisabled);
|
settings_->setDecryptSidebar(!isDisabled);
|
||||||
|
emit decryptSidebarChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(avatarCircles_, &Toggle::toggled, this, [this](bool isDisabled) {
|
connect(avatarCircles_, &Toggle::toggled, this, [this](bool isDisabled) {
|
||||||
|
@ -183,6 +183,7 @@ signals:
|
|||||||
void moveBack();
|
void moveBack();
|
||||||
void trayOptionChanged(bool value);
|
void trayOptionChanged(bool value);
|
||||||
void themeChanged();
|
void themeChanged();
|
||||||
|
void decryptSidebarChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void importSessionKeys();
|
void importSessionKeys();
|
||||||
|
@ -502,6 +502,13 @@ isMessage(const mtx::events::Event<T> &)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
auto
|
||||||
|
isMessage(const mtx::events::EncryptedEvent<T> &)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TimelineModel::updateLastMessage()
|
TimelineModel::updateLastMessage()
|
||||||
{
|
{
|
||||||
|
@ -189,6 +189,7 @@ public:
|
|||||||
Q_INVOKABLE void cacheMedia(QString eventId);
|
Q_INVOKABLE void cacheMedia(QString eventId);
|
||||||
Q_INVOKABLE bool saveMedia(QString eventId) const;
|
Q_INVOKABLE bool saveMedia(QString eventId) const;
|
||||||
|
|
||||||
|
void updateLastMessage();
|
||||||
void addEvents(const mtx::responses::Timeline &events);
|
void addEvents(const mtx::responses::Timeline &events);
|
||||||
template<class T>
|
template<class T>
|
||||||
void sendMessage(const T &msg);
|
void sendMessage(const T &msg);
|
||||||
@ -257,7 +258,6 @@ private:
|
|||||||
const std::string &user_id,
|
const std::string &user_id,
|
||||||
const mtx::responses::ClaimKeys &res,
|
const mtx::responses::ClaimKeys &res,
|
||||||
mtx::http::RequestErr err);
|
mtx::http::RequestErr err);
|
||||||
void updateLastMessage();
|
|
||||||
void readEvent(const std::string &id);
|
void readEvent(const std::string &id);
|
||||||
|
|
||||||
QHash<QString, mtx::events::collections::TimelineEvents> events;
|
QHash<QString, mtx::events::collections::TimelineEvents> events;
|
||||||
|
@ -16,6 +16,19 @@
|
|||||||
|
|
||||||
Q_DECLARE_METATYPE(mtx::events::collections::TimelineEvents)
|
Q_DECLARE_METATYPE(mtx::events::collections::TimelineEvents)
|
||||||
|
|
||||||
|
void
|
||||||
|
TimelineViewManager::updateEncryptedDescriptions()
|
||||||
|
{
|
||||||
|
QHash<QString, QSharedPointer<TimelineModel>>::iterator i;
|
||||||
|
for (i = models.begin(); i != models.end(); ++i) {
|
||||||
|
auto ptr = i.value();
|
||||||
|
|
||||||
|
if (!ptr.isNull()) {
|
||||||
|
ptr->updateLastMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TimelineViewManager::updateColorPalette()
|
TimelineViewManager::updateColorPalette()
|
||||||
{
|
{
|
||||||
@ -83,6 +96,10 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettin
|
|||||||
&ChatPage::themeChanged,
|
&ChatPage::themeChanged,
|
||||||
this,
|
this,
|
||||||
&TimelineViewManager::updateColorPalette);
|
&TimelineViewManager::updateColorPalette);
|
||||||
|
connect(dynamic_cast<ChatPage *>(parent),
|
||||||
|
&ChatPage::decryptSidebarChanged,
|
||||||
|
this,
|
||||||
|
&TimelineViewManager::updateEncryptedDescriptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -84,6 +84,7 @@ public slots:
|
|||||||
const QString &url,
|
const QString &url,
|
||||||
const QString &mime,
|
const QString &mime,
|
||||||
uint64_t dsize);
|
uint64_t dsize);
|
||||||
|
void updateEncryptedDescriptions();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef USE_QUICK_VIEW
|
#ifdef USE_QUICK_VIEW
|
||||||
|
Loading…
Reference in New Issue
Block a user