8go / 8go/matrix-commander-rs

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

Đang mở
#240 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
236
Fork
25
Merge trung bình
4 giờ 30 phút
Pull request đã merge (30 ngày)
2

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.