1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-22 09:53:02 +01:00
Commit Graph

1361 Commits

Author SHA1 Message Date
jfreegman
9e353443c2
Fix outdated help message 2021-08-16 11:14:09 -04:00
jfreegman
d02f3b4acb
Fix a graphical bug with the game border on some terminal emulators 2021-07-27 14:15:36 -04:00
jfreegman
768617a129
Fix small build bug and bump to v0.11.1 2021-06-28 16:04:25 -04:00
jfreegman
8dfd009e0e
Some minor fixes for game module 2021-06-28 13:54:25 -04:00
jfreegman
321f694bb8
Add ability to toggle colours in game of life 2021-06-03 14:45:03 -04:00
jfreegman
4514ecd839
Refactor game window sizing
- 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
2021-06-03 01:19:49 -04:00
jfreegman
5e67571908
Implement Conway's Game of Life 2021-06-01 23:00:00 -04:00
jfreegman
c293fbe0c7
Add support for game window notifications 2021-05-24 14:30:29 -04:00
jfreegman
93fb84206d
Bump to version 0.11.0 2021-05-24 14:30:28 -04:00
jfreegman
35aa6922d6
Show previous window instead of Home after closing a window 2021-05-24 14:30:28 -04:00
jfreegman
7abf6388f8
Add ability to compile without game support 2021-05-24 14:30:28 -04:00
jfreegman
7aeb1a0aac
Add networking to game engine / add multiplayer chess 2021-05-24 14:30:27 -04:00
jfreegman
60bdcf0ba5
Begin implementing chess 2021-05-24 14:30:27 -04:00
jfreegman
a623976a0e
Add game module (WIP) 2021-05-24 14:30:26 -04:00
jfreegman
a2f0f298aa
Fix bug showing friends with busy status as online 2021-04-20 13:29:41 -04:00
jfreegman
0fc1d9e994
Add two missing mutex unlocks 2021-03-27 11:50:57 -04:00
jfreegman
80fd3d3b97
Fix buggy behaviour when printing non-ascii characters in Home input field
This line doesn't appear to be doing anything useful - most likely a leftover
from the recent UI overhaul
2021-01-25 22:36:05 -05:00
jfreegman
07a41f9e0b
Show previous window instead of Home after closing a window 2021-01-25 17:09:23 -05:00
jfreegman
f643975941
Fix bug preventing the /clear command from working in Home window 2021-01-23 21:17:46 -05:00
jfreegman
81eb58532e
Fix bug sometimes causing join message spam on conference join 2021-01-17 17:10:10 -05:00
jfreegman
8464ea9a7a
Fix minor display bug with the audio call info box 2021-01-12 19:18:22 -05:00
jfreegman
eb964b64c2
Fix off by one error and comment magic numbers 2020-12-05 20:53:09 -05:00
Lily
2ff9d29491
Custom colors proof of concept
Fix formatting

Fix repeated variable in example config
2020-12-05 17:46:13 -06:00
jfreegman
2640919318
Don't announce when ghost peers leave the group
This appears to be a toxcore bug, but nonetheless it looks ugly. Also changed
group -> conference for join/part messages
2020-12-03 11:49:48 -05:00
jfreegman
2fcbc4fa1c
Remove lots of duplicate code related to printing timestamps 2020-11-30 17:55:57 -05:00
jfreegman
4330bf5867
Show peer join/part messages in conferences
Also a couple trivial fixes
2020-11-30 12:06:13 -05:00
jfreegman
3f1b7cdd26
Update config example and some default settings to reflect recent changes 2020-11-30 00:58:43 -05:00
jfreegman
1e985c1456
Interface improvements and bump to v0.10.0
- 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
2020-11-29 23:26:51 -05:00
jfreegman
61740bda85
Fix a couple minor issues
Print a warning if remove() fails, and check if the win pointer is null
before using it (this is unnecessary but it's correct and shuts coverity up)
2020-11-26 18:25:37 -05:00
jfreegman
39e4ff8bd6
Fix tab complete bug
If a directory contains a single entry tab complete will no longer fail
2020-11-26 16:20:51 -05:00
jfreegman
0434ac186a
Fix bug causing file transfer status bars to be truncated 2020-11-26 16:17:00 -05:00
jfreegman
8d9d51640c
Fix display bug caused by noread flag appended to unread messages
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.
2020-11-26 16:16:59 -05:00
jfreegman
c4c0c0d1f4
Another logging fix
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.
2020-11-26 16:10:59 -05:00
jfreegman
7b7ea0e386
Fix small regression
This wasn't supposed to make it into the commit
2020-11-24 23:42:25 -05:00
jfreegman
d35a38735b
Fix line wrapping/padding issues
It should now parse messages with newlines properly as well as messages that
contain long sequences of characters with no spaces
2020-11-24 19:47:04 -05:00
jfreegman
f0c4906fdc
Fix some off by one bugs with line scrolling and some cleanup
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.
2020-11-24 19:36:03 -05:00
jfreegman
56ba61e061
Cleanup and refactor x11 code
- Deleted X11 code for an unfinished/broken feature
- Rename xtra -> x11focus
- Cleanup the remaining code a bit
2020-11-24 19:31:59 -05:00
jfreegman
898d89e95a
Properly handle failures to convert widechar strings to multibyte 2020-11-24 16:41:42 -05:00
jfreegman
1fd1e27bdf
Remove seconds from default timestamp
Also reduce the --- prefix to one dash before a message. These characters are taking
up valuable real-estate
2020-11-22 18:53:32 -05:00
jfreegman
8e84ac58d4
Implement word wrapping
It's about time
2020-11-22 18:41:12 -05:00
jfreegman
9d65997871
Add notification counters to bottom tab
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)
2020-11-21 11:25:41 -05:00
jfreegman
da2889f3ab
Fix UI regression
The conference number needs to be displayed in the tab name
so that you can invite friends to conferences
2020-11-20 02:10:52 -05:00
jfreegman
312b38d253
A few small fixes
- 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
2020-11-19 14:23:32 -05:00
jfreegman
0554bf0240
Create backup of duplicate log file instead of deleting it
This case should never occur, but just in case it does it's good to handle it
without any data loss
2020-11-19 14:23:31 -05:00
jfreegman
53a7530e8a
Some UI improvements
- 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
2020-11-19 01:30:30 -05:00
jfreegman
41be04a142
Implement push-to-talk for conference audio 2020-11-18 16:57:26 -05:00
jfreegman
31f36318a2
Add config settings for audio channels 2020-11-18 16:29:01 -05:00
jfreegman
f882fdf608
Use two channels for conference audio 2020-11-17 16:31:17 -05:00
jfreegman
7e1e410307
Refactor logging
- 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.
2020-11-17 16:05:20 -05:00
zugz (tox)
c135c812c2
Fix playing unallocated memory on opening audio device 2020-11-16 00:00:00 +00:00
jfreegman
6c239193ab
Fix bug sometimes preventing typing status from being updated 2020-11-15 12:30:26 -05:00
zugz (tox)
ba5ded9bc2
Use compound literals to zero out structs instead of memset 2020-11-14 00:00:05 +00:00
zugz (tox)
4581dee4fc
astyle 2020-11-14 00:00:05 +00:00
zugz (tox)
d75d6e8b60
sort includes 2020-11-14 00:00:05 +00:00
zugz (tox)
142ce642f0
Per-call pending status and state handling
* Proper handling of incoming video calls.
* Add command /vcall for initiating video calls
* Add command /res command to set video resolution
2020-11-14 00:00:10 +00:00
zugz (tox)
7dead5ec96
Implement simplistic VAD 2020-11-14 00:00:01 +00:00
zugz
ddcf224db2
Implement groupAV 2020-11-14 00:00:01 +00:00
zugz
daf794c4a2
Rework audio device handling
We now have at most one input and one output device open at any time,
but can have multiple capture callbacks and multiple output sources.
2020-11-14 00:00:01 +00:00
jfreegman
dac0124f0f
Fix some issues with file transfers
- Fix bug causing failed avatar transfers to be sent as normal file transfers
      when a friend goes offline and comes back online
- Remove some unused members of the FileTransfer struct
- Rename filenum -> filenumber and friendnum -> friendnumber
2020-11-13 19:38:33 -05:00
jfreegman
15b7a30925
Fix some bugs/issues with the message queue
- It's no longer possible for messages to be sent out of order
- Check if logger is enabled before doing pointless API calls
- Fix linked list bug (a part of the code almost never executes)
2020-11-12 11:39:19 -05:00
jfreegman
77ab71f26f
Refactor message queue
We now attempt to send all queued messages per call to cqueue_try_send() instead
of just the oldest message in the queue. This speeds things up substantially.

