The wcswidth() function was silently failing when trying to convert
messages containing a newline to a widechar buffer which resulted
in the message showing up as an empty line. we now fall back
to using strlen to get the width of the string, which might still
cause minor display bugs when the message contains unicode, but is
still better than losing messages entirely.
This fixes a bug where printing a bunch of UTF8 chars with glyphs
that have a size > 1 would make the entire chat window disappear.
It also fixes an issue where said UTF8 chars would be truncated
and generally not display correctly.
This will alert the user when the first six bytes of a new
contact's public key is the same as any other contact in
their list. These 6 bytes are used elsewhere in toxic for
unique identification.
Also did a small refactor regarding the KEY_IDENT_BYTES
define
There is no check at all that the types of externs actually match the
type of the definition. This just accidentally was not a problem, but now
the compiler helps a bit in keeping it that way.
This fixes a rare but possible scenario where a name@domain lookup that's
longer than a tox id won't work. It also fixes custom messages for domain
lookups
`ncuses-6.3` added printf-style function attributes and now makes
it easier to catch cases when user input is used in palce of format
string when built with CFLAGS=-Werror=format-security:
toxic/src/game_chess.c:1633:63: error:
format not a string literal and no format arguments [-Werror=format-security]
1633 | mvwprintw(win, board->y_bottom_bound + 2, x_mid, state->status_message);
| ~~~~~^~~~~~~~~~~~~~~~
Let's wrap all the missing places with "%s" format.
- Add large square and rectangle window types
- Remove forced small windows
- Fit game of life to largest possible window type
- Hide cursor in game of life when game is running
- Give window tab and statusbar a make over
- Place window tab above input field
- Reduce input field to one square in height
- Refactor window tab so that it's now a subwin of its parent ToxWindow
- Fix bug causing notification counter to sometimes increment by 2
- No longer scroll on output when output is not at bottom of screen
- Show a small indicator on far left of window tab when output is
not at bottom of screen
- Reduce ncurses/UI thread sleep time by half
- Handle nanosleep errors better
A line's line count now increments without messing up the formatting in cases where
the noread flag wraps to the next line.
Additionally, the way noread flags are handled has been refactored and made
more efficient.
When renaming a log file, if the new name already exists we just
start appending to it and delete the old file. There's no need
to create a backup.
This fixes an issue where leaving and rejoining the same group
multiple times will eventually lead to the logger not working
due to trying to use the same file name over and over again.
Instead of trying (and failing) to correctly calculate the number of lines on the
screen a given message will need space for, we dynamically set the value both
on initiation of a new line, and whenever that line is printed to the screen
using the print_wrap() function.
This should fix the screen occasionally not scrolling down the correct number of
lines when a new message is printed.
A counter now increments in the bottom bar for unfocused windows showing how
many unread messages are pending. Tabs with no pending messages show [*]
instead of their index (showing the index is useless and somewhat confusing)
- Fix race condition in draw_peer()
- Handle realloc_peer_list() error
- Remove dead code in cmd_conference()
- Reduce scope of a few variable variables
- Fix possible buffer truncation in api.c
- Bottom tab now only shows indices of active chat windows unless focused
- Always focus Home screen on startup instead of the last loaded conference
- Conference tab names are no longer prefixed with the conference number
- Home and Contact tab names are now capitalized
- Conference logging now behaves the same as 1-on-1 chats: Instead
of creating a new log file every time we restat the client
we use the unique conference ID to keep track of path names.
This also allows us to load history for saved groups on client startup
- Added a log init function / general code refactor.
- Fixed a bug that caused log files to be created even when logging
is disabled.