small fixes, newlines, mark as unread
This commit is contained in:
parent
344e677eed
commit
7522be5a3a
|
@ -1,7 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="36e5cfaf-0aa9-4137-8110-a5678a9c5443" name="Default Changelist" comment="" />
|
<list default="true" id="36e5cfaf-0aa9-4137-8110-a5678a9c5443" name="Default Changelist" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/.idea.tgcli/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.tgcli/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/telegram/Command.cs" beforeDir="false" afterPath="$PROJECT_DIR$/telegram/Command.cs" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/telegram/Util.cs" beforeDir="false" afterPath="$PROJECT_DIR$/telegram/Util.cs" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/telegram/tgcli.cs" beforeDir="false" afterPath="$PROJECT_DIR$/telegram/tgcli.cs" afterDir="false" />
|
||||||
|
</list>
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -29,6 +34,7 @@
|
||||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/39AD1EAB-EC41-4054-96D6-7E75046A6833/98/e27fdd21/EventHandler`1.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/39AD1EAB-EC41-4054-96D6-7E75046A6833/98/e27fdd21/EventHandler`1.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/tdsharp/TDLib.Api/Functions/EditMessageText.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/tdsharp/TDLib.Api/Functions/EditMessageText.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/tdsharp/TDLib.Api/Functions/GetAuthorizationState.cs" root0="FORCE_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/tdsharp/TDLib.Api/Functions/GetAuthorizationState.cs" root0="FORCE_HIGHLIGHTING" />
|
||||||
|
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/7B2C2408-23DE-40E4-9D78-A7E306473419/fe/a4516fce/ConsoleModifiers.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/tdsharp/TDLib.Api/Objects/TdlibParameters.cs" root0="FORCE_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/tdsharp/TDLib.Api/Objects/TdlibParameters.cs" root0="FORCE_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/tdsharp/TDLib.Api/Objects/Message.cs" root0="SKIP_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/tdsharp/TDLib.Api/Objects/Message.cs" root0="SKIP_HIGHLIGHTING" />
|
||||||
<setting file="file://$PROJECT_DIR$/telegram/Util.cs" root0="FORCE_HIGHLIGHTING" />
|
<setting file="file://$PROJECT_DIR$/telegram/Util.cs" root0="FORCE_HIGHLIGHTING" />
|
||||||
|
@ -51,8 +57,8 @@
|
||||||
<option value="$PROJECT_DIR$/tgcli.core/tgcli.cs" />
|
<option value="$PROJECT_DIR$/tgcli.core/tgcli.cs" />
|
||||||
<option value="$PROJECT_DIR$/tgcli.core/Util.cs" />
|
<option value="$PROJECT_DIR$/tgcli.core/Util.cs" />
|
||||||
<option value="$PROJECT_DIR$/tgcli.core/Command.cs" />
|
<option value="$PROJECT_DIR$/tgcli.core/Command.cs" />
|
||||||
<option value="$PROJECT_DIR$/telegram/Util.cs" />
|
|
||||||
<option value="$PROJECT_DIR$/telegram/Command.cs" />
|
<option value="$PROJECT_DIR$/telegram/Command.cs" />
|
||||||
|
<option value="$PROJECT_DIR$/telegram/Util.cs" />
|
||||||
<option value="$PROJECT_DIR$/telegram/tgcli.cs" />
|
<option value="$PROJECT_DIR$/telegram/tgcli.cs" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
|
@ -115,7 +121,7 @@
|
||||||
<workItem from="1575536428992" duration="12000" />
|
<workItem from="1575536428992" duration="12000" />
|
||||||
<workItem from="1575536474314" duration="39215000" />
|
<workItem from="1575536474314" duration="39215000" />
|
||||||
<workItem from="1575724030612" duration="6335000" />
|
<workItem from="1575724030612" duration="6335000" />
|
||||||
<workItem from="1575806456895" duration="24330000" />
|
<workItem from="1575806456895" duration="26434000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -11,182 +11,179 @@ namespace telegram
|
||||||
{
|
{
|
||||||
public static void ParseCommand(string command)
|
public static void ParseCommand(string command)
|
||||||
{
|
{
|
||||||
var split = command.Split(" ");
|
while (true)
|
||||||
if (split[0].Equals("open") || split[0].Equals("o"))
|
|
||||||
{
|
{
|
||||||
if (split.Length < 2)
|
var split = command.Split(" ");
|
||||||
return;
|
if (split[0].Equals("open") || split[0].Equals("o"))
|
||||||
|
|
||||||
var query = command.Substring(split[0].Length);
|
|
||||||
|
|
||||||
var chatId = searchChatId(query);
|
|
||||||
if (chatId == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
currentChatId = 0;
|
|
||||||
currentChatUserId = 0;
|
|
||||||
currentUserOnline = false;
|
|
||||||
currentUserTyping = false;
|
|
||||||
currentUserRead = false;
|
|
||||||
ctsTyping?.Cancel();
|
|
||||||
|
|
||||||
var chat = getChat(chatId);
|
|
||||||
if (chat.Type is TdApi.ChatType.ChatTypePrivate privChat)
|
|
||||||
{
|
{
|
||||||
currentChatUserId = privChat.UserId;
|
if (split.Length < 2) return;
|
||||||
}
|
|
||||||
|
|
||||||
currentChatId = chat.Id;
|
var query = command.Substring(split[0].Length);
|
||||||
prefix = $"[{chat.Title}";
|
|
||||||
lock (_lock)
|
var chatId = searchChatId(query);
|
||||||
{
|
if (chatId == 0) return;
|
||||||
messageQueue.Add($"{Ansi.Yellow}[tgcli] Opening chat: {chat.Title}");
|
|
||||||
messageQueue.Add($"{Ansi.Yellow}" +
|
currentChatId = 0;
|
||||||
$"[tgcli] You have {chat.UnreadCount} unread message" +
|
currentChatUserId = 0;
|
||||||
$"{(chat.UnreadCount == 1 ? "." : "s.")}");
|
currentUserOnline = false;
|
||||||
while (getHistory(chatId, 50).Count == 1)
|
currentUserTyping = false;
|
||||||
|
currentUserRead = false;
|
||||||
|
ctsTyping?.Cancel();
|
||||||
|
|
||||||
|
var chat = getChat(chatId);
|
||||||
|
if (chat.Type is TdApi.ChatType.ChatTypePrivate privChat)
|
||||||
{
|
{
|
||||||
getHistory(chatId, 10);
|
currentChatUserId = privChat.UserId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chat.UnreadCount >= 5)
|
currentChatId = chat.Id;
|
||||||
{
|
prefix = $"[{chat.Title}";
|
||||||
var capped = chat.UnreadCount > 50;
|
|
||||||
getHistory(chatId, capped ? 50 : chat.UnreadCount).ForEach(AddMessageToQueue);
|
|
||||||
if (capped)
|
|
||||||
messageQueue.Add($"{Ansi.Yellow}[tgcli] " +
|
|
||||||
$"Showing 50 of {chat.UnreadCount} unread messages.");
|
|
||||||
}
|
|
||||||
else if (chat.UnreadCount > 0)
|
|
||||||
{
|
|
||||||
var unreads = getHistory(chatId, chat.UnreadCount);
|
|
||||||
var rest = getHistory(chatId, 5 - unreads.Count, unreads.First().Id);
|
|
||||||
rest.ForEach(AddMessageToQueue);
|
|
||||||
messageQueue.Add($"{Ansi.Yellow}[tgcli] ---UNREAD---");
|
|
||||||
unreads.ForEach(AddMessageToQueue);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
getHistory(chatId).ForEach(AddMessageToQueue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
markRead(chat.Id, getHistory(chat.Id).First().Id);
|
|
||||||
var history = getHistory(currentChatId, 50);
|
|
||||||
var last = history.LastOrDefault(p => p.IsOutgoing);
|
|
||||||
if (last == null)
|
|
||||||
{
|
|
||||||
currentUserRead = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lastMessage = last;
|
|
||||||
currentUserRead = isMessageRead(last.ChatId, last.Id);
|
|
||||||
}
|
|
||||||
else if (split[0].Equals("close") || split[0].Equals("c"))
|
|
||||||
{
|
|
||||||
if (split.Length != 1 || currentChatId == 0)
|
|
||||||
return;
|
|
||||||
currentChatId = 0;
|
|
||||||
currentChatUserId = 0;
|
|
||||||
currentUserOnline = false;
|
|
||||||
currentUserTyping = false;
|
|
||||||
currentUserRead = false;
|
|
||||||
ctsTyping?.Cancel();
|
|
||||||
lastMessage = null;
|
|
||||||
prefix = "[tgcli";
|
|
||||||
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
messageQueue.Add($"{Ansi.Yellow}[tgcli] Closing chat.");
|
|
||||||
var count = missedMessages.Count;
|
|
||||||
if (count == 0)
|
|
||||||
return;
|
|
||||||
messageQueue.Add($"{Ansi.Yellow}" +
|
|
||||||
$"[tgcli] You have {count} missed message" +
|
|
||||||
$"{(count == 1 ? "." : "s.")}");
|
|
||||||
messageQueue.AddRange(missedMessages);
|
|
||||||
missedMessages.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (split[0].Equals("history") || split[0].Equals("h"))
|
|
||||||
{
|
|
||||||
if (split.Length != 1 && split.Length != 2 || currentChatId == 0)
|
|
||||||
{
|
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
messageQueue.Add($"{Ansi.Red}[tgcli] " +
|
|
||||||
"No chat selected. Select a chat with /open <query>");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var history = split.Length > 1 && int.TryParse(split[1], out var limit)
|
|
||||||
? getHistory(currentChatId, limit)
|
|
||||||
: getHistory(currentChatId);
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
messageQueue.Add($"{Ansi.Yellow}[tgcli] Last {history.Count} messages in " +
|
|
||||||
$"{getChat(currentChatId).Title}");
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var msg in history)
|
|
||||||
{
|
|
||||||
AddMessageToQueue(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (split[0].Equals("clear") || split[0].Equals("cl"))
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
Console.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (split[0].Equals("quit") || split[0].Equals("q"))
|
|
||||||
{
|
|
||||||
quitting = true;
|
|
||||||
}
|
|
||||||
else if (split[0].Equals("unreads") || split[0].Equals("u"))
|
|
||||||
{
|
|
||||||
var unreads = getUnreadChats(split.Length == 2 && split[1].Equals("all"));
|
|
||||||
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
messageQueue.Add($"{Ansi.Yellow}[tgcli] You have {unreads.Count} unread chats.");
|
|
||||||
unreads.ForEach(chat =>
|
|
||||||
{
|
{
|
||||||
string line;
|
messageQueue.Add($"{Ansi.Yellow}[tgcli] Opening chat: {chat.Title}");
|
||||||
if (chat.UnreadCount == 0)
|
messageQueue.Add($"{Ansi.Yellow}" + $"[tgcli] You have {chat.UnreadCount} unread message" + $"{(chat.UnreadCount == 1 ? "." : "s.")}");
|
||||||
line = $"{Ansi.Bold}{Ansi.Yellow}[M] {chat.Title}";
|
while (getHistory(chatId, 50).Count == 1)
|
||||||
|
{
|
||||||
|
getHistory(chatId, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chat.UnreadCount >= 5)
|
||||||
|
{
|
||||||
|
var capped = chat.UnreadCount > 50;
|
||||||
|
getHistory(chatId, capped ? 50 : chat.UnreadCount).ForEach(AddMessageToQueue);
|
||||||
|
if (capped) messageQueue.Add($"{Ansi.Yellow}[tgcli] " + $"Showing 50 of {chat.UnreadCount} unread messages.");
|
||||||
|
}
|
||||||
|
else if (chat.UnreadCount > 0)
|
||||||
|
{
|
||||||
|
var unreads = getHistory(chatId, chat.UnreadCount);
|
||||||
|
var rest = getHistory(chatId, 5 - unreads.Count, unreads.First().Id);
|
||||||
|
rest.ForEach(AddMessageToQueue);
|
||||||
|
messageQueue.Add($"{Ansi.Yellow}[tgcli] ---UNREAD---");
|
||||||
|
unreads.ForEach(AddMessageToQueue);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
line = $"{Ansi.Bold}{Ansi.Green}[{chat.UnreadCount}] {chat.Title}";
|
{
|
||||||
messageQueue.Add(line);
|
getHistory(chatId).ForEach(AddMessageToQueue);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (split[0].Equals("edit") || split[0].Equals("e"))
|
|
||||||
{
|
|
||||||
if (currentChatId == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (split.Length == 1)
|
markRead(chat.Id, getHistory(chat.Id).First().Id);
|
||||||
{
|
|
||||||
currentInputLine = "/e " + ((TdApi.MessageContent.MessageText) lastMessage?.Content)?.Text?.Text;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastMessage == null)
|
|
||||||
{
|
|
||||||
//try to find last message
|
|
||||||
var history = getHistory(currentChatId, 50);
|
var history = getHistory(currentChatId, 50);
|
||||||
var last = history.LastOrDefault(p => p.IsOutgoing);
|
var last = history.LastOrDefault(p => p.IsOutgoing);
|
||||||
if (last == null)
|
if (last == null)
|
||||||
|
{
|
||||||
|
currentUserRead = true;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lastMessage = last;
|
lastMessage = last;
|
||||||
|
currentUserRead = isMessageRead(last.ChatId, last.Id);
|
||||||
|
}
|
||||||
|
else if (split[0].Equals("cu") || split[0].Equals("closeunread"))
|
||||||
|
{
|
||||||
|
if (currentChatId == 0) return;
|
||||||
|
markUnread(currentChatId);
|
||||||
|
command = "close";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (split[0].Equals("close") || split[0].Equals("c"))
|
||||||
|
{
|
||||||
|
if (split.Length != 1 || currentChatId == 0) return;
|
||||||
|
currentChatId = 0;
|
||||||
|
currentChatUserId = 0;
|
||||||
|
currentUserOnline = false;
|
||||||
|
currentUserTyping = false;
|
||||||
|
currentUserRead = false;
|
||||||
|
ctsTyping?.Cancel();
|
||||||
|
lastMessage = null;
|
||||||
|
prefix = "[tgcli";
|
||||||
|
|
||||||
|
|
||||||
|
lock (_lock)
|
||||||
|
{
|
||||||
|
messageQueue.Add($"{Ansi.Yellow}[tgcli] Closing chat.");
|
||||||
|
var count = missedMessages.Count;
|
||||||
|
if (count == 0) return;
|
||||||
|
messageQueue.Add($"{Ansi.Yellow}" + $"[tgcli] You have {count} missed message" + $"{(count == 1 ? "." : "s.")}");
|
||||||
|
messageQueue.AddRange(missedMessages);
|
||||||
|
missedMessages.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (split[0].Equals("history") || split[0].Equals("h"))
|
||||||
|
{
|
||||||
|
if (split.Length != 1 && split.Length != 2 || currentChatId == 0)
|
||||||
|
{
|
||||||
|
lock (_lock) messageQueue.Add($"{Ansi.Red}[tgcli] " + "No chat selected. Select a chat with /open <query>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var history = split.Length > 1 && int.TryParse(split[1], out var limit)
|
||||||
|
? getHistory(currentChatId, limit)
|
||||||
|
: getHistory(currentChatId);
|
||||||
|
|
||||||
|
lock (_lock)
|
||||||
|
{
|
||||||
|
messageQueue.Add($"{Ansi.Yellow}[tgcli] Last {history.Count} messages in " + $"{getChat(currentChatId).Title}");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var msg in history)
|
||||||
|
{
|
||||||
|
AddMessageToQueue(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (split[0].Equals("clear") || split[0].Equals("cl"))
|
||||||
|
{
|
||||||
|
lock (_lock)
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (split[0].Equals("quit") || split[0].Equals("q"))
|
||||||
|
{
|
||||||
|
quitting = true;
|
||||||
|
}
|
||||||
|
else if (split[0].Equals("unreads") || split[0].Equals("u"))
|
||||||
|
{
|
||||||
|
var unreads = getUnreadChats(split.Length == 2 && split[1].Equals("all"));
|
||||||
|
|
||||||
|
lock (_lock)
|
||||||
|
{
|
||||||
|
messageQueue.Add($"{Ansi.Yellow}[tgcli] You have {unreads.Count} unread chats.");
|
||||||
|
unreads.ForEach(chat =>
|
||||||
|
{
|
||||||
|
string line;
|
||||||
|
if (chat.UnreadCount == 0)
|
||||||
|
line = $"{Ansi.Bold}{Ansi.Yellow}[M] {chat.Title}";
|
||||||
|
else
|
||||||
|
line = $"{Ansi.Bold}{Ansi.Green}[{chat.UnreadCount}] {chat.Title}";
|
||||||
|
messageQueue.Add(line);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (split[0].Equals("edit") || split[0].Equals("e"))
|
||||||
|
{
|
||||||
|
if (currentChatId == 0) return;
|
||||||
|
|
||||||
|
if (split.Length == 1)
|
||||||
|
{
|
||||||
|
currentInputLine = "/e " + ((TdApi.MessageContent.MessageText) lastMessage?.Content)?.Text?.Text;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastMessage == null)
|
||||||
|
{
|
||||||
|
//try to find last message
|
||||||
|
var history = getHistory(currentChatId, 50);
|
||||||
|
var last = history.LastOrDefault(p => p.IsOutgoing);
|
||||||
|
if (last == null) return;
|
||||||
|
lastMessage = last;
|
||||||
|
}
|
||||||
|
|
||||||
|
var message = command.Substring(split[0].Length);
|
||||||
|
editMessage(message, lastMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
var message = command.Substring(split[0].Length);
|
break;
|
||||||
editMessage(message, lastMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,6 +142,7 @@ namespace telegram
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(message))
|
if (string.IsNullOrWhiteSpace(message))
|
||||||
return;
|
return;
|
||||||
|
message = message.Replace("⏎", "\n");
|
||||||
client.ExecuteAsync(new SendMessage
|
client.ExecuteAsync(new SendMessage
|
||||||
{
|
{
|
||||||
ChatId = chatId,
|
ChatId = chatId,
|
||||||
|
@ -187,6 +188,15 @@ namespace telegram
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void markUnread(long chatId)
|
||||||
|
{
|
||||||
|
client.ExecuteAsync(new ToggleChatIsMarkedAsUnread
|
||||||
|
{
|
||||||
|
ChatId = chatId,
|
||||||
|
IsMarkedAsUnread = true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static long searchChatId(string query)
|
public static long searchChatId(string query)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -14,8 +14,7 @@ namespace telegram
|
||||||
* reply to x messages ago
|
* reply to x messages ago
|
||||||
* cap length & truncate extremely long chat names!
|
* cap length & truncate extremely long chat names!
|
||||||
* make emojis not break terminal -> :shrug: and stuff
|
* make emojis not break terminal -> :shrug: and stuff
|
||||||
* mark chat as unread
|
* make typing newlines actually good (inputline as list?)
|
||||||
* some way of typing newlines
|
|
||||||
* fix history not fully displaying on channel open (query returning less results than expected?)
|
* fix history not fully displaying on channel open (query returning less results than expected?)
|
||||||
* waaay more error messages instead of just doing nothing
|
* waaay more error messages instead of just doing nothing
|
||||||
* make Util.getActualStringWidth better
|
* make Util.getActualStringWidth better
|
||||||
|
@ -179,7 +178,6 @@ namespace telegram
|
||||||
Thread.Sleep(1);
|
Thread.Sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Command.ParseCommand("u");
|
|
||||||
ScreenUpdate();
|
ScreenUpdate();
|
||||||
while (!quitting)
|
while (!quitting)
|
||||||
MainLoop();
|
MainLoop();
|
||||||
|
@ -293,9 +291,16 @@ namespace telegram
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
if (key.Key == ConsoleKey.N && key.Modifiers.HasFlag(ConsoleModifiers.Control))
|
||||||
|
{
|
||||||
|
currentInputLine += "⏎";
|
||||||
|
ScreenUpdate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!specialKeys.Contains(key.Key))
|
if (!specialKeys.Contains(key.Key))
|
||||||
{
|
{
|
||||||
currentInputLine += key.KeyChar;
|
currentInputLine += key.KeyChar;
|
||||||
|
//TODO currentInputLine = currentInputLine.Replace(":xd:", "😂");
|
||||||
ScreenUpdate();
|
ScreenUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue