fix channel username

This commit is contained in:
Laura Hausmann 2019-12-07 00:43:00 +01:00
parent f2da983635
commit 0f7b4c329e

View file

@ -298,10 +298,11 @@ namespace tgcli.core
var chat = getChat(msg.ChatId);
var username = getFormattedUsername(sender);
var time = formatTime(msg.Date);
var isChannel = msg.IsChannelPost;
var isPrivate = chat.Type is Td.TdApi.ChatType.ChatTypePrivate;
return $"{Ansi.Bold}{Ansi.Green}[{time}] {Ansi.Cyan}{chat.Title} " +
$"{(isPrivate ? "" : $"{Ansi.Yellow}{username} ")}" +
$"{(isPrivate || isChannel ? "" : $"{Ansi.Yellow}{username} ")}" +
$"{(msg.IsOutgoing ? $"{Ansi.Blue}»»»" : $"{Ansi.Magenta}«««")} " +
$"{text}";
}