[evolution] eds-I#289 - Support Matrix IM Protocol for Contacts



commit 474e5621555d78e69fd3569e5b8f8590a2045290
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jun 14 22:07:09 2021 +0200

    eds-I#289 - Support Matrix IM Protocol for Contacts
    
    Related to https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/289

 data/icons/CMakeLists.txt                          |   4 +
 data/icons/hicolor_apps_16x16_im-matrix.png        | Bin 0 -> 409 bytes
 data/icons/hicolor_apps_22x22_im-matrix.png        | Bin 0 -> 484 bytes
 data/icons/hicolor_apps_24x24_im-matrix.png        | Bin 0 -> 551 bytes
 data/icons/hicolor_apps_scalable_im-matrix.svg     | 106 +++++++++++++++++++++
 .../gui/contact-editor/e-contact-editor.c          |   4 +-
 .../gui/widgets/eab-contact-formatter.c            |   2 +
 src/addressbook/gui/widgets/eab-contact-merging.c  |   9 +-
 .../importers/evolution-vcard-importer.c           |   2 +
 src/addressbook/util/eab-book-util.c               |   3 +-
 src/plugins/bbdb/gaimbuddies.c                     |   2 +
 11 files changed, 128 insertions(+), 4 deletions(-)
---
diff --git a/data/icons/CMakeLists.txt b/data/icons/CMakeLists.txt
index eba1a21178..60235cf637 100644
--- a/data/icons/CMakeLists.txt
+++ b/data/icons/CMakeLists.txt
@@ -32,6 +32,7 @@ set(private_icons
        hicolor_apps_16x16_im-aim.png
        hicolor_apps_16x16_im-icq.png
        hicolor_apps_16x16_im-jabber.png
+       hicolor_apps_16x16_im-matrix.png
        hicolor_apps_16x16_im-msn.png
        hicolor_apps_16x16_im-nov.png
        hicolor_apps_16x16_im-yahoo.png
@@ -39,6 +40,7 @@ set(private_icons
        hicolor_apps_22x22_im-aim.png
        hicolor_apps_22x22_im-icq.png
        hicolor_apps_22x22_im-jabber.png
+       hicolor_apps_22x22_im-matrix.png
        hicolor_apps_22x22_im-msn.png
        hicolor_apps_22x22_im-nov.png
        hicolor_apps_22x22_im-yahoo.png
@@ -46,6 +48,7 @@ set(private_icons
        hicolor_apps_24x24_im-aim.png
        hicolor_apps_24x24_im-icq.png
        hicolor_apps_24x24_im-jabber.png
+       hicolor_apps_24x24_im-matrix.png
        hicolor_apps_24x24_im-msn.png
        hicolor_apps_24x24_im-nov.png
        hicolor_apps_24x24_im-yahoo.png
@@ -55,6 +58,7 @@ set(private_icons
        hicolor_apps_scalable_im-aim.svg
        hicolor_apps_scalable_im-icq.svg
        hicolor_apps_scalable_im-jabber.svg
+       hicolor_apps_scalable_im-matrix.svg
        hicolor_apps_scalable_im-msn.svg
        hicolor_apps_scalable_im-nov.svg
        hicolor_apps_scalable_im-yahoo.svg
diff --git a/data/icons/hicolor_apps_16x16_im-matrix.png b/data/icons/hicolor_apps_16x16_im-matrix.png
new file mode 100644
index 0000000000..a48980f8ff
Binary files /dev/null and b/data/icons/hicolor_apps_16x16_im-matrix.png differ
diff --git a/data/icons/hicolor_apps_22x22_im-matrix.png b/data/icons/hicolor_apps_22x22_im-matrix.png
new file mode 100644
index 0000000000..9779c4b731
Binary files /dev/null and b/data/icons/hicolor_apps_22x22_im-matrix.png differ
diff --git a/data/icons/hicolor_apps_24x24_im-matrix.png b/data/icons/hicolor_apps_24x24_im-matrix.png
new file mode 100644
index 0000000000..df87b80c58
Binary files /dev/null and b/data/icons/hicolor_apps_24x24_im-matrix.png differ
diff --git a/data/icons/hicolor_apps_scalable_im-matrix.svg b/data/icons/hicolor_apps_scalable_im-matrix.svg
new file mode 100644
index 0000000000..b491c69d34
--- /dev/null
+++ b/data/icons/hicolor_apps_scalable_im-matrix.svg
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   inkscape:export-ydpi="44"
+   inkscape:export-xdpi="44"
+   width="48px"
+   height="48px"
+   id="svg11300"
+   sodipodi:version="0.32"
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
+   sodipodi:docname="hicolor_apps_scalable_im-matrix.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.1">
+  <sodipodi:namedview
+     stroke="#c4a000"
+     fill="#edd400"
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="0.25490196"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="8"
+     inkscape:cx="46.771053"
+     inkscape:cy="18.733417"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:showpageshadow="false"
+     inkscape:window-width="1258"
+     inkscape:window-height="731"
+     inkscape:window-x="411"
+     inkscape:window-y="268"
+     inkscape:document-rotation="0"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid844"
+       dotted="true"
+       units="px"
+       spacingx="0.1"
+       spacingy="0.1" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata4">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/GPL/2.0/"; />
+        <dc:title>IM - Matrix</dc:title>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/GPL/2.0/";>
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/Reproduction"; />
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/Distribution"; />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/Notice"; />
+        <cc:permits
+           rdf:resource="http://web.resource.org/cc/DerivativeWorks"; />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/ShareAlike"; />
+        <cc:requires
+           rdf:resource="http://web.resource.org/cc/SourceCode"; />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       
style="fill:#ffffff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 4,4 H 44 V 44 H 4 Z"
+       id="path872" />
+    <text
+       xml:space="preserve"
+       style="font-size:17.0079px;line-height:25px;font-family:'Khmer 
OS';-inkscape-font-specification:'Khmer 
OS';letter-spacing:0px;word-spacing:0px;fill:#000000;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       x="10.259147"
+       y="31.699997"
+       id="text848"><tspan
+         sodipodi:role="line"
+         id="tspan846"
+         x="10.259147"
+         y="31.699997"
+         style="font-size:28.3465px">m</tspan></text>
+    <path
+       
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 12,8 H 8 v 32 h 4"
+       id="path874" />
+    <path
+       
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="m 36,8 h 4 v 32 h -4"
+       id="path876" />
+  </g>
+</svg>
diff --git a/src/addressbook/gui/contact-editor/e-contact-editor.c 
b/src/addressbook/gui/contact-editor/e-contact-editor.c
index 6307d9f77e..ae351fc4b0 100644
--- a/src/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/src/addressbook/gui/contact-editor/e-contact-editor.c
@@ -176,7 +176,8 @@ im_service_fetch_set[] =
        E_CONTACT_IM_GROUPWISE,
        E_CONTACT_IM_SKYPE,
        E_CONTACT_IM_TWITTER,
-       E_CONTACT_IM_GOOGLE_TALK
+       E_CONTACT_IM_GOOGLE_TALK,
+       E_CONTACT_IM_MATRIX
 };
 
 /* Defaults selected from eab_get_im_type_labels */
@@ -4675,6 +4676,7 @@ static const EContactField  non_string_fields[] = {
        E_CONTACT_IM_ICQ,
        E_CONTACT_IM_SKYPE,
        E_CONTACT_IM_TWITTER,
+       E_CONTACT_IM_MATRIX,
        E_CONTACT_PHOTO,
        E_CONTACT_LOGO,
        E_CONTACT_X509_CERT,
diff --git a/src/addressbook/gui/widgets/eab-contact-formatter.c 
b/src/addressbook/gui/widgets/eab-contact-formatter.c
index c4755e3ea4..b747c9ad19 100644
--- a/src/addressbook/gui/widgets/eab-contact-formatter.c
+++ b/src/addressbook/gui/widgets/eab-contact-formatter.c
@@ -46,6 +46,7 @@
 #define SKYPE_ICON       "stock_people"
 #define TWITTER_ICON     "im-twitter"
 #define VIDEOCONF_ICON    "stock_video-conferencing"
+#define MATRIX_ICON      "im-matrix"
 
 #define MAX_COMPACT_IMAGE_DIMENSION 48
 
@@ -930,6 +931,7 @@ render_contact_column (EABContactFormatter *formatter,
        accum_attribute_multival (accum, contact, _("Gadu-Gadu"), E_CONTACT_IM_GADUGADU, GADUGADU_ICON, 0);
        accum_attribute_multival (accum, contact, _("Skype"), E_CONTACT_IM_SKYPE, SKYPE_ICON, 0);
        accum_attribute_multival (accum, contact, _("Twitter"), E_CONTACT_IM_TWITTER, TWITTER_ICON, 0);
+       accum_attribute_multival (accum, contact, _("Matrix"), E_CONTACT_IM_MATRIX, MATRIX_ICON, 0);
 
        if (accum->len)
                g_string_append_printf (
diff --git a/src/addressbook/gui/widgets/eab-contact-merging.c 
b/src/addressbook/gui/widgets/eab-contact-merging.c
index 0919df0593..535fb4536d 100644
--- a/src/addressbook/gui/widgets/eab-contact-merging.c
+++ b/src/addressbook/gui/widgets/eab-contact-merging.c
@@ -49,7 +49,8 @@ im_fetch_set[] =
        E_CONTACT_IM_GROUPWISE,
        E_CONTACT_IM_SKYPE,
        E_CONTACT_IM_TWITTER,
-       E_CONTACT_IM_GOOGLE_TALK
+       E_CONTACT_IM_GOOGLE_TALK,
+       E_CONTACT_IM_MATRIX
 };
 
 typedef enum {
@@ -527,7 +528,11 @@ merge_dialog_data_create (EContactMergingLookup *lookup,
                if (string && *string) {
                        if ((field >= E_CONTACT_FIRST_EMAIL_ID && field <= E_CONTACT_LAST_EMAIL_ID) ||
                            (field >= E_CONTACT_FIRST_PHONE_ID && field <= E_CONTACT_LAST_PHONE_ID) ||
-                           (field >= E_CONTACT_IM_AIM_HOME_1 && field <= E_CONTACT_IM_ICQ_WORK_3) ) {
+                           (field >= E_CONTACT_IM_AIM_HOME_1 && field <= E_CONTACT_IM_ICQ_WORK_3) ||
+                           (field >= E_CONTACT_IM_GADUGADU_HOME_1 && field <= E_CONTACT_IM_GADUGADU_WORK_3) 
||
+                           (field >= E_CONTACT_IM_SKYPE_HOME_1 && field <= E_CONTACT_IM_SKYPE_WORK_3) ||
+                           (field >= E_CONTACT_IM_GOOGLE_TALK_HOME_1 && field <= 
E_CONTACT_IM_GOOGLE_TALK_WORK_3) ||
+                           (field >= E_CONTACT_IM_MATRIX_HOME_1 && field <= E_CONTACT_IM_MATRIX_WORK_3)) {
                                /* ignore multival attributes, they are compared after this for-loop */
                                continue;
                        }
diff --git a/src/addressbook/importers/evolution-vcard-importer.c 
b/src/addressbook/importers/evolution-vcard-importer.c
index 1bf8d6d4c7..30a82e351d 100644
--- a/src/addressbook/importers/evolution-vcard-importer.c
+++ b/src/addressbook/importers/evolution-vcard-importer.c
@@ -576,6 +576,7 @@ preview_contact (EWebViewPreview *preview,
                E_CONTACT_IM_GADUGADU,
                E_CONTACT_IM_SKYPE,
                E_CONTACT_IM_TWITTER,
+               E_CONTACT_IM_MATRIX,
 
                -1,
 
@@ -666,6 +667,7 @@ preview_contact (EWebViewPreview *preview,
                           field == E_CONTACT_IM_GADUGADU ||
                           field == E_CONTACT_IM_SKYPE ||
                           field == E_CONTACT_IM_TWITTER ||
+                          field == E_CONTACT_IM_MATRIX ||
                           field == E_CONTACT_EMAIL) {
                        GList *attrs, *a;
                        gboolean have = FALSE;
diff --git a/src/addressbook/util/eab-book-util.c b/src/addressbook/util/eab-book-util.c
index 1666f9f719..d3d07c2fa1 100644
--- a/src/addressbook/util/eab-book-util.c
+++ b/src/addressbook/util/eab-book-util.c
@@ -78,7 +78,8 @@ eab_im_service[] =
        { E_CONTACT_IM_GROUPWISE,   NULL, NULL, NC_ ("addressbook-label", "GroupWise") },
        { E_CONTACT_IM_SKYPE,       NULL, NULL, NC_ ("addressbook-label", "Skype")     },
        { E_CONTACT_IM_TWITTER,     NULL, NULL, NC_ ("addressbook-label", "Twitter")   },
-       { E_CONTACT_IM_GOOGLE_TALK, NULL, NULL, NC_ ("addressbook-label", "Google Talk")}
+       { E_CONTACT_IM_GOOGLE_TALK, NULL, NULL, NC_ ("addressbook-label", "Google Talk")},
+       { E_CONTACT_IM_MATRIX,      NULL, NULL, NC_ ("addressbook-label", "Matrix")    }
 };
 
 const EABTypeLabel*
diff --git a/src/plugins/bbdb/gaimbuddies.c b/src/plugins/bbdb/gaimbuddies.c
index 65b9e89b43..1059fc8ac0 100644
--- a/src/plugins/bbdb/gaimbuddies.c
+++ b/src/plugins/bbdb/gaimbuddies.c
@@ -438,6 +438,8 @@ proto_to_contact_field (const gchar *proto)
                return E_CONTACT_IM_JABBER;
        if (!strcmp (proto, "prpl-gg"))
                return E_CONTACT_IM_GADUGADU;
+       if (!strcmp (proto, "prpl-matrix"))
+               return E_CONTACT_IM_MATRIX;
 
        return E_CONTACT_IM_AIM;
 }


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