8go / 8go/matrix-commander-rs

Feature request: Add CLI argument to support redacted event elision in `--tail` calls.

未關閉
#240 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
236
分支
25
平均合併
4 小時 30 分鐘
30 天內合併 PR
2

描述

This is a continuation of issue #228. We would like to have a CLI argument `--skip-redacted` that when combined with `--tail` skips all of the redacted events in the message stream.

---
The current behavior is:

```text
kevin@kevin-hp-840g10:~/matrix-commander-rs$ cargo run -- --tail 6 --listen-self
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.55s
Running `target/debug/matrix-commander-rs --tail 6 --listen-self`
Redacted message: room "!tELNSqxlPfJBLbWiax:matrix.org", sender "@kcexton:matrix.org", event id "$i5Q8qjFwM6NmZxlqjt-OAMbBJDoddwzbTgBDzp0CKDo",
RoomRedaction: content: RoomRedactionEventContent { redacts: Some("$i5Q8qjFwM6NmZxlqjt-OAMbBJDoddwzbTgBDzp0CKDo"), reason: Some("test") }, redacts Some("$i5Q8qjFwM6NmZxlqjt-OAMbBJDoddwzbTgBDzp0CKDo"), room "!tELNSqxlPfJBLbWiax:matrix.org", sender "@kcexton:matrix.org", event id "$E8rPHXsTXbl-d5j8R6xl4wQTOKW2bVlcFgw7Cv_pXOw",
Redacted message: room "!tELNSqxlPfJBLbWiax:matrix.org", sender "@kcexton:matrix.org", event id "$_bFqEG3o-lewwQFAojAisXMwwAGVfP_QtrehyMH8jNc",
RoomRedaction: content: RoomRedactionEventContent { redacts: Some("$_bFqEG3o-lewwQFAojAisXMwwAGVfP_QtrehyMH8jNc"), reason: Some("test") }, redacts Some("$_bFqEG3o-lewwQFAojAisXMwwAGVfP_QtrehyMH8jNc"), room "!tELNSqxlPfJBLbWiax:matrix.org", sender "@kcexton:matrix.org", event id "$UOSvbIazgVt0Lc2W_rzyu01fSoXN9DTGdOQfEqfpcfo",
Message: type Text: body "Hello, world!", room "!tELNSqxlPfJBLbWiax:matrix.org", sender "@kcexton:matrix.org", event id "$IJaQX6VA-cvneDz03psqA57t3jQAdK3hcV2swijqs48", formatted None,
```

---
With the new `--skip-redacted` flag the expected behavior for these same room events will be:

```text
kevin@kevin-hp-840g10:~/matrix-commander-rs$ cargo run -- --tail 3 --skip-redacted --listen-self
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.55s
Running `target/debug/matrix-commander-rs --tail 3 --skip-redacted --listen-self`
RoomRedaction: content: RoomRedactionEventContent { redacts: Some("$i5Q8qjFwM6NmZxlqjt-OAMbBJDoddwzbTgBDzp0CKDo"), reason: Some("test") }, redacts Some("$i5Q8qjFwM6NmZxlqjt-OAMbBJDoddwzbTgBDzp0CKDo"), room "!tELNSqxlPfJBLbWiax:matrix.org", sender "@kcexton:matrix.org", event id "$E8rPHXsTXbl-d5j8R6xl4wQTOKW2bVlcFgw7Cv_pXOw",
RoomRedaction: content: RoomRedactionEventContent { redacts: Some("$_bFqEG3o-lewwQFAojAisXMwwAGVfP_QtrehyMH8jNc"), reason: Some("test") }, redacts Some("$_bFqEG3o-lewwQFAojAisXMwwAGVfP_QtrehyMH8jNc"), room "!tELNSqxlPfJBLbWiax:matrix.org", sender "@kcexton:matrix.org", event id "$UOSvbIazgVt0Lc2W_rzyu01fSoXN9DTGdOQfEqfpcfo",
Message: type Text: body "Hello, world!", room "!tELNSqxlPfJBLbWiax:matrix.org", sender "@kcexton:matrix.org", event id "$IJaQX6VA-cvneDz03psqA57t3jQAdK3hcV2swijqs48", formatted None,
```

note that `--tail` now needs to consume more than 3 events in order to find 3 printable events.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。