-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(metadata): Keeps track of participants last used display name. #546
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,15 +123,16 @@ class CallPage(driver: RemoteWebDriver) : AbstractPageObject(driver) { | |
val result = driver.executeScript( | ||
""" | ||
try { | ||
window._jibriParticipants = []; | ||
window._jibriParticipants = new Map(); | ||
const existingMembers = APP.conference._room.room.members || {}; | ||
const existingMemberJids = Object.keys(existingMembers); | ||
console.log("There were " + existingMemberJids.length + " existing members"); | ||
existingMemberJids.forEach(jid => { | ||
const existingMember = existingMembers[jid]; | ||
if (existingMember.identity) { | ||
console.log("Member ", existingMember, " has identity, adding"); | ||
window._jibriParticipants.push(existingMember.identity); | ||
existingMember.identity.lastKnownDisplayName = existingMember.nick; | ||
window._jibriParticipants.set(jid, existingMember.identity); | ||
} else { | ||
console.log("Member ", existingMember.jid, " has no identity, skipping"); | ||
} | ||
|
@@ -141,10 +142,21 @@ class CallPage(driver: RemoteWebDriver) : AbstractPageObject(driver) { | |
(from, nick, role, hidden, statsid, status, identity) => { | ||
console.log("Jibri got MUC_MEMBER_JOINED: ", from, identity); | ||
if (!hidden && identity) { | ||
window._jibriParticipants.push(identity); | ||
identity.lastKnownDisplayName = nick; | ||
window._jibriParticipants.set(from, identity); | ||
} | ||
} | ||
); | ||
APP.conference._room.room.addListener( | ||
"xmpp.display_name_changed", | ||
(jid, displayName) => { | ||
const identity = window._jibriParticipants.get(jid); | ||
if (identity) { | ||
identity.lastKnownDisplayName = displayName; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pl set the display name property instead, so the JaaS webhook payload doesn't change since it takes it from the metadata file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So identity already has the display name that is coming from the jwt. Do you want to override that one and lost any values from it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, to overwrite name in user:
|
||
} | ||
} | ||
); | ||
|
||
return true; | ||
} catch (e) { | ||
return e.message; | ||
|
@@ -189,7 +201,7 @@ class CallPage(driver: RemoteWebDriver) : AbstractPageObject(driver) { | |
val result = driver.executeScript( | ||
""" | ||
try { | ||
return window._jibriParticipants; | ||
return window._jibriParticipants.values().toArray(); | ||
} catch (e) { | ||
return e.message; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skip if display name is undefined or 0 length.