On Mon, Apr 08, 2019 at 09:22:43PM +0000, Linda Lapinlampi wrote:
> I'm attaching a DEP-3 formatted Debian patch, backported from upstream
> mtxclient to nheko 0.6.3-1 in Debian.

...and here's the patch I forgot to attach earlier.
Author: redsky17 <joedono...@gmail.com>
Bug: https://github.com/Nheko-Reborn/mtxclient/issues/3
Bug-Debian: https://bugs.debian.org/926671
Description: Fix Room v3 Issue
 This at least partially addresses #3.  I have a feeling that
 additional updates will be needed at some point, but this
 fixes the issue where mtxclient would throw an exception for
 unrecognized event id formats, which caused nheko to crash.
Origin: backport, https://github.com/Nheko-Reborn/mtxclient/commit/67d39691666bcdf3cc660db19ccc0d9941df13fd
Last-Update: 2019-04-08

diff --git a/mtxclient/include/mtx/identifiers.hpp b/mtxclient/include/mtx/identifiers.hpp
index 87acc43..7885885 100644
--- a/mtxclient/include/mtx/identifiers.hpp
+++ b/mtxclient/include/mtx/identifiers.hpp
@@ -90,7 +90,10 @@ parse(const std::string &id)
                 identifier.hostname_  = id.substr(parts + 1);
                 identifier.id_        = id;
         } else {
-                throw std::invalid_argument(id + ": invalid format\n");
+                // V3 event ids don't use ':' at all, don't parse them the same way.
+                identifier.localpart_ = id;
+                identifier.hostname_ = id;
+                identifier.id_ = id;
         }
 
         return identifier;

Reply via email to