(selfUID string, groupUin uint32, msg []*message.PushMsgBody)
| 10 | ) |
| 11 | |
| 12 | func BuildMultiMsgUploadReq(selfUID string, groupUin uint32, msg []*message.PushMsgBody) ([]byte, error) { |
| 13 | longMsgResult := &message.LongMsgResult{ |
| 14 | Action: []*message.LongMsgAction{{ |
| 15 | ActionCommand: "MultiMsg", |
| 16 | ActionData: &message.LongMsgContent{ |
| 17 | MsgBody: msg, |
| 18 | }, |
| 19 | }}, |
| 20 | } |
| 21 | longMsgResultData, _ := proto.Marshal(longMsgResult) |
| 22 | payload := binary.GZipCompress(longMsgResultData) |
| 23 | req := &message.SendLongMsgReq{ |
| 24 | Info: &message.SendLongMsgInfo{ |
| 25 | Type: utils.Ternary[uint32](groupUin == 0, 1, 3), |
| 26 | Uid: &message.LongMsgUid{ |
| 27 | Uid: proto.String(utils.Ternary(groupUin == 0, selfUID, strconv.Itoa(int(groupUin)))), |
| 28 | }, |
| 29 | GroupUin: proto.Uint32(groupUin), |
| 30 | Payload: payload, |
| 31 | }, |
| 32 | Settings: &message.LongMsgSettings{ |
| 33 | Field1: 4, |
| 34 | Field2: 1, |
| 35 | Field3: 7, |
| 36 | Field4: 0, |
| 37 | }, |
| 38 | } |
| 39 | return proto.Marshal(req) |
| 40 | } |
| 41 | |
| 42 | func ParseMultiMsgUploadResp(data []byte) (resp *message.SendLongMsgResp, err error) { |
| 43 | resp = &message.SendLongMsgResp{} |
nothing calls this directly
no test coverage detected