Add "permission" for sessions that may not receive display names.

By default, the "join" events contain the whole userdata as received
from the "auth" response. This might include a "displayname" field
containing the display name of the associated user.

For privacy reasons in certain scenarios, some attendees should not
be able to know which other users are connected to a room, therefore
the "displayname" should be hidden for them. By default, no filtering
occurrs.
This commit is contained in:
Joachim Bauch
2022-04-26 14:47:01 +02:00
parent 6fa4a8b434
commit 39cc523477
4 changed files with 232 additions and 17 deletions
+21
View File
@@ -620,6 +620,18 @@ type RoomFlagsServerMessage struct {
Flags uint32 `json:"flags"`
}
type ChatComment map[string]interface{}
type RoomEventMessageDataChat struct {
Comment *ChatComment `json:"comment,omitempty"`
}
type RoomEventMessageData struct {
Type string `json:"type"`
Chat *RoomEventMessageDataChat `json:"chat,omitempty"`
}
type EventServerMessage struct {
Target string `json:"target"`
Type string `json:"type"`
@@ -646,6 +658,15 @@ type EventServerMessageSessionEntry struct {
RoomSessionId string `json:"roomsessionid,omitempty"`
}
func (e *EventServerMessageSessionEntry) Clone() *EventServerMessageSessionEntry {
return &EventServerMessageSessionEntry{
SessionId: e.SessionId,
UserId: e.UserId,
User: e.User,
RoomSessionId: e.RoomSessionId,
}
}
// MCU-related types
type AnswerOfferMessage struct {