improve padding
This commit is contained in:
parent
74fefd9d7b
commit
132334bedd
|
@ -130,7 +130,6 @@ namespace telegram
|
||||||
else if (chat.UnreadCount > 0)
|
else if (chat.UnreadCount > 0)
|
||||||
{
|
{
|
||||||
var unreads = GetHistory(chatId, chat.UnreadCount);
|
var unreads = GetHistory(chatId, chat.UnreadCount);
|
||||||
Console.WriteLine(unreads.Count);
|
|
||||||
var rest = GetHistory(chatId, 5 - unreads.Count, unreads.First().Id);
|
var rest = GetHistory(chatId, 5 - unreads.Count, unreads.First().Id);
|
||||||
rest.ForEach(AddMessageToQueue);
|
rest.ForEach(AddMessageToQueue);
|
||||||
messageQueue.Add($"{Ansi.Yellow}[tgcli] ---UNREAD---");
|
messageQueue.Add($"{Ansi.Yellow}[tgcli] ---UNREAD---");
|
||||||
|
@ -204,7 +203,6 @@ namespace telegram
|
||||||
else if (chat.UnreadCount > 0)
|
else if (chat.UnreadCount > 0)
|
||||||
{
|
{
|
||||||
var unreads = GetHistory(chat.Id, chat.UnreadCount);
|
var unreads = GetHistory(chat.Id, chat.UnreadCount);
|
||||||
Console.WriteLine(unreads.Count);
|
|
||||||
var rest = GetHistory(chat.Id, 5 - unreads.Count, unreads.First().Id);
|
var rest = GetHistory(chat.Id, 5 - unreads.Count, unreads.First().Id);
|
||||||
rest.ForEach(AddMessageToQueue);
|
rest.ForEach(AddMessageToQueue);
|
||||||
messageQueue.Add($"{Ansi.Yellow}[tgcli] ---UNREAD---");
|
messageQueue.Add($"{Ansi.Yellow}[tgcli] ---UNREAD---");
|
||||||
|
|
|
@ -380,7 +380,7 @@ namespace telegram
|
||||||
return results.ChatIds.First(p =>
|
return results.ChatIds.First(p =>
|
||||||
GetChat(p).Type is ChatType.ChatTypePrivate type &&
|
GetChat(p).Type is ChatType.ChatTypePrivate type &&
|
||||||
GetUser(type.UserId).Username == query.Substring(1));
|
GetUser(type.UserId).Username == query.Substring(1));
|
||||||
return results.ChatIds.First();
|
return results.ChatIds.First(p => !(GetChat(p).Type is ChatType.ChatTypeSecret));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
@ -495,7 +495,7 @@ namespace telegram
|
||||||
maxLen = 2;
|
maxLen = 2;
|
||||||
if (input.Contains("⏎"))
|
if (input.Contains("⏎"))
|
||||||
input = "⏎" + input.Split("⏎").Last();
|
input = "⏎" + input.Split("⏎").Last();
|
||||||
return input.Length <= maxLen ? input : "<" + input.Substring(input.Length - maxLen + 1);
|
return input.Length < maxLen ? input : "<" + input.Substring(input.Length - maxLen + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly List<Tuple<string, string>> Emojis = new List<Tuple<string, string>>
|
public static readonly List<Tuple<string, string>> Emojis = new List<Tuple<string, string>>
|
||||||
|
|
|
@ -14,6 +14,8 @@ namespace telegram
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO:
|
||||||
|
* fuzzy matching for replies?
|
||||||
|
* unreads are unreliable in secret chats!
|
||||||
* mute,unmute chats
|
* mute,unmute chats
|
||||||
* photo & document download & show externally
|
* photo & document download & show externally
|
||||||
* publish AUR package
|
* publish AUR package
|
||||||
|
@ -212,7 +214,7 @@ namespace telegram
|
||||||
else
|
else
|
||||||
output += "]";
|
output += "]";
|
||||||
output += " > ";
|
output += " > ";
|
||||||
output += TruncateMessageStart(currentInputLine, Console.LargestWindowWidth - output.Length);
|
output += TruncateMessageStart(currentInputLine, Console.LargestWindowWidth - GetActualStringWidth(output));
|
||||||
Console.Write(output);
|
Console.Write(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue