Ignore alias in room with no permission to talk

This commit is contained in:
miruka 2020-03-13 12:47:01 -04:00
parent 8d6fcf5c88
commit 9d7bffcee8
3 changed files with 14 additions and 5 deletions

View File

@ -88,9 +88,6 @@
- Code highlighting - Code highlighting
- Adapt shortcuts flicking speed to font size - Adapt shortcuts flicking speed to font size
- Multiaccount aliases:
- Prevent sending messages with a user not in the current room
- Accept drag and drop to upload files or set a new avatar - Accept drag and drop to upload files or set a new avatar
- Improve room tooltips, e.g. show last messages - Improve room tooltips, e.g. show last messages
- Warn user when connection is lost or 429s happen - Warn user when connection is lost or 429s happen

View File

@ -202,7 +202,7 @@ HGridLayout {
toolTip.text: qsTr( toolTip.text: qsTr(
"From any account, start a message with specified alias " + "From any account, start a message with specified alias " +
"followed by a space to type and send as this account.\n" + "followed by a space to type and send as this account.\n" +
"This account must a member of the room too.\n" + "The account must have permission to talk in the room.\n"+
"To ignore the alias when typing, prepend it with a space." "To ignore the alias when typing, prepend it with a space."
) )

View File

@ -22,7 +22,19 @@ Rectangle {
property string indent: " " property string indent: " "
property var aliases: window.settings.writeAliases property var aliases: {
const obj = {}
for (const [id, alia] of Object.entries(window.settings.writeAliases)){
const room = ModelStore.get(id, "rooms").find(chat.roomId)
if (room &&
! room.inviter_id && ! room.left && room.can_send_messages)
obj[id] = alia
}
return obj
}
property string toSend: "" property string toSend: ""
property string writingUserId: chat.userId property string writingUserId: chat.userId