Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package whatsapp-for-linux for 
openSUSE:Factory checked in at 2024-04-25 20:50:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/whatsapp-for-linux (Old)
 and      /work/SRC/openSUSE:Factory/.whatsapp-for-linux.new.1880 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "whatsapp-for-linux"

Thu Apr 25 20:50:37 2024 rev:13 rq:1170143 version:1.6.5~20240425.2717ff6

Changes:
--------
--- /work/SRC/openSUSE:Factory/whatsapp-for-linux/whatsapp-for-linux.changes    
2024-02-06 16:36:35.871496550 +0100
+++ 
/work/SRC/openSUSE:Factory/.whatsapp-for-linux.new.1880/whatsapp-for-linux.changes
  2024-04-25 20:51:01.246107758 +0200
@@ -1,0 +2,17 @@
+Thu Apr 25 11:53:19 UTC 2024 - Michael Vetter <mvet...@suse.com>
+
+- Update to 1.6.5:
+  Implemented enhancements:
+  * Add Chinese (simplified) translations #346
+  * Port to WebKit2GTK 4.1 #302
+  * Custom css or userscript #208
+  Fixed bugs:
+  * Google chrome version too old #360
+  * Visual: Repo's readme could look better #357
+  Merged pull requests:
+  * Adding custom.css #370
+  * Set user agent to a valid Google Chrome release #361
+  * Update es.po #354
+  * add polish translation #327
+
+-------------------------------------------------------------------

Old:
----
  whatsapp-for-linux-1.6.5~20240123.aada9ef.tar.xz

New:
----
  whatsapp-for-linux-1.6.5~20240425.2717ff6.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ whatsapp-for-linux.spec ++++++
--- /var/tmp/diff_new_pack.xjn5OV/_old  2024-04-25 20:51:01.938132893 +0200
+++ /var/tmp/diff_new_pack.xjn5OV/_new  2024-04-25 20:51:01.942133038 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           whatsapp-for-linux
-Version:        1.6.5~20240123.aada9ef
+Version:        1.6.5~20240425.2717ff6
 Release:        0
 Summary:        WhatsApp for Linux
 License:        GPL-3.0-only

++++++ _service ++++++
--- /var/tmp/diff_new_pack.xjn5OV/_old  2024-04-25 20:51:01.974134200 +0200
+++ /var/tmp/diff_new_pack.xjn5OV/_new  2024-04-25 20:51:01.978134346 +0200
@@ -2,7 +2,7 @@
        <service name="tar_scm" mode="disabled">
                <param name="scm">git</param>
                <param 
name="url">https://github.com/eneshecan/whatsapp-for-linux.git</param>
-               <param 
name="revision">aada9eff167176765a136a207829fe7a5455d243</param>
+               <param 
name="revision">2717ff67871696ca2c9c3b2c7f47678139411d12</param>
                <param name="versionformat">1.6.5~%cd.%h</param>
        </service>
        <service name="recompress" mode="disabled">

++++++ whatsapp-for-linux-1.6.5~20240123.aada9ef.tar.xz -> 
whatsapp-for-linux-1.6.5~20240425.2717ff6.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/whatsapp-for-linux-1.6.5~20240123.aada9ef/README.md 
new/whatsapp-for-linux-1.6.5~20240425.2717ff6/README.md
--- old/whatsapp-for-linux-1.6.5~20240123.aada9ef/README.md     2024-01-23 
00:51:20.000000000 +0100
+++ new/whatsapp-for-linux-1.6.5~20240425.2717ff6/README.md     2024-04-25 
10:04:53.000000000 +0200
@@ -4,25 +4,10 @@
 
 <p align="left">
     <a 
href="https://flathub.org/apps/details/com.github.eneshecan.WhatsAppForLinux";>
-        <img align="center" alt="Download on Flathub" 
src="https://flathub.org/assets/badges/flathub-badge-en.png"; width="120">
+        <img align="center" alt="Download on Flathub" 
src="https://flathub.org/assets/badges/flathub-badge-en.png"; width="200">
     </a>
     <a href="https://snapcraft.io/whatsapp-for-linux";>
