-
Notifications
You must be signed in to change notification settings - Fork 442
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
Stop refreshing participant list when a guest is chatting #866
Stop refreshing participant list when a guest is chatting #866
Conversation
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
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.
Thanks for looking into this, found two issues.
->set('display_name', $query->createNamedParameter($displayName)) | ||
->where($query->expr()->eq('session_hash', $query->createNamedParameter($sessionHash))); | ||
$query->execute(); | ||
$dispatchEvent = true; |
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.
This is never set to false
.
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.
right, changed the logic of the code and broke this.
lib/GuestManager.php
Outdated
$dispatchEvent = true; | ||
} | ||
} catch (ParticipantNotFoundException $e) { | ||
$this->connection->insertIfNotExist('*PREFIX*talk_guests', [ |
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.
IMHO inserting an initial name should also dispatch an event.
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.
It does, because of the $dispatchEvent = true;
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/GuestManager.php
Outdated
|
||
try { | ||
$oldName = $this->getNameBySessionHash($sessionHash); | ||
$dispatchEvent = $oldName !== $displayName; |
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.
Better, though I would rather write it like this to save the redundant comparison:
if ($oldName !== $displayName) {
...
} else {
$dispatchEvent = false;
}
But that's just my personal taste 😉
Fix #865