支持显示at人、开放平台接口支持显示房管

This commit is contained in:
John Smith
2025-01-19 17:09:02 +08:00
parent 87922e0809
commit 3b343464ae
5 changed files with 41 additions and 7 deletions

View File

@@ -233,12 +233,19 @@ export default class ChatClientDirectOpenLive extends ChatClientOfficialBase {
let authorType
if (data.open_id === this.roomOwnerOpenId) {
authorType = 3
} else if (data.is_admin) {
authorType = 2
} else if (data.guard_level !== 0) {
authorType = 1
} else {
authorType = 0
}
let showContent = data.msg
if (data.reply_uname !== '') {
showContent = `@${data.reply_uname} ${showContent}`
}
let emoticon = null
if (data.dm_type === 1) {
emoticon = data.emoji_img_url
@@ -249,7 +256,7 @@ export default class ChatClientDirectOpenLive extends ChatClientOfficialBase {
timestamp: data.timestamp,
authorName: data.uname,
authorType: authorType,
content: data.msg,
content: showContent,
privilegeType: data.guard_level,
isGiftDanmaku: chat.isGiftDanmakuByContent(data.msg),
medalLevel: data.fans_medal_wearing_status ? data.fans_medal_level : 0,

View File

@@ -98,14 +98,30 @@ export default class ChatClientDirectWeb extends ChatClientOfficialBase {
authorType = 0
}
let authorName = info[2][1]
let extra
try {
extra = modeInfo.extra
if (typeof extra !== 'object') {
extra = JSON.parse(extra)
}
} catch {
extra = {}
}
let content = info[1]
let replyUname = extra.reply_uname ?? ''
let showContent = content
if (replyUname !== '') {
showContent = `@${replyUname} ${showContent}`
}
let authorName = info[2][1]
let data = new chatModels.AddTextMsg({
avatarUrl: avatarUrl,
timestamp: info[0][4] / 1000,
authorName: authorName,
authorType: authorType,
content: content,
content: showContent,
privilegeType: privilegeType,
isGiftDanmaku: Boolean(info[0][9]) || chat.isGiftDanmakuByContent(content),
authorLevel: info[4][0],