lib/chatrix/matrix.rb
def sync(filter: nil, since: nil, full_state: false,
             set_presence: true, timeout: 30_000)
      options = { full_state: full_state }

      options[:since] = since if since
      options[:set_presence] = 'offline' unless set_presence
      options[:timeout] = timeout if timeout
      options[:filter] = parse_filter filter

      make_request(:get, '/sync', params: options).parsed_response
    end
# Synchronize with the latest state on the server.
#
# For initial sync, call this method with the `since` parameter
# set to `nil`.
#
# @param filter [String,Hash] The ID of a filter to use, or provided
#   directly as a hash.
# @param since [String,nil] A point in time to continue sync from.
#   Will retrieve a snapshot of the state if not set, which will also
#   provide a `next_batch` value to use for `since` in the next call.
# @param full_state [Boolean] If `true`, all state events will be returned
#   for all rooms the user is a member of.
# @param set_presence [Boolean] If `true`, the user performing this request
#   will have their presence updated to show them as being online.
# @param timeout [Fixnum] Maximum time (in milliseconds) to wait before
#   the request is aborted.
# @return [Hash] The initial snapshot of the state (if no `since` value
#   was provided), or a delta to use for updating state.
Synchronize with the latest state on the server.
For initial sync, call this method with the `since` parameter
set to `nil`.
Synchronize with the latest state on the server . For initial sync call this method with the ` since ` parameter set to ` nil ` .
def sync(filter: nil, since: nil, full_state: false,
             set_presence: true, timeout: 30_000)
      options = { full_state: full_state }
      options[:since] = since if since
      options[:set_presence] = 'offline' unless set_presence
      options[:timeout] = timeout if timeout
      options[:filter] = parse_filter filter
      make_request(:get, '/sync', params: options).parsed_response
    end
def sync ( filter : nil , since : nil , full_state : false , set_presence : true , timeout : 30_000 ) options = { full_state : full_state } options [ :since ] = since if since options [ :set_presence ] = 'offline' unless set_presence options [ :timeout ] = timeout if timeout options [ :filter ] = parse_filter filter make_request ( :get , '/sync' , params : options ) . parsed_response end
Synchronize with the latest state on the server.
Synchronize with the latest state on the server .
The initial snapshot of the state (if no `since` value was provided), or a delta to use for updating state.
The initial snapshot of the state ( if no ` since ` value was provided ) or a delta to use for updating state .
Hash
filter
The ID of a filter to use, or provided directly as a hash.
The ID of a filter to use or provided directly as a hash .
since
A point in time to continue sync from. Will retrieve a snapshot of the state if not set, which will also provide a `next_batch` value to use for `since` in the next call.
A point in time to continue sync from . Will retrieve a snapshot of the state if not set which will also provide a ` next_batch ` value to use for ` since ` in the next call .
full_state
If `true`, all state events will be returned for all rooms the user is a member of.
If ` true ` all state events will be returned for all rooms the user is a member of .
set_presence
If `true`, the user performing this request will have their presence updated to show them as being online.
If ` true ` the user performing this request will have their presence updated to show them as being online .
timeout
Maximum time (in milliseconds) to wait before the request is aborted.
Maximum time ( in milliseconds ) to wait before the request is aborted .