1
0
forked from blue/squawk

Fixing build without omemo, release preparation, unnecessary inheritance removed, info widget fix

This commit is contained in:
Blue 2024-02-04 09:44:19 -03:00
parent 829777935f
commit acd60eaba2
Signed by untrusted user: blue
GPG Key ID: 9B203B252A63EE38
13 changed files with 92 additions and 40 deletions

View File

@ -0,0 +1,45 @@
name: Squawk Release workflow
run-name: ${{ gitea.actor }} is running Squawk Release workflow on release ${{ gitea.event.release.tag_name }}
on:
release:
types: [published]
jobs:
Archlinux:
runs-on: archlinux
steps:
- name: Download the release tarball
run: curl -sL ${{ gitea.server_url }}/${{ gitea.repository }}/archive/${{ gitea.event.release.tag_name }}.tar.gz --output tarball.tar.gz
- name: Calculate SHA256 for the tarball
run: echo "tbSum=$(sha256sum tarball.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Unarchive tarball
run: tar -xvzf tarball.tar.gz
- name: Clone the AUR repository
run: |
echo "${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}" > key
chmod 600 key
GIT_SSH_COMMAND="ssh -i key -o 'IdentitiesOnly yes' -o 'StrictHostKeyChecking no'" git clone ssh://aur@aur.archlinux.org/squawk.git aur
chmod 777 -R aur
cd aur
git config user.name ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
git config user.email ${{ secrets.DEPLOY_TO_AUR_EMAIL }}
- name: Copy PKGBUILD to the directory
run: cp squawk/packaging/Archlinux/PKGBUILD aur/
- name: Put SHA256 sum to PKGBUILD file, and generate .SRCINFO
working-directory: aur
run: |
sed -i "/sha256sums=/c\sha256sums=('${{ env.tbSum }}')" PKGBUILD
sudo -u build makepkg --printsrcinfo > .SRCINFO
- name: Commit package to aur
working-directory: aur
run: |
git add PKGBUILD .SRCINFO
git commit -m "${{ gitea.event.release.body }}"
GIT_SSH_COMMAND="ssh -i ../key -o 'IdentitiesOnly yes' -o 'StrictHostKeyChecking no'" git push

View File

@ -1,9 +1,10 @@
# Changelog # Changelog
## Squawk 0.2.3 (UNRELEASED) ## Squawk 0.2.3 (February 04, 2024)
### Bug fixes ### Bug fixes
- "Add contact" and "Join conference" menu are enabled once again (pavavno)! - "Add contact" and "Join conference" menu are enabled once again (pavavno)!
- availability is now read from the same section of config file it was stored - availability is now read from the same section of config file it was stored
- automatic avatars (if a contact doesn't have one) get generated once again
### Improvements ### Improvements
- deactivated accounts now don't appear in combobox of "Add contact" and "Join conference" dialogues - deactivated accounts now don't appear in combobox of "Add contact" and "Join conference" dialogues
@ -11,6 +12,7 @@
- settings file on the disk is not rewritten every roster element expansion or collapse - settings file on the disk is not rewritten every roster element expansion or collapse
- removed unnecessary own vcard request at sturtup (used to do it to discover my own avatar) - removed unnecessary own vcard request at sturtup (used to do it to discover my own avatar)
- vcard window now is Info system and it can display more information - vcard window now is Info system and it can display more information
- reduced vcard request spam in MUCs
### New features ### New features
- now you can enable tray icon from settings! - now you can enable tray icon from settings!

View File

@ -33,7 +33,7 @@ option(SYSTEM_LMDBAL "Use system lmdbal lib" ON)
option(WITH_KWALLET "Build KWallet support module" ON) option(WITH_KWALLET "Build KWallet support module" ON)
option(WITH_KIO "Build KIO support module" ON) option(WITH_KIO "Build KIO support module" ON)
option(WITH_KCONFIG "Build KConfig support module" ON) option(WITH_KCONFIG "Build KConfig support module" ON)
option(WITH_OMEMO "Build OMEMO support module" ON) option(WITH_OMEMO "Build OMEMO support module" OFF) #it should be off by default untill I sourt the problems out
# Dependencies # Dependencies
## Qt ## Qt

View File

@ -60,12 +60,14 @@
#include "handlers/vcardhandler.h" #include "handlers/vcardhandler.h"
#include "handlers/discoveryhandler.h" #include "handlers/discoveryhandler.h"
#if (QXMPP_VERSION) >= QT_VERSION_CHECK(1, 5, 0)
#include <QXmppTrustManager.h>
#ifdef WITH_OMEMO #ifdef WITH_OMEMO
#include <QXmppOmemoManager.h> #include <QXmppOmemoManager.h>
#include <QXmppTrustManager.h>
#include "handlers/trusthandler.h"
#include "handlers/omemohandler.h" #include "handlers/omemohandler.h"
#endif #endif
#include "handlers/trusthandler.h"
#endif
namespace Core { namespace Core {

View File

@ -45,7 +45,10 @@ void Core::DelayManager::Info::receivedVCard(const Shared::VCard& card) {
throw 245; throw 245;
info = new Shared::VCard(card); info = new Shared::VCard(card);
#ifdef WITH_OMEMO
stage = Stage::waitingForBundles; stage = Stage::waitingForBundles;
#endif
} }
Shared::VCard * Core::DelayManager::Info::claim() { Shared::VCard * Core::DelayManager::Info::claim() {

View File

@ -242,7 +242,9 @@ void Core::DelayManager::Manager::jobIsCanceled(Job* job, bool wasRunning) {
emit gotVCard(jb->jid, Shared::VCard()); emit gotVCard(jb->jid, Shared::VCard());
break; break;
case InfoForUser::Stage::waitingForBundles: case InfoForUser::Stage::waitingForBundles:
#ifdef WITH_OMEMO
requestedBundles.erase(jb->jid); requestedBundles.erase(jb->jid);
#endif
break; break;
default: default:
break; break;
@ -356,6 +358,7 @@ void Core::DelayManager::Manager::receivedOwnVCard(const Shared::VCard& card) {
} }
} }
#ifdef WITH_OMEMO
void Core::DelayManager::Manager::receivedBundles(const QString& jid, const std::list<Shared::KeyInfo>& keys) { void Core::DelayManager::Manager::receivedBundles(const QString& jid, const std::list<Shared::KeyInfo>& keys) {
std::map<QString, Job::Id>::const_iterator itr = requestedBundles.find(jid); std::map<QString, Job::Id>::const_iterator itr = requestedBundles.find(jid);
if (itr == requestedBundles.end()) { if (itr == requestedBundles.end()) {
@ -397,6 +400,7 @@ void Core::DelayManager::Manager::receivedOwnBundles(const std::list<Shared::Key
emit gotOwnInfo(info); emit gotOwnInfo(info);
jobIsDone(jobId); jobIsDone(jobId);
} }
#endif
void Core::DelayManager::Manager::setOwnJid(const QString& jid) { void Core::DelayManager::Manager::setOwnJid(const QString& jid) {
ownJid = jid; ownJid = jid;

View File

@ -56,8 +56,11 @@ public slots:
signals: signals:
void requestVCard(const QString& jid); void requestVCard(const QString& jid);
void requestOwnVCard(); void requestOwnVCard();
#ifdef WITH_OMEMO
void requestBundles(const QString& jid); void requestBundles(const QString& jid);
void requestOwnBundles(); void requestOwnBundles();
#endif
void gotVCard(const QString& jid, const Shared::VCard& info); void gotVCard(const QString& jid, const Shared::VCard& info);
void gotOwnVCard(const Shared::VCard& info); void gotOwnVCard(const Shared::VCard& info);
@ -68,8 +71,11 @@ public slots:
void disconnected(); void disconnected();
void receivedOwnVCard(const Shared::VCard& card); void receivedOwnVCard(const Shared::VCard& card);
void receivedVCard(const QString& jid, const Shared::VCard& card); void receivedVCard(const QString& jid, const Shared::VCard& card);
#ifdef WITH_OMEMO
void receivedBundles(const QString& jid, const std::list<Shared::KeyInfo>& keys); void receivedBundles(const QString& jid, const std::list<Shared::KeyInfo>& keys);
void receivedOwnBundles(const std::list<Shared::KeyInfo>& keys); void receivedOwnBundles(const std::list<Shared::KeyInfo>& keys);
#endif
private: private:
void preScheduleJob(Job* job); void preScheduleJob(Job* job);

View File

@ -3,7 +3,6 @@ set(SOURCE_FILES
rosterhandler.cpp rosterhandler.cpp
vcardhandler.cpp vcardhandler.cpp
discoveryhandler.cpp discoveryhandler.cpp
omemohandler.cpp
trusthandler.cpp trusthandler.cpp
) )
@ -12,11 +11,12 @@ set(HEADER_FILES
rosterhandler.h rosterhandler.h
vcardhandler.h vcardhandler.h
discoveryhandler.h discoveryhandler.h
omemohandler.h
trusthandler.h trusthandler.h
) )
target_sources(squawk PRIVATE if(WITH_OMEMO)
${SOURCE_FILES} list(APPEND SOURCE_FILES omemohandler.cpp)
${HEADER_FILES} list(APPEND HEADER_FILES omemohandler.h)
) endif()
target_sources(squawk PRIVATE ${SOURCE_FILES})

View File

@ -6,15 +6,15 @@ pkgdesc="An XMPP desktop messenger, written on pure c++ (qt)"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://git.macaw.me/blue/squawk" url="https://git.macaw.me/blue/squawk"
license=('GPL3') license=('GPL3')
depends=('hicolor-icon-theme' 'desktop-file-utils' 'lmdbal' 'qxmpp>=1.1.0') depends=('hicolor-icon-theme' 'desktop-file-utils' 'lmdbal' 'qxmpp-qt5')
makedepends=('cmake>=3.3' 'imagemagick' 'qt5-tools' 'boost') makedepends=('cmake>=3.3' 'imagemagick' 'qt5-tools' 'boost')
optdepends=('kwallet: secure password storage (requires rebuild)' optdepends=('kwallet: secure password storage (requires rebuild)'
'kconfig: system themes support (requires rebuild)' 'kconfig: system themes support (requires rebuild)'
'kconfigwidgets: system themes support (requires rebuild)' 'kconfigwidgets: system themes support (requires rebuild)'
'kio: better show in folder action (requires rebuild)') 'kio: better show in folder action (requires rebuild)')
source=("$pkgname-$pkgver.tar.gz") source=("$pkgname-$pkgver.tar.gz::https://git.macaw.me/blue/$pkgname/archive/$pkgver.tar.gz")
sha256sums=('e4fa2174a3ba95159cc3b0bac3f00550c9e0ce971c55334e2662696a4543fc7e') sha256sums=('SKIP')
build() { build() {
cd "$srcdir/squawk" cd "$srcdir/squawk"
cmake . -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release cmake . -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release

View File

@ -24,7 +24,7 @@
#ifdef WITH_OMEMO #ifdef WITH_OMEMO
constexpr bool OMEMO_SUPPORT = true; constexpr bool OMEMO_SUPPORT = true;
#else #else
constexpr bool OMEMO_SUPPORT = false constexpr bool OMEMO_SUPPORT = false;
#endif #endif
QFont getFont (QFontDatabase::SystemFont type, bool bold = false, bool italic = false, qreal factor = 1.0) { QFont getFont (QFontDatabase::SystemFont type, bool bold = false, bool italic = false, qreal factor = 1.0) {

View File

@ -31,7 +31,7 @@ namespace Shared {
* *
* under development yet * under development yet
*/ */
class Info : public QObject, public VCard { class Info {
public: public:
Info (); Info ();
Info (const QString& address, EntryType = EntryType::none); Info (const QString& address, EntryType = EntryType::none);

View File

@ -19,13 +19,13 @@
#include <QXmppGlobal.h> #include <QXmppGlobal.h>
#include <QDebug> #include <QDebug>
#if (QXMPP_VERSION) < QT_VERSION_CHECK(1, 3, 0) #if (QXMPP_VERSION) < QT_VERSION_CHECK(1, 2, 0)
static const std::string QXMPP_VERSION_PATCH(std::to_string(QXMPP_VERSION & 0xff)); static const std::string _QXMPP_PATCH_(std::to_string(QXMPP_VERSION & 0xff));
static const std::string QXMPP_VERSION_MINOR(std::to_string((QXMPP_VERSION & 0xff00) >> 8)); static const std::string _QXMPP_MINOR_(std::to_string((QXMPP_VERSION & 0xff00) >> 8));
static const std::string QXMPP_VERSION_MAJOR(std::to_string(QXMPP_VERSION >> 16)); static const std::string _QXMPP_MAJOR_(std::to_string(QXMPP_VERSION >> 16));
static const QString QXMPP_VERSION_STRING = QString::fromStdString(QXMPP_VERSION_MAJOR + "." + QXMPP_VERSION_MINOR + "." + QXMPP_VERSION_PATCH); static const QString SQUAWK_INNER_QXMPP_VERSION_STRING = QString::fromStdString(_QXMPP_MAJOR_ + "." + _QXMPP_MINOR_ + "." + _QXMPP_PATCH_);
#else #else
static const QString QXMPP_VERSION_STRING = QXmppVersion(); static const QString SQUAWK_INNER_QXMPP_VERSION_STRING = QXmppVersion();
#endif #endif
About::About(QWidget* parent): About::About(QWidget* parent):
@ -39,7 +39,7 @@ About::About(QWidget* parent):
m_ui->qtBuiltAgainstVersion->setText(tr("(built against %1)").arg(QT_VERSION_STR)); m_ui->qtBuiltAgainstVersion->setText(tr("(built against %1)").arg(QT_VERSION_STR));
m_ui->qxmppVersionValue->setText(QXmppVersion()); m_ui->qxmppVersionValue->setText(QXmppVersion());
m_ui->qxmppBuiltAgainstVersion->setText(tr("(built against %1)").arg(QXMPP_VERSION_STRING)); m_ui->qxmppBuiltAgainstVersion->setText(tr("(built against %1)").arg(SQUAWK_INNER_QXMPP_VERSION_STRING));
setWindowFlag(Qt::Tool); setWindowFlag(Qt::Tool);
@ -52,8 +52,7 @@ About::~About() {
} }
}; };
void About::onLicenseActivated() void About::onLicenseActivated() {
{
if (license == nullptr) { if (license == nullptr) {
QFile file; QFile file;
bool found = false; bool found = false;
@ -106,7 +105,6 @@ void About::onLicenseActivated()
license->show(); license->show();
} }
void About::onLicenseClosed() void About::onLicenseClosed() {
{
license = nullptr; license = nullptr;
} }

View File

@ -14,8 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef ABOUT_H #pragma once
#define ABOUT_H
#include <QWidget> #include <QWidget>
#include <QScopedPointer> #include <QScopedPointer>
@ -24,16 +23,11 @@
#include <QTextStream> #include <QTextStream>
#include <QStandardPaths> #include <QStandardPaths>
namespace Ui namespace Ui{
{
class About; class About;
} }
/** class About : public QWidget {
* @todo write docs
*/
class About : public QWidget
{
Q_OBJECT Q_OBJECT
public: public:
About(QWidget* parent = nullptr); About(QWidget* parent = nullptr);
@ -47,5 +41,3 @@ private:
QScopedPointer<Ui::About> m_ui; QScopedPointer<Ui::About> m_ui;
QWidget* license; QWidget* license;
}; };
#endif // ABOUT_H