cai.client.online_push package

OnlinePush Related SDK.

This module is used to build and handle online push related packet.

Copyright

Copyright (C) 2021-2021 cscs181

License

AGPL-3.0 or later. See LICENSE for detail.

cai.client.online_push.encode_push_response(seq: int, session_id: bytes, uin: int, d2key: bytes, resp_uin: int, svrip: int, delete_messages: List[cai.client.online_push.jce.DelMsgInfo] = [], push_token: Optional[bytes] = None, service_type: int = 0, device_info: Optional[cai.client.online_push.jce.DeviceInfo] = None) cai.utils.binary.Packet

Build online push response packet.

Called in com.tencent.mobileqq.app.BaseMessageHandler.a.

command name: OnlinePush.RespPush

注解

Source: com.tencent.mobileqq.service.message.MessageFactorySender.b

参数
  • seq (int) – Packet sequence.

  • session_id (bytes) – Session ID.

  • uin (int) – User QQ number.

  • d2key (bytes) – Siginfo d2 key.

  • resp_uin (int) – Push response uin.

  • svrip (int) – Svrip from push packet.

  • delete_messages (List[DelMsgInfo]) – List of delete messages.

  • push_token (Optional[bytes]) – Push token from push packet.

  • service_type (int) – Service type.

  • device_info (Optional[DeviceInfo]) – Device info.

返回

PbDeleteMsg packet.

返回类型

Packet

async cai.client.online_push.handle_c2c_sync(client: Client, packet: cai.client.packet.IncomingPacket) cai.client.online_push.command.PushMsgCommand

Handle C2C Message Sync.

注解

Source: c2c 2003

com.tencent.imcore.message.C2CMessageProcessor.b (handleMsgPush_PB_SlaveMaster)

com.tencent.mobileqq.app.MessageHandler.b

async cai.client.online_push.handle_push_msg(client: Client, packet: cai.client.packet.IncomingPacket) cai.client.online_push.command.PushMsgCommand

Handle Push Message Command.

注解

Source: troop 1001, c2c 1001, discussion 1001

com.tencent.mobileqq.app.MessageHandler.b

Submodules

cai.client.online_push.command module

MessageSvc Command Parser.

This module is used to parse MessageSvc response packets into command.

Copyright

Copyright (C) 2021-2021 cscs181

License

AGPL-3.0 or later. See LICENSE for detail.

class cai.client.online_push.command.PushMsgCommand(uin: int, seq: int, ret_code: int, command_name: str)

基类:cai.client.command.Command

classmethod decode_response(uin: int, seq: int, ret_code: int, command_name: str, data: bytes) cai.client.online_push.command.PushMsgCommand

Decode OnlinePush push message packet.

Including commands: OnlinePush.PbPushGroupMsg, OnlinePush.PbPushDisMsg, OnlinePush.PbC2CMsgSync, OnlinePush.PbPushC2CMsg, OnlinePush.PbPushBindUinGroupMsg

注解

Source: com.tencent.mobileqq.app.MessageHandler.b

参数
  • uin (int) – User QQ

  • seq (int) – Sequence number of the response packet.

  • ret_code (int) – Return code of the response.

  • command_name (str) – Command name of the response.

  • data (bytes) – Payload data of the response.

uin: int
seq: int
ret_code: int
command_name: str
class cai.client.online_push.command.PushMsg(uin: int, seq: int, ret_code: int, command_name: str, push: cai.pb.msf.msg.onlinepush.onlinepush_pb2.PbPushMsg)

基类:cai.client.online_push.command.PushMsgCommand

push: cai.pb.msf.msg.onlinepush.onlinepush_pb2.PbPushMsg
class cai.client.online_push.command.PushMsgError(uin: int, seq: int, ret_code: int, command_name: str, message: str)

基类:cai.client.online_push.command.PushMsgCommand

message: str

cai.client.online_push.jce module

OnlinePush Packet Builder.

This module is used to build and handle OnlinePush packets.

Copyright

Copyright (C) 2021-2021 cscs181

License

AGPL-3.0 or later. See LICENSE for detail.

class cai.client.online_push.jce.DelMsgInfo(*, from_uin: jce.types.INT64, msg_time: jce.types.INT64, msg_seq: jce.types.INT8, msg_cookies: jce.types.BYTES = b'', cmd: jce.types.INT8 = 0, msg_type: jce.types.INT64 = 0, app_id: jce.types.INT64 = 0, send_time: jce.types.INT64 = 0, sso_seq: jce.types.INT32 = 0, sso_ip: jce.types.INT32 = 0, client_ip: jce.types.INT32 = 0)

基类:jce.types.JceStruct

OnlinePush Delete Message Info Packet.

注解

Source: OnlinePushPack.DelMsgInfo

from_uin: jce.types.INT64
msg_time: jce.types.INT64
msg_seq: jce.types.INT8
msg_cookies: jce.types.BYTES
cmd: jce.types.INT8
msg_type: jce.types.INT64
app_id: jce.types.INT64
send_time: jce.types.INT64
sso_seq: jce.types.INT32
sso_ip: jce.types.INT32
client_ip: jce.types.INT32
class cai.client.online_push.jce.DeviceInfo(*, net_type: jce.types.BYTE = b'\x00', dev_type: jce.types.STRING = '', os_ver: jce.types.STRING = '', vendor_name: jce.types.STRING = '', vendor_os_name: jce.types.STRING = '', ios_idfa: jce.types.STRING = '')

基类:jce.types.JceStruct

OnlinePush Device Info Packet.

注解

Source: OnlinePushPack.DeviceInfo

net_type: jce.types.BYTE
dev_type: jce.types.STRING
os_ver: jce.types.STRING
vendor_name: jce.types.STRING
vendor_os_name: jce.types.STRING
ios_idfa: jce.types.STRING
class cai.client.online_push.jce.SvcRespPushMsg(*, uin: jce.types.INT64, del_infos: jce.types.LIST[cai.client.online_push.jce.DelMsgInfo], svrip: jce.types.INT32, push_token: jce.types.BYTES = None, service_type: jce.types.INT32 = 0, device_info: cai.client.online_push.jce.DeviceInfo = None)

基类:jce.types.JceStruct

OnlinePush Service Push Response Packet.

注解

Source: OnlinePushPack.SvcRespPushMsg

uin: jce.types.INT64
del_infos: jce.types.LIST[cai.client.online_push.jce.DelMsgInfo]
svrip: jce.types.INT32
push_token: Optional[jce.types.BYTES]
service_type: jce.types.INT32
device_info: Optional[cai.client.online_push.jce.DeviceInfo]