Skip to content

Latest commit

 

History

History
112 lines (89 loc) · 1.98 KB

Models.md

File metadata and controls

112 lines (89 loc) · 1.98 KB

中文文档

Contents

UserInfo

fromUser = {
  userId: ""
  displayName: ""
  avatarPath: "avatar image path"
}

Message

status must be one of the following values: "send_succeed", "send_failed", "send_going", "download_failed",if you don't specify it, default value will be "send_succeed".

TextMessage

  textMessage = {
    msgId: "msgid",
    status: "send_going",
    msgType: "text",
    isOutgoing: true,
    text: "text",
    fromUser: {},
    extras: {}// option
}

ImageMessage

imageMessage = {
    msgId: "msgid",
    msgType: "image",
    isOutGoing: true,
    mediaPath: "image path",
    fromUser: {}
    extras: {}// option
}

VoiceMessage

message = {
    msgId: "msgid",
    msgType: "voice",
    isOutGoing: true,
    duration: number, // duration of voice message, second
    mediaPath: "voice path",
    fromUser: {},
    extras: {}// option
}

VideoMessage

videoMessage = {  // video message
    msgId: "msgid",
    status: "send_failed",
    msgType: "video",
    isOutGoing: true,
    druation: number,
    mediaPath: "voice path",
    fromUser: {},
    extras: {}// option
}s

CustomMessage

customMessage = {  // custom message
    msgId: "msgid",
    msgType: "custom",
    status: "send_failed",
    isOutgoing: true,
    contentSize: {height: 100, width: 100},
    content: "<h1>custom message will render html string</h1>", // content is html format, avoid to use <script>
    fromUser: {}, 
    extras: {}// option
}

EventMessage

eventMessage = {  // event message
    msgId: "msgid",
    msgType: "event",
    text: "the event text"
}