Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package leechcraft for openSUSE:Factory checked in at 2021-11-01 18:35:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/leechcraft (Old) and /work/SRC/openSUSE:Factory/.leechcraft.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "leechcraft" Mon Nov 1 18:35:43 2021 rev:66 rq:928557 version:0.6.70+git.14794.g33744ae6ce Changes: -------- --- /work/SRC/openSUSE:Factory/leechcraft/leechcraft-doc.changes 2021-09-07 21:22:15.429363572 +0200 +++ /work/SRC/openSUSE:Factory/.leechcraft.new.1890/leechcraft-doc.changes 2021-11-01 18:35:57.609344283 +0100 @@ -1,0 +2,6 @@ +Fri Oct 29 05:26:33 UTC 2021 - Dmitriy Perlow <dap.darkness@gmail.com> + +- Updated to 0.6.70-14794.g33744ae6ce snapshot: + * no changes for doc subpackages. + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/leechcraft/leechcraft.changes 2021-09-07 21:22:15.445363591 +0200 +++ /work/SRC/openSUSE:Factory/.leechcraft.new.1890/leechcraft.changes 2021-11-01 18:35:57.629344295 +0100 @@ -1,0 +2,6 @@ +Fri Oct 29 05:26:33 UTC 2021 - Dmitriy Perlow <dap.darkness@gmail.com> + +- Updated to 0.6.70-14794.g33744ae6ce snapshot: + * Qt5WebKit bcond. + +------------------------------------------------------------------- Old: ---- leechcraft-0.6.70-14771-g9d21b0f8ad.tar.xz New: ---- leechcraft-0.6.70-14794-g33744ae6ce.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ leechcraft-doc.spec ++++++ --- /var/tmp/diff_new_pack.hj1oLd/_old 2021-11-01 18:35:58.361344713 +0100 +++ /var/tmp/diff_new_pack.hj1oLd/_new 2021-11-01 18:35:58.365344716 +0100 @@ -16,10 +16,10 @@ # -%define LEECHCRAFT_VERSION 0.6.70-14771-g9d21b0f8ad +%define LEECHCRAFT_VERSION 0.6.70-14794-g33744ae6ce Name: leechcraft-doc -Version: 0.6.70+git.14771.g9d21b0f8ad +Version: 0.6.70+git.14794.g33744ae6ce Release: 0 Summary: Modular Internet Client Documentation License: BSL-1.0 ++++++ leechcraft.spec ++++++ --- /var/tmp/diff_new_pack.hj1oLd/_old 2021-11-01 18:35:58.381344725 +0100 +++ /var/tmp/diff_new_pack.hj1oLd/_new 2021-11-01 18:35:58.385344727 +0100 @@ -20,6 +20,7 @@ %global __requires_exclude (org.LC.common.1)|(org.LC.Blasq.1)|(SB2.1)|(Mellonetray.1)|(org.LC.Ooronee.1) %bcond_without ffmpeg +%bcond_with QtWebKit %define plugin_dir %{_libdir}/leechcraft/plugins-qt5 %define translations_dir %{_datadir}/leechcraft/translations @@ -27,7 +28,7 @@ %define qml_dir %{_datadir}/leechcraft/qml5 %define so_ver -qt5-0_6_75 -%define LEECHCRAFT_VERSION 0.6.70-14771-g9d21b0f8ad +%define LEECHCRAFT_VERSION 0.6.70-14794-g33744ae6ce %define db_postfix %{so_ver}_1 %define gui_postfix %{so_ver}_1 @@ -46,7 +47,7 @@ %define xsd_postfix %{so_ver} Name: leechcraft -Version: 0.6.70+git.14771.g9d21b0f8ad +Version: 0.6.70+git.14794.g33744ae6ce Release: 0 Summary: Modular Internet Client License: BSL-1.0 @@ -81,9 +82,7 @@ BuildRequires: libsensors4-devel BuildRequires: libtidy-devel BuildRequires: pkgconfig -%if 0%{?suse_version} > 1325 BuildRequires: wt-devel -%endif BuildRequires: cmake(Qt5LinguistTools) >= 5.13 BuildRequires: pkgconfig(Qt5Concurrent) >= 5.13 BuildRequires: pkgconfig(Qt5Core) >= 5.13 @@ -106,8 +105,9 @@ %ifnarch ppc ppc64 ppc64le s390 s390x BuildRequires: cmake(Qt5WebEngineWidgets) >= 5.13 %endif -# Will be removed soon! WIP: core, blogique, lhtr etc. +%if %{with QtWebKit} BuildRequires: pkgconfig(Qt5WebKitWidgets) >= 5.13 +%endif BuildRequires: pkgconfig(Qt5Widgets) >= 5.13 BuildRequires: pkgconfig(Qt5X11Extras) >= 5.13 BuildRequires: pkgconfig(Qt5Xml) >= 5.13 @@ -184,8 +184,17 @@ Recommends: %{name}-visualnotifications Suggests: %{name}-lastfmscrobble +%ifarch ppc ppc64 ppc64le s390 s390x +Obsoletes: %{name}-azoth +%endif +%if %{without QtWebKit} +Obsoletes: %{name}-blogique +%endif Obsoletes: %{name}-choroid Obsoletes: %{name}-harbinger +%if %{without QtWebKit} +Obsoletes: %{name}-lhtr +%endif Obsoletes: %{name}-nacheku Obsoletes: %{name}-popishu %ifarch ppc ppc64 ppc64le s390 s390x @@ -232,8 +241,8 @@ Requires: %{name}-http = %{version} Requires: libQt5Sql5-sqlite Recommends: %{name}-poshuku = %{version} -%if 0%{?suse_version} < 1325 -Obsoletes: %{name}-aggregator-webaccess +%if %{without QtWebKit} +Obsoletes: %{name}-aggregator-bodyfetch %endif %description aggregator @@ -252,6 +261,7 @@ A web browser plugin is recommended to show the news in a fancy way. +%if %{with QtWebKit} %package aggregator-bodyfetch Summary: LeechCraft Aggregator Bodyfetch Module License: BSL-1.0 @@ -268,9 +278,9 @@ Fetching is done according to little scripts called recipes. For this to work, a script provider like Qrosp should be installed. Please refer to the guide to writing recipes if you are interested in writing your own. +%endif -%if 0%{?suse_version} > 1325 %package aggregator-webaccess Summary: LeechCraft Aggregator Web Interface Module License: BSL-1.0 @@ -281,7 +291,7 @@ WebAccess provides a basic web interface for the Aggregator feed reader, so one can read news articles from a mobile device or another machine. -%endif + %package anhero Summary: LeechCraft Crash handler Module @@ -775,6 +785,7 @@ for LeechCraft Blasq. +%if %{with QtWebKit} %package blogique Summary: LeechCraft Blogging client Module License: BSL-1.0 @@ -811,6 +822,7 @@ %description blogique-metida This package provides a LiveJournal subplugin for LeechCraft Blogique. +%endif %package certmgr @@ -1259,6 +1271,7 @@ This package provides another Network Monitor plugin for Leechcraft. +%if %{with QtWebKit} %package lhtr Summary: LeechCraft HTML WYSIWYG editor Module License: BSL-1.0 @@ -1269,6 +1282,7 @@ %description lhtr This package provides a HTML WYSIWYG editor plugin for Leechcraft, usable with mail and blog modules. +%endif %package liznoo @@ -1661,7 +1675,13 @@ Requires: %{name}-poshuku-backend = %{version} Recommends: %{name}-imgaste = %{version} Recommends: %{name}-intermutko = %{version} +%if %{without QtWebKit} +Obsoletes: %{name}-poshuku-dcac +%endif Obsoletes: %{name}-poshuku-foc +%if %{without QtWebKit} +Obsoletes: %{name}-poshuku-speeddial +%endif Obsoletes: %{name}-poshuku-webkitview %description poshuku @@ -1703,6 +1723,7 @@ * Whitelists for the Flash blocker. +%if %{with QtWebKit} %package poshuku-dcac Summary: LeechCraft Poshuku DC/AC Module License: BSL-1.0 @@ -1712,6 +1733,7 @@ %description poshuku-dcac This package provides the DC/AC plugin for LeechCraft Poshuku which inverts colors on web pages. +%endif %package poshuku-fatape @@ -1819,6 +1841,7 @@ which can represent the URL of a web page as a QR code. +%if %{with QtWebKit} %package poshuku-speeddial Summary: LeechCraft Poshuku Speed Dial Module License: BSL-1.0 @@ -1827,6 +1850,7 @@ %description poshuku-speeddial This package provides the Speed Dial support plugin for LeechCraft Poshuku. +%endif %package poshuku-webengineview @@ -2267,7 +2291,11 @@ -DENABLE_UTIL_TESTS=True \ -DENABLE_ADVANCEDNOTIFICATIONS=True \ -DENABLE_AGGREGATOR=True \ +%if %{with QtWebKit} -DENABLE_AGGREGATOR_BODYFETCH=True \ +%else + -DENABLE_AGGREGATOR_BODYFETCH=False \ +%endif -DENABLE_AGGREGATOR_WEBACCESS=True \ -DENABLE_AUSCRIE=True \ %ifnarch ppc ppc64 ppc64le s390 s390x @@ -2314,9 +2342,13 @@ -DENABLE_BLASQ_RAPPOR=True \ -DENABLE_BLASQ_SPEGNERSI=False \ -DENABLE_BLASQ_VANGOG=True \ +%if %{with QtWebKit} -DENABLE_BLOGIQUE=True \ -DENABLE_BLOGIQUE_HESTIA=True \ -DENABLE_BLOGIQUE_METIDA=True \ +%else + -DENABLE_BLOGIQUE=False \ +%endif -DENABLE_CERTMGR=True \ -DENABLE_CHOROID=False \ -DENABLE_CPULOAD=True \ @@ -2344,8 +2376,12 @@ -DENABLE_LAUGHTY=True \ -DENABLE_LAUNCHY=True \ -DENABLE_LEMON=True \ +%if %{with QtWebKit} -DENABLE_LHTR=True \ -DWITH_LHTR_HTML=True \ +%else + -DENABLE_LHTR=False \ +%endif -DENABLE_LIZNOO=True \ -DENABLE_LMP=True \ -DENABLE_LMP_BRAINSLUGZ=True \ @@ -2394,8 +2430,12 @@ -DENABLE_IDN=True \ -DENABLE_POSHUKU_AUTOSEARCH=True \ -DENABLE_POSHUKU_CLEANWEB=True \ +%if %{with QtWebKit} -DENABLE_POSHUKU_DCAC=True \ -DENABLE_POSHUKU_DCAC_TESTS=True \ +%else + -DENABLE_POSHUKU_DCAC=False \ +%endif -DENABLE_POSHUKU_FATAPE=True \ -DENABLE_POSHUKU_FILESCHEME=True \ -DENABLE_POSHUKU_FUA=True \ @@ -2404,7 +2444,11 @@ -DENABLE_POSHUKU_ONLINEBOOKMARKS_DELICIOUS=True \ -DENABLE_POSHUKU_ONLINEBOOKMARKS_READITLATER=True \ -DENABLE_POSHUKU_QRD=True \ +%if %{with QtWebKit} -DENABLE_POSHUKU_SPEEDDIAL=True \ +%else + -DENABLE_POSHUKU_SPEEDDIAL=False \ +%endif -DENABLE_POSHUKU_WEBENGINEVIEW=True \ -DENABLE_POSHUKU_WEBENGINEVIEW_TESTS=True \ -DENABLE_POSHUKU_WEBKITVIEW=False \ @@ -2530,20 +2574,20 @@ %{translations_dir}/*craft_aggregator_??.qm %{translations_dir}/*craft_aggregator_??_??.qm %{plugin_dir}/*craft_aggregator.so +%dir %{_datadir}/leechcraft/scripts +%if %{with QtWebKit} %files aggregator-bodyfetch %defattr(-,root,root) %{plugin_dir}/*craft_aggregator_bodyfetch.so -%dir %{_datadir}/leechcraft/scripts -%{_datadir}/leechcraft/scripts/aggregator/ +%{_datadir}/leechcraft/scripts/aggregator +%endif -%if 0%{?suse_version} > 1325 %files aggregator-webaccess %defattr(-,root,root) %{plugin_dir}/*craft_aggregator_webaccess.so %{settings_dir}/aggregatorwebaccesssettings.xml %{translations_dir}/*craft_aggregator_webaccess*.qm -%endif %files anhero %defattr(-,root,root) @@ -2761,6 +2805,7 @@ %{plugin_dir}/lib%{name}_blasq_vangog.so %{translations_dir}/*craft_blasq_vangog*.qm +%if %{with QtWebKit} %files blogique %defattr(-,root,root) %{plugin_dir}/lib%{name}_blogique.so @@ -2781,6 +2826,7 @@ %{plugin_dir}/lib%{name}_blogique_metida.so %{settings_dir}/blogiquemetidasettings.xml %{translations_dir}/*craft_blogique_metida*.qm +%endif %files certmgr %defattr(-,root,root) @@ -2973,11 +3019,13 @@ %{translations_dir}/*craft_lemon_*.qm %{settings_dir}/lemonsettings.xml +%if %{with QtWebKit} %files lhtr %defattr(-,root,root) %{plugin_dir}/lib%{name}_lhtr.so %{translations_dir}/*craft_lhtr_*.qm %{settings_dir}/lhtrsettings.xml +%endif %files liznoo %defattr(-,root,root) @@ -3181,12 +3229,14 @@ %{translations_dir}/*craft_poshuku_cleanweb*.qm %{plugin_dir}/*craft_poshuku_cleanweb.so +%if %{with QtWebKit} %files poshuku-dcac %defattr(-,root,root) %{plugin_dir}/*craft_poshuku_dcac.so %{translations_dir}/*craft_poshuku_dcac_??.qm %{translations_dir}/*craft_poshuku_dcac_??_??.qm %{settings_dir}/poshukudcacsettings.xml +%endif %files poshuku-fatape %defattr(-,root,root) @@ -3231,12 +3281,14 @@ %{translations_dir}/*craft_poshuku_qrd_??.qm %{translations_dir}/*craft_poshuku_qrd_??_??.qm +%if %{with QtWebKit} %files poshuku-speeddial %defattr(-,root,root) %{plugin_dir}/lib%{name}_poshuku_speeddial.so %{settings_dir}/poshukuspeeddialsettings.xml %{translations_dir}/*craft_poshuku_speeddial_??.qm %{translations_dir}/*craft_poshuku_speeddial_??_??.qm +%endif %files poshuku-webengineview %defattr(-,root,root) ++++++ _service ++++++ --- /var/tmp/diff_new_pack.hj1oLd/_old 2021-11-01 18:35:58.413344743 +0100 +++ /var/tmp/diff_new_pack.hj1oLd/_new 2021-11-01 18:35:58.413344743 +0100 @@ -1,7 +1,7 @@ <services> <service name="verify_file" mode="buildtime"> - <param name="file">leechcraft-0.6.70-14771-g9d21b0f8ad.tar.xz</param> + <param name="file">leechcraft-0.6.70-14794-g33744ae6ce.tar.xz</param> <param name="verifier">sha1</param> - <param name="checksum">c40cf203f1ed547fd115954c51d6664adb9fa277</param> + <param name="checksum">140c7d03a72fe4671646f6b7070c91584890a53d</param> </service> </services> ++++++ leechcraft-0.6.70-14771-g9d21b0f8ad.tar.xz -> leechcraft-0.6.70-14794-g33744ae6ce.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/chattab.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/chattab.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/chattab.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/chattab.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -132,6 +132,22 @@ fontsWidget->RegisterSettable (this); + Ui_.View_->setFocusProxy (Ui_.MsgEdit_); + for (const auto child : Ui_.View_->findChildren<QWidget*> ()) + child->setFocusProxy (Ui_.MsgEdit_); + + Ui_.View_->installEventFilter (Util::MakeLambdaEventFilter ([this] (QChildEvent *e) + { + if (e->type () != QEvent::ChildAdded) + return false; + + if (const auto w = qobject_cast<QWidget*> (e->child ())) + w->setFocusProxy (Ui_.MsgEdit_); + + return false; + }, + this)); + Ui_.View_->installEventFilter (Util::MakeLambdaEventFilter ([this, fontsWidget] (QWheelEvent *e) { if (!(e->modifiers () & Qt::ControlModifier)) @@ -237,8 +253,6 @@ GetEntry<QObject> (), Ui_.View_); - Ui_.View_->setFocusProxy (Ui_.MsgEdit_); - HandleMUCParticipantsChanged (); connect (Core::Instance ().GetCustomChatStyleManager (), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/core.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/core.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/core.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/core.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -804,9 +804,9 @@ op ("entryId", other->GetEntryID ()); } - string.append ("<span class='nickname'><a href='"); + string.append ("<span class='nickname'><a href=\""); string.append (url.toEncoded ()); - string.append ("' class='nicklink' style='text-decoration:none; color:"); + string.append ("\" class='nicklink' style='text-decoration:none; color:"); string.append (color); string.append ("'>"); string.append (nick); @@ -1021,7 +1021,6 @@ PluginProxyObject_->GetFormatterProxy ().FormatLinks (body); body.replace ('\n', "<br />"); body.replace (" ", " "); - body.replace ('"', """); } body = HandleSmiles (body); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/interfaces/azoth/iprovidecommands.h new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/interfaces/azoth/iprovidecommands.h --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/interfaces/azoth/iprovidecommands.h 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/interfaces/azoth/iprovidecommands.h 2021-09-06 21:42:59.000000000 +0200 @@ -61,26 +61,8 @@ QStringList Names_; Command_f Command_; - QString Description_; - QString Help_; - - StaticCommand () = default; - StaticCommand (const StaticCommand&) = default; - - StaticCommand (const QStringList& names, const Command_f& command) - : Names_ { names } - , Command_ { command } - { - } - - StaticCommand (const QStringList& names, const Command_f& command, - const QString& descr, const QString& help) - : Names_ { names } - , Command_ { command } - , Description_ { descr } - , Help_ { help } - { - } + QString Description_ = {}; + QString Help_ = {}; }; typedef QList<StaticCommand> StaticCommands_t; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/acetamide.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/acetamide.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/acetamide.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/acetamide.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -24,7 +24,7 @@ { namespace Acetamide { - void Plugin::Init (ICoreProxy_ptr proxy) + void Plugin::Init (ICoreProxy_ptr) { Translator_.reset (Util::InstallTranslator ("azoth_acetamide")); @@ -36,15 +36,8 @@ SettingsDialog_->RegisterObject (&XmlSettingsManager::Instance (), "azothacetamidesettings.xml"); - Core::Instance ().SetProxy (proxy); - SettingsDialog_->SetCustomWidget ("NickServIdentifyWidget", Core::Instance ().GetNickServIdentifyWidget ()); - - connect (&Core::Instance (), - SIGNAL (gotEntity (const LC::Entity&)), - this, - SIGNAL (gotEntity (const LC::Entity&))); } void Plugin::SecondInit () @@ -74,7 +67,7 @@ QIcon Plugin::GetIcon () const { - return Core::Instance ().GetProxy ()->GetIconThemeManager ()->GetPluginIcon (); + return GetProxyHolder ()->GetIconThemeManager ()->GetPluginIcon (); } QSet<QByteArray> Plugin::GetPluginClasses () const @@ -107,26 +100,5 @@ } } -QDataStream& operator<< (QDataStream& out, const QList<QStringList>& list) -{ - for (const auto& subList : list) - out << subList; - - return out; -} - -QDataStream& operator>> (QDataStream& in, QList<QStringList>& list) -{ - QStringList subList; - while (!in.atEnd ()) - { - in >> subList; - list << subList; - subList.clear (); - } - - return in; -} - LC_EXPORT_PLUGIN (leechcraft_azoth_acetamide, LC::Azoth::Acetamide::Plugin); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/acetamide.h new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/acetamide.h --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/acetamide.h 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/acetamide.h 2021-09-06 21:42:59.000000000 +0200 @@ -52,16 +52,10 @@ public slots: void initPlugin (QObject*); signals: - void gotEntity (const LC::Entity&); void gotNewProtocols (const QList<QObject*>&); }; } } } -QDataStream& operator<< (QDataStream& out, const QList<QStringList>& myObj); -QDataStream& operator>> (QDataStream& in, QList<QStringList>& myObj); - -Q_DECLARE_METATYPE (QList<QStringList>) - #endif // PLUGINS_AZOTH_PLUGINS_ACETAMIDE_ACETAMIDE_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/clientconnection.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/clientconnection.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/clientconnection.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/clientconnection.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -10,11 +10,12 @@ #include <QTextCodec> #include <util/sll/prelude.h> #include <util/xpc/util.h> +#include <interfaces/core/icoreproxy.h> +#include <interfaces/core/ientitymanager.h> #include <interfaces/azoth/iprotocol.h> #include <interfaces/azoth/iproxyobject.h> #include "channelclentry.h" #include "channelhandler.h" -#include "core.h" #include "ircprotocol.h" #include "ircserverclentry.h" #include "ircserverhandler.h" @@ -87,12 +88,8 @@ return; } - IrcServerHandler *ish = new IrcServerHandler (server, Account_); + const auto ish = new IrcServerHandler (server, Account_); emit gotRosterItems ({ ish->GetCLEntry () }); - connect (ish, - SIGNAL (gotSocketError (QAbstractSocket::SocketError, const QString&)), - this, - SLOT (handleError(QAbstractSocket::SocketError, const QString&))); ish->SetConsoleEnabled (IsConsoleEnabled_); if (IsConsoleEnabled_) @@ -122,10 +119,10 @@ if (ServerHandlers_ [serverId]->IsChannelExists (channelId)) { - Entity e = Util::MakeNotification ("Azoth", - tr ("This channel is already joined."), - Priority::Critical); - Core::Instance ().SendEntity (e); + const auto& e = Util::MakeNotification ("Azoth", + tr ("This channel is already joined."), + Priority::Warning); + GetProxyHolder ()->GetEntityManager ()->HandleEntity(e); return; } @@ -199,9 +196,12 @@ } if (hadUnknownVersions) - Core::Instance ().SendEntity (Util::MakeNotification ("Azoth Acetamide", - tr ("Some bookmarks were lost due to unknown storage version."), - Priority::Warning)); + { + const auto& entity = Util::MakeNotification ("Azoth Acetamide", + tr ("Some bookmarks were lost due to unknown storage version."), + Priority::Warning); + GetProxyHolder ()->GetEntityManager ()->HandleEntity (entity); + } return bookmarks; } @@ -218,7 +218,10 @@ void ClientConnection::DisconnectFromAll () { - for (auto ish : ServerHandlers_) + // we need to make a copy here since `SendQuit()` might cause the handler + // to be removed synchronously + const auto& values = ServerHandlers_.values (); + for (auto ish : values) ish->SendQuit (); } @@ -306,38 +309,6 @@ QString ())); } - void ClientConnection::handleError (QAbstractSocket::SocketError error, - const QString& errorString) - { - qWarning () << Q_FUNC_INFO - << error - << errorString; - IrcServerHandler *ish = qobject_cast<IrcServerHandler*> (sender ()); - if (!ish) - { - qWarning () << Q_FUNC_INFO - << "is not an IrcServerHandler" - << sender (); - return; - } - - serverDisconnected (ish->GetServerID ()); - - Entity e = Util::MakeNotification ("Azoth", - errorString, - Priority::Critical); - Core::Instance ().SendEntity (e); - - const auto& serverOpts = ish->GetServerOptions (); - - const auto& activeChannels = Util::Map (ish->GetChannelHandlers (), - &ChannelHandler::GetChannelOptions); - - JoinServer (serverOpts); - for (const auto& co : activeChannels) - JoinChannel (serverOpts, co); - } - void ClientConnection::handleLog (IMessage::Direction type, const QString& msg) { switch (type) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/clientconnection.h new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/clientconnection.h --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/clientconnection.h 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/clientconnection.h 2021-09-06 21:42:59.000000000 +0200 @@ -74,8 +74,6 @@ public slots: void serverConnected (const QString&); void serverDisconnected (const QString&); - void handleError (QAbstractSocket::SocketError error, - const QString& errorString); void handleLog (IMessage::Direction, const QString&); signals: void gotRosterItems (const QList<QObject*>&); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/core.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/core.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/core.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/core.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -61,21 +61,6 @@ return qobject_cast<IProxyObject*> (PluginProxy_); } - void Core::SetProxy (ICoreProxy_ptr proxy) - { - Proxy_ = proxy; - } - - ICoreProxy_ptr Core::GetProxy () const - { - return Proxy_; - } - - void Core::SendEntity (const LC::Entity& e) - { - emit gotEntity (e); - } - void Core::handleItemsAdded (const QList<QObject*>&) { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/core.h new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/core.h --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/core.h 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/core.h 2021-09-06 21:42:59.000000000 +0200 @@ -32,7 +32,6 @@ { Q_OBJECT - ICoreProxy_ptr Proxy_; std::shared_ptr<IrcProtocol> IrcProtocol_; QObject *PluginProxy_ = nullptr; QStandardItemModel* Model_; @@ -49,9 +48,6 @@ void SetPluginProxy (QObject*); IProxyObject* GetPluginProxy () const; - void SetProxy (ICoreProxy_ptr); - ICoreProxy_ptr GetProxy () const; - void SendEntity (const Entity&); NickServIdentifyWidget* GetNickServIdentifyWidget () const; QStandardItemModel* GetNickServIdentifyModel () const; @@ -65,8 +61,6 @@ const QString&, const QString&) const; private slots: void handleItemsAdded (const QList<QObject*>&); - signals: - void gotEntity (const LC::Entity&); }; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircerrorhandler.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircerrorhandler.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircerrorhandler.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircerrorhandler.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -9,9 +9,10 @@ #include "ircerrorhandler.h" #include <QTextCodec> +#include <interfaces/core/icoreproxy.h> +#include <interfaces/core/ientitymanager.h> #include <util/xpc/util.h> #include <util/xpc/notificationactionhandler.h> -#include "core.h" #include "ircserverhandler.h" namespace LC @@ -42,7 +43,7 @@ options.Message_ : (paramsMessage + ": " + options.Message_), Priority::Warning); - Core::Instance ().SendEntity (e); + GetProxyHolder ()->GetEntityManager ()->HandleEntity (e); } bool IrcErrorHandler::IsError (int id) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircserverhandler.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircserverhandler.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircserverhandler.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircserverhandler.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -9,10 +9,11 @@ #include "ircserverhandler.h" #include <QTextCodec> #include <QTimer> -#include <QMessageBox> -#include <QInputDialog> #include <util/util.h> #include <util/xpc/notificationactionhandler.h> +#include <util/xpc/util.h> +#include <interfaces/core/icoreproxy.h> +#include <interfaces/core/ientitymanager.h> #include "channelhandler.h" #include "channelclentry.h" #include "servercommandmessage.h" @@ -83,6 +84,8 @@ handleSetAutoWho (); } + IrcServerHandler::~IrcServerHandler () = default; + IrcServerCLEntry* IrcServerHandler::GetCLEntry () const { return ServerCLEntry_; @@ -220,8 +223,11 @@ void IrcServerHandler::SendQuit () { - IrcParser_->QuitCommand (QStringList (Account_->GetClientConnection ()-> - GetStatusStringForState (SOffline))); + if (ServerConnectionState_ == Connected) + IrcParser_->QuitCommand ({ Account_->GetClientConnection ()->GetStatusStringForState (SOffline) }); + + if (Socket_) + Socket_->Close (); } void IrcServerHandler::QuitParticipant (const QString& nick, const QString& msg) @@ -913,15 +919,64 @@ if (ServerConnectionState_ != NotConnected) return; - Socket_ = new IrcServerSocket (this); - Socket_->ConnectToHost (ServerOptions_.ServerName_, - ServerOptions_.ServerPort_); + Socket_ = std::make_unique<IrcServerSocket> (this); + Socket_->ConnectToHost (ServerOptions_.ServerName_, ServerOptions_.ServerPort_); ServerConnectionState_ = InProgress; - connect (Socket_, - SIGNAL (sslErrors (QList<QSslError>, ICanHaveSslErrors::ISslErrorsReaction_ptr)), + connect (Socket_.get (), + &IrcServerSocket::connected, + this, + [this] + { + ServerConnectionState_ = Connected; + emit connected (ServerID_); + ServerCLEntry_->SetStatus (EntryStatus (SOnline, QString ())); + IrcParser_->AuthCommand (); + + for (const auto& handler : GetChannelHandlers ()) + JoinChannel (handler->GetChannelOptions ()); + }); + connect (Socket_.get (), + &IrcServerSocket::disconnected, + this, + [this, socket = Socket_.get ()] + { + ServerConnectionState_ = NotConnected; + ServerCLEntry_->SetStatus (EntryStatus (SOffline, QString ())); + socket->Close (); + emit disconnected (ServerID_); + }); + + connect (Socket_.get (), + &IrcServerSocket::retriableSocketError, + this, + [this] (QAbstractSocket::SocketError, const QString& errorString) + { + ServerConnectionState_ = NotConnected; + ServerCLEntry_->SetStatus (EntryStatus (SError, errorString)); + + const auto& e = Util::MakeNotification ("Azoth", + errorString, + Priority::Warning); + GetProxyHolder ()->GetEntityManager ()->HandleEntity (e); + }); + connect (Socket_.get (), + &IrcServerSocket::finalSocketError, + this, + [this] (QAbstractSocket::SocketError, const QString& errorString) + { + ServerConnectionState_ = NotConnected; + ServerCLEntry_->SetStatus (EntryStatus (SError, errorString)); + + const auto& e = Util::MakeNotification ("Azoth", + errorString, + Priority::Critical); + GetProxyHolder ()->GetEntityManager ()->HandleEntity (e); + }); + connect (Socket_.get (), + &IrcServerSocket::sslErrors, Account_, - SIGNAL (sslErrors (QList<QSslError>, ICanHaveSslErrors::ISslErrorsReaction_ptr))); + &IrcAccount::sslErrors); } void IrcServerHandler::DisconnectFromServer () @@ -1167,23 +1222,6 @@ emit gotChannelsEnd (); } - void IrcServerHandler::connectionEstablished () - { - ServerConnectionState_ = Connected; - emit connected (ServerID_); - ServerCLEntry_->SetStatus (EntryStatus (SOnline, QString ())); - IrcParser_->AuthCommand (); - } - - void IrcServerHandler::connectionClosed () - { - ServerConnectionState_ = NotConnected; - ServerCLEntry_->SetStatus (EntryStatus (SOffline, QString ())); - if (Socket_) - Socket_->Close (); - emit disconnected (ServerID_); - } - void IrcServerHandler::joinAfterInvite () { for (const auto& channel : InviteChannelsDialog_->GetChannels ()) @@ -1206,25 +1244,6 @@ } } - void IrcServerHandler::handleSocketError (QAbstractSocket::SocketError error) - { - QTcpSocket *socket = qobject_cast<QTcpSocket*> (sender ()); - if (!socket) - { - qWarning () << Q_FUNC_INFO - << "is not an object of TcpSocket" - << sender (); - return; - } - - qDebug () << "Socket error on server:" - << ServerID_ - << error - << socket->errorString (); - - emit gotSocketError (error, socket->errorString ()); - } - void IrcServerHandler::showChannels (const QStringList&) { IrcParser_->ChannelsListCommand (QStringList ()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircserverhandler.h new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircserverhandler.h --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircserverhandler.h 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircserverhandler.h 2021-09-06 21:42:59.000000000 +0200 @@ -45,7 +45,7 @@ IrcErrorHandler *ErrorHandler_; IrcParser *IrcParser_ = 0; IrcServerCLEntry *ServerCLEntry_; - IrcServerSocket *Socket_ = 0; + std::unique_ptr<IrcServerSocket> Socket_; UserCommandManager *CmdManager_ = 0; ServerResponseManager *ServerResponseManager_ = 0; RplISupportParser *RplISupportParser_ = 0; @@ -70,6 +70,7 @@ int LastNickIndex_ = 0; public: IrcServerHandler (const ServerOptions& server, IrcAccount* account); + ~IrcServerHandler () override; IrcServerCLEntry* GetCLEntry () const; IrcAccount* GetAccount () const; @@ -225,11 +226,8 @@ ServerParticipantEntry_ptr CreateParticipantEntry (const QString&); public slots: void autoWhoRequest (); - void handleSocketError (QAbstractSocket::SocketError error); void showChannels (const QStringList& = QStringList ()); private slots: - void connectionEstablished (); - void connectionClosed (); void joinAfterInvite (); void handleSetAutoWho (); void handleUpdateWhoPeriod (); @@ -238,8 +236,6 @@ void disconnected (const QString&); void sendMessageToConsole (IMessage::Direction, const QString&); void nicknameConflict (const QString&); - void gotSocketError (QAbstractSocket::SocketError error, - const QString& erorString); void gotChannelsBegin (); void gotChannels (const ChannelsDiscoverInfo& info); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircserversocket.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircserversocket.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircserversocket.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircserversocket.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -10,45 +10,108 @@ #include "ircserversocket.h" #include <QTcpSocket> #include <QTextCodec> -#include <interfaces/core/icoreproxy.h> +#include <QTimer> #include <interfaces/core/ientitymanager.h> #include <util/xpc/util.h> #include <util/sll/visitor.h> -#include <util/sll/functional.h> +#include <util/sll/qtutil.h> #include "ircserverhandler.h" #include "clientconnection.h" -namespace LC +namespace LC::Azoth::Acetamide { -namespace Azoth -{ -namespace Acetamide -{ - int elideWidth = 300; + constexpr int MaxRetriesCount = 10; IrcServerSocket::IrcServerSocket (IrcServerHandler *ish) - : QObject (ish) - , ISH_ (ish) + : QObject { ish } + , ISH_ { ish } + , RetryTimer_ { new QTimer { this } } { + RetryTimer_->setSingleShot (true); + RetryTimer_->callOnTimeout ([this] + { + qDebug () << "LC::Azoth::Acetamide::IrcServerSocket: retrying..."; + ConnectToHost (Host_, Port_); + }); + if (ish->GetServerOptions ().SSL_) - Socket_ = std::make_shared<QSslSocket> (); + { + auto socket = std::make_shared<QSslSocket> (); + Socket_ = socket; + connect (socket.get (), + qOverload<const QList<QSslError>&> (&QSslSocket::sslErrors), + this, + &IrcServerSocket::handleSslErrors); + } else Socket_ = std::make_shared<QTcpSocket> (); - Init (); + const auto socket = GetSocketPtr (); + + connect (socket, + &QTcpSocket::readyRead, + this, + [this, socket] + { + RetriesCount_ = 0; + RetryTimer_->stop (); + + while (socket->canReadLine ()) + ISH_->ReadReply (socket->readLine ()); + }); + + connect (socket, + &QTcpSocket::connected, + this, + [this, socket] + { + qDebug () << "LC::Azoth::Acetamide::IrcServerSocket: connected"; + emit connected (); + connect (socket, + &QTcpSocket::disconnected, + this, + &IrcServerSocket::disconnected, + Qt::UniqueConnection); + }); + + connect (socket, + &QTcpSocket::errorOccurred, + this, + [this, socket] (QAbstractSocket::SocketError error) + { + disconnect (socket, + &QTcpSocket::disconnected, + this, + &IrcServerSocket::disconnected); + + qWarning () << "LC::Azoth::Acetamide::IrcServerSocket:" + << error + << "after" << RetriesCount_ << "retries;" + << socket->errorString (); + if (++RetriesCount_ > MaxRetriesCount) + { + emit finalSocketError (error, socket->errorString ()); + return; + } + emit retriableSocketError (error, socket->errorString ()); + RetryTimer_->start ((2 * RetriesCount_ + 1) * 1000); + }); } IrcServerSocket::~IrcServerSocket () { if (const auto socket = GetSocketPtr ()) { - QObject::disconnect (socket, 0, 0, 0); + QObject::disconnect (socket, nullptr, nullptr, nullptr); socket->abort (); } } void IrcServerSocket::ConnectToHost (const QString& host, int port) { + Host_ = host; + Port_ = port; + Util::Visit (Socket_, [&] (const Tcp_ptr& ptr) { ptr->connectToHost (host, port); }, [&] (const Ssl_ptr& ptr) { ptr->connectToHostEncrypted (host, port); }); @@ -56,10 +119,7 @@ void IrcServerSocket::DisconnectFromHost () { - if (const auto socket = GetSocketPtr ()) - { - socket->disconnectFromHost (); - } + GetSocketPtr ()->disconnectFromHost (); } void IrcServerSocket::Send (const QString& message) @@ -86,47 +146,13 @@ GetSocketPtr ()->close (); } - void IrcServerSocket::Init () - { - const auto socket = GetSocketPtr (); - connect (socket, - SIGNAL (readyRead ()), - this, - SLOT (readReply ())); - - connect (socket, - SIGNAL (connected ()), - ISH_, - SLOT (connectionEstablished ())); - - connect (socket, - SIGNAL (disconnected ()), - ISH_, - SLOT (connectionClosed ())); - - connect (socket, - SIGNAL (error (QAbstractSocket::SocketError)), - ISH_, - SLOT (handleSocketError (QAbstractSocket::SocketError))); - - Util::Visit (Socket_, - [this] (const Ssl_ptr& ptr) - { - connect (ptr.get (), - SIGNAL (sslErrors (const QList<QSslError> &)), - this, - SLOT (handleSslErrors (const QList<QSslError>&))); - }, - [] (auto) {}); - } - void IrcServerSocket::RefreshCodec () { const auto encoding = ISH_->GetServerOptions ().ServerEncoding_; if (LastCodec_ && LastCodec_->name () == encoding) return; - const auto newCodec = encoding == "System" ? + const auto newCodec = encoding == "System"_ql ? QTextCodec::codecForLocale () : QTextCodec::codecForName (encoding.toLatin1 ()); if (newCodec) @@ -145,7 +171,7 @@ tr ("Unknown encoding %1.") .arg ("<em>" + encoding + "</em>"), Priority::Critical); - Core::Instance ().GetProxy ()->GetEntityManager ()->HandleEntity (notify); + GetProxyHolder ()->GetEntityManager ()->HandleEntity (notify); if (LastCodec_) return; @@ -159,14 +185,7 @@ QTcpSocket* IrcServerSocket::GetSocketPtr () const { return Util::Visit (Socket_, - [] (const auto& ptr) { return Util::Upcast<QTcpSocket*> (ptr.get ()); }); - } - - void IrcServerSocket::readReply () - { - const auto socket = GetSocketPtr (); - while (socket->canReadLine ()) - ISH_->ReadReply (socket->readLine ()); + [] (const auto& ptr) -> QTcpSocket* { return ptr.get (); }); } namespace @@ -175,7 +194,7 @@ { std::weak_ptr<QSslSocket> Sock_; public: - SslErrorsReaction (const std::shared_ptr<QSslSocket>& sock) + explicit SslErrorsReaction (const std::shared_ptr<QSslSocket>& sock) : Sock_ { sock } { } @@ -192,17 +211,10 @@ }; } - void IrcServerSocket::HandleSslErrors (const std::shared_ptr<QSslSocket>& s, const QList<QSslError>& errors) - { - emit sslErrors (errors, std::make_shared<SslErrorsReaction> (s)); - } - void IrcServerSocket::handleSslErrors (const QList<QSslError>& errors) { Util::Visit (Socket_, - [&] (const Ssl_ptr& s) { HandleSslErrors (s, errors); }, + [&] (const Ssl_ptr& s) { emit sslErrors (errors, std::make_shared<SslErrorsReaction> (s)); }, [] (auto) { qWarning () << Q_FUNC_INFO << "expected SSL socket"; }); } } -} -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircserversocket.h new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircserversocket.h --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/ircserversocket.h 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/ircserversocket.h 2021-09-06 21:42:59.000000000 +0200 @@ -11,16 +11,14 @@ #include <memory> #include <variant> #include <QObject> -#include <QSslSocket> +#include <QAbstractSocket> #include <interfaces/azoth/icanhavesslerrors.h> class QTcpSocket; +class QSslSocket; +class QTimer; -namespace LC -{ -namespace Azoth -{ -namespace Acetamide +namespace LC::Azoth::Acetamide { class IrcServerHandler; class IrcAccount; @@ -36,27 +34,31 @@ std::variant<Tcp_ptr, Ssl_ptr> Socket_; QTextCodec *LastCodec_ = nullptr; + + QString Host_; + int Port_; + int RetriesCount_ = 0; + QTimer * const RetryTimer_; public: - IrcServerSocket (IrcServerHandler*); - ~IrcServerSocket(); + explicit IrcServerSocket (IrcServerHandler*); + ~IrcServerSocket () override; void ConnectToHost (const QString&, int); void DisconnectFromHost (); void Send (const QString&); void Close (); private: - void Init (); - void RefreshCodec (); - void HandleSslErrors (const std::shared_ptr<QSslSocket>&, const QList<QSslError>&); QTcpSocket* GetSocketPtr () const; private slots: - void readReply (); void handleSslErrors (const QList<QSslError>& errors); signals: + void connected (); + void disconnected (); + + void retriableSocketError (QAbstractSocket::SocketError, const QString&); + void finalSocketError (QAbstractSocket::SocketError, const QString&); void sslErrors (const QList<QSslError>&, const ICanHaveSslErrors::ISslErrorsReaction_ptr&); }; } -} -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/serverresponsemanager.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/serverresponsemanager.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/acetamide/serverresponsemanager.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/acetamide/serverresponsemanager.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -269,10 +269,8 @@ QString cmd; QString outputMessage; - const QString& lcVer = Core::Instance ().GetProxy ()->GetVersion (); - const QString version = QString ("LeechCraft %1 (Acetamide 2.0) " - "(c) 2006-2017 LeechCraft team") - .arg (lcVer); + const QString& lcVer = GetProxyHolder ()->GetVersion (); + const QString version = QString ("LeechCraft %1 (Acetamide 2.0)").arg (lcVer); const QDateTime currentDT = QDateTime::currentDateTime (); const QString firstPartOutput = QString ("LeechCraft %1 (Acetamide 2.0) - " "https://leechcraft.org") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/standardstyles/standardstylesource.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/standardstyles/standardstylesource.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/azoth/plugins/standardstyles/standardstylesource.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/azoth/plugins/standardstyles/standardstylesource.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -310,7 +310,7 @@ } js += R"( - document.body.insertAdjacentHTML("beforeend", "<div class='%1' style='word-wrap: break-word;'>%2</div>"); + document.body.insertAdjacentHTML("beforeend", `<div class='%1' style='word-wrap: break-word;'>%2</div>`); true; )"_ql .arg (divClass, string); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/bittorrent/addtorrent.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/bittorrent/addtorrent.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/bittorrent/addtorrent.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/bittorrent/addtorrent.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -243,8 +243,7 @@ { const auto& dir = QFileDialog::getExistingDirectory (this, tr ("Select save directory"), - Ui_.Destination_->text (), - {}); + Ui_.Destination_->text ()); if (dir.isEmpty ()) return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/blogique/blogique.h new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/blogique/blogique.h --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/blogique/blogique.h 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/blogique/blogique.h 2021-09-06 21:42:59.000000000 +0200 @@ -18,7 +18,6 @@ #include <interfaces/ihaverecoverabletabs.h> #include <xmlsettingsdialog/xmlsettingsdialog.h> -class QWebView; namespace LC { namespace Blogique diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/lackman/CMakeLists.txt new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/lackman/CMakeLists.txt --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/lackman/CMakeLists.txt 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/lackman/CMakeLists.txt 2021-09-06 21:42:59.000000000 +0200 @@ -36,7 +36,6 @@ add_executable (lc_lackman_versioncomparatortest WIN32 tests/versioncomparatortest.cpp versioncomparator.cpp - ${VERSIONCOMPARATORTEST_MOC} ) target_link_libraries (lc_lackman_versioncomparatortest ${LEECHCRAFT_LIBRARIES} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/lmp/interfaces/lmp/mediainfo.h new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/lmp/interfaces/lmp/mediainfo.h --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/lmp/interfaces/lmp/mediainfo.h 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/lmp/interfaces/lmp/mediainfo.h 2021-09-06 21:42:59.000000000 +0200 @@ -18,29 +18,19 @@ { struct MediaInfo { - QString LocalPath_; + QString LocalPath_ = {}; - QString Artist_; - QString Album_; - QString Title_; + QString Artist_ = {}; + QString Album_ = {}; + QString Title_ = {}; - QStringList Genres_; + QStringList Genres_ = {}; qint32 Length_ = 0; qint32 Year_ = 0; qint32 TrackNumber_ = 0; - QVariantMap Additional_; - - MediaInfo () = default; - MediaInfo (const MediaInfo&) = default; - - MediaInfo (const QString& localPath, - const QString& artist, const QString& album, const QString& title, - const QStringList& genres, - qint32 length, qint32 year, qint32 trackNumber); - - MediaInfo& operator= (const Media::AudioInfo&); + QVariantMap Additional_ = {}; bool IsUseless () const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/lmp/mediainfo.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/lmp/mediainfo.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/lmp/mediainfo.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/lmp/mediainfo.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -13,42 +13,6 @@ { namespace LMP { - MediaInfo::MediaInfo (const QString& localPath, - const QString& artist, const QString& album, const QString& title, - const QStringList& genres, - qint32 length, qint32 year, qint32 trackNumber) - : LocalPath_ { localPath } - , Artist_ { artist } - , Album_ { album } - , Title_ { title } - , Genres_ { genres } - , Length_ { length } - , Year_ { year } - , TrackNumber_ { trackNumber } - { - } - - MediaInfo& MediaInfo::operator= (const Media::AudioInfo& info) - { - Artist_ = info.Artist_; - Album_ = info.Album_; - Title_ = info.Title_; - Genres_ = info.Genres_; - Length_ = info.Length_; - Year_ = info.Year_; - TrackNumber_ = info.TrackNumber_; - Additional_ = info.Other_; - - if (Additional_.contains ("URL")) - { - const auto& url = Additional_.take ("URL").toUrl (); - if (url.isLocalFile ()) - LocalPath_ = url.toLocalFile (); - } - - return *this; - } - bool MediaInfo::IsUseless () const { return (Artist_ + Album_ + Title_).trimmed ().isEmpty (); @@ -73,9 +37,26 @@ MediaInfo MediaInfo::FromAudioInfo (const Media::AudioInfo& info) { - MediaInfo result; - result = info; - return result; + MediaInfo mi + { + .Artist_ = info.Artist_, + .Album_ = info.Album_, + .Title_ = info.Title_, + .Genres_ = info.Genres_, + .Length_ = info.Length_, + .Year_ = info.Year_, + .TrackNumber_ = info.TrackNumber_, + .Additional_ = info.Other_, + }; + + if (mi.Additional_.contains ("URL")) + { + const auto& url = mi.Additional_.take ("URL").toUrl (); + if (url.isLocalFile ()) + mi.LocalPath_ = url.toLocalFile (); + } + + return mi; } QDataStream& operator<< (QDataStream& out, const MediaInfo& info) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/lmp/player.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/lmp/player.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/lmp/player.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/lmp/player.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -1550,7 +1550,7 @@ void Player::handleRadioStream (const QUrl& url, const Media::AudioInfo& info) { - Url2Info_ [url] = info; + Url2Info_ [url] = MediaInfo::FromAudioInfo (info); Source_->SetCurrentSource (url); qDebug () << Q_FUNC_INFO << static_cast<int> (Source_->GetState ()); @@ -1591,7 +1591,7 @@ continue; } - Url2Info_ [url] = info; + Url2Info_ [url] = MediaInfo::FromAudioInfo (info); sources << url; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/poshuku/plugins/webengineview/customwebpage.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/poshuku/plugins/webengineview/customwebpage.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/plugins/poshuku/plugins/webengineview/customwebpage.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/plugins/poshuku/plugins/webengineview/customwebpage.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -23,13 +23,9 @@ { poshukuProxy->RegisterHookable (this); - QTimer::singleShot (0, this, - [this] - { - LinkOpenModifier_->InstallOn (view ()); - for (const auto child : view ()->findChildren<QWidget*> ()) - LinkOpenModifier_->InstallOn (child); - }); + LinkOpenModifier_->InstallOn (parent); + for (const auto child : parent->findChildren<QWidget*> ()) + LinkOpenModifier_->InstallOn (child); } namespace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/util/db/util.cpp new/leechcraft-0.6.70-14794-g33744ae6ce/src/util/db/util.cpp --- old/leechcraft-0.6.70-14771-g9d21b0f8ad/src/util/db/util.cpp 2021-08-30 18:06:49.000000000 +0200 +++ new/leechcraft-0.6.70-14794-g33744ae6ce/src/util/db/util.cpp 2021-09-06 21:42:59.000000000 +0200 @@ -47,18 +47,10 @@ Util::DBLock::Execute (query); } - namespace - { - uintptr_t Thread2Num (QThread *thread) - { - return thread - static_cast<QThread*> (nullptr); - } - } - QString GenConnectionName (const QString& base) { return (base + ".%1_%2") .arg (qrand ()) - .arg (Thread2Num (QThread::currentThread ())); + .arg (reinterpret_cast<uintptr_t> (QThread::currentThread ())); } }
participants (1)
-
Source-Sync