mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-19 21:29:52 -07:00
Add support for threads (#216)
This commit is contained in:
parent
8ee203c9a9
commit
ef868175cb
10 changed files with 466 additions and 201 deletions
|
@ -409,7 +409,7 @@ fn members_insert(
|
|||
) {
|
||||
if let Ok(members) = res {
|
||||
let ChatStore { rooms, .. } = &mut store.application;
|
||||
let info = rooms.get_or_default(room_id.clone());
|
||||
let info = rooms.get_or_default(room_id);
|
||||
|
||||
for member in members {
|
||||
let user_id = member.user_id();
|
||||
|
@ -1069,12 +1069,20 @@ impl ClientWorker {
|
|||
|
||||
match info.keys.get(redacts) {
|
||||
None => return,
|
||||
Some(EventLocation::Message(key)) => {
|
||||
Some(EventLocation::Message(None, key)) => {
|
||||
if let Some(msg) = info.messages.get_mut(key) {
|
||||
let ev = SyncRoomRedactionEvent::Original(ev);
|
||||
msg.redact(ev, room_version);
|
||||
}
|
||||
},
|
||||
Some(EventLocation::Message(Some(root), key)) => {
|
||||
if let Some(thread) = info.threads.get_mut(root) {
|
||||
if let Some(msg) = thread.get_mut(key) {
|
||||
let ev = SyncRoomRedactionEvent::Original(ev);
|
||||
msg.redact(ev, room_version);
|
||||
}
|
||||
}
|
||||
},
|
||||
Some(EventLocation::Reaction(event_id)) => {
|
||||
if let Some(reactions) = info.reactions.get_mut(event_id) {
|
||||
reactions.remove(redacts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue