Class: MTProto::TL::AffectedHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/mtproto/tl/objects/affected_history.rb

Overview

messages.affectedHistory — reply to bulk history operations (unpinAllMessages, deleteHistory, readHistory…). pts/pts_count advance the update state; a nonzero offset means the server processed only part of the range and the caller must repeat the request with the same arguments until offset reaches 0.

Constant Summary collapse

CONSTRUCTOR =
0xb45c69d1

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pts:, pts_count:, offset:) ⇒ AffectedHistory

Returns a new instance of AffectedHistory.



14
15
16
17
18
# File 'lib/mtproto/tl/objects/affected_history.rb', line 14

def initialize(pts:, pts_count:, offset:)
  @pts = pts
  @pts_count = pts_count
  @offset = offset
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



12
13
14
# File 'lib/mtproto/tl/objects/affected_history.rb', line 12

def offset
  @offset
end

#ptsObject (readonly)

Returns the value of attribute pts.



12
13
14
# File 'lib/mtproto/tl/objects/affected_history.rb', line 12

def pts
  @pts
end

#pts_countObject (readonly)

Returns the value of attribute pts_count.



12
13
14
# File 'lib/mtproto/tl/objects/affected_history.rb', line 12

def pts_count
  @pts_count
end

Class Method Details

.deserialize(data) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/mtproto/tl/objects/affected_history.rb', line 20

def self.deserialize(data)
  constructor = data[0, 4].unpack1('L<')
  raise UnexpectedConstructorError, constructor unless constructor == CONSTRUCTOR

  pts = data[4, 4].unpack1('l<')
  pts_count = data[8, 4].unpack1('l<')
  offset = data[12, 4].unpack1('l<')
  new(pts: pts, pts_count: pts_count, offset: offset)
end