Permalink
Browse files

Added Messenger#close

  • Loading branch information...
1 parent 494febf commit c8b16ebe91acd7d135feabd7ed0941c97fc7fe8d Ary Borenszweig committed Nov 7, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 lib/msn/messenger.rb
View
@@ -63,11 +63,6 @@ def get_contacts
@notification_server.get_contacts
end
- def send_contact_command(email, command, list)
- username, domain = email.split '@', 2
- @notification_server.send_payload_command_and_wait command, %Q(<ml><d n="#{domain}"><c n="#{username}" t="1" l="#{list}" /></d></ml>)
- end
-
def on_ready(&handler)
@on_ready_handler = handler
end
@@ -96,6 +91,15 @@ def send_message(email, text)
@notification_server.send_message email, text
end
+ def close
+ @notification_server.close_connection
+ end
+
+ def send_contact_command(email, command, list)
+ username, domain = email.split '@', 2
+ @notification_server.send_payload_command_and_wait command, %Q(<ml><d n="#{domain}"><c n="#{username}" t="1" l="#{list}" /></d></ml>)
+ end
+
def accept_message(message)
call_handler @on_message_handler, message
end

0 comments on commit c8b16eb

Please sign in to comment.