Class: MTProto::Updates::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/mtproto/updates/event.rb

Overview

One normalized update the state machine emits, unified across the live push and the getDifference/getChannelDifference recovery paths so a host sees one shape however an update arrived. kind selects which payload fields are set:

:message / :edit          message (TL::Message#to_h)
:join                     joined_user_id
:leave                    left_user_id
:reaction / :unreaction   msg_id, reactors
:delete                   deleted_ids
:callback                 query_id, user_id, data, msg_id
:guest_query              query_id, message, qts

pts/pts_count/channel drive ordering and gap detection; they are nil for updates outside the pts sequence (e.g. getDifference's common new_messages, which the protocol delivers without a per-message pts). users/chats are the peers that rode in the same batch (shared by reference) — the access_hash source a host caches and enriches from.

Instance Attribute Summary collapse

Instance Attribute Details

#channelObject

Returns the value of attribute channel

Returns:

  • (Object)

    the current value of channel



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def channel
  @channel
end

#chatsObject

Returns the value of attribute chats

Returns:

  • (Object)

    the current value of chats



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def chats
  @chats
end

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def data
  @data
end

#deleted_idsObject

Returns the value of attribute deleted_ids

Returns:

  • (Object)

    the current value of deleted_ids



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def deleted_ids
  @deleted_ids
end

#joined_user_idObject

Returns the value of attribute joined_user_id

Returns:

  • (Object)

    the current value of joined_user_id



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def joined_user_id
  @joined_user_id
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def kind
  @kind
end

#left_user_idObject

Returns the value of attribute left_user_id

Returns:

  • (Object)

    the current value of left_user_id



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def left_user_id
  @left_user_id
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def message
  @message
end

#msg_idObject

Returns the value of attribute msg_id

Returns:

  • (Object)

    the current value of msg_id



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def msg_id
  @msg_id
end

#peer_idObject

Returns the value of attribute peer_id

Returns:

  • (Object)

    the current value of peer_id



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def peer_id
  @peer_id
end

#peer_typeObject

Returns the value of attribute peer_type

Returns:

  • (Object)

    the current value of peer_type



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def peer_type
  @peer_type
end

#ptsObject

Returns the value of attribute pts

Returns:

  • (Object)

    the current value of pts



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def pts
  @pts
end

#pts_countObject

Returns the value of attribute pts_count

Returns:

  • (Object)

    the current value of pts_count



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def pts_count
  @pts_count
end

#qtsObject

Returns the value of attribute qts

Returns:

  • (Object)

    the current value of qts



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def qts
  @qts
end

#query_idObject

Returns the value of attribute query_id

Returns:

  • (Object)

    the current value of query_id



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def query_id
  @query_id
end

#reactorsObject

Returns the value of attribute reactors

Returns:

  • (Object)

    the current value of reactors



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def reactors
  @reactors
end

#user_idObject

Returns the value of attribute user_id

Returns:

  • (Object)

    the current value of user_id



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def user_id
  @user_id
end

#usersObject

Returns the value of attribute users

Returns:

  • (Object)

    the current value of users



20
21
22
# File 'lib/mtproto/updates/event.rb', line 20

def users
  @users
end