Class: Meshchat::Network::Message::Disconnect
- Defined in:
- lib/meshchat/network/message/disconnect.rb
Instance Attribute Summary
Attributes inherited from Base
#_message, #_message_dispatcher, #_message_factory, #_sender_location, #_sender_name, #_sender_uid, #_time_received, #payload
Instance Method Summary collapse
Methods inherited from Base
#client, #client_version, #encrypt_for, #handle, #initialize, #message, #render, #respond, #sender, #sender_location, #sender_name, #sender_uid, #time_received, #time_received_as_date, #type
Constructor Details
This class inherits a constructor from Meshchat::Network::Message::Base
Instance Method Details
#display ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/meshchat/network/message/disconnect.rb', line 6 def display location = payload['sender']['location'] uid = payload['sender']['uid'] name = payload['sender']['alias'] node = Node.find_by_uid(uid) if node node.update(on_local_network: false) node.update(on_relay: false) end "#{name}@#{location} has disconnected" end |