1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 08:36:45 +02:00

Compare commits

..

4 Commits

Author SHA1 Message Date
7ed031b9bf Fix static build script 2022-06-28 10:54:19 -04:00
6ef2c784c5 Fix tab alert bug on peer exit 2022-06-28 17:31:27 +03:00
058057c64d Fix style issues 2022-06-27 19:42:38 -04:00
146b00b8ca Fix chatlog saving with new hide connection msg pr 2022-06-28 01:58:32 +03:00
4 changed files with 32 additions and 13 deletions

View File

@ -114,7 +114,6 @@ apk add \
libsodium-dev \ libsodium-dev \
libsodium-static \ libsodium-static \
linux-headers \ linux-headers \
msgpack-c-dev \
ncurses-dev \ ncurses-dev \
ncurses-static \ ncurses-static \
ncurses-terminfo \ ncurses-terminfo \
@ -137,20 +136,27 @@ mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR" cd "$BUILD_DIR"
# The git hash of the c-toxcore version we're using # The git hash of the c-toxcore version we're using
TOXCORE_VERSION="v0.2.16" TOXCORE_VERSION="02996f06850fb565fa5520cb4e1daa8c616b41c1"
# The sha256sum of the c-toxcore tarball for TOXCORE_VERSION TOXCORE_FILENAME="toxcore-$TOXCORE_VERSION.tar.gz"
TOXCORE_HASH="653aa42654b607f0940cecfac873e9ce55605119a90d1dc454d1090ff6ca29c0"
TOXCORE_FILENAME="c-toxcore-$TOXCORE_VERSION.tar.gz" wget --timeout=10 -O "$TOXCORE_FILENAME" "https://github.com/JFreegman/toxcore/archive/$TOXCORE_VERSION.tar.gz"
wget --timeout=10 -O "$TOXCORE_FILENAME" "https://github.com/TokTok/c-toxcore/archive/$TOXCORE_VERSION.tar.gz"
check_sha256 "$TOXCORE_HASH" "$TOXCORE_FILENAME"
tar -o -xf "$TOXCORE_FILENAME" tar -o -xf "$TOXCORE_FILENAME"
rm "$TOXCORE_FILENAME" rm "$TOXCORE_FILENAME"
cd c-toxcore*
cd toxcore*
mkdir -p "third_party" && cd "third_party"
CMP_VERSION="074e0df43e8a61ea938c4f77f65d1fbccc0c3bf9"
CMP_FILENAME="cmp-$CMP_VERSION.tar.gz"
wget --timeout=10 -O "$CMP_FILENAME" "https://github.com/TokTok/cmp/archive/$CMP_VERSION.tar.gz"
tar -o -xf "$CMP_FILENAME"
mv cmp\-*/* "cmp/"
cd ..
cmake -B_build -H. \ cmake -B_build -H. \
-DUSE_TEST_NETWORK=ON \
-DENABLE_STATIC=ON \ -DENABLE_STATIC=ON \
-DENABLE_SHARED=OFF \ -DENABLE_SHARED=OFF \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \

View File

@ -601,6 +601,7 @@ int load_DHT_nodeslist(void)
Nodes.count = 2; Nodes.count = 2;
#if 0 #if 0
if (thread_data.active) { if (thread_data.active) {
return -1; return -1;
} }
@ -623,6 +624,7 @@ int load_DHT_nodeslist(void)
thread_data.active = false; thread_data.active = false;
return -5; return -5;
} }
#endif #endif
return 0; return 0;

View File

@ -991,7 +991,9 @@ static void groupchat_onGroupPeerJoin(ToxWindow *self, Tox *m, uint32_t groupnum
++chat->max_idx; ++chat->max_idx;
} }
if (timed_out(chat->time_connected, 60) && user_settings->show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON) { /* ignore join messages when we first connect to the group */ if (timed_out(chat->time_connected, 60)
&& user_settings->show_group_connection_msg ==
SHOW_GROUP_CONNECTION_MSG_ON) { /* ignore join messages when we first connect to the group */
line_info_add(self, true, peer->name, NULL, CONNECTION, 0, GREEN, "has joined the room"); line_info_add(self, true, peer->name, NULL, CONNECTION, 0, GREEN, "has joined the room");
write_to_log("has joined the room", peer->name, self->chatwin->log, true); write_to_log("has joined the room", peer->name, self->chatwin->log, true);
@ -1027,16 +1029,18 @@ void groupchat_onGroupPeerExit(ToxWindow *self, Tox *m, uint32_t groupnumber, ui
if (length > 0) { if (length > 0) {
line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[Quit]: %s", part_message); line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[Quit]: %s", part_message);
snprintf(log_str, sizeof(log_str), "has left the room (%s)", part_message); snprintf(log_str, sizeof(log_str), "has left the room (%s)", part_message);
write_to_log(log_str, name, self->chatwin->log, true);
sound_notify(self, silent, NT_WNDALERT_2, NULL);
} else if (user_settings->show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON) { } else if (user_settings->show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON) {
const char *exit_string = get_group_exit_string(exit_type); const char *exit_string = get_group_exit_string(exit_type);
line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[%s]", exit_string); line_info_add(self, true, name, NULL, DISCONNECTION, 0, RED, "[%s]", exit_string);
snprintf(log_str, sizeof(log_str), "[%s]", exit_string); snprintf(log_str, sizeof(log_str), "[%s]", exit_string);
}
write_to_log(log_str, name, self->chatwin->log, true); write_to_log(log_str, name, self->chatwin->log, true);
sound_notify(self, silent, NT_WNDALERT_2, NULL); sound_notify(self, silent, NT_WNDALERT_2, NULL);
} }
}
int peer_index = get_peer_index(groupnumber, peer_id); int peer_index = get_peer_index(groupnumber, peer_id);
if (peer_index < 0) { if (peer_index < 0) {

View File

@ -269,13 +269,20 @@ void cb_toxcore_logger(Tox *m, TOX_LOG_LEVEL level, const char *file, uint32_t l
} }
struct timeval tv; struct timeval tv;
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
struct tm tmp; struct tm tmp;
gmtime_r(&tv.tv_sec, &tmp); gmtime_r(&tv.tv_sec, &tmp);
char timestamp[200]; char timestamp[200];
strftime(timestamp, sizeof(timestamp), "%F %T", &tmp); strftime(timestamp, sizeof(timestamp), "%F %T", &tmp);
fprintf(fp, "%c %s.%06ld %s:%u(%s) - %s\n", tox_log_level_show(level)[0], timestamp, tv.tv_usec, file, line, func, message); fprintf(fp, "%c %s.%06ld %s:%u(%s) - %s\n", tox_log_level_show(level)[0], timestamp, tv.tv_usec, file, line, func,
message);
fflush(fp); fflush(fp);
} }