Method: Msn::NotificationServer#login

Defined in:
lib/msn/notification_server.rb

#loginObject



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/msn/notification_server.rb', line 119

def 
  Fiber.new do
    begin
      ver "MSNP18", "CVR0"
      cvr "0x0409", "winnt", "5.1", "i386", "MSNMSGR", "8.5.1302", "BC01", username
      response = usr "SSO", "I", username
      if response[0] == "XFR" && response[2] == "NS"
        host, port = response[3].split ':'
        @reconnect_host, @reconnect_port = response[3].split ':'
        close_connection
      else
        (response[4], response[5])
      end
    rescue Msn::AuthenticationError => ex
      messenger.(ex.message)
      close_connection
    end
  end.resume
end