Hello community, here is the log from the commit of package geary for openSUSE:Factory checked in at 2018-07-17 09:42:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/geary (Old) and /work/SRC/openSUSE:Factory/.geary.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "geary" Tue Jul 17 09:42:22 2018 rev:38 rq:623089 version:0.12.3 Changes: -------- --- /work/SRC/openSUSE:Factory/geary/geary.changes 2018-05-03 12:33:01.090921219 +0200 +++ /work/SRC/openSUSE:Factory/.geary.new/geary.changes 2018-07-17 09:43:38.225017453 +0200 @@ -1,0 +2,12 @@ +Sun Jul 15 17:52:06 UTC 2018 - [email protected] + +- Update to version 0.12.3: + + Not syncing mail using Turkish locale (bgo#795906). + + Fix crash saving an attachment with unknown content type. + + Fix crash in secret_collection_get_locked (bgo#795328). + + "Move to folder" selection bug glgo#GNOME/geary#24. + + Subfolders with special folders not displayed in list + glgo#GNOME/geary#11. + + Add OARS metadata for Flathub. + +------------------------------------------------------------------- Old: ---- geary-0.12.2.tar.xz New: ---- geary-0.12.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ geary.spec ++++++ --- /var/tmp/diff_new_pack.cUk7dT/_old 2018-07-17 09:43:39.065014374 +0200 +++ /var/tmp/diff_new_pack.cUk7dT/_new 2018-07-17 09:43:39.069014359 +0200 @@ -17,13 +17,14 @@ Name: geary -Version: 0.12.2 +Version: 0.12.3 Release: 0 Summary: An email reader for the GNOME desktop License: LGPL-2.1-or-later AND CC-BY-3.0 AND BSD-2-Clause Group: Productivity/Networking/Email/Clients URL: https://wiki.gnome.org/Apps/Geary -Source: http://download.gnome.org/sources/geary/0.12/%{name}-%{version}.tar.xz +Source0: https://download.gnome.org/sources/geary/0.12/%{name}-%{version}.tar.xz + BuildRequires: cmake BuildRequires: fdupes BuildRequires: intltool ++++++ geary-0.12.2.tar.xz -> geary-0.12.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/.gitlab-ci.yml new/geary-0.12.3/.gitlab-ci.yml --- old/geary-0.12.2/.gitlab-ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/geary-0.12.3/.gitlab-ci.yml 2018-07-14 04:39:08.000000000 +0200 @@ -0,0 +1,110 @@ +# +# Geary CI config. +# + +stages: + - build + +variables: + BUILD_DIR: build + CONFIG_CMD: ./configure + BUILD_CMD: make + TEST_CMD: xvfb-run make test + INSTALL_CMD: make install + FEDORA_BUILD_DEPS: gcc make + FEDORA_DEPS: vala gobject-introspection-devel intltool cmake + desktop-file-utils gnome-doc-utils libcanberra-devel + libgee-devel glib2-devel gmime-devel gtk3-devel + libnotify-devel sqlite-devel webkitgtk4-devel + libsecret-devel libxml2-devel vala-tools gcr-devel + enchant-devel + FEDORA_TEST_DEPS: Xvfb + DEBIAN_DEPS: valac libgirepository1.0-dev intltool cmake + desktop-file-utils gnome-doc-utils libcanberra-dev + libgee-0.8-dev libglib2.0-dev libgmime-2.6-dev + libgtk-3-dev libsecret-1-dev libxml2-dev libnotify-dev + libsqlite3-dev libwebkit2gtk-4.0-dev libgcr-3-dev + libenchant-dev + DEBIAN_TEST_DEPS: xauth xvfb + UBUNTU_DEPS: $DEBIAN_DEPS libunity-dev libmessaging-menu-dev + UBUNTU_TEST_DEPS: xauth xvfb + +# +# Stages +# + +fedora: + stage: build + image: fedora:latest + before_script: + - dnf update -y --nogpgcheck + - dnf install -y --nogpgcheck $FEDORA_BUILD_DEPS $FEDORA_DEPS $FEDORA_TEST_DEPS + script: + - $CONFIG_CMD + - $BUILD_CMD + - $TEST_CMD + - $INSTALL_CMD + +debian: + stage: build + image: debian:stable + before_script: + - apt-get update + - apt-get install -q -y --no-install-recommends $DEBIAN_DEPS $DEBIAN_TEST_DEPS + script: + - $CONFIG_CMD + - $BUILD_CMD + - $TEST_CMD + - $INSTALL_CMD + +ubuntu: + stage: build + image: ubuntu:xenial + before_script: + - apt-get update + - apt-get install -q -y --no-install-recommends $UBUNTU_DEPS $UBUNTU_TEST_DEPS + script: + - $CONFIG_CMD + - $BUILD_CMD + - $TEST_CMD + - $INSTALL_CMD + +deb-package: + stage: build + image: ubuntu:xenial + before_script: + - apt-get update + - apt-get install -q -y --no-install-recommends packaging-dev $UBUNTU_DEPS + script: + - dpkg-buildpackage -b -us -uc + +flatpack-package: + image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:3.28 + stage: build + + variables: + GIT_SUBMODULE_STRATEGY: normal + FLATPAK_ARTIFACT: geary-git.flatpak + + script: + - flatpak-builder flatpak-build org.gnome.Geary.json + - flatpak build-export flatpak-repo flatpak-build --update-appstream + - flatpak build-bundle flatpak-repo $FLATPAK_ARTIFACT + --runtime-repo=https://sdk.gnome.org/gnome-nightly.flatpakrepo + org.gnome.Geary + + artifacts: + paths: + - $FLATPAK_ARTIFACT + expire_in: 2 days + + cache: + # JOB_NAME - Each job will have it's own cache + # COMMIT_REF_SLUG = Lowercase name of the branch + # ^ Keep diffrerent caches for each branch + key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + paths: + # Cache .flatpak-builder + - .flatpak-builder/cache/ + - .flatpak-builder/downloads/ + - .flatpak-builder/git/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/CMakeLists.txt new/geary-0.12.3/CMakeLists.txt --- old/geary-0.12.2/CMakeLists.txt 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/CMakeLists.txt 2018-07-14 04:39:08.000000000 +0200 @@ -19,7 +19,7 @@ # set(GETTEXT_PACKAGE "geary") set(RELEASE_NAME "Lightweight email client for GNOME.") -set(VERSION "0.12.2") +set(VERSION "0.12.3") set(VERSION_INFO "Release") set(LANGUAGE_SUPPORT_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/locale) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/NEWS new/geary-0.12.3/NEWS --- old/geary-0.12.2/NEWS 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/NEWS 2018-07-14 04:39:08.000000000 +0200 @@ -1,3 +1,19 @@ +Version 0.12.3 +~~~~~~~~~~~~~~ +Released: 2018-07-14 + +Bug fixes included in this release: + * Not syncing mail using Turkish locale. Bug 795906 + * Fix crash saving an attachment with unknown content type + * Fix crash in secret_collection_get_locked. Bug 795328 + * "Move to folder" selection bug. Issue #24 + * Subfolders with special folders not displayed in list. Issue #11 + * Add OARS metadata for Flathub + +Thanks to all who contributed code fixes and enhancements to this +release: + * Nick Richards + Version 0.12.2 ~~~~~~~~~~~~~~ Released: 2018-04-24 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/THANKS new/geary-0.12.3/THANKS --- old/geary-0.12.2/THANKS 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/THANKS 2018-07-14 04:39:08.000000000 +0200 @@ -56,6 +56,7 @@ Mario Sanchez Prada <[email protected]> Tiago Quelhas <[email protected]> Viko Adi Rahmawan <[email protected]> +nick richards <[email protected]> ritchiew <[email protected]> Leonardo Robol <[email protected]> Didier Roche <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/desktop/org.gnome.Geary.appdata.xml.in new/geary-0.12.3/desktop/org.gnome.Geary.appdata.xml.in --- old/geary-0.12.2/desktop/org.gnome.Geary.appdata.xml.in 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/desktop/org.gnome.Geary.appdata.xml.in 2018-07-14 04:39:08.000000000 +0200 @@ -77,6 +77,21 @@ <translation type="gettext">geary</translation> <releases> + <release version="0.12.3" date="2018-07-14"> + <description> + <p>Bug fixes included in this release:</p> + <ul> + <li>Not syncing mail using Turkish locale. Bug 795906</li> + <li>Fix crash saving an attachment with unknown content type</li> + <li>Fix crash in secret_collection_get_locked. Bug 795328</li> + <li>"Move to folder" selection bug. Issue #24</li> + <li>Subfolders with special folders not displayed in + list. Issue #11</li> + <li>Add OARS metadata for Flathub</li> + </ul> + </description> + </release> + <release version="0.12.2" date="2018-04-24"> <description> <p>Bug fixes included in this release:</p> @@ -165,4 +180,33 @@ </description> </release> </releases> + <content_rating type="oars-1.1"> + <content_attribute id="violence-cartoon">none</content_attribute> + <content_attribute id="violence-fantasy">none</content_attribute> + <content_attribute id="violence-realistic">none</content_attribute> + <content_attribute id="violence-bloodshed">none</content_attribute> + <content_attribute id="violence-sexual">none</content_attribute> + <content_attribute id="violence-desecration">none</content_attribute> + <content_attribute id="violence-slavery">none</content_attribute> + <content_attribute id="violence-worship">none</content_attribute> + <content_attribute id="drugs-alcohol">none</content_attribute> + <content_attribute id="drugs-narcotics">none</content_attribute> + <content_attribute id="drugs-tobacco">none</content_attribute> + <content_attribute id="sex-nudity">none</content_attribute> + <content_attribute id="sex-themes">none</content_attribute> + <content_attribute id="sex-homosexuality">none</content_attribute> + <content_attribute id="sex-prostitution">none</content_attribute> + <content_attribute id="sex-adultery">none</content_attribute> + <content_attribute id="sex-appearance">none</content_attribute> + <content_attribute id="language-profanity">none</content_attribute> + <content_attribute id="language-humor">none</content_attribute> + <content_attribute id="language-discrimination">none</content_attribute> + <content_attribute id="social-chat">intense</content_attribute> + <content_attribute id="social-info">none</content_attribute> + <content_attribute id="social-audio">none</content_attribute> + <content_attribute id="social-location">none</content_attribute> + <content_attribute id="social-contacts">intense</content_attribute> + <content_attribute id="money-purchasing">none</content_attribute> + <content_attribute id="money-gambling">none</content_attribute> + </content_rating> </component> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/client/application/geary-controller.vala new/geary-0.12.3/src/client/application/geary-controller.vala --- old/geary-0.12.2/src/client/application/geary-controller.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/client/application/geary-controller.vala 2018-07-14 04:39:08.000000000 +0200 @@ -1606,12 +1606,23 @@ ); } - private void on_special_folder_type_changed(Geary.Folder folder, Geary.SpecialFolderType old_type, - Geary.SpecialFolderType new_type) { + private void on_special_folder_type_changed(Geary.Folder folder, + Geary.SpecialFolderType old_type, + Geary.SpecialFolderType new_type) { main_window.folder_list.remove_folder(folder); main_window.folder_list.add_folder(folder); + // Since removing the folder will also remove its children, we + // need to check for any and re-add them. See isssue #11. + try { + foreach (Geary.Folder child in + folder.account.list_matching_folders(folder.path)) { + main_window.folder_list.add_folder(child); + } + } catch (Error err) { + // Oh well + } } - + private void on_engine_opened() { // Locate the first account so we can select its inbox when available. try { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/client/application/secret-mediator.vala new/geary-0.12.3/src/client/application/secret-mediator.vala --- old/geary-0.12.2/src/client/application/secret-mediator.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/client/application/secret-mediator.vala 2018-07-14 04:39:08.000000000 +0200 @@ -157,13 +157,19 @@ Secret.Service service = yield Secret.Service.get( Secret.ServiceFlags.OPEN_SESSION, cancellable ); - Secret.Collection collection = yield Secret.Collection.for_alias( + Secret.Collection? collection = yield Secret.Collection.for_alias( service, Secret.COLLECTION_DEFAULT, Secret.CollectionFlags.NONE, cancellable ); - if (collection.get_locked()) { + + // For custom desktop setups, it is possible that the current + // session has a service responding on DBus but no password + // keyring. There's no much we can do in this case except just + // check for the collection being null so we don't crash. See + // Bug 795328. + if (collection != null && collection.get_locked()) { List<Secret.Collection> to_lock = new List<Secret.Collection>(); to_lock.append(collection); List<DBusProxy> unlocked; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/api/geary-attachment.vala new/geary-0.12.3/src/engine/api/geary-attachment.vala --- old/geary-0.12.2/src/engine/api/geary-attachment.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/api/geary-attachment.vala 2018-07-14 04:39:08.000000000 +0200 @@ -155,7 +155,7 @@ } } string? ext = mime_type.get_file_name_extension(); - if (!file_name.has_suffix(ext)) { + if (ext != null && !file_name.has_suffix(ext)) { file_name = file_name + (ext ?? ""); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/imap/message/imap-data-format.vala new/geary-0.12.3/src/engine/imap/message/imap-data-format.vala --- old/geary-0.12.2/src/engine/imap/message/imap-data-format.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/imap/message/imap-data-format.vala 2018-07-14 04:39:08.000000000 +0200 @@ -23,10 +23,10 @@ private bool is_special_char(char ch, char[] ar, string? exceptions) { if (ch > 0x7F || ch.iscntrl()) return true; - + if (ch in ar) - return (exceptions != null) ? exceptions.index_of_char(ch) < 0 : true; - + return (exceptions != null) ? Ascii.index_of(exceptions, ch) < 0 : true; + return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/imap/message/imap-fetch-body-data-specifier.vala new/geary-0.12.3/src/engine/imap/message/imap-fetch-body-data-specifier.vala --- old/geary-0.12.2/src/engine/imap/message/imap-fetch-body-data-specifier.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/imap/message/imap-fetch-body-data-specifier.vala 2018-07-14 04:39:08.000000000 +0200 @@ -73,15 +73,15 @@ assert_not_reached(); } } - + public static SectionPart deserialize(string value) throws ImapError { if (String.is_empty(value)) return NONE; - - switch (value.down()) { + + switch (Ascii.strdown(value)) { case "header": return HEADER; - + case "header.fields": return HEADER_FIELDS; @@ -178,25 +178,23 @@ this.subset_start = subset_start; this.subset_count = subset_count; this.is_peek = is_peek; - + if (field_names != null && field_names.length > 0) { - this.field_names = new Gee.TreeSet<string>((s1, s2) => { - return GLib.strcmp(s1, s2); - }); + this.field_names = new Gee.TreeSet<string>(Ascii.strcmp); foreach (string field_name in field_names) { - string converted = field_name.strip().down(); - + string converted = Ascii.strdown(field_name.strip()); + if (!String.is_empty(converted)) this.field_names.add(converted); } } else { this.field_names = null; } - + // see equal_to() for why the response version is used hashable = serialize_response(); } - + /** * Returns the {@link FetchBodyDataSpecifier} in a string ready for a {@link Command}. * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/imap/message/imap-internal-date.vala new/geary-0.12.3/src/engine/imap/message/imap-internal-date.vala --- old/geary-0.12.2/src/engine/imap/message/imap-internal-date.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/imap/message/imap-internal-date.vala 2018-07-14 04:39:08.000000000 +0200 @@ -64,18 +64,18 @@ || year < 1970) { throw new ImapError.PARSE_ERROR("Invalid INTERNALDATE \"%s\": bad numerical range", internaldate); } - + // check month (this catches localization problems) int month = -1; - string mon_down = ((string) mon).down(); + string mon_down = Ascii.strdown(((string) mon)); for (int ctr = 0; ctr < EN_US_MON_DOWN.length; ctr++) { if (mon_down == EN_US_MON_DOWN[ctr]) { month = ctr; - + break; } } - + if (month < 0) throw new ImapError.PARSE_ERROR("Invalid INTERNALDATE \"%s\": bad month", internaldate); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/imap/message/imap-mailbox-specifier.vala new/geary-0.12.3/src/engine/imap/message/imap-mailbox-specifier.vala --- old/geary-0.12.2/src/engine/imap/message/imap-mailbox-specifier.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/imap/message/imap-mailbox-specifier.vala 2018-07-14 04:39:08.000000000 +0200 @@ -72,7 +72,7 @@ public static bool is_inbox_name(string name) { return Ascii.stri_equal(name, CANONICAL_INBOX_NAME); } - + /** * Returns true if the string is the ''canonical'' name of the IMAP Inbox. * @@ -85,9 +85,9 @@ * @see is_inbox_name */ public static bool is_canonical_inbox_name(string name) { - return (name == CANONICAL_INBOX_NAME); + return Ascii.str_equal(name, CANONICAL_INBOX_NAME); } - + /** * Converts a generic {@link FolderPath} into an IMAP mailbox specifier. */ @@ -175,27 +175,27 @@ public uint hash() { return is_inbox ? Ascii.stri_hash(name) : Ascii.str_hash(name); } - + public bool equal_to(MailboxSpecifier other) { if (this == other) return true; - + if (is_inbox) return Ascii.stri_equal(name, other.name); - - return (name == other.name); + + return Ascii.str_equal(name, other.name); } - + public int compare_to(MailboxSpecifier other) { if (this == other) return 0; - + if (is_inbox && other.is_inbox) return 0; - - return GLib.strcmp(name, other.name); + + return Ascii.strcmp(name, other.name); } - + public string to_string() { return name; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/imap/parameter/imap-string-parameter.vala new/geary-0.12.3/src/engine/imap/parameter/imap-string-parameter.vala --- old/geary-0.12.2/src/engine/imap/parameter/imap-string-parameter.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/imap/parameter/imap-string-parameter.vala 2018-07-14 04:39:08.000000000 +0200 @@ -134,35 +134,35 @@ public bool is_empty() { return String.is_empty(ascii); } - + /** * Case-sensitive comparison. */ public bool equals_cs(string value) { - return (ascii == value); + return Ascii.str_equal(ascii, value); } - + /** * Case-insensitive comparison. */ public bool equals_ci(string value) { return Ascii.stri_equal(ascii, value); } - + /** * Returns the string lowercased. */ public string as_lower() { - return ascii.down(); + return Ascii.strdown(ascii); } - + /** * Returns the string uppercased. */ public string as_upper() { - return ascii.up(); + return Ascii.strup(ascii); } - + /** * Converts the {@link ascii} to a signed 32-bit integer, clamped between clamp_min and * clamp_max. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/imap/response/imap-response-code-type.vala new/geary-0.12.3/src/engine/imap/response/imap-response-code-type.vala --- old/geary-0.12.2/src/engine/imap/response/imap-response-code-type.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/imap/response/imap-response-code-type.vala 2018-07-14 04:39:08.000000000 +0200 @@ -64,17 +64,17 @@ public ResponseCodeType.from_parameter(StringParameter stringp) throws ImapError { init(stringp.ascii); } - + private void init(string ascii) throws ImapError { // note that is_quoting_required() also catches empty strings (as they require quoting) if (DataFormat.is_quoting_required(ascii) != DataFormat.Quoting.OPTIONAL) throw new ImapError.INVALID("\"%s\" cannot be represented as a ResponseCodeType", ascii); - + // store lowercased so it's easily compared with const strings above original = ascii; - value = ascii.down(); + value = Ascii.strdown(ascii); } - + public bool is_value(string str) { return Ascii.stri_equal(value, str); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/mime/mime-content-parameters.vala new/geary-0.12.3/src/engine/mime/mime-content-parameters.vala --- old/geary-0.12.2/src/engine/mime/mime-content-parameters.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/mime/mime-content-parameters.vala 2018-07-14 04:39:08.000000000 +0200 @@ -78,7 +78,7 @@ return (stored != null) ? Ascii.stri_equal(stored, value) : false; } - + /** * Returns true if the attribute has the supplied value (case-sensitive comparison). * @@ -86,10 +86,10 @@ */ public bool has_value_cs(string attribute, string value) { string? stored = params.get(attribute); - - return (stored != null) ? (stored == value) : false; + + return (stored != null) ? Ascii.str_equal(stored, value) : false; } - + /** * Add or replace the parameter. * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/mime/mime-content-type.vala new/geary-0.12.3/src/engine/mime/mime-content-type.vala --- old/geary-0.12.2/src/engine/mime/mime-content-type.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/mime/mime-content-type.vala 2018-07-14 04:39:08.000000000 +0200 @@ -79,9 +79,9 @@ int max_len = 4096; // XXX determine actual max needed buffer size using // xdg_mime_get_max_buffer_extents? - uint8[] data = (max_len > buf.size) - ? buf.get_bytes()[0:max_len - 1].get_data() - : buf.get_uint8_array(); + uint8[] data = (buf.size <= max_len) + ? buf.get_uint8_array() + : buf.get_bytes()[0:max_len].get_data(); // XXX might just want to use xdgmime lib directly here to // avoid the intermediate glib_content_type step here? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/mime/mime-disposition-type.vala new/geary-0.12.3/src/engine/mime/mime-disposition-type.vala --- old/geary-0.12.2/src/engine/mime/mime-disposition-type.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/mime/mime-disposition-type.vala 2018-07-14 04:39:08.000000000 +0200 @@ -31,24 +31,24 @@ */ public static DispositionType deserialize(string? str, out bool is_unknown) { is_unknown = false; - + if (String.is_empty_or_whitespace(str)) return UNSPECIFIED; - - switch (str.down()) { + + switch (Ascii.strdown(str)) { case "inline": return INLINE; - + case "attachment": return ATTACHMENT; - + default: is_unknown = true; - + return ATTACHMENT; } } - + /** * Returns null if value is {@link UNSPECIFIED} */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/mime/mime-multipart-subtype.vala new/geary-0.12.3/src/engine/mime/mime-multipart-subtype.vala --- old/geary-0.12.2/src/engine/mime/mime-multipart-subtype.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/mime/mime-multipart-subtype.vala 2018-07-14 04:39:08.000000000 +0200 @@ -48,24 +48,24 @@ public static MultipartSubtype from_content_type(ContentType? content_type, out bool is_unknown) { if (content_type == null || !content_type.has_media_type("multipart")) { is_unknown = true; - + return MIXED; } - + is_unknown = false; - switch (content_type.media_subtype.down()) { + switch (Ascii.strdown(content_type.media_subtype)) { case "mixed": return MIXED; - + case "alternative": return ALTERNATIVE; - + case "related": return RELATED; - + default: is_unknown = true; - + return MIXED; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/rfc822/rfc822-mailbox-address.vala new/geary-0.12.3/src/engine/rfc822/rfc822-mailbox-address.vala --- old/geary-0.12.2/src/engine/rfc822/rfc822-mailbox-address.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/rfc822/rfc822-mailbox-address.vala 2018-07-14 04:39:08.000000000 +0200 @@ -53,7 +53,7 @@ source_route = null; - int atsign = address.index_of_char('@'); + int atsign = Ascii.index_of(address, '@'); if (atsign > 0) { mailbox = address.slice(0, atsign); domain = address.slice(atsign + 1, address.length); @@ -62,7 +62,7 @@ domain = ""; } } - + public MailboxAddress.imap(string? name, string? source_route, string mailbox, string domain) { this.name = (name != null) ? decode_name(name) : null; this.source_route = source_route; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/smtp/smtp-command.vala new/geary-0.12.3/src/engine/smtp/smtp-command.vala --- old/geary-0.12.2/src/engine/smtp/smtp-command.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/smtp/smtp-command.vala 2018-07-14 04:39:08.000000000 +0200 @@ -56,36 +56,36 @@ assert_not_reached(); } } - + public static Command deserialize(string str) throws SmtpError { - switch (str.down()) { + switch (Ascii.strdown(str)) { case "helo": return HELO; - + case "ehlo": return EHLO; - + case "quit": return QUIT; - + case "help": return HELP; - + case "noop": return NOOP; - + case "rset": return RSET; - + case "auth": return AUTH; - + case "mail": return MAIL; - + case "rcpt": return RCPT; - + case "data": return DATA; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/smtp/smtp-greeting.vala new/geary-0.12.3/src/engine/smtp/smtp-greeting.vala --- old/geary-0.12.2/src/engine/smtp/smtp-greeting.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/smtp/smtp-greeting.vala 2018-07-14 04:39:08.000000000 +0200 @@ -25,21 +25,21 @@ return ""; } } - + public static ServerFlavor deserialize(string str) { - switch (str.up()) { + switch (Ascii.strup(str)) { case "SMTP": return SMTP; - + case "ESMTP": return ESMTP; - + default: return UNSPECIFIED; } } } - + public string? domain { get; private set; default = null; } public ServerFlavor flavor { get; private set; default = ServerFlavor.UNSPECIFIED; } public string? message { get; private set; default = null; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/src/engine/util/util-ascii.vala new/geary-0.12.3/src/engine/util/util-ascii.vala --- old/geary-0.12.2/src/engine/util/util-ascii.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/src/engine/util/util-ascii.vala 2018-07-14 04:39:08.000000000 +0200 @@ -4,40 +4,71 @@ * (version 2.1 or later). See the COPYING file in this distribution. */ +// These calls are bound to the string class in Vala 0.26. When that version of Vala is the +// minimum, these can be dropped and Ascii.strup and Ascii.strdown can use the string methods. +extern string g_ascii_strup(string str, ssize_t len = -1); +extern string g_ascii_strdown(string str, ssize_t len = -1); + namespace Geary.Ascii { +public int index_of(string str, char ch) { + char *strptr = str; + int index = 0; + for (;;) { + char strch = *strptr++; + + if (strch == String.EOS) + return -1; + + if (strch == ch) + return index; + + index++; + } +} + public bool get_next_char(string str, ref int index, out char ch) { ch = str[index++]; - + return ch != String.EOS; } -public bool stri_equal(string a, string b) { - // XXX Is this marginally faster than a.down() == b.down() in the - // best case, slower in the worse case, so not worth it? +public inline int strcmp(string a, string b) { + return GLib.strcmp(a, b); +} + +public int stricmp(string a, string b) { char *aptr = a; char *bptr = b; for (;;) { int diff = (int) (*aptr).tolower() - (int) (*bptr).tolower(); if (diff != 0) - return false; - + return diff; + if (*aptr == String.EOS) - return true; - + return 0; + aptr++; bptr++; } } +public inline bool str_equal(string a, string b) { + return a == b; +} + +public inline bool stri_equal(string a, string b) { + return stricmp(a, b) == 0; +} + public bool nullable_stri_equal(string? a, string? b) { if (a == null) return (b == null); - + // a != null, so always false if (b == null) return false; - + return stri_equal(a, b); } @@ -55,6 +86,14 @@ return (str != null) ? stri_hash(str) : 0; } +public string strdown(string str) { + return g_ascii_strdown(str); +} + +public string strup(string str) { + return g_ascii_strup(str); +} + /** * Returns true if the ASCII string contains only whitespace and at least one numeric character. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/test/engine/api/geary-attachment-test.vala new/geary-0.12.3/test/engine/api/geary-attachment-test.vala --- old/geary-0.12.2/test/engine/api/geary-attachment-test.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/test/engine/api/geary-attachment-test.vala 2018-07-14 04:39:08.000000000 +0200 @@ -56,6 +56,8 @@ get_safe_file_name_with_default_content_type); add_test("get_safe_file_name_with_default_content_type_bad_file_name", get_safe_file_name_with_default_content_type_bad_file_name); + add_test("get_safe_file_name_with_unknown_content_type", + get_safe_file_name_with_unknown_content_type); } public override void set_up() { @@ -235,4 +237,24 @@ assert(test.get_safe_file_name.end(async_result()) == RESULT_FILENAME); } + public void get_safe_file_name_with_unknown_content_type() { + const string TEST_FILENAME = "test-filename.unlikely"; + Attachment test = new TestAttachment( + ATTACHMENT_ID, + this.default_type, + CONTENT_ID, + CONTENT_DESC, + content_disposition, + TEST_FILENAME, + File.new_for_path(TEST_FILENAME), + 742 + ); + + test.get_safe_file_name.begin(null, (obj, ret) => { + async_complete(ret); + }); + + assert(TEST_FILENAME == test.get_safe_file_name.end(async_result())); + } + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/geary-0.12.2/test/engine/imap/transport/imap-deserializer-test.vala new/geary-0.12.3/test/engine/imap/transport/imap-deserializer-test.vala --- old/geary-0.12.2/test/engine/imap/transport/imap-deserializer-test.vala 2018-04-24 02:22:39.000000000 +0200 +++ new/geary-0.12.3/test/engine/imap/transport/imap-deserializer-test.vala 2018-07-14 04:39:08.000000000 +0200 @@ -48,8 +48,8 @@ public void test_gmail_greeting() { string greeting = "* OK Gimap ready for requests from 115.187.245.46 c194mb399904375ivc"; - this.stream.add_data(greeting.data); - this.stream.add_data(EOL.data); + this.stream.add_data(greeting.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.MESSAGE, (obj, ret) => { async_complete(ret); }); RootParameters? message = this.process.end(async_result()); @@ -59,8 +59,8 @@ public void test_cyrus_2_4_greeting() { string greeting = "* OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE AUTH=PLAIN SASL-IR] mogul Cyrus IMAP v2.4.12-Debian-2.4.12-2 server ready"; - this.stream.add_data(greeting.data); - this.stream.add_data(EOL.data); + this.stream.add_data(greeting.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.MESSAGE, (obj, ret) => { async_complete(ret); }); RootParameters? message = this.process.end(async_result()); @@ -71,8 +71,8 @@ public void test_aliyun_greeting() { string greeting = "* OK AliYun IMAP Server Ready(10.147.40.164)"; string parsed = "* OK AliYun IMAP Server Ready (10.147.40.164)"; - this.stream.add_data(greeting.data); - this.stream.add_data(EOL.data); + this.stream.add_data(greeting.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.MESSAGE, (obj, ret) => { async_complete(ret); }); RootParameters? message = this.process.end(async_result()); @@ -82,8 +82,8 @@ public void test_invalid_atom_prefix() { string flags = """* OK %atom"""; - this.stream.add_data(flags.data); - this.stream.add_data(EOL.data); + this.stream.add_data(flags.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.DESER_FAIL, (obj, ret) => { async_complete(ret); }); this.process.end(async_result()); @@ -91,8 +91,8 @@ public void test_gmail_flags() { string flags = """* FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing)"""; - this.stream.add_data(flags.data); - this.stream.add_data(EOL.data); + this.stream.add_data(flags.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.MESSAGE, (obj, ret) => { async_complete(ret); }); RootParameters? message = this.process.end(async_result()); @@ -102,8 +102,8 @@ public void test_gmail_permanent_flags() { string flags = """* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing \*)] Flags permitted."""; - this.stream.add_data(flags.data); - this.stream.add_data(EOL.data); + this.stream.add_data(flags.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.MESSAGE, (obj, ret) => { async_complete(ret); }); RootParameters? message = this.process.end(async_result()); @@ -113,8 +113,8 @@ public void test_cyrus_flags() { string flags = """* 2934 FETCH (FLAGS (\Answered \Seen $Quuxo::Spam::Trained) UID 3041)"""; - this.stream.add_data(flags.data); - this.stream.add_data(EOL.data); + this.stream.add_data(flags.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.MESSAGE, (obj, ret) => { async_complete(ret); }); RootParameters? message = this.process.end(async_result()); @@ -128,8 +128,8 @@ // distinct atom. string flags = """* OK \*atom"""; string expected = """* OK \* atom"""; - this.stream.add_data(flags.data); - this.stream.add_data(EOL.data); + this.stream.add_data(flags.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.MESSAGE, (obj, ret) => { async_complete(ret); }); RootParameters? message = this.process.end(async_result()); @@ -139,8 +139,8 @@ public void test_invalid_flag_prefix() { string flags = """* OK \%atom"""; - this.stream.add_data(flags.data); - this.stream.add_data(EOL.data); + this.stream.add_data(flags.data, g_free); + this.stream.add_data(EOL.data, g_free); this.process.begin(Expect.DESER_FAIL, (obj, ret) => { async_complete(ret); }); this.process.end(async_result()); @@ -154,7 +154,7 @@ public void test_bye_eos() { string bye = """* OK bye"""; - this.stream.add_data(bye.data); + this.stream.add_data(bye.data, g_free); bool eos = false; this.deser.eos.connect(() => { eos = true; }); @@ -211,6 +211,12 @@ assert_not_reached(); } + // Process any remaining async tasks the deserializer might + // have left over. + while (this.main_loop.pending()) { + this.main_loop.iteration(true); + } + return message; }
