syntax = "proto3";

package ccim.protocol;

option csharp_namespace = "CCIM.Protocol";

enum MessageType {
    MESSAGE_TYPE_TEXT = 0;
    MESSAGE_TYPE_VOICE = 1;
}

enum MessageSourceType {
    MESSAGE_SOURCE_TYPE_PRIVATE = 0;
    MESSAGE_SOURCE_TYPE_CHANNEL = 1;
}

message ChatMessage {
    message UserInfo {
        int64 user_id = 1;
        string username = 2;
        string ext_data = 3;
    }

    int64 msg_id = 1;
    int64 sender_user_id = 2;
    int64 msg_src_id = 3;
    MessageSourceType msg_src_type = 4;
    MessageType msg_type = 5;
    string content = 6;
    int64 created_date = 7;
    int64 modified_date = 8;

    UserInfo sender_user = 9;
    string voice_content = 10;
}