From dcfc4d78c3880e84b76ea81f4c1b9df90c3a603b Mon Sep 17 00:00:00 2001 From: sijanec Date: Mon, 22 Mar 2021 18:44:55 +0100 Subject: for real 0.0.1 zdej --- src/ui.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ui.c b/src/ui.c index 22aff0e..df52ac2 100644 --- a/src/ui.c +++ b/src/ui.c @@ -16,15 +16,21 @@ void dc_null() { return; /* a simple null function */ } int dc_ui_print_message (WINDOW * textwin, struct dc_message * msg2do) { + int y, x; char timestring[64]; struct tm timestruct; localtime_r(&msg2do->time, ×truct); strftime(timestring, 64, DC_I18N_MSGTIMEF, ×truct); /* recimo, da je 23 znakov */ - DC_SIMPLEPRINT(textwin, 1, "#%012.12s ", msg2do->channel->name); - DC_SIMPLEPRINT(textwin, 2, "%018.18s ", timestring); - DC_SIMPLEPRINT(textwin, 4, "%08.8s: ", msg2do->username); - DC_SIMPLEPRINT(textwin, 3, "%s\n", msg2do->content); + DC_SIMPLEPRINT(textwin, 1, "%.35s", msg2do->channel->name); + getyx(textwin, y, x); + wmove(textwin, y, 10); + DC_SIMPLEPRINT(textwin, 2, " %.18s ", timestring); + DC_SIMPLEPRINT(textwin, 4, "%.33s", msg2do->username); + getyx(textwin, y, x); + wmove(textwin, y, 37); /* quick mafs */ + DC_SIMPLEPRINT(textwin, 3, ": %s\n", msg2do->content); msg2do->status = 1; + if (x); /* set but not used */ return 1; } int dc_ui_processline (struct dc_thread_control * t, char * l, WINDOW * textwin) { @@ -84,7 +90,6 @@ int dc_ui_processline (struct dc_thread_control * t, char * l, WINDOW * textwin) for (m = 0; m < c->guilds_sizeof; m++) /* we loop over all channels */ for (n = 0; n < c->guilds[m]->channels_sizeof; n++) c->guilds[m]->channels[n]->focused = 0; /* remove focus from all channels */ - DC_SIMPLEPRINT(textwin, 3, "/join %d %d", j, k); c->guilds[j]->channels[k]->focused = 1; c->guilds[j]->channels[k]->joined = 1; DC_CUE(c, c->guilds_lock); -- cgit v1.2.3