def online(buddies, rooms)
      resp = httpost('/presences/online', reqdata().merge({
        :buddies => buddies.join(','),
        :rooms => rooms.join(','),
        :name => @endpoint[:id],
        :nick => @endpoint[:nick],
        :show => @endpoint[:show],
        :status => @endpoint[:status]
      }))
      @ticket = resp["ticket"]
      connection = {
        :ticket => @ticket,
        :domain => @domain,
        :server => resp['server'],
        :jsonpd => resp['jsonpd']
      }
      connection[:websocket] = resp['websocket'] if resp['websocket']
      connection[:mqtt] = resp['mqtt'] if resp['mqtt']
      {
          :success => true,
          :connection => connection,
          :presences => resp['presences']
      }
    end
def online(buddies, rooms)
      resp = httpost('/presences/online', reqdata().merge({
        :buddies => buddies.join(','),
        :rooms => rooms.join(','),
        :name => @endpoint[:id],
        :nick => @endpoint[:nick],
        :show => @endpoint[:show],
        :status => @endpoint[:status]
      }))
      @ticket = resp["ticket"]
      connection = {
        :ticket => @ticket,
        :domain => @domain,
        :server => resp['server'],
        :jsonpd => resp['jsonpd']
      }
      connection[:websocket] = resp['websocket'] if resp['websocket']
      connection[:mqtt] = resp['mqtt'] if resp['mqtt']
      {
          :success => true,
          :connection => connection,
          :presences => resp['presences']
      }
    end
创建Client对象

 endpoint: 用户Hash对象
 domain: 域名
 apikey: 通信APIKEY
 host: 服务器地址
 port: 服务器端口号
 ticket: 通信令牌
 timeout: HTTP超时时间


  向消息服务器转发用户上线消息，同时发送用户的好友id列表、群组id列表

  buddies: 好友id列表
  rooms: 群组id列表