Add interface for method "GetInCall".

This commit is contained in:
Joachim Bauch 2025-09-29 21:18:38 +02:00
commit 89c71e4a3c
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02
2 changed files with 6 additions and 8 deletions

10
room.go
View file

@ -957,14 +957,8 @@ func (r *Room) NotifySessionChanged(session Session, flags SessionChangeFlag) {
if flags&SessionChangeInCall != 0 {
joinLeave := 0
if clientSession, ok := session.(*ClientSession); ok {
if clientSession.GetInCall()&FlagInCall != 0 {
joinLeave = 1
} else {
joinLeave = 2
}
} else if virtual, ok := session.(*VirtualSession); ok {
if virtual.GetInCall()&FlagInCall != 0 {
if session, ok := session.(SessionWithInCall); ok {
if session.GetInCall()&FlagInCall != 0 {
joinLeave = 1
} else {
joinLeave = 2

View file

@ -76,6 +76,10 @@ type Session interface {
SendMessage(message *ServerMessage) bool
}
type SessionWithInCall interface {
GetInCall() int
}
func parseUserData(data json.RawMessage) func() (api.StringMap, error) {
return sync.OnceValues(func() (api.StringMap, error) {
if len(data) == 0 {