syntax = "proto2";
package msf.msg.svc;

// msf/msgsvc/msg_svc.java

import "cai/pb/msf/msg/comm/comm.proto";
import "cai/pb/msf/msg/ctrl/ctrl.proto";
import "cai/pb/im/msg/msg_body/msg_body.proto";
import "cai/pb/im/msg/msg_head/msg_head.proto";
import "cai/pb/im/msg/receipt/receipt.proto";

message AccostTmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
  optional bool reply = 3;
}

message AddressListTmp {
  optional string from_phone = 1;
  optional string to_phone = 2;
  optional uint64 to_uin = 3;
  optional bytes sig = 4;
  optional uint32 from_contact_size = 5;
}

message AuthTmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
}

message BsnsTmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
}

message BusinessWPATmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
  optional bytes sigt = 3;
}

message C2C {
  optional uint64 to_uin = 1;
}

message CommTmp {
  optional uint64 to_uin = 1;
  optional uint32 c2c_type = 2;
  optional uint32 svr_type = 3;
  optional bytes sig = 4;
  optional bytes reserved = 5;
}

message Dis {
  optional uint64 dis_uin = 1;
}

message DisTmp {
  optional uint64 dis_uin = 1;
  optional uint64 to_uin = 2;
}

message Grp {
  optional uint64 group_code = 1;
}

message GrpTmp {
  optional uint64 group_uin = 1;
  optional uint64 to_uin = 2;
}

message MsgSendInfo {
  optional uint32 receiver = 1;
}

message MultiMsgAssist {
  repeated RoutingHead repeated_routing = 1;
  optional uint32 use = 2;
  optional uint64 temp_id = 3;
  optional uint64 vedio_len = 4;
  optional bytes redbag_id = 5;
  optional uint64 redbag_amount = 6;
  optional uint32 has_readbag = 7;
  optional uint32 has_vedio = 8;
}

message NearByAssistantTmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
  optional bool reply = 3;
}

message NearByDatingTmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
  optional bool reply = 3;
}

message PbBindUinGetMsgReq {
  optional uint64 bind_uin = 1;
  optional bytes bind_uin_sig = 2;
  optional uint32 sync_flag = 3;
  optional bytes sync_cookie = 4;
}

message PbBindUinMsgReadedConfirmReq {
  optional bytes sync_cookie = 1;
  optional uint64 bind_uin = 2;
}

message PbBindUinMsgReadedConfirmResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional bytes sync_cookie = 3;
  optional uint64 bind_uin = 4;
}

message PbBindUinUnReadMsgNumReq {
  optional uint64 bind_uin = 1;
  optional bytes sync_cookie = 2;
}

message PbBindUinUnReadMsgNumResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint64 bind_uin = 3;
  optional uint32 num = 4;
}

message PbC2CMsgWithDrawReq {
  repeated MsgInfo info = 1;
  optional uint32 long_message_flag = 2;
  optional bytes reserved = 3;
  optional uint32 sub_cmd = 4;

  message MsgInfo {
    optional uint64 from_uin = 1;
    optional uint64 to_uin = 2;
    optional uint32 msg_seq = 3;
    optional uint64 msg_uid = 4;
    optional uint64 msg_time = 5;
    optional uint32 msg_random = 6;
    optional uint32 pkg_num = 7;
    optional uint32 pkg_index = 8;
    optional uint32 div_seq = 9;
    optional uint32 msg_type = 10;
    optional RoutingHead routing_head = 20;
  }
}

message PbC2CMsgWithDrawResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  repeated MsgStatus status = 3;
  optional uint32 sub_cmd = 4;
  optional WithDrawWordingInfo wording_info = 5;
}

message MsgStatus {
  optional PbC2CMsgWithDrawReq.MsgInfo info = 1;
  optional uint32 status = 2;
}

message PbC2CReadedReportReq {
  optional bytes sync_cookie = 1;
  repeated UinPairReadInfo pair_info = 2;
}

message UinPairReadInfo {
  optional uint64 peer_uin = 1;
  optional uint32 last_read_time = 2;
  optional bytes crm_sig = 3;
  optional uint32 peer_type = 4;
  optional uint32 chat_type = 5;
  optional uint64 cpid = 6;
  optional uint32 aio_type = 7;
  optional uint64 to_tiny_id = 9;
}

message PbC2CReadedReportResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional bytes sync_cookie = 3;
}

message PbC2CUnReadMsgNumReq {
}

message PbC2CUnReadMsgNumResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint32 num = 3;
}

message PbDelRoamMsgReq {
  optional C2CMsg c2c_msg = 1;
  optional GrpMsg grp_msg = 2;
  optional DisMsg dis_msg = 3;
}

message C2CMsg {
  optional uint64 from_uin = 1;
  optional uint64 peer_uin = 2;
  optional uint32 time = 3;
  optional uint32 random = 4;
  optional uint32 seq = 5;
}

message DisMsg {
  optional uint64 discuss_uin = 1;
  optional uint64 seq = 2;
}

message GrpMsg {
  optional uint64 group_code = 1;
  optional uint64 seq = 2;
  optional uint32 resv_flag = 3;
}

message PbDelRoamMsgResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
}

message PbDeleteMsgReq {
  repeated MsgItem msg_items = 1;
  message MsgItem {
    optional uint64 from_uin = 1;
    optional uint64 to_uin = 2;
    optional uint32 type = 3;
    optional uint32 seq = 4;
    optional uint64 uid = 5;
    optional bytes sig = 7;
  }
}

message PbDeleteMsgResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
}

message PbDiscussReadedReportReq {
  optional uint64 conf_uin = 1;
  optional uint64 last_read_seq = 2;
}

message PbDiscussReadedReportResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint64 conf_uin = 3;
  optional uint64 member_seq = 4;
  optional uint64 conf_seq = 5;
}

message PbGetDiscussMsgReq {
  optional uint64 discuss_uin = 1;
  optional uint64 end_seq = 2;
  optional uint64 begin_seq = 3;
  optional uint64 last_get_time = 4;
  optional uint64 discuss_info_seq = 5;
  optional uint32 filter = 6;
  optional uint64 member_seq = 7;
}

message PbGetDiscussMsgResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint64 discuss_uin = 3;
  optional uint64 return_end_seq = 4;
  optional uint64 return_begin_seq = 5;
  repeated comm.Msg msg = 6;
  optional uint64 last_get_time = 7;
  optional uint64 discuss_info_seq = 8;
}

message PbGetGroupMsgReq {
  optional uint64 group_code = 1;
  optional uint64 begin_seq = 2;
  optional uint64 end_seq = 3;
  optional uint32 filter = 4;
  optional uint64 member_seq = 5;
  optional bool public_group = 6;
  optional uint32 shield_flag = 7;
  optional uint32 save_traffic_flag = 8;
}

message PbGetGroupMsgResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint64 group_code = 3;
  optional uint64 return_begin_seq = 4;
  optional uint64 return_end_seq = 5;
  repeated comm.Msg msg = 6;
}

message PbGetMsgReq {
  optional uint32 sync_flag = 1;
  optional bytes sync_cookie = 2;
  optional uint32 ramble_flag = 3;
  optional uint32 latest_ramble_number = 4;
  optional uint32 other_ramble_number = 5;
  optional uint32 online_sync_flag = 6;
  optional uint32 context_flag = 7;
  optional uint32 whisper_session_id = 8;
  optional uint32 req_type = 9;
  optional bytes pubaccount_cookie = 10;
  optional bytes ctrl_buf = 11;
  optional bytes server_buf = 12;
}

message PbGetMsgResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional bytes sync_cookie = 3;
  optional uint32 sync_flag = 4;
  repeated comm.UinPairMsg uin_pair_msgs = 5;
  optional uint64 bind_uin = 6;
  optional uint32 rsp_type = 7;
  optional bytes pubaccount_cookie = 8;
  optional bool is_partial_sync = 9;
  optional bytes ctrl_buf = 10;
}

message PbGetOneDayRoamMsgReq {
  optional uint64 peer_uin = 1;
  optional uint64 last_msgtime = 2;
  optional uint64 random = 3;
  optional uint32 read_cnt = 4;
}

message PbGetOneDayRoamMsgResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint64 peer_uin = 3;
  optional uint64 last_msgtime = 4;
  optional uint64 random = 5;
  repeated comm.Msg msg = 6;
  optional uint32 iscomplete = 7;
}

message PbGetRoamMsgReq {
  optional uint64 peer_uin = 1;
  optional uint64 last_msgtime = 2;
  optional uint64 random = 3;
  optional uint32 read_cnt = 4;
  optional uint32 check_pwd = 5;
  optional bytes sig = 6;
  optional bytes pwd = 7;
  optional uint32 subcmd = 8;
  optional uint64 begin_msgtime = 9;
  optional uint32 req_type = 10;
}

message PbGetRoamMsgResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint64 peer_uin = 3;
  optional uint64 last_msgtime = 4;
  optional uint64 random = 5;
  repeated comm.Msg msg = 6;
  optional bytes sig = 7;
}

message PbGroupMsgWithDrawReq {
  optional uint32 sub_cmd = 1;
  optional uint32 group_type = 2;
  optional uint64 group_code = 3;
  repeated MessageInfo list = 4;
  optional bytes userdef = 5;
}

message MessageInfo {
  optional uint32 msg_seq = 1;
  optional uint32 msg_random = 2;
  optional uint32 msg_type = 3;
  optional uint32 resv_flag = 4;
}

message PbGroupMsgWithDrawResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint32 sub_cmd = 3;
  optional uint32 group_type = 4;
  optional uint64 group_code = 5;
  repeated MessageResult failed_msg_list = 6;
  optional bytes userdef = 7;
  optional WithDrawWordingInfo wording_info = 8;
}

message MessageResult {
  optional uint32 result = 1;
  optional uint32 msg_seq = 2;
  optional uint32 msg_time = 3;
  optional uint32 msg_random = 4;
  optional bytes err_msg = 5;
  optional uint32 msg_type = 6;
}

message PbGroupReadedReportReq {
  optional uint64 group_code = 1;
  optional uint64 last_read_seq = 2;
}

message PbGroupReadedReportResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint64 group_code = 3;
  optional uint64 member_seq = 4;
  optional uint64 group_msg_seq = 5;
}

message PbInputNotifyInfo {
  optional uint64 to_uin = 1;
  optional uint32 ime = 2;
  optional uint32 notify_flag = 3;
  optional bytes pb_reserve = 4;
  optional bytes ios_push_wording = 5;
}

message PbMsgReadedReportReq {
  repeated PbGroupReadedReportReq grp_read_report = 1;
  repeated PbDiscussReadedReportReq dis_read_report = 2;
  optional PbC2CReadedReportReq c2c_read_report = 3;
  optional PbBindUinMsgReadedConfirmReq bind_uin_read_report = 4;
}

message PbMsgReadedReportResp {
  repeated PbGroupReadedReportResp grp_read_report = 1;
  repeated PbDiscussReadedReportResp dis_read_report = 2;
  optional PbC2CReadedReportResp c2c_read_report = 3;
  optional PbBindUinMsgReadedConfirmResp bind_uin_read_report = 4;
}

message PbMsgWithDrawReq {
  repeated PbC2CMsgWithDrawReq c2c_with_draw = 1;
  repeated PbGroupMsgWithDrawReq group_with_draw = 2;
}

message PbMsgWithDrawResp {
  repeated PbC2CMsgWithDrawResp c2c_with_draw = 1;
  repeated PbGroupMsgWithDrawResp group_with_draw = 2;
}

message PbPullDiscussMsgSeqReq {
  repeated DiscussInfoReq discuss_info_req = 1;
}

message DiscussInfoReq {
  optional uint64 conf_uin = 1;
  optional uint64 last_seq = 2;
}

message PbPullDiscussMsgSeqResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  repeated DiscussInfoResp discuss_info_resp = 3;
}

message DiscussInfoResp {
  optional uint64 conf_uin = 1;
  optional uint64 member_seq = 2;
  optional uint64 conf_seq = 3;
}

message PbPullGroupMsgSeqReq {
  repeated GroupInfoReq group_info_req = 1;
}

message GroupInfoReq {
  optional uint64 group_code = 1;
  optional uint64 last_seq = 2;
}

message PbPullGroupMsgSeqResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  repeated GroupInfoResp group_info_resp = 3;
}

message GroupInfoResp {
  optional uint64 group_code = 1;
  optional uint64 member_seq = 2;
  optional uint64 group_seq = 3;
}

message PbSearchRoamMsgInCloudReq {
  optional bytes serialize_reqbody = 1;
}

message PbSearchRoamMsgInCloudResp {
  repeated comm.Msg msg = 1;
  optional bytes serialize_rspbody = 2;
}

message PbSendMsgReq {
  optional RoutingHead routing_head = 1;
  optional comm.ContentHead content_head = 2;
  optional im.msg.msg_body.MsgBody body = 3;
  optional uint32 seq = 4;
  optional uint32 rand = 5;
  optional bytes sync_cookie = 6;
  optional comm.AppShareInfo app_share = 7;
  optional uint32 via = 8;
  optional uint32 data_statist = 9;
  optional MultiMsgAssist multi_msg_assist = 10;
  optional PbInputNotifyInfo input_notify_info = 11;
  optional ctrl.MsgCtrl ctrl = 12;
  optional im.msg.receipt.ReceiptReq receipt_req = 13;
  optional uint32 multi_send_seq = 14;
}

message PbSendMsgResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint32 send_time = 3;
  optional uint32 svrbusy_wait_time = 4;
  optional MsgSendInfo send_info = 5;
  optional uint32 errtype = 6;
  optional TransSvrInfo trans_svr_info = 7;
  optional im.msg.receipt.ReceiptResp receipt_resp = 8;
  optional uint32 text_analysis_result = 9;
  optional uint32 msg_info_flag = 10;
}

message PbThirdQQUnReadMsgNumReq {
  repeated ThirdQQReqInfo thirdqq_req_info = 1;
  optional uint32 source = 2;
}

message ThirdQQReqInfo {
  optional uint64 third_uin = 1;
  optional bytes third_uin_sig = 2;
  optional bytes third_uin_cookie = 3;
}

message PbThirdQQUnReadMsgNumResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  repeated ThirdQQRespInfo thirdqq_resp_info = 3;
  optional uint32 interval = 4;
}

message ThirdQQRespInfo {
  optional uint64 third_uin = 1;
  optional bytes third_uin_cookie = 2;
  optional uint32 num = 3;
  optional uint32 flag = 4;
  optional uint32 redbag_time = 5;
  optional uint32 status = 6;
  optional uint32 last_msg_time = 7;
}

message PbUnReadMsgSeqReq {
  optional PbC2CUnReadMsgNumReq c2c_unread_info = 1;
  repeated PbBindUinUnReadMsgNumReq binduin_unread_info = 2;
  optional PbPullGroupMsgSeqReq group_unread_info = 3;
  optional PbPullDiscussMsgSeqReq discuss_unread_info = 4;
  optional PbThirdQQUnReadMsgNumReq thirdqq_unread_info = 5;
}

message PbUnReadMsgSeqResp {
  optional PbC2CUnReadMsgNumResp c2c_unread_info = 1;
  repeated PbBindUinUnReadMsgNumResp binduin_unread_info = 2;
  optional PbPullGroupMsgSeqResp group_unread_info = 3;
  optional PbPullDiscussMsgSeqResp discuss_unread_info = 4;
  optional PbThirdQQUnReadMsgNumResp thirdqq_unread_info = 5;
}

message PubGroupTmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
  optional uint64 group_uin = 3;
}

message PublicPlat {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
}

message QQQueryBusinessTmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
}

message RichStatusTmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
}

message RoutingHead {
  optional C2C c2c = 1;
  optional Grp grp = 2;
  optional GrpTmp grp_tmp = 3;
  optional Dis dis = 4;
  optional DisTmp dis_tmp = 5;
  optional WPATmp wpa_tmp = 6;
  // optional SecretFileHead secret_file = 7;
  optional PublicPlat public_plat = 8;
  optional TransMsg trans_msg = 9;
  optional AddressListTmp address_list = 10;
  optional RichStatusTmp rich_status_tmp = 11;
  optional TransCmd trans_cmd = 12;
  optional AccostTmp accost_tmp = 13;
  optional PubGroupTmp pub_group_tmp = 14;
  optional Trans0x211 trans_0_x211 = 15;
  optional BusinessWPATmp business_wpa_tmp = 16;
  optional AuthTmp auth_tmp = 17;
  optional BsnsTmp bsns_tmp = 18;
  optional QQQueryBusinessTmp qq_querybusiness_tmp = 19;
  optional NearByDatingTmp nearby_dating_tmp = 20;
  optional NearByAssistantTmp nearby_assistant_tmp = 21;
  optional CommTmp comm_tmp = 22;
}

// message SecretFileHead {
//   optional SubMsgType0xc1.MsgBody secret_file_msg = 1;
//   optional SubMsgType0x1a.MsgBody secret_file_status = 2;
// }

message Trans0x211 {
  optional uint64 to_uin = 1;
  optional uint32 cc_cmd = 2;
  optional im.msg.msg_head.InstCtrl inst_ctrl = 3;
  optional bytes sig = 4;
  optional uint32 c2c_type = 5;
  optional uint32 service_type = 6;
  optional uint32 dataline_flag = 7;
}

message TransCmd {
  optional uint64 to_uin = 1;
  optional uint32 type = 2;
}

message TransMsg {
  optional uint64 to_uin = 1;
  optional uint32 c2c_cmd = 2;
}

message TransReq {
  optional int32 command = 1;
  optional uint32 req_tag = 2;
  optional bytes req_buff = 3;
}

message TransResp {
  optional uint32 result = 1;
  optional string errmsg = 2;
  optional uint32 resp_tag = 3;
  optional bytes resp_buff = 4;
}

message TransSvrInfo {
  optional uint32 sub_type = 1;
  optional int32 ret_code = 2;
  optional bytes err_msg = 3;
  optional bytes trans_info = 4;
}

message WPATmp {
  optional uint64 to_uin = 1;
  optional bytes sig = 2;
}

message WithDrawWordingInfo {
  optional int32 item_id = 1;
  optional string item_name = 2;
}
