mirror of https://github.com/Nofated095/Q2TG.git
chore: TG -> QQ 的昵称 emoji 使用 TG 的名字颜色
This commit is contained in:
parent
396037d2ce
commit
174462119a
|
@ -7,4 +7,11 @@ export default {
|
|||
index = index % arr.length;
|
||||
return arr[index];
|
||||
},
|
||||
tgColor(index: number) {
|
||||
// https://github.com/telegramdesktop/tdesktop/blob/7049929a59176a996c4257d5a09df08b04ac3b22/Telegram/SourceFiles/ui/chat/chat_style.cpp#L1043
|
||||
// https://github.com/LyoSU/quote-api/blob/master/utils/quote-generate.js#L163
|
||||
const arr = [...new Intl.Segmenter().segment('❤️🧡💜💚🩵💙🩷')].map(x => x.segment);
|
||||
index = index % arr.length;
|
||||
return arr[index];
|
||||
},
|
||||
};
|
||||
|
|
|
@ -459,7 +459,7 @@ export default class ForwardService {
|
|||
'') +
|
||||
': \n';
|
||||
if ((pair.flags | this.instance.flags) & flags.COLOR_EMOJI_PREFIX) {
|
||||
messageHeader = emoji.color(message.senderId.toJSNumber()) + messageHeader;
|
||||
messageHeader = emoji.tgColor((message.sender as Api.User)?.color || message.senderId.toJSNumber()) + messageHeader;
|
||||
}
|
||||
if (message.photo instanceof Api.Photo ||
|
||||
// stickers 和以文件发送的图片都是这个
|
||||
|
|
Loading…
Reference in New Issue