1 Dec 2023 |
Matthias | Apparently not: | 16:35:09 |
Matthias |  Download clipboard.png | 16:35:13 |
Matthias | I think ik what the problem may be tho.. | 16:35:55 |
Gitlab | [famedly/conduit] _ZN3val
opened
merge request !562: Room v11
Resolves https://gitlab.com/famedly/conduit/-/issues/408
- [x] I agree to release my code and all other changes of this MR under the Apache-2.0 license
| 17:18:32 |
Gitlab | [famedly/conduit] _ZN3val
changed the title of
merge request !562 to Add support for room v11 | 17:18:49 |
val | can't see the image, could you copy-paste it? | 17:19:32 |
val | * can't see the image, could you copy-paste the error? | 17:19:39 |
GrayShade | Me neither | 17:23:17 |
| testosteron1 joined the room. | 17:36:09 |
frog ⚡️ | their server is offline, they likely cannot see these messages yet :p | 17:36:38 |
Gitlab | [famedly/conduit] zecakeh
commented on
merge request !562: Add support for room v11
v11 actually allow all keys here, and there are other changes in the redaction rules. I am wondering why this doesn't use the methods from Ruma, like ruma::canonical_json::redact_content_in_place , is it a type issue?
| 17:45:34 |
Gitlab | [famedly/conduit] _ZN3val
commented on
merge request !562: Add support for room v11
Ah you're right, I misunderstood the spec.
| 17:52:38 |
Matthias | In reply to @val:trix.re can't see the image, could you copy-paste the error? error[E0382]: use of moved value: `room_alias_result`
--> src/database/mod.rs:966:42
|
964 | for room_alias_result in room_aliases {
| -----------------
| |
| this reinitialization might get skipped
| move occurs because `room_alias_result` has type `std::result::Result<OwnedRoomAliasId, utils::error::Error>`, which does not implement the `Copy` trait
965 | for pattern in &services().globals.co...
966 | let room_alias = room_alias_result?;
| ^^^^^^^^^^^^^^^^^-
| |
| `room_alias_result` moved due to this method call, in previous iteration of loop
|
| 17:58:21 |
val | move it out of the inner loop | 17:58:59 |
Matthias | the pattern one? | 18:00:23 |
Matthias | Well that does work. :) But is there no performance penalty for fetching the list of rooms for every pattern? | 18:05:03 |
Matthias | Nvm, I guess you meant move it out of that pattern loop | 18:06:20 |
Matthias | Works aswell! | 18:06:26 |
val | I don't know | 18:06:28 |
Matthias | I should have noticed that, the error makes sense now. | 18:07:45 |
Gitlab | [famedly/conduit] _ZN3val
commented on
merge request !562: Add support for room v11
I switched to redact_content_in_place , it seems to work (tested only on m.room.message ). Thanks!
| 18:11:06 |
Matthias | Anyways, thanks for the help! | 18:11:35 |
Matthias | In reply to @val:trix.re can't see the image, could you copy-paste the error? I usually use image because it prevents wrapping (which can make it unreadable) and it keeps the colours. | 20:13:13 |
Matthias | I created a mock-mr if someone wants to review it: https://codeberg.org/Kladky/conduit/pulls/1 | 21:07:49 |
val | If it's statically defined (or unlikely to change), you can compile all the patterns into one big regexp. It's much faster than checking all patterns, when there are many. | 21:17:14 |
val | * If it's statically defined (or changes rarely), you can compile all the patterns into one big regexp. It's much faster than checking all patterns, when there are many. | 21:17:24 |
Matthias | You mean compiling it when loading the config? | 21:29:57 |
Matthias | * You mean compiling it when loading/deserializing the config? | 21:31:12 |
Timo on Conduit ⚡️ | Instead of defining a Vec<Regex>, you could just input a Regex and let the user combine them, but that's not great. Probably a better solution is to just take a string from the config and save a compiled version in the globals | 21:37:08 |
Timo on Conduit ⚡️ | But I don't think performance matters for this | 21:37:23 |