-        <img align="center" alt="Get it from the Snap Store" 
src="https://snapcraft.io/static/images/badges/en/snap-store-black.svg"; 
width="120">
-    </a>
-    <a href="https://aur.archlinux.org/packages/whatsapp-for-linux";>
-        <img align="center" alt="Get it from the AUR" 
src="https://archlinux.org/static/logos/archlinux-logo-dark-scalable.518881f04ca9.svg";
 width="120">
-    </a>
-    <a href="https://gpo.zugaina.org/Overlays/guru/net-im/whatsapp-for-linux";>
-        <img align="center" alt="Get it from the Gentoo Overlay Guru" 
src="https://gpo.zugaina.org/img/logo.png"; width="120">
-    </a>
-    <a 
href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/instant-messengers/whatsapp-for-linux/default.nix";>
-        <img align="center" alt="Get it from the nixpkgs" 
src="https://nixos.org/logo/nixos-hires.png"; width="120">
-    </a>
-    <a 
href="https://github.com/OpenMandrivaAssociation/whatsapp-for-linux/tree/master";>
-        <img align="center" alt="Get it from the OpenMandrive Cooker" 
src="https://www.openmandriva.org/squelettes/img/OM-300pl.png"; width="120">
-    </a>
-        <a href="https://madb.mageia.org/package/show/name/whatsapp-for-linux";>
-        <img align="center" alt="Get it from Mageia" 
src="https://www.mageia.org/g/media/logo/mageia-2013.png"; width="120">
+        <img align="center" alt="Get it from the Snap Store" 
src="https://snapcraft.io/static/images/badges/en/snap-store-black.svg"; 
width="200">
     </a>
 </p>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/whatsapp-for-linux-1.6.5~20240123.aada9ef/resource/desktop/com.github.eneshecan.WhatsAppForLinux.appdata.xml.in
 
new/whatsapp-for-linux-1.6.5~20240425.2717ff6/resource/desktop/com.github.eneshecan.WhatsAppForLinux.appdata.xml.in
--- 
old/whatsapp-for-linux-1.6.5~20240123.aada9ef/resource/desktop/com.github.eneshecan.WhatsAppForLinux.appdata.xml.in
 2024-01-23 00:51:20.000000000 +0100
+++ 
new/whatsapp-for-linux-1.6.5~20240425.2717ff6/resource/desktop/com.github.eneshecan.WhatsAppForLinux.appdata.xml.in
 2024-04-25 10:04:53.000000000 +0200
@@ -5,7 +5,7 @@
   <metadata_license>FSFAP</metadata_license>
   <project_license>GPL-3.0</project_license>
   <name>${WFL_FRIENDLY_NAME}</name>
-  <summary>${WFL_DESCRIPTION}</summary>
+  <summary>Unofficial WhatsApp application</summary>
   <content_rating type="oars-1.1"/>
 
   <description>
@@ -27,10 +27,6 @@
   <developer_name>Enes Hecan</developer_name>
   <update_contact>nshecan_AT_gmail.com</update_contact>
 
-  <mimetypes>
-    <mimetype>x-scheme-handler/whatsapp</mimetype>
-  </mimetypes>
-
   <releases>
     <release version="${WFL_VERSION}" date="${WFL_BUILD_DATE}">
       <description>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/whatsapp-for-linux-1.6.5~20240123.aada9ef/snap/snapcraft.yaml 
new/whatsapp-for-linux-1.6.5~20240425.2717ff6/snap/snapcraft.yaml
--- old/whatsapp-for-linux-1.6.5~20240123.aada9ef/snap/snapcraft.yaml   
2024-01-23 00:51:20.000000000 +0100
+++ new/whatsapp-for-linux-1.6.5~20240425.2717ff6/snap/snapcraft.yaml   
2024-04-25 10:04:53.000000000 +0200
@@ -19,10 +19,10 @@
       - libcanberra-dev
       - libsigc++-2.0-dev
       - libgtkmm-3.0-dev
-      - libwebkit2gtk-4.1-dev
+      - libwebkit2gtk-4.0-dev
       - libayatana-appindicator3-dev
     stage-packages:
-      - libwebkit2gtk-4.1-0
+      - libwebkit2gtk-4.0-37
       - libayatana-appindicator3-1
       - glib-networking
       - libglu1-mesa
@@ -133,8 +133,8 @@
       - desktop
 
 layout:
-  /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.1:
-    bind: $SNAP/gnome-platform/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.1
+  /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0:
+    bind: $SNAP/gnome-platform/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0
   /usr/share/libdrm:
     bind: $SNAP/gnome-platform/usr/share/libdrm
   /usr/share/xml/iso-codes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/whatsapp-for-linux-1.6.5~20240123.aada9ef/src/ui/WebView.cpp 
new/whatsapp-for-linux-1.6.5~20240425.2717ff6/src/ui/WebView.cpp
--- old/whatsapp-for-linux-1.6.5~20240123.aada9ef/src/ui/WebView.cpp    
2024-01-23 00:51:20.000000000 +0100
+++ new/whatsapp-for-linux-1.6.5~20240425.2717ff6/src/ui/WebView.cpp    
2024-04-25 10:04:53.000000000 +0200
@@ -1,13 +1,17 @@
 #include "WebView.hpp"
 #include <iostream>
 #include <string>
+#include <fstream>
+#include <streambuf>
 #include <optional>
 #include <locale>
 #include <glibmm/i18n.h>
 #include <glibmm/main.h>
+#include <glibmm/miscutils.h>
 #include <gtkmm/messagedialog.h>
 #include <gtkmm/filechooserdialog.h>
 #include "../util/Settings.hpp"
+#include "Config.hpp"
 
 namespace wfl::ui
 {
@@ -147,6 +151,20 @@
 
             return FALSE;
         }
+
+        bool cssFileExists(const std::string& filePath)
+        {
+            auto const file = std::ifstream(filePath);
+            return file.good();
+        }
+
+        std::string loadCssContent(const std::string& cssFilePath)
+        {
+            auto cssFile    = std::ifstream(cssFilePath);
+            auto cssContent = 
std::string((std::istreambuf_iterator<char>(cssFile)), 
std::istreambuf_iterator<char>());
+
+            return cssContent;
+        }
     }
 
     namespace detail
@@ -171,6 +189,9 @@
     {
         auto const webContext = webkit_web_view_get_context(*this);
 
+        auto configDir   = Glib::get_user_config_dir();
+        auto cssFilePath = configDir + "/" + WFL_NAME + "/web.css";
+
         g_signal_connect(*this, "load-changed", 
G_CALLBACK(detail::loadChanged), this);
         g_signal_connect(*this, "permission-request", 
G_CALLBACK(permissionRequest), nullptr);
         g_signal_connect(*this, "decide-policy", G_CALLBACK(decidePolicy), 
nullptr);
@@ -195,6 +216,11 @@
 
         webkit_web_view_set_zoom_level(*this, 
util::Settings::getInstance().getValue<double>("general", "zoom-level", 1.0));
 
+        if (cssFileExists(cssFilePath))
+        {
+            applyCustomCss(cssFilePath);
+        }
+
         webkit_web_view_load_uri(*this, WHATSAPP_WEB_URI);
     }
 
@@ -346,4 +372,15 @@
 
         return true;
     }
+
+    void WebView::applyCustomCss(const std::string& cssFilePath)
+    {
+        auto const cssContent = loadCssContent(cssFilePath);
+
+        auto* styleSheet
+            = webkit_user_style_sheet_new(cssContent.c_str(), 
WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_STYLE_LEVEL_USER, nullptr, 
nullptr);
+
+        auto* manager = webkit_web_view_get_user_content_manager(*this);
+        webkit_user_content_manager_add_style_sheet(manager, styleSheet);
+    }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/whatsapp-for-linux-1.6.5~20240123.aada9ef/src/ui/WebView.hpp 
new/whatsapp-for-linux-1.6.5~20240425.2717ff6/src/ui/WebView.hpp
--- old/whatsapp-for-linux-1.6.5~20240123.aada9ef/src/ui/WebView.hpp    
2024-01-23 00:51:20.000000000 +0100
+++ new/whatsapp-for-linux-1.6.5~20240425.2717ff6/src/ui/WebView.hpp    
2024-04-25 10:04:53.000000000 +0200
@@ -38,6 +38,7 @@
         private:
             void onLoadStatusChanged(WebKitLoadEvent loadEvent);
             bool onTimeout();
+            void applyCustomCss(const std::string& cssFilePath);
 
             friend void detail::loadChanged(WebKitWebView*, WebKitLoadEvent, 
gpointer);
 

Reply via email to