Method: MatrixSdk::Protocols::CS#send_location

Defined in:
lib/matrix_sdk/protocols/cs.rb

#send_location(room_id, geo_uri, name, **params) ⇒ Response

Send a geographic location to a room

Parameters:

  • room_id (MXID, String)

    The room ID to send the location to

  • geo_uri (URI, String)

    The geographical URI to send

  • name (String)

    The name of the location

  • params (Hash)

    Options for the request

Options Hash (**params):

  • :extra_information (Hash) — default: {}

    Extra information for the location

  • :thumbnail_url (URI, String)

    The URL to a thumbnail of the location

  • :thumbnail_info (Hash)

    Image information about the location thumbnail

Returns:

  • (Response)

    A response hash with the parameter :event_id

See Also:



378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/matrix_sdk/protocols/cs.rb', line 378

def send_location(room_id, geo_uri, name, **params)
  content = {
    geo_uri: geo_uri,
    msgtype: 'm.location',
    body: name,
    info: params.delete(:extra_information) { {} }
  }
  content[:info][:thumbnail_url] = params.delete(:thumbnail_url) if params.key? :thumbnail_url
  content[:info][:thumbnail_info] = params.delete(:thumbnail_info) if params.key? :thumbnail_info

  send_message_event(room_id, 'm.room.message', content, params)
end