Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case PadchatMessageType.Text:
type = MessageType.Text
break
case PadchatMessageType.Image:
type = MessageType.Image
// console.log(rawPayload)
break
case PadchatMessageType.Voice:
type = MessageType.Audio
// console.log(rawPayload)
break
case PadchatMessageType.Emoticon:
type = MessageType.Emoticon
// console.log(rawPayload)
break
case PadchatMessageType.App:
type = MessageType.Attachment
// console.log(rawPayload)
break
case PadchatMessageType.Video:
type = MessageType.Video
// console.log(rawPayload)
break
case PadchatMessageType.Sys:
type = MessageType.Unknown
break
case PadplusMessageType.Text:
type = MessageType.Text
break
case PadplusMessageType.Image:
type = MessageType.Image
// console.log(rawPayload)
break
case PadplusMessageType.Voice:
type = MessageType.Audio
// console.log(rawPayload)
break
case PadplusMessageType.Emoticon:
type = MessageType.Emoticon
// console.log(rawPayload)
break
case PadplusMessageType.App:
type = MessageType.Attachment
// console.log(rawPayload)
break
case PadplusMessageType.Location:
type = MessageType.Location
// console.log(rawPayload)
break
case PadplusMessageType.Video:
type = MessageType.Video
// console.log(rawPayload)
id : string,
timestamp : number,
type : MessageType,
filename? : string,
url? : string,
}
if (type === MessageType.Image
|| type === MessageType.Audio
|| type === MessageType.Video
|| type === MessageType.Attachment
) {
payloadBase.filename = messageFileName(rawPayload) || undefined
}
if (type === MessageType.Emoticon) {
payloadBase.url = rawPayload.url
}
let fromId: undefined | string
let roomId: undefined | string
let toId: undefined | string
let text: undefined | string
let mentionIdList: undefined | string[]
/**
* 1. Set Room Id
*/
if (isRoomId(rawPayload.fromUserName)) {
roomId = rawPayload.fromUserName