1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

more event supported.

This commit is contained in:
Mrs4s 2020-07-07 02:58:36 +08:00
parent d7fca72524
commit b6aee75d67
11 changed files with 608 additions and 69 deletions

View File

@ -9,13 +9,13 @@ qq-android协议的golang实现 移植于Mirai
| 功能 | 状态 | | 功能 | 状态 |
| -------- | ------ | | -------- | ------ |
| 登录 | 完成 | | 登录 | 完成 |
| 自动重连 | 正在做 | | 自动重连 | 大概能用了 |
| 好友/群列表 | 完成 | | 好友/群列表 | 完成 |
| 好友消息接受 | 完成 | | 好友消息接受 | 完成 |
| 好友消息发送 | 正在做| | 好友消息发送 | 正在做|
| 群消息接受 |完成| | 群消息接受 |完成|
| 群消息发送 | 50% (仅支持 文本/图片/表情)| | 群消息发送 | 50% (仅支持 文本/图片/表情)|
| QQ各种事件 | 正在做 | | QQ各种事件 | 正在做, 已支持 群内禁言/群内消息撤回 |
| Cookies相关 | 咕咕| | Cookies相关 | 咕咕|
| MiraiGo文档 | 咕咕| | MiraiGo文档 | 咕咕|
| QQ协议说明文档| 自用整理 有空了应该会做| | QQ协议说明文档| 自用整理 有空了应该会做|

View File

@ -414,3 +414,7 @@ func (r *JceReader) ReadObject(i interface{}, tag int) {
o.ReadFrom(r) o.ReadFrom(r)
} }
} }
func (r *JceReader) ReadAvailable() []byte {
return r.readBytes(r.buf.Len())
}

View File

@ -5,7 +5,6 @@ type IJecStruct interface {
ReadFrom(*JceReader) ReadFrom(*JceReader)
} }
// TODO: code gen
type ( type (
RequestPacket struct { RequestPacket struct {
IVersion int16 `jceId:"1"` IVersion int16 `jceId:"1"`
@ -67,6 +66,28 @@ type (
SetMute byte `jceId:"36"` SetMute byte `jceId:"36"`
} }
PushMessageInfo struct {
FromUin int64 `jceId:"0"`
MsgTime int64 `jceId:"1"`
MsgType int16 `jceId:"2"`
MsgSeq int16 `jceId:"3"`
Msg string `jceId:"4"`
RealMsgTime int32 `jceId:"5"`
VMsg []byte `jceId:"6"`
AppShareID int64 `jceId:"7"`
MsgCookies []byte `jceId:"8"`
AppShareCookie []byte `jceId:"9"`
MsgUid int64 `jceId:"10"`
LastChangeTime int64 `jceId:"11"`
FromInstId int64 `jceId:"14"`
RemarkOfSender []byte `jceId:"15"`
FromMobile string `jceId:"16"`
FromName string `jceId:"17"`
}
SvcRespPushMsg struct {
}
FriendListRequest struct { FriendListRequest struct {
Reqtype int32 `jceId:"0"` Reqtype int32 `jceId:"0"`
IfReflush byte `jceId:"1"` IfReflush byte `jceId:"1"`
@ -395,3 +416,20 @@ func (pkt *TroopMemberInfo) ReadFrom(r *JceReader) {
pkt.SpecialTitleExpireTime = r.ReadInt64(24) pkt.SpecialTitleExpireTime = r.ReadInt64(24)
pkt.Job = r.ReadString(25) pkt.Job = r.ReadString(25)
} }
func (pkt *PushMessageInfo) ToBytes() []byte {
w := NewJceWriter()
w.WriteJceStructRaw(pkt)
return w.Bytes()
}
func (pkt *PushMessageInfo) ReadFrom(r *JceReader) {
pkt.FromUin = r.ReadInt64(0)
pkt.MsgTime = r.ReadInt64(1)
pkt.MsgType = r.ReadInt16(2)
pkt.MsgSeq = r.ReadInt16(3)
pkt.Msg = r.ReadString(4)
pkt.VMsg = r.ReadAny(6).([]byte)
pkt.FromMobile = r.ReadString(16)
pkt.FromName = r.ReadString(17)
}

View File

@ -121,26 +121,34 @@ func NewNetworkReader(conn net.Conn) *NetworkReader {
return &NetworkReader{conn: conn} return &NetworkReader{conn: conn}
} }
func (r *NetworkReader) ReadByte() byte { func (r *NetworkReader) ReadByte() (byte, error) {
buf := make([]byte, 1) buf := make([]byte, 1)
n, err := r.conn.Read(buf) n, err := r.conn.Read(buf)
if err != nil { if err != nil {
panic(err) return 0, err
} }
if n != 1 { if n != 1 {
return r.ReadByte() return r.ReadByte()
} }
return buf[0] return buf[0], nil
} }
func (r *NetworkReader) ReadBytes(len int) []byte { func (r *NetworkReader) ReadBytes(len int) ([]byte, error) {
buf := make([]byte, len) buf := make([]byte, len)
for i := 0; i < len; i++ { for i := 0; i < len; i++ {
buf[i] = r.ReadByte() b, err := r.ReadByte()
if err != nil {
return nil, err
} }
return buf buf[i] = b
}
return buf, nil
} }
func (r *NetworkReader) ReadInt32() int32 { func (r *NetworkReader) ReadInt32() (int32, error) {
return (int32(r.ReadByte()) << 24) | (int32(r.ReadByte()) << 16) | (int32(r.ReadByte()) << 8) | int32(r.ReadByte()) b, err := r.ReadBytes(4)
if err != nil {
return 0, err
}
return (int32(b[0]) << 24) | (int32(b[1]) << 16) | (int32(b[2]) << 8) | int32(b[3]), nil
} }

View File

@ -139,7 +139,7 @@ func (c *QQClient) buildClientRegisterPacket() (uint16, []byte) {
return seq, packet return seq, packet
} }
func (c *QQClient) buildPushResponsePacket(t int32, pktSeq int64, jceBuf []byte) (uint16, []byte) { func (c *QQClient) buildConfPushRespPacket(t int32, pktSeq int64, jceBuf []byte) (uint16, []byte) {
seq := c.nextSeq() seq := c.nextSeq()
req := jce.NewJceWriter() req := jce.NewJceWriter()
req.WriteInt32(t, 1) req.WriteInt32(t, 1)
@ -162,6 +162,10 @@ func (c *QQClient) buildPushResponsePacket(t int32, pktSeq int64, jceBuf []byte)
return seq, packet return seq, packet
} }
func (c *QQClient) buildOnlinePushRespPacket() {
}
func (c *QQClient) buildFriendGroupListRequestPacket(friendStartIndex, friendListCount, groupStartIndex, groupListCount int16) (uint16, []byte) { func (c *QQClient) buildFriendGroupListRequestPacket(friendStartIndex, friendListCount, groupStartIndex, groupListCount int16) (uint16, []byte) {
seq := c.nextSeq() seq := c.nextSeq()
d50, _ := proto.Marshal(&pb.D50ReqBody{ d50, _ := proto.Marshal(&pb.D50ReqBody{

View File

@ -9,6 +9,7 @@ import (
"github.com/Mrs4s/MiraiGo/message" "github.com/Mrs4s/MiraiGo/message"
"github.com/Mrs4s/MiraiGo/protocol/packets" "github.com/Mrs4s/MiraiGo/protocol/packets"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"io"
"log" "log"
"math/rand" "math/rand"
"net" "net"
@ -54,9 +55,7 @@ type QQClient struct {
requestPacketRequestId int32 requestPacketRequestId int32
messageSeq int32 messageSeq int32
groupDataTransSeq int32 groupDataTransSeq int32
eventHandlers *eventHandlers
privateMessageHandlers []func(*QQClient, *message.PrivateMessage)
groupMessageHandlers []func(*QQClient, *message.GroupMessage)
} }
type loginSigInfo struct { type loginSigInfo struct {
@ -90,6 +89,7 @@ func NewClient(uin int64, password string) *QQClient {
"StatSvc.register": decodeClientRegisterResponse, "StatSvc.register": decodeClientRegisterResponse,
"MessageSvc.PushNotify": decodeSvcNotify, "MessageSvc.PushNotify": decodeSvcNotify,
"OnlinePush.PbPushGroupMsg": decodeGroupMessagePacket, "OnlinePush.PbPushGroupMsg": decodeGroupMessagePacket,
"OnlinePush.ReqPush": decodeOnlinePushReqPacket,
"ConfigPushSvc.PushReq": decodePushReqPacket, "ConfigPushSvc.PushReq": decodePushReqPacket,
"MessageSvc.PbGetMsg": decodeMessageSvcPacket, "MessageSvc.PbGetMsg": decodeMessageSvcPacket,
"friendlist.getFriendGroupList": decodeFriendGroupListResponse, "friendlist.getFriendGroupList": decodeFriendGroupListResponse,
@ -102,6 +102,7 @@ func NewClient(uin int64, password string) *QQClient {
requestPacketRequestId: 1921334513, requestPacketRequestId: 1921334513,
messageSeq: 22911, messageSeq: 22911,
ksid: []byte("|454001228437590|A8.2.7.27f6ea96"), ksid: []byte("|454001228437590|A8.2.7.27f6ea96"),
eventHandlers: &eventHandlers{},
} }
rand.Read(cli.RandomKey) rand.Read(cli.RandomKey)
return cli return cli
@ -112,11 +113,10 @@ func (c *QQClient) Login() (*LoginResponse, error) {
if c.running { if c.running {
return nil, ErrAlreadyRunning return nil, ErrAlreadyRunning
} }
conn, err := net.Dial("tcp", "125.94.60.146:80") //TODO: more servers err := c.connect()
if err != nil { if err != nil {
return nil, err return nil, err
} }
c.Conn = conn
c.running = true c.running = true
go c.loop() go c.loop()
seq, packet := c.buildLoginPacket() seq, packet := c.buildLoginPacket()
@ -214,10 +214,13 @@ func (c *QQClient) UploadGroupImage(groupCode int64, img []byte) (*message.Group
continue continue
} }
r := binary.NewNetworkReader(conn) r := binary.NewNetworkReader(conn)
r.ReadByte() _, err = r.ReadByte()
hl := r.ReadInt32() if err != nil {
r.ReadBytes(4) continue
payload := r.ReadBytes(int(hl)) }
hl, _ := r.ReadInt32()
_, _ = r.ReadBytes(4)
payload, _ := r.ReadBytes(int(hl))
_ = conn.Close() _ = conn.Close()
rsp := pb.RspDataHighwayHead{} rsp := pb.RspDataHighwayHead{}
if proto.Unmarshal(payload, &rsp) != nil { if proto.Unmarshal(payload, &rsp) != nil {
@ -303,9 +306,18 @@ func (g *GroupInfo) FindMember(uin int64) *GroupMemberInfo {
return nil return nil
} }
func (c *QQClient) connect() error {
conn, err := net.Dial("tcp", "125.94.60.146:80") //TODO: more servers
if err != nil {
return err
}
c.Conn = conn
return nil
}
func (c *QQClient) registerClient() { func (c *QQClient) registerClient() {
seq, packet := c.buildClientRegisterPacket() _, packet := c.buildClientRegisterPacket()
_, _ = c.sendAndWait(seq, packet) _ = c.send(packet)
} }
func (c *QQClient) nextSeq() uint16 { func (c *QQClient) nextSeq() uint16 {
@ -363,7 +375,20 @@ func (c *QQClient) sendAndWait(seq uint16, pkt []byte) (interface{}, error) {
func (c *QQClient) loop() { func (c *QQClient) loop() {
reader := binary.NewNetworkReader(c.Conn) reader := binary.NewNetworkReader(c.Conn)
for c.running { for c.running {
data := reader.ReadBytes(int(reader.ReadInt32()) - 4) l, err := reader.ReadInt32()
if err == io.EOF || err == io.ErrClosedPipe {
err = c.connect()
if err != nil {
c.running = false
return
}
reader = binary.NewNetworkReader(c.Conn)
c.registerClient()
}
if l <= 0 {
continue
}
data, err := reader.ReadBytes(int(l) - 4)
pkt, err := packets.ParseIncomingPacket(data, c.sigInfo.d2Key) pkt, err := packets.ParseIncomingPacket(data, c.sigInfo.d2Key)
if err != nil { if err != nil {
log.Println("parse incoming packet error: " + err.Error()) log.Println("parse incoming packet error: " + err.Error())

View File

@ -109,7 +109,7 @@ func decodePushReqPacket(c *QQClient, payload []byte) (interface{}, error) {
t := r.ReadInt32(1) t := r.ReadInt32(1)
r.ReadSlice(&jceBuf, 2) r.ReadSlice(&jceBuf, 2)
seq := r.ReadInt64(3) seq := r.ReadInt64(3)
_, pkt := c.buildPushResponsePacket(t, seq, jceBuf) _, pkt := c.buildConfPushRespPacket(t, seq, jceBuf)
return nil, c.send(pkt) return nil, c.send(pkt)
} }
@ -280,3 +280,54 @@ func decodeGroupImageStoreResponse(c *QQClient, payload []byte) (interface{}, er
UploadPort: rsp.Uint32UpPort, UploadPort: rsp.Uint32UpPort,
}, nil }, nil
} }
func decodeOnlinePushReqPacket(c *QQClient, payload []byte) (interface{}, error) {
request := &jce.RequestPacket{}
request.ReadFrom(jce.NewJceReader(payload))
data := &jce.RequestDataVersion2{}
data.ReadFrom(jce.NewJceReader(request.SBuffer))
jr := jce.NewJceReader(data.Map["req"]["OnlinePushPack.SvcReqPushMsg"][1:])
msgInfos := []jce.PushMessageInfo{}
jr.ReadSlice(&msgInfos, 2)
for _, m := range msgInfos {
if m.MsgType == 732 {
r := binary.NewReader(m.VMsg)
groupId := int64(uint32(r.ReadInt32()))
iType := r.ReadByte()
r.ReadByte()
switch iType {
case 0x0c: // 群内禁言
operator := int64(uint32(r.ReadInt32()))
if operator == c.Uin {
continue
}
r.ReadBytes(6)
target := int64(uint32(r.ReadInt32()))
t := r.ReadInt32()
c.dispatchGroupMuteEvent(&GroupMuteEvent{
GroupUin: groupId,
OperatorUin: operator,
TargetUin: target,
Time: t,
})
case 0x11: // 撤回消息
r.ReadByte()
b := pb.NotifyMsgBody{}
_ = proto.Unmarshal(r.ReadAvailable(), &b)
if b.OptMsgRecall == nil {
continue
}
for _, rm := range b.OptMsgRecall.RecalledMsgList {
c.dispatchGroupMessageRecalledEvent(&GroupMessageRecalledEvent{
GroupUin: groupId,
OperatorUin: b.OptMsgRecall.Uin,
AuthorUin: rm.AuthorUin,
MessageId: rm.Seq,
Time: rm.Time,
})
}
}
}
}
return nil, nil
}

View File

@ -55,6 +55,21 @@ type (
Job string Job string
} }
GroupMuteEvent struct {
GroupUin int64
OperatorUin int64
TargetUin int64
Time int32
}
GroupMessageRecalledEvent struct {
GroupUin int64
OperatorUin int64
AuthorUin int64
MessageId int32
Time int32
}
groupMemberListResponse struct { groupMemberListResponse struct {
NextUin int64 NextUin int64
list []GroupMemberInfo list []GroupMemberInfo

View File

@ -1,13 +1,41 @@
package client package client
import "github.com/Mrs4s/MiraiGo/message" import (
"errors"
"github.com/Mrs4s/MiraiGo/message"
)
var ErrEventUndefined = errors.New("event undefined")
type eventHandlers struct {
privateMessageHandlers []func(*QQClient, *message.PrivateMessage)
groupMessageHandlers []func(*QQClient, *message.GroupMessage)
groupMuteEventHandlers []func(*QQClient, *GroupMuteEvent)
groupRecalledHandlers []func(*QQClient, *GroupMessageRecalledEvent)
}
func (c *QQClient) OnEvent(i interface{}) error {
switch f := i.(type) {
case func(*QQClient, *message.PrivateMessage):
c.OnPrivateMessage(f)
case func(*QQClient, *message.GroupMessage):
c.OnGroupMessage(f)
case func(*QQClient, *GroupMuteEvent):
c.OnGroupMuted(f)
case func(*QQClient, *GroupMessageRecalledEvent):
c.OnGroupMessageRecalled(f)
default:
return ErrEventUndefined
}
return nil
}
func (c *QQClient) OnPrivateMessage(f func(*QQClient, *message.PrivateMessage)) { func (c *QQClient) OnPrivateMessage(f func(*QQClient, *message.PrivateMessage)) {
c.privateMessageHandlers = append(c.privateMessageHandlers, f) c.eventHandlers.privateMessageHandlers = append(c.eventHandlers.privateMessageHandlers, f)
} }
func (c *QQClient) OnPrivateMessageF(filter func(*message.PrivateMessage) bool, f func(*QQClient, *message.PrivateMessage)) { func (c *QQClient) OnPrivateMessageF(filter func(*message.PrivateMessage) bool, f func(*QQClient, *message.PrivateMessage)) {
c.privateMessageHandlers = append(c.privateMessageHandlers, func(client *QQClient, msg *message.PrivateMessage) { c.OnPrivateMessage(func(client *QQClient, msg *message.PrivateMessage) {
if filter(msg) { if filter(msg) {
f(client, msg) f(client, msg)
} }
@ -15,7 +43,15 @@ func (c *QQClient) OnPrivateMessageF(filter func(*message.PrivateMessage) bool,
} }
func (c *QQClient) OnGroupMessage(f func(*QQClient, *message.GroupMessage)) { func (c *QQClient) OnGroupMessage(f func(*QQClient, *message.GroupMessage)) {
c.groupMessageHandlers = append(c.groupMessageHandlers, f) c.eventHandlers.groupMessageHandlers = append(c.eventHandlers.groupMessageHandlers, f)
}
func (c *QQClient) OnGroupMuted(f func(*QQClient, *GroupMuteEvent)) {
c.eventHandlers.groupMuteEventHandlers = append(c.eventHandlers.groupMuteEventHandlers, f)
}
func (c *QQClient) OnGroupMessageRecalled(f func(*QQClient, *GroupMessageRecalledEvent)) {
c.eventHandlers.groupRecalledHandlers = append(c.eventHandlers.groupRecalledHandlers, f)
} }
func NewUinFilterPrivate(uin int64) func(*message.PrivateMessage) bool { func NewUinFilterPrivate(uin int64) func(*message.PrivateMessage) bool {
@ -28,15 +64,10 @@ func (c *QQClient) dispatchFriendMessage(msg *message.PrivateMessage) {
if msg == nil { if msg == nil {
return return
} }
for _, f := range c.privateMessageHandlers { for _, f := range c.eventHandlers.privateMessageHandlers {
func() { cover(func() {
defer func() {
if pan := recover(); pan != nil {
//
}
}()
f(c, msg) f(c, msg)
}() })
} }
} }
@ -44,14 +75,40 @@ func (c *QQClient) dispatchGroupMessage(msg *message.GroupMessage) {
if msg == nil { if msg == nil {
return return
} }
for _, f := range c.groupMessageHandlers { for _, f := range c.eventHandlers.groupMessageHandlers {
func() { cover(func() {
defer func() {
if pan := recover(); pan != nil {
// TODO: logger
}
}()
f(c, msg) f(c, msg)
}() })
} }
} }
func (c *QQClient) dispatchGroupMuteEvent(e *GroupMuteEvent) {
if e == nil {
return
}
for _, f := range c.eventHandlers.groupMuteEventHandlers {
cover(func() {
f(c, e)
})
}
}
func (c *QQClient) dispatchGroupMessageRecalledEvent(e *GroupMessageRecalledEvent) {
if e == nil {
return
}
for _, f := range c.eventHandlers.groupRecalledHandlers {
cover(func() {
f(c, e)
})
}
}
func cover(f func()) {
defer func() {
if pan := recover(); pan != nil {
}
}()
f()
}

View File

@ -1474,6 +1474,243 @@ func (x *MessageItem) GetSig() []byte {
return nil return nil
} }
type NotifyMsgBody struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
OptMsgRecall *MessageRecallReminder `protobuf:"bytes,11,opt,name=optMsgRecall,proto3" json:"optMsgRecall,omitempty"`
ServiceType int32 `protobuf:"varint,13,opt,name=serviceType,proto3" json:"serviceType,omitempty"`
}
func (x *NotifyMsgBody) Reset() {
*x = NotifyMsgBody{}
if protoimpl.UnsafeEnabled {
mi := &file_data_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NotifyMsgBody) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NotifyMsgBody) ProtoMessage() {}
func (x *NotifyMsgBody) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NotifyMsgBody.ProtoReflect.Descriptor instead.
func (*NotifyMsgBody) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{15}
}
func (x *NotifyMsgBody) GetOptMsgRecall() *MessageRecallReminder {
if x != nil {
return x.OptMsgRecall
}
return nil
}
func (x *NotifyMsgBody) GetServiceType() int32 {
if x != nil {
return x.ServiceType
}
return 0
}
type MessageRecallReminder struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uin int64 `protobuf:"varint,1,opt,name=uin,proto3" json:"uin,omitempty"`
Nickname []byte `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"`
RecalledMsgList []*RecalledMessageMeta `protobuf:"bytes,3,rep,name=recalledMsgList,proto3" json:"recalledMsgList,omitempty"`
ReminderContent []byte `protobuf:"bytes,4,opt,name=reminderContent,proto3" json:"reminderContent,omitempty"`
Userdef []byte `protobuf:"bytes,5,opt,name=userdef,proto3" json:"userdef,omitempty"`
GroupType int32 `protobuf:"varint,6,opt,name=groupType,proto3" json:"groupType,omitempty"`
OpType int32 `protobuf:"varint,7,opt,name=opType,proto3" json:"opType,omitempty"`
}
func (x *MessageRecallReminder) Reset() {
*x = MessageRecallReminder{}
if protoimpl.UnsafeEnabled {
mi := &file_data_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *MessageRecallReminder) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MessageRecallReminder) ProtoMessage() {}
func (x *MessageRecallReminder) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MessageRecallReminder.ProtoReflect.Descriptor instead.
func (*MessageRecallReminder) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{16}
}
func (x *MessageRecallReminder) GetUin() int64 {
if x != nil {
return x.Uin
}
return 0
}
func (x *MessageRecallReminder) GetNickname() []byte {
if x != nil {
return x.Nickname
}
return nil
}
func (x *MessageRecallReminder) GetRecalledMsgList() []*RecalledMessageMeta {
if x != nil {
return x.RecalledMsgList
}
return nil
}
func (x *MessageRecallReminder) GetReminderContent() []byte {
if x != nil {
return x.ReminderContent
}
return nil
}
func (x *MessageRecallReminder) GetUserdef() []byte {
if x != nil {
return x.Userdef
}
return nil
}
func (x *MessageRecallReminder) GetGroupType() int32 {
if x != nil {
return x.GroupType
}
return 0
}
func (x *MessageRecallReminder) GetOpType() int32 {
if x != nil {
return x.OpType
}
return 0
}
type RecalledMessageMeta struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Seq int32 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"`
Time int32 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
MsgRandom int32 `protobuf:"varint,3,opt,name=msgRandom,proto3" json:"msgRandom,omitempty"`
MsgType int32 `protobuf:"varint,4,opt,name=msgType,proto3" json:"msgType,omitempty"`
MsgFlag int32 `protobuf:"varint,5,opt,name=msgFlag,proto3" json:"msgFlag,omitempty"`
AuthorUin int64 `protobuf:"varint,6,opt,name=authorUin,proto3" json:"authorUin,omitempty"`
}
func (x *RecalledMessageMeta) Reset() {
*x = RecalledMessageMeta{}
if protoimpl.UnsafeEnabled {
mi := &file_data_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RecalledMessageMeta) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RecalledMessageMeta) ProtoMessage() {}
func (x *RecalledMessageMeta) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RecalledMessageMeta.ProtoReflect.Descriptor instead.
func (*RecalledMessageMeta) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{17}
}
func (x *RecalledMessageMeta) GetSeq() int32 {
if x != nil {
return x.Seq
}
return 0
}
func (x *RecalledMessageMeta) GetTime() int32 {
if x != nil {
return x.Time
}
return 0
}
func (x *RecalledMessageMeta) GetMsgRandom() int32 {
if x != nil {
return x.MsgRandom
}
return 0
}
func (x *RecalledMessageMeta) GetMsgType() int32 {
if x != nil {
return x.MsgType
}
return 0
}
func (x *RecalledMessageMeta) GetMsgFlag() int32 {
if x != nil {
return x.MsgFlag
}
return 0
}
func (x *RecalledMessageMeta) GetAuthorUin() int64 {
if x != nil {
return x.AuthorUin
}
return 0
}
var File_data_proto protoreflect.FileDescriptor var File_data_proto protoreflect.FileDescriptor
var file_data_proto_rawDesc = []byte{ var file_data_proto_rawDesc = []byte{
@ -1700,8 +1937,42 @@ var file_data_proto_rawDesc = []byte{
0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x73, 0x67, 0x53, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x73, 0x67, 0x53, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x6d,
0x73, 0x67, 0x55, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x73, 0x67, 0x73, 0x67, 0x55, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x73, 0x67,
0x55, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x55, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c,
0x52, 0x03, 0x73, 0x69, 0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x52, 0x03, 0x73, 0x69, 0x67, 0x22, 0x6d, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4d,
0x72, 0x6f, 0x74, 0x6f, 0x33, 0x73, 0x67, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x3a, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x4d, 0x73, 0x67,
0x52, 0x65, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x4d,
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6d, 0x69,
0x6e, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x6f, 0x70, 0x74, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x63, 0x61,
0x6c, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70,
0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x54, 0x79, 0x70, 0x65, 0x22, 0xff, 0x01, 0x0a, 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x52, 0x65, 0x63, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x10,
0x0a, 0x03, 0x75, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x6e,
0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x0f,
0x72, 0x65, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x18,
0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x52, 0x65, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x64,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x0f, 0x72, 0x65, 0x63,
0x61, 0x6c, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f,
0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,
0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x72, 0x65, 0x6d, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x43,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x64, 0x65,
0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x64, 0x65, 0x66,
0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20,
0x01, 0x28, 0x05, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16,
0x0a, 0x06, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x63, 0x61, 0x6c,
0x6c, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x10,
0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x65, 0x71,
0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x52, 0x61, 0x6e, 0x64, 0x6f,
0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6d, 0x73, 0x67, 0x52, 0x61, 0x6e, 0x64,
0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x6d, 0x73, 0x67, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d,
0x73, 0x67, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72,
0x55, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f,
0x72, 0x55, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -1716,7 +1987,7 @@ func file_data_proto_rawDescGZIP() []byte {
return file_data_proto_rawDescData return file_data_proto_rawDescData
} }
var file_data_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_data_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
var file_data_proto_goTypes = []interface{}{ var file_data_proto_goTypes = []interface{}{
(*DeviceInfo)(nil), // 0: DeviceInfo (*DeviceInfo)(nil), // 0: DeviceInfo
(*RequestBody)(nil), // 1: RequestBody (*RequestBody)(nil), // 1: RequestBody
@ -1733,6 +2004,9 @@ var file_data_proto_goTypes = []interface{}{
(*ImgInfo)(nil), // 12: ImgInfo (*ImgInfo)(nil), // 12: ImgInfo
(*DeleteMessageRequest)(nil), // 13: DeleteMessageRequest (*DeleteMessageRequest)(nil), // 13: DeleteMessageRequest
(*MessageItem)(nil), // 14: MessageItem (*MessageItem)(nil), // 14: MessageItem
(*NotifyMsgBody)(nil), // 15: NotifyMsgBody
(*MessageRecallReminder)(nil), // 16: MessageRecallReminder
(*RecalledMessageMeta)(nil), // 17: RecalledMessageMeta
} }
var file_data_proto_depIdxs = []int32{ var file_data_proto_depIdxs = []int32{
2, // 0: RequestBody.rpt_config_list:type_name -> ConfigSeq 2, // 0: RequestBody.rpt_config_list:type_name -> ConfigSeq
@ -1744,11 +2018,13 @@ var file_data_proto_depIdxs = []int32{
9, // 6: RspDataHighwayHead.msgSeghead:type_name -> SegHead 9, // 6: RspDataHighwayHead.msgSeghead:type_name -> SegHead
12, // 7: TryUpImgResp.msgImgInfo:type_name -> ImgInfo 12, // 7: TryUpImgResp.msgImgInfo:type_name -> ImgInfo
14, // 8: DeleteMessageRequest.items:type_name -> MessageItem 14, // 8: DeleteMessageRequest.items:type_name -> MessageItem
9, // [9:9] is the sub-list for method output_type 16, // 9: NotifyMsgBody.optMsgRecall:type_name -> MessageRecallReminder
9, // [9:9] is the sub-list for method input_type 17, // 10: MessageRecallReminder.recalledMsgList:type_name -> RecalledMessageMeta
9, // [9:9] is the sub-list for extension type_name 11, // [11:11] is the sub-list for method output_type
9, // [9:9] is the sub-list for extension extendee 11, // [11:11] is the sub-list for method input_type
0, // [0:9] is the sub-list for field type_name 11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
} }
func init() { file_data_proto_init() } func init() { file_data_proto_init() }
@ -1937,6 +2213,42 @@ func file_data_proto_init() {
return nil return nil
} }
} }
file_data_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NotifyMsgBody); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_data_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MessageRecallReminder); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_data_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RecalledMessageMeta); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -1944,7 +2256,7 @@ func file_data_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_data_proto_rawDesc, RawDescriptor: file_data_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 15, NumMessages: 18,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -155,3 +155,28 @@ message MessageItem {
int64 msgUid = 5; int64 msgUid = 5;
bytes sig = 7; bytes sig = 7;
} }
message NotifyMsgBody {
MessageRecallReminder optMsgRecall = 11;
int32 serviceType = 13;
}
message MessageRecallReminder {
int64 uin = 1;
bytes nickname = 2;
repeated RecalledMessageMeta recalledMsgList = 3;
bytes reminderContent = 4;
bytes userdef = 5;
int32 groupType = 6;
int32 opType = 7;
}
message RecalledMessageMeta {
int32 seq = 1;
int32 time = 2;
int32 msgRandom = 3;
int32 msgType = 4;
int32 msgFlag = 5;
int64 authorUin = 6;
}