mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
FIX: Presence bug (#5329)
* Add failing test case * FIX: new activity was not triggering cleanup
This commit is contained in:
committed by
Régis Hanol
parent
7e841a0495
commit
28073413eb
@@ -122,9 +122,9 @@ after_initialize do
|
||||
if topic
|
||||
guardian.ensure_can_see!(topic)
|
||||
|
||||
any_changes = false
|
||||
any_changes ||= Presence::PresenceManager.remove(type, id, current_user.id)
|
||||
any_changes ||= Presence::PresenceManager.cleanup(type, id)
|
||||
removed = Presence::PresenceManager.remove(type, id, current_user.id)
|
||||
any_removed = Presence::PresenceManager.cleanup(type, id)
|
||||
any_changes = removed || any_removed
|
||||
|
||||
users = Presence::PresenceManager.publish(type, id) if any_changes
|
||||
end
|
||||
@@ -144,9 +144,9 @@ after_initialize do
|
||||
if topic
|
||||
guardian.ensure_can_see!(topic)
|
||||
|
||||
any_changes = false
|
||||
any_changes ||= Presence::PresenceManager.add(type, id, current_user.id)
|
||||
any_changes ||= Presence::PresenceManager.cleanup(type, id)
|
||||
added = Presence::PresenceManager.add(type, id, current_user.id)
|
||||
any_removed = Presence::PresenceManager.cleanup(type, id)
|
||||
any_changes = added || any_removed
|
||||
|
||||
users = Presence::PresenceManager.publish(type, id) if any_changes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user