commit:     a8c443eafd66555f64443342cf7015222a3cae09
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 31 11:28:06 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Jul 31 11:29:15 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8c443ea

net-im/neochat: Fix build with >=net-libs/libquotient-0.8

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/neochat-23.04.3-libquotient-0.8-1.patch  | 91 ++++++++++++++++++++++
 .../files/neochat-23.04.3-libquotient-0.8-2.patch  | 55 +++++++++++++
 net-im/neochat/neochat-23.04.3.ebuild              |  2 +
 3 files changed, 148 insertions(+)

diff --git a/net-im/neochat/files/neochat-23.04.3-libquotient-0.8-1.patch 
b/net-im/neochat/files/neochat-23.04.3-libquotient-0.8-1.patch
new file mode 100644
index 000000000000..9e4aaa3b19df
--- /dev/null
+++ b/net-im/neochat/files/neochat-23.04.3-libquotient-0.8-1.patch
@@ -0,0 +1,91 @@
+From a94f46f90462dce1f817e9f28d24dad454e0dfb4 Mon Sep 17 00:00:00 2001
+From: Tobias Fella <fe...@posteo.de>
+Date: Fri, 26 May 2023 17:47:26 +0200
+Subject: [PATCH] Fix build against libQuotient 0.8
+
+---
+ src/controller.cpp | 24 ++++++++++++++++++++----
+ src/login.cpp      |  4 ++++
+ 2 files changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/src/controller.cpp b/src/controller.cpp
+index dd38ede9b..3835e312b 100644
+--- a/src/controller.cpp
++++ b/src/controller.cpp
+@@ -109,18 +109,22 @@ Controller::Controller(QObject *parent)
+     }
+ #endif
+ 
++#ifdef QUOTIENT_07
++    connect(&Accounts, &AccountRegistry::accountCountChanged, this, 
&Controller::activeConnectionIndexChanged);
++#else
+     connect(&AccountRegistry::instance(), 
&AccountRegistry::accountCountChanged, this, 
&Controller::activeConnectionIndexChanged);
++#endif
+ 
+ #ifdef QUOTIENT_07
+     static int oldAccountCount = 0;
+-    connect(&AccountRegistry::instance(), 
&AccountRegistry::accountCountChanged, this, [=]() {
+-        if (AccountRegistry::instance().size() > oldAccountCount) {
+-            auto connection = 
AccountRegistry::instance().accounts()[AccountRegistry::instance().size() - 1];
++    connect(&Accounts, &AccountRegistry::accountCountChanged, this, [=]() {
++        if (Accounts.size() > oldAccountCount) {
++            auto connection = Accounts.accounts()[Accounts.size() - 1];
+             connect(connection, &Connection::syncDone, this, [=]() {
+                 handleNotifications(connection);
+             });
+         }
+-        oldAccountCount = AccountRegistry::instance().size();
++        oldAccountCount = Accounts.size();
+     });
+ #endif
+ }
+@@ -228,10 +232,18 @@ void Controller::logout(Connection *conn, bool 
serverSideLogout)
+     job.start();
+     loop.exec();
+ 
++#ifdef QUOTIENT_07
++    if (Accounts.count() > 1) {
++#else
+     if (AccountRegistry::instance().count() > 1) {
++#endif
+         // Only set the connection if the the account being logged out is 
currently active
+         if (conn == activeConnection()) {
++#ifdef QUOTIENT_07
++            setActiveConnection(Accounts.accounts()[0]);
++#else
+             setActiveConnection(AccountRegistry::instance().accounts()[0]);
++#endif
+         }
+     } else {
+         setActiveConnection(nullptr);
+@@ -495,7 +507,11 @@ NeochatChangePasswordJob::NeochatChangePasswordJob(const 
QString &newPassword, b
+ 
+ int Controller::accountCount() const
+ {
++#ifdef QUOTIENT_07
++    return Accounts.count();
++#else
+     return AccountRegistry::instance().count();
++#endif
+ }
+ 
+ void Controller::setQuitOnLastWindowClosed()
+diff --git a/src/login.cpp b/src/login.cpp
+index 1121875f9..8b937abaa 100644
+--- a/src/login.cpp
++++ b/src/login.cpp
+@@ -43,7 +43,11 @@ void Login::init()
+             return;
+         }
+ 
++#ifdef QUOTIENT_07
++        m_isLoggedIn = Accounts.isLoggedIn(m_matrixId);
++#else
+         m_isLoggedIn = AccountRegistry::instance().isLoggedIn(m_matrixId);
++#endif
+         Q_EMIT isLoggedInChanged();
+         if (m_isLoggedIn) {
+             return;
+-- 
+GitLab
+

diff --git a/net-im/neochat/files/neochat-23.04.3-libquotient-0.8-2.patch 
b/net-im/neochat/files/neochat-23.04.3-libquotient-0.8-2.patch
new file mode 100644
index 000000000000..2bd85146b28f
--- /dev/null
+++ b/net-im/neochat/files/neochat-23.04.3-libquotient-0.8-2.patch
@@ -0,0 +1,55 @@
+From 8f4e5a41c58986b68406251051c26beb059dd9ce Mon Sep 17 00:00:00 2001
+From: Tobias Fella <fe...@posteo.de>
+Date: Sun, 28 May 2023 11:22:40 +0200
+Subject: [PATCH] Drop reset*Count invocations
+
+Still coming from Spectral, where they were taken from Quaternion, where they 
were dropped because they don't work as expected.
+Also, soon to be removed from libQuotient itself.
+---
+ src/neochatroom.cpp | 10 ----------
+ src/neochatroom.h   |  1 -
+ 2 files changed, 11 deletions(-)
+
+diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp
+index a98b6cdbe..101c0fc50 100644
+--- a/src/neochatroom.cpp
++++ b/src/neochatroom.cpp
+@@ -66,8 +66,6 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString 
roomId, JoinState joinS
+     : Room(connection, std::move(roomId), joinState)
+ {
+     connect(connection, &Connection::accountDataChanged, this, 
&NeoChatRoom::updatePushNotificationState);
+-    connect(this, &NeoChatRoom::notificationCountChanged, this, 
&NeoChatRoom::countChanged);
+-    connect(this, &NeoChatRoom::highlightCountChanged, this, 
&NeoChatRoom::countChanged);
+     connect(this, &Room::fileTransferCompleted, this, [this] {
+         setFileUploadingProgress(0);
+         setHasFileUploading(false);
+@@ -410,14 +408,6 @@ void NeoChatRoom::onRedaction(const RoomEvent &prevEvent, 
const RoomEvent & /*af
+     }
+ }
+ 
+-void NeoChatRoom::countChanged()
+-{
+-    if (displayed() && !hasUnreadMessages()) {
+-        resetNotificationCount();
+-        resetHighlightCount();
+-    }
+-}
+-
+ QDateTime NeoChatRoom::lastActiveTime()
+ {
+     if (timelineSize() == 0) {
+diff --git a/src/neochatroom.h b/src/neochatroom.h
+index d0795f383..6125cfa96 100644
+--- a/src/neochatroom.h
++++ b/src/neochatroom.h
+@@ -866,7 +866,6 @@ private:
+ #endif
+ 
+ private Q_SLOTS:
+-    void countChanged();
+     void updatePushNotificationState(QString type);
+ 
+     void cacheLastEvent();
+-- 
+GitLab
+

diff --git a/net-im/neochat/neochat-23.04.3.ebuild 
b/net-im/neochat/neochat-23.04.3.ebuild
index 77b0c006b60c..09f09da36393 100644
--- a/net-im/neochat/neochat-23.04.3.ebuild
+++ b/net-im/neochat/neochat-23.04.3.ebuild
@@ -49,3 +49,5 @@ RDEPEND="${DEPEND}
        >=kde-frameworks/purpose-${KFMIN}:5
 "
 BDEPEND="virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/${P}-libquotient-0.8-{1,2}.patch )

Reply via email to