X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Firc_src%2Finput.c;h=b99935c05e6560b841884c68a3527c194e0362eb;hb=5b487e31cf5145372e9777e9f82a8cd661d4f1b4;hp=2236152a137629adc8827bd726ad112f76b8248a;hpb=fcb22b3d1770e7f441385198cde6ddda3953e38b;p=tpg%2Facess2.git diff --git a/Usermode/Applications/irc_src/input.c b/Usermode/Applications/irc_src/input.c index 2236152a..b99935c0 100644 --- a/Usermode/Applications/irc_src/input.c +++ b/Usermode/Applications/irc_src/input.c @@ -42,9 +42,11 @@ void Input_HandleSelect(int nfds, const fd_set *rfds) } free(cmd); // Prompt - SetCursorPos(giTerminal_Height-1, 1); + SetCursorPos(giTerminal_Height, 1); printf("\x1B[2K"); // Clear line - printf("[%s]", Window_GetName(NULL)); + int prompt_len = printf("[%s] ", Window_GetName(NULL)); + SetCursorPos(giTerminal_Height, prompt_len+1); + fflush(stdout); } } } @@ -104,6 +106,15 @@ void Cmd_window(char *ArgString) } } +void Cmd_me(char *ArgString) +{ + tServer *srv = Window_GetServer(NULL); + if( srv && Window_IsChat(NULL) ) { + Window_AppendMessage(NULL, MSG_CLASS_ACTION, Server_GetNick(srv), "%s", ArgString); + Server_SendCommand(srv, "PRIVMSG %s :\1ACTION %s\1\n", Window_GetName(NULL), ArgString); + } +} + const struct { const char *Name; void (*Fcn)(char *ArgString);