Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 PadchatMessageType.ShareCard:
type = MessageType.Contact
break
case PadchatMessageType.Recalled:
case PadchatMessageType.StatusNotify:
case PadchatMessageType.SysNotice:
type = MessageType.Unknown
break
default:
throw new Error('unsupported type: ' + PadchatMessageType[rawType] + '(' + rawType + ')')
}
payload.type = MessageType.ChatHistory
break
case WechatAppMessageType.MiniProgram:
case WechatAppMessageType.MiniProgramApp:
payload.type = MessageType.MiniProgram
break
case WechatAppMessageType.RedEnvelopes:
case WechatAppMessageType.Transfers:
payload.type = MessageType.Money
break
case WechatAppMessageType.RealtimeShareLocation:
payload.type = MessageType.Location
break
default:
payload.type = MessageType.Unknown
break
}
}
}
return payload
}
case PadplusMessageType.Sys:
type = MessageType.Unknown
break
case PadplusMessageType.ShareCard:
type = MessageType.Contact
break
case PadplusMessageType.VoipMsg:
case PadplusMessageType.Recalled:
type = MessageType.Recalled
break
case PadplusMessageType.StatusNotify:
case PadplusMessageType.SysNotice:
type = MessageType.Unknown
break
default:
throw new Error('unsupported type: ' + PadplusMessageType[rawType] + '(' + rawType + ')')
}
return type
}