Also fixed a very unlikely bug where the read receipt might wrap around to zero
which we used as a reserved value for an unsent message
2020-11-11 16:28:50 -05:00
jfreegman
68e1ba312d
Use compound literals to zero out structs instead of memset
This is cleaner and much less prone to bugs
2020-11-10 21:25:27 -05:00
jfreegman
752fc6d619
Fix race condition when window is closed with active notifications
A ToxWindow's notifications need to be halted before the window is freed
2020-11-10 17:20:40 -05:00
jfreegman
71d7d355a6
Use enum to identify window types instead of bool variables 2020-11-09 17:01:22 -05:00
jfreegman
4188b392cc
Rename: groupchats -> conferences
This is in line with the toxcore API naming scheme and is in preparation
for the merge with the new groupchat implementation
2020-11-08 10:08:24 -05:00
jfreegman
811fbfbb1e
Fix char -> widechar comparisons 2020-11-08 00:07:28 -05:00
jfreegman
32eb7d3040
Filter invalid file names for inbound file transfers 2020-11-05 10:55:48 -05:00
jfreegman
42763905d7
Replace deprecated usleep function with nanosleep
usleep was declared obsolete in POSIX.1-2001
2020-11-04 22:05:59 -05:00
jfreegman
f64300d1d6
Close file handlers when inbound file transfer fails 2020-11-03 13:26:23 -05:00
jfreegman
1a723f0e8e
Fix bad behaviour with duplicate file names
If the new path is too long for the buffer we cancel the file transfer
and return an error instead of truncating the file name and continuing.
2020-11-03 13:03:47 -05:00
jfreegman
a86884c40e
Remove legacy code and fix a couple format specifiers
This code was added over 5 years ago and no longer serves a purpose
2020-11-03 01:00:08 -05:00
jfreegman
3f02e119f4
add missing malloc error checks and fix widechar to char comparison 2020-11-03 00:59:28 -05:00
jfreegman
1bbd50aac7
Fix a few issues
- realloc needs to be error checked
- use correct format specifiers
- make sure optarg and DATA_FILE aren't null before using them
2020-11-02 18:08:54 -05:00
jfreegman
e7a0c32a68
Refactor a few complex functions
Also moved some single use functions from misc_tools to their
respective files
2020-11-01 15:55:07 -05:00
jfreegman
7560bc9547
modularize string arrays for line completion
Instead of using various different forms of string arrays and having to handle them
differently for string completion, we now always use char pointer arrays. This allows
us to remove some large stack allocations, remove a bunch of confusing defines that
keep track of global array sizes, and generally unclutters the code so it's easier
to read.
2020-11-01 11:29:51 -05:00
jfreegman
2b43340c90
Convert all variable length arrays to heap allocations
VLA's are inherently unsafe so the safest option is to not use them
2020-11-01 11:29:48 -05:00
jfreegman
ff1620c923
fix invalid usage of stderr and incorrect formatting 2020-11-01 11:19:18 -05:00
jfreegman
91f194c821
Fix pointer use after free bug
If toxcore fails to end a call we still need to do a cleanup
2020-10-28 23:59:28 -04:00
jfreegman
478762f76c
Dynamically allocate audio frame buffer memory 2020-10-28 23:59:25 -04:00
jfreegman
4d96d6a753
Fix regression related to https lookups
Reducing the buffer size of HTTPS responses broke DHT nodelist fetching. This change
puts the old buffer size back and converts all stack allocations of the read buffer
to heap allocations.
2020-10-27 12:34:12 -04:00
jfreegman
3cdcfbf4e5
Reduce size of some large stack memory allocations 2020-10-25 13:48:14 -04:00
jfreegman
4c302da503
Fix a bunch of Wformat-truncation warnings due to snprintf() misuse 2020-10-24 14:44:41 -04:00
jfreegman
e428879beb
Fix clashing key bindings
Scrolling the groupchat peer list now uses ctrl+up and down
2020-10-13 19:52:43 -04:00
jfreegman
3015138a5a
Manually attempt to decode input char sequences
This is currently a fallback method for when the terminal doesn't
detect ctrl arrow sequences, but it is generalized for future additions
2020-10-13 16:12:55 -04:00
jfreegman
9c06ad608b
Add ability to skip words in input field with ctrl-left/right arrow 2020-10-10 11:21:15 -04:00
Johannes Heimansberg
015dbd9a96
fix: Fix non-working bell notifications
The problem with the bell notifications only happens when Toxic is
compiled with X11 support, but does not run under X. This commit changes
toxic's behavior such that it behaves identically when not running under an
X session, no matter if it has been compiled with X11 support or not.
2020-08-24 16:36:52 +02:00
jfreegman
a7466c3142
Add option to disable LAN 2020-08-10 21:56:45 -04:00
jfreegman
f012007cc4
A couple small fixes 2020-05-19 21:44:35 -04:00
jfreegman
dcf3baf60f
Make sure logger file is closed after tox_kill 2020-05-18 13:58:55 -04:00
JFreegman
4bda799a4b
Add the ability to log to file (#84) 2020-05-16 23:12:54 -04:00
jfreegman
4bfb344caa
Add option for toxcore logging in stderr 2020-05-04 16:15:28 -04:00
iphydf
68db926f9f
Check that files are formatted correctly.
Fail the CI build if they are not.
2020-04-23 01:16:57 +00:00
iphydf
b270c1e8b7
Remove extra semicolon in lock/unlock macros.
lock/unlock are always expanded in a context followed by a semicolon.
2020-04-23 01:12:34 +00:00
jfreegman
e7142e49fd
Terminate notify before windows
This fixes a use after free bug
2020-04-22 20:54:53 -04:00
zugz (tox)
610906d07f
fix segfault on starting video 2020-04-17 00:00:00 +00:00
iphydf
6f72a191ba
Revert "Add feature flags and missing #includes."
This reverts commit dd5fa236ae.

Also, set `-std=gnu99` in Bazel build.
2020-04-17 19:37:22 +00:00
iphydf
dd5fa236ae
Add feature flags and missing #includes.
These are needed to compile on some strict Linuxes.
2020-04-15 21:34:30 +00:00
jfreegman
ddc8c53abf
Fix unused variable warnings and change all (void)s to UNUSED macro 2020-03-30 16:02:27 -04:00
iphydf
46513017e3
Half-hearted attempt at making toxic work on osx.
Video has no chance without X11 for now.
2020-03-30 18:14:43 +00:00
jfreegman
98cb7f58c0
Fix unused parameter and unused result warnings 2020-03-15 14:57:00 -04:00
iphydf
45ff6d8bac
Migrate to Camel_Case enum types.
UPPER_CASE enum types are deprecated and will be removed in 0.3.0.
2020-03-07 18:11:41 +00:00
jfreegman
437dd8baeb
Some misc fixes 2020-02-29 14:14:56 -05:00
jfreegman
b080236ee5
Fix typo 2020-02-10 17:16:56 -05:00
jfreegman
116bff8cef
format fixes 2019-12-07 23:17:02 -05:00
Rodrigo Martins
ddeca171a0
Add input line text to history on UP and DOWN 2019-12-07 18:29:33 -03:00
jfreegman
127f9462e0
make friend add fail if friend is in the block list 2019-11-16 01:55:47 -05:00
jfreegman
4b5a9abbd4
Fix A/V bug preventing the caller from being properly informed of call termination 2019-07-12 11:51:08 -04:00
JFreegman
bb2257973e
Load conference titles on startup for saved conferences (#43) 2019-06-30 14:51:13 -04:00
jfreegman
12b9cd2386
Fix header issues 2019-03-27 01:38:15 -04:00
jfreegman
2cbe8fa880
Use correct integer types to fix groupchat peer scrolling bug 2019-03-26 23:05:24 -04:00
jfreegman
05eda76643
Partially fix autocomplete behaviour for input with spaces 2019-02-17 17:25:34 -05:00
Rob Levitsky
f7b73af9a7
Add config option for the notification timeout duration 2018-11-10 08:54:59 -05:00
jfreegman
73aaa44d12
Add config option to set data file auto-save frequency 2018-10-30 18:22:30 -04:00
jfreegman
9e3d4f3889
Check if pointer is null before accessing 2018-10-28 07:09:37 -04:00
jfreegman
b7d67c1d86
re-init AV for unblocked contacts 2018-10-20 02:56:37 -04:00
jfreegman
c4a11f8dc7
Refactor ToxWindows
ToxWindow constructor functions now return pointers instead of structs
ToxWindow windows array now holds pointers instead of structs
Refactor some logic in windows.c pertaining to keeping track of active windows
Use uint8_t for window array indexing
2018-10-19 17:43:06 -04:00
jfreegman
d18cc8cbc2
Fix two memory leaks and properly clean up friendlist window 2018-10-19 17:43:03 -04:00
jfreegman
ce6d4861fb
Fix bug where autocomplete added a forward slash to files with no extension
Also slightly refactored the line complete functions
2018-10-17 18:00:09 -04:00
jfreegman
8f0e6026f0
Add enum for file_type() and a little cleanup 2018-10-17 18:00:08 -04:00
jfreegman
258736995d
Remove ability to set note with status command 2018-10-17 18:00:08 -04:00
jfreegman
56e03a3f8b
No longer require quotes to enclose paths 2018-10-17 18:00:08 -04:00
jfreegman
b6c746b5f5
No longer require quotes for commands that take strings as arguments 2018-10-17 18:00:07 -04:00
jfreegman
0fea930c24
Convert deprecated uppercase enums to camelcase 2018-10-10 13:34:17 -04:00
jfreegman
94d22a8853
Allow empty status messages 2018-10-09 18:21:05 -04:00
jfreegman
63cc23401a
Improve readability of defines 2018-10-08 13:39:04 -04:00
Leonid Bobrov
f90a774470
Make Toxic easier to port 2018-10-03 22:00:43 +00:00
jfreegman
e7c5fbc873
Cleanup xtra.c
Privatise some functions that don't need to be public
Fix struct names starting with _ char
Remove unnecessary memset of Xtra struct in init_xtra()
2018-09-27 03:41:58 -04:00
iphydf
d62902ffb3
Use (void) in prototypes instead of ().
Also, removed `__inline` from an extern function (why was it there?).
Also, moved one extern declaration to a header file. There are lots of
these that need to be moved, but one thing at a time.
2018-09-13 23:47:47 +00:00
iphydf
bebff3be0e
Use (void) for empty parameter list in C. 2018-09-08 17:23:07 +00:00
iphydf
20b5e46850
Rename callback implementations to be of the form on_$event.
So it's easy to map from implementation to the event without looking at
the `tox_callback_*` calls.
2018-07-18 17:06:28 +00:00
iphydf
f2b796940e
Add missing braces to if/for/while blocks.
Astyle doesn't quite catch all of them.
2018-07-18 15:56:21 +00:00
jfreegman
a37bf300f9
Update astylerc to match toxcore & reformat all source files 2018-07-18 11:33:16 -04:00
iphydf
3cd2bc7e3c
Don't compile A/V code if AUDIO/VIDEO are not #defined. 2018-07-06 15:46:12 +00:00
iphydf
685837357b
Add bazel build file for toxic. 2018-07-06 14:41:16 +00:00
François-Xavier Carton
46f646afcf Add an option to disable qr codes 2018-06-16 05:07:16 +02:00
jfreegman
68ce17a57f
Temp fix for nick change spam on group join 2018-04-19 22:23:49 -04:00
jfreegman
a69fad15c1
Use default timestamp format if provided one is invalid 2018-04-10 17:47:21 -04:00
jfreegman
815c29ee31
Significantly reduce time before trying to re-send a message with no read receipt
(also some formatting cleanup)
2018-03-03 23:54:12 -05:00
jfreegman
a223329815
Fix persistent groupchat loading 2018-02-27 18:46:56 -05:00
jfreegman
221edb0012
add a .travis file and some build fixes 2018-02-26 02:34:38 -05:00
jfreegman
2710ab6034
Re-implement group nick change notifications 2018-02-25 03:43:19 -05:00
jfreegman
bc3ffac0ba
re-add group peer list sorting 2018-02-25 01:21:22 -05:00
jfreegman
29f55c5277
Update API
-Removed usage of deprecated API functions
-Integrated conference changes with a few regressions
2018-02-25 00:00:06 -05:00
jfreegman
a290f0f7f8
Update toxav API calls 2018-02-24 15:38:07 -05:00
jfreegman
5cd196a769
Fix autocomplete bug
Formatting was messed up due to not accounting for null byte in directory list
2018-02-20 20:54:26 -05:00
iphydf
51f1daeec8
Treat Tox_Options as opaque struct: no deref, no alloc.
We allocate it inside toxcore and dereference it inside as well. This
allows us to change the layout of that struct and add new members.
2018-01-20 19:51:13 +00:00
iphydf
b9f9546e2b
Fix typedef enums and potential uninitialised value. 2018-01-20 18:30:35 +00:00
jfreegman
846bc4613e
Fix comment 2017-11-20 07:07:24 -05:00
jfreegman
fe6a7074ea
Dynamically allocate audio calls structure
This fixes a bug that caused a segfault when attempting to call a friend with a
friend number above the MAX_CALLS limit
2017-11-20 07:02:56 -05:00
Mateusz Poszwa
0bd5b4ddee Repair operating system checks (#474) 2017-11-16 16:59:51 -05:00