summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsijanec <anton@sijanec.eu>2021-03-22 18:44:55 +0100
committersijanec <anton@sijanec.eu>2021-03-22 18:44:55 +0100
commitdcfc4d78c3880e84b76ea81f4c1b9df90c3a603b (patch)
tree6489e6a6013a010c86b3e14f68b1258105c8472d
parentupdate 0.0.1 (diff)
downloaddiscord.c-dcfc4d78c3880e84b76ea81f4c1b9df90c3a603b.tar
discord.c-dcfc4d78c3880e84b76ea81f4c1b9df90c3a603b.tar.gz
discord.c-dcfc4d78c3880e84b76ea81f4c1b9df90c3a603b.tar.bz2
discord.c-dcfc4d78c3880e84b76ea81f4c1b9df90c3a603b.tar.lz
discord.c-dcfc4d78c3880e84b76ea81f4c1b9df90c3a603b.tar.xz
discord.c-dcfc4d78c3880e84b76ea81f4c1b9df90c3a603b.tar.zst
discord.c-dcfc4d78c3880e84b76ea81f4c1b9df90c3a603b.zip
-rw-r--r--src/ui.c15
1 files 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, &timestruct);
strftime(timestring, 64, DC_I18N_MSGTIMEF, &timestruct); /* 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);