This commit is contained in:
emdee@spm.plastiras.org 2024-03-08 04:02:20 +00:00
parent d200a55938
commit 3a3d8ab5e4
3 changed files with 56 additions and 10 deletions

View File

@ -3,11 +3,11 @@ Tox-WeeChat is a [Tox][1] protocol plugin for [WeeChat][2]. It is functional,
but lacks certain features that might be expected of a full-fledged Tox client. but lacks certain features that might be expected of a full-fledged Tox client.
Originally from the abandonned https://github.com/haavard/tox-weechat Originally from the abandonned https://github.com/haavard/tox-weechat
Tox-WeeChat is compliant with all "Required" points in the [Tox Client Tox-WeeChat is compliant with all "Required" points in the
Standard][3]. [Tox Client Standard][3]. There is no support for NGC groups.
## Features ## Features
- One-to-one chats - One-to-one chats
- Conference chats (text only) - Conference chats (text only)
- Proxy support - Proxy support
@ -16,7 +16,8 @@ Standard][3].
- File transfer - File transfer
## Installation ## Installation
Tox-WeeChat requires [WeeChat][2] (tested with version 2.3) and [TokTok
Tox-WeeChat requires [WeeChat][2] (tested with version 4.1.2) and [TokTok
c-toxcore][4] (tested with version 0.2.18). CMake 2.8.12 or newer is also c-toxcore][4] (tested with version 0.2.18). CMake 2.8.12 or newer is also
required to build. required to build.
@ -41,12 +42,15 @@ an example.
- Create a new profile with `/tox create <profile name>`. The data file is - Create a new profile with `/tox create <profile name>`. The data file is
stored in `~/.cache/weechat/tox/` by default. stored in `~/.cache/weechat/tox/` by default.
- Load your profile and connect to the Tox network with - Load your profile and connect to the Tox network with
`/tox load <profile name>`. `/tox load <profile name>` (see also /bootstrap, /conf, /friend, /invite,
/me, /msg, /myid, /name, /names, /nospam, /part, /send,
/status, /statusmsg, /topic, /tox).
- Run `/help -listfull tox` to get a list of all available commands, and - Run `/help -listfull tox` to get a list of all available commands, and
`/set tox.*` for a list of options, including proxies. `/set tox.*` for a list of options, including proxies.
### Common issues ### Common issues
#### Long Tox names messing up WeeChat layout #### Long Tox names messing up WeeChat layout
Tox allows names up to 128 bytes long. To prevent long names from taking all Tox allows names up to 128 bytes long. To prevent long names from taking all
your screen space, you can set the following options in WeeChat: your screen space, you can set the following options in WeeChat:
- `weechat.bar.nicklist.size_max` - `weechat.bar.nicklist.size_max`
@ -54,8 +58,10 @@ your screen space, you can set the following options in WeeChat:
- `buffers.look.name_size_max` (if using buffers.pl) - `buffers.look.name_size_max` (if using buffers.pl)
#### Tox won't connect through my proxy #### Tox won't connect through my proxy
Make sure the proxy type, address and port is correct, and that UDP is Make sure the proxy type, address and port is correct, and that UDP is
disabled (`/set tox.profile.*.udp`) and probably IPv6. disabled (`/set tox.profile.*.udp`) and it is required to disable IPv6
(`/set tox.profile.*.ipv6`).
## License ## License
Copyright (c) 2018 Håvard Pettersson <mail@haavard.me> Copyright (c) 2018 Håvard Pettersson <mail@haavard.me>
@ -83,4 +89,6 @@ along with Tox-WeeChat. If not, see <http://www.gnu.org/licenses/>.
--- ---
This is a hard fork of https://github.com/haavard/tox-weechat/ This is a hard fork of https://github.com/haavard/tox-weechat/
now at https://git.macaw.me/emdee/tox-weechat now at https://git.macaw.me/emdee/tox-weechat You can also run weechat under
toxygen https://git.macaw.me/emdee/toxygen using qweechat
https://git.macaw.me/emdee/qweechat

View File

@ -231,6 +231,16 @@ twc_cmd_bootstrap(const void *pointer, void *data, struct t_gui_buffer *buffer,
} else if (argc > 2 && strlen(argv[2]) > 0) { } else if (argc > 2 && strlen(argv[2]) > 0) {
if (weechat_strcasecmp(argv[2], "0") == 0) { if (weechat_strcasecmp(argv[2], "0") == 0) {
TOX_CONNECTION status; TOX_CONNECTION status;
if (!(profile)) {
weechat_printf(profile->buffer, "%sInvalid profile.",
weechat_prefix("error"));
return WEECHAT_RC_OK;
}
if (!(profile->tox)) {
weechat_printf(profile->buffer, "%sInvalid tox in profile.",
weechat_prefix("error"));
return WEECHAT_RC_OK;
}
status = tox_self_get_connection_status(profile->tox); status = tox_self_get_connection_status(profile->tox);
if ( status == TOX_CONNECTION_NONE) { if ( status == TOX_CONNECTION_NONE) {
weechat_printf(profile->buffer, weechat_printf(profile->buffer,
@ -285,6 +295,18 @@ twc_cmd_bootstrap(const void *pointer, void *data, struct t_gui_buffer *buffer,
} else if (argc > 2 && strlen(argv[2]) > 0) { } else if (argc > 2 && strlen(argv[2]) > 0) {
if (weechat_strcasecmp(argv[2], "0") == 0) { if (weechat_strcasecmp(argv[2], "0") == 0) {
TOX_CONNECTION status; TOX_CONNECTION status;
if (!(profile)) {
weechat_printf(profile->buffer,
"%sNo profile.",
weechat_prefix("network"));
return WEECHAT_RC_OK;
}
if (!(profile->tox)) {
weechat_printf(profile->buffer,
"%sNo tox in profile.",
weechat_prefix("network"));
return WEECHAT_RC_OK;
}
status = tox_self_get_connection_status(profile->tox); status = tox_self_get_connection_status(profile->tox);
if ( status == TOX_CONNECTION_NONE) { if ( status == TOX_CONNECTION_NONE) {
weechat_printf(profile->buffer, weechat_printf(profile->buffer,
@ -557,8 +579,19 @@ twc_cmd_friend(const void *pointer, void *data, struct t_gui_buffer *buffer,
{ {
char *endptr; char *endptr;
unsigned long num = strtoul(argv[2], &endptr, 10); unsigned long num = strtoul(argv[2], &endptr, 10);
if (endptr == argv[2] || if (endptr == argv[2])
(request = twc_friend_request_with_index(profile, num)) == NULL) {
weechat_printf(profile->buffer, "%sInvalid friend request ID.",
weechat_prefix("error"));
return WEECHAT_RC_OK;
}
if (!(profile))
{
weechat_printf(profile->buffer, "%sInvalid profile.",
weechat_prefix("error"));
return WEECHAT_RC_OK;
}
if ((request = twc_friend_request_with_index(profile, num)) == NULL)
{ {
weechat_printf(profile->buffer, "%sInvalid friend request ID.", weechat_printf(profile->buffer, "%sInvalid friend request ID.",
weechat_prefix("error")); weechat_prefix("error"));

View File

@ -796,12 +796,17 @@ twc_tox_log_callback(Tox *tox, TOX_LOG_LEVEL level, const char *file,
{ {
case TOX_LOG_LEVEL_TRACE: case TOX_LOG_LEVEL_TRACE:
color = weechat_color("gray"); color = weechat_color("gray");
if (weechat_strcasecmp(file, "network.c") == 0)
return;
if (weechat_strcasecmp(file, "onion_client.c") == 0 &&
weechat_strcasecmp(file, "onion_isconnected") != 0)
return;
break; break;
case TOX_LOG_LEVEL_DEBUG: case TOX_LOG_LEVEL_DEBUG:
color = weechat_color("white"); color = weechat_color("white");
break; break;
case TOX_LOG_LEVEL_INFO: case TOX_LOG_LEVEL_INFO:
color = weechat_color("lightblue"); color = weechat_color("lightgreen");
break; break;
case TOX_LOG_LEVEL_WARNING: case TOX_LOG_LEVEL_WARNING:
color = weechat_color("yellow"); color = weechat_color("yellow");