[geary: 2/4] Link preview popup is way too big



commit 026cbe4e5b0760d5ce795ed5a8fffd1f3154b621
Author: Mario Ravalli <mario raval li>
Date:   Thu Nov 14 09:29:06 2019 +0100

    Link preview popup is way too big
    
    When on a message there is a link address very long, the popup displayed
    is oversize.
    To fix this situation, the link over 90 chars are shortened taking the
    first 40 chars and the last 40 chars, joined by a "..."
    
    https://gitlab.gnome.org/GNOME/geary/issues/356

 src/client/conversation-viewer/conversation-message.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index 1dedf569..2b3f5226 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -1155,11 +1155,13 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
     }
 
     private string get_link_uri(string uri) {
+        string new_uri = "";
         if (uri.length < 90) {
-            return uri;
+            new_uri = uri;
         } else {
-            return uri.substring(0,40) + "..." + uri.substring(-40);
+            new_uri = uri.substring(0,40) + "..." + uri.substring(-40);
         }
+        return new_uri;
     }
 
     // Check for possible phishing links, displays a popover if found.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]