feat: 显示匿名消息发送者名称

This commit is contained in:
Clansty 2022-03-02 21:51:59 +08:00
parent 069b72491f
commit a39a7b43d2
No known key found for this signature in database
GPG Key ID: 05F8479BA63A8E92
2 changed files with 5 additions and 2 deletions

View File

@ -271,7 +271,7 @@ export default class ConfigService {
} }
private async getAboutText(entity: Friend | Group) { private async getAboutText(entity: Friend | Group) {
let text = ''; let text: string;
if (entity instanceof Friend) { if (entity instanceof Friend) {
text = `备注:${entity.remark}\n` + text = `备注:${entity.remark}\n` +
`昵称:${entity.nickname}\n` + `昵称:${entity.nickname}\n` +

View File

@ -36,7 +36,10 @@ export default class ForwardService {
let messageHeader = ''; let messageHeader = '';
if (event.message_type === 'group') { if (event.message_type === 'group') {
// 产生头部,这和工作模式没有关系 // 产生头部,这和工作模式没有关系
const sender = event.sender.card || event.sender.nickname; let sender = event.sender.card || event.sender.nickname;
if(event.anonymous){
sender = `[${sender}]${event.anonymous.name}`
}
messageHeader = `<b>${helper.htmlEscape(sender)}</b>: `; messageHeader = `<b>${helper.htmlEscape(sender)}</b>: `;
} }
for (const elem of event.message) { for (const elem of event.message) {