//指定版本
//注意proto3与proto2的写法有些不同
// protobuf官方中文文档
// https://www.jianshu.com/p/4443c28d4bf7
syntax = "proto3";

//包名，通过protoc生成时go文件时
package im_types;

option go_package = "./im_types";

import "data_type.proto";
import "contact.proto";

// 推送的设备信息
message PushDevData{
  int64 maxVer = 1; // 最大版本号
  repeated Device DeviceList = 2; // 设备信息列表
}

message PushMsgData{
  string PushAddr = 1; // 推送节点地址
  string Addr = 2; //客户端地址
  ModelUser UserInfo = 3; // 用户信息
  PushDevData DeviceInfo = 4; // 设备信息

  repeated GetContactInfoRes ContactList = 5; // 联系人信息
  repeated ContactRequestConversationRes contactReqList = 6; // 联系人申请表
  repeated Group groupEntity = 7; // 群信息
  repeated GroupUser groupMembers = 8; // 群成员
  repeated GroupJoinRequest groupMemReqs = 9; // 群成员申请表
  repeated SingleMsg chatSingles = 10; // 单聊消息
  repeated SingleMsgOp chatSingleStates = 11; // 单聊消息-状态
  repeated GroupMsg chatGroups = 12; // 群聊消息
  repeated GroupMsgOp chatGroupsStates = 13; // 群聊消息-状态
}

message RecvMsgData {
  string addr = 1; // 用户id
  string mid = 2; // 用户设备id
  int64 UserInfoVer = 3; // 用户信息版本
  int64 DevListVer = 4; // 用户设备版本
  int64 ContactsVer = 6; // 用户联系人
  int64 ContactReqVer = 7; // 用户联系人申请消息版本
  repeated RecvMsg ChatSingles = 8; // 单聊消息回执版本
  repeated RecvMsgState ChatSingleStates = 9; // 单聊消息状态回执版本

  repeated RecvGroup RecvGroups = 10;
  repeated RecvMsg ChatGroup = 11; // 群聊消息回执版本
  repeated RecvMsgState ChatGroupState = 12; // 群聊消息状态回执版本
}

message RecvMsg{
  string MsgKey = 1;
  repeated int64 MsgId = 2;
}
message RecvMsgState{
  string MsgKey = 1;
  int64 MsgId = 2;
}

message RecvGroup {
  string Gid = 1;
  int64 InfoVer = 2;
  int64 MemberVer = 3;
  int64 GroupMemReqVer = 4;
}
