Support inviting people from UserDetailDialog
This commit is contained in:
@@ -600,8 +600,10 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format,
|
|||||||
} else {
|
} else {
|
||||||
return i18n("self-banned from the room");
|
return i18n("self-banned from the room");
|
||||||
}
|
}
|
||||||
case MembershipType::Knock:
|
case MembershipType::Knock: {
|
||||||
return i18n("requested an invite");
|
QString reason(e.contentJson()["reason"_ls].toString().toHtmlEscaped());
|
||||||
|
return reason.isEmpty() ? i18n("requested an invite") : i18n("requested an invite with reason: %1", reason);
|
||||||
|
}
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
return i18n("made something unknown");
|
return i18n("made something unknown");
|
||||||
|
|||||||
@@ -97,6 +97,19 @@ Kirigami.OverlaySheet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Kirigami.BasicListItem {
|
||||||
|
visible: user !== room.localUser && room.canSendState("invite") && !room.containsUser(user.id)
|
||||||
|
|
||||||
|
action: Kirigami.Action {
|
||||||
|
enabled: !room.isUserBanned(user.id)
|
||||||
|
text: i18n("Invite this user")
|
||||||
|
icon.name: "list-add-user"
|
||||||
|
onTriggered: {
|
||||||
|
room.inviteToRoom(user.id)
|
||||||
|
root.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Kirigami.BasicListItem {
|
Kirigami.BasicListItem {
|
||||||
visible: user !== room.localUser && room.canSendState("ban") && !room.isUserBanned(user.id)
|
visible: user !== room.localUser && room.canSendState("ban") && !room.isUserBanned(user.id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user