syntax = "proto3";

package ccim.protocol;

import "message_spec.proto";

message SendMessageRequest {
    int64 receiver_user_id = 1;
    string content = 2;
    MessageType msg_type = 3;
}

message SendMessageResponse {
    int64 msg_id = 1;
    string content = 2;
}

message SendChannelMessageRequest {
    int64 channel_id = 1;
    string content = 2;
    MessageType msg_type = 3;
}

message SendChannelMessageResponse {
    int64 msg_id = 1;
    string content = 2;
}

message PullOfflineMessageRequest {
    int64 last_pulled_msg_id = 1;   // 本地存储最后一条私聊消息id，调用此接口时带上，若没有填0
    int32 limit = 2;                // 条数
}

message PullOfflineMessageResponse {
//    repeated OfflineMessage offline_msgs = 1; reserved for compatibility
    repeated ChatMessage offline_messages = 2;
}

message PullPrivateMessageRequest {
    int64 user_id = 1;
}

message PullPrivateMessageResponse {
    repeated ChatMessage message = 1;
}

message PullChannelMessageRequest {
    int64 channel_id = 1;
}

message PullChannelMessageResponse {
    repeated ChatMessage message = 1;
}