fix: don't allow unjoined users to send typing notifications
This commit is contained in:
parent
3573d40027
commit
b6b27b66c8
2 changed files with 24 additions and 13 deletions
|
@ -770,17 +770,21 @@ pub async fn send_transaction_message_route(
|
|||
}
|
||||
}
|
||||
Edu::Typing(typing) => {
|
||||
if typing.typing {
|
||||
db.rooms.edus.typing_add(
|
||||
&typing.user_id,
|
||||
&typing.room_id,
|
||||
3000 + utils::millis_since_unix_epoch(),
|
||||
&db.globals,
|
||||
)?;
|
||||
} else {
|
||||
db.rooms
|
||||
.edus
|
||||
.typing_remove(&typing.user_id, &typing.room_id, &db.globals)?;
|
||||
if db.rooms.is_joined(&typing.user_id, &typing.room_id)? {
|
||||
if typing.typing {
|
||||
db.rooms.edus.typing_add(
|
||||
&typing.user_id,
|
||||
&typing.room_id,
|
||||
3000 + utils::millis_since_unix_epoch(),
|
||||
&db.globals,
|
||||
)?;
|
||||
} else {
|
||||
db.rooms.edus.typing_remove(
|
||||
&typing.user_id,
|
||||
&typing.room_id,
|
||||
&db.globals,
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
Edu::DeviceListUpdate(DeviceListUpdateContent { user_id, .. }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue