lib/ayadn/api.rb in ayadn-1.7.7 vs lib/ayadn/api.rb in ayadn-1.8.0

- old
+ new

@@ -223,11 +223,11 @@ # options = {:count => 200, :before_id => resp['meta']['min_id']} # end # big end - def get_channel channel_id, options + def get_channel channel_id, options = {} options = {:recent_message => 1, :annotations => 1, :before_id => nil} get_parsed_response(Endpoints.new.channel(channel_id, options)) end def get_messages(channel_id, options) @@ -243,9 +243,18 @@ if res['meta']['code'] == 200 res else Errors.global_error({error: nil, caller: caller, data: [res['meta']]}) end + end + + def update_marker(name, last_read_id) + obj = { + 'name' => name, + 'id' => last_read_id + } + url = Endpoints.new.update_marker + CNX.post(url, obj) end def self.build_query(arg) if arg[:count].to_s.is_integer? count = arg[:count]