Class: Hipbot::Callbacks::LobbyPresence

Inherits:
Presence show all
Defined in:
lib/hipbot/callbacks/lobby_presence.rb

Instance Attribute Summary

Attributes inherited from Presence

#presence

Instance Method Summary collapse

Constructor Details

#initialize(user_id, presence) ⇒ LobbyPresence

Returns a new instance of LobbyPresence.



4
5
6
7
8
9
10
11
# File 'lib/hipbot/callbacks/lobby_presence.rb', line 4

def initialize user_id, presence
  self.presence = presence

  with_user(id: user_id) do |user|
    Hipbot.logger.info("PRESENCE from #{user}: #{presence}")
    user.update_attribute(:is_online, !offline_presence?)
  end
end