mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 06:33:02 +01:00
fix file statusbar draw bug
This commit is contained in:
parent
4acfe84171
commit
5a175f374a
@ -448,7 +448,7 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, int32_t num, uint8_t rec
|
|||||||
|
|
||||||
switch (control_type) {
|
switch (control_type) {
|
||||||
case TOX_FILECONTROL_ACCEPT:
|
case TOX_FILECONTROL_ACCEPT:
|
||||||
if (receive_send == 1) {
|
if (receive_send == 1 && file_senders[send_idx].last_progress == 0) {
|
||||||
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer [%d] for '%s' accepted.",
|
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "File transfer [%d] for '%s' accepted.",
|
||||||
filenum, filename);
|
filenum, filename);
|
||||||
/* prep progress bar line */
|
/* prep progress bar line */
|
||||||
@ -515,7 +515,7 @@ static void chat_onFileControl(ToxWindow *self, Tox *m, int32_t num, uint8_t rec
|
|||||||
memcpy(&datapos, tmp, sizeof(uint64_t));
|
memcpy(&datapos, tmp, sizeof(uint64_t));
|
||||||
|
|
||||||
if (fseek(fp, datapos, SEEK_SET) == -1) {
|
if (fseek(fp, datapos, SEEK_SET) == -1) {
|
||||||
snprintf(msg, sizeof(msg), "File transfer for '%s' failed.", filename);
|
snprintf(msg, sizeof(msg), "File transfer for '%s' failed to resume", filename);
|
||||||
close_file_sender(self, m, send_idx, NULL, TOX_FILECONTROL_FINISHED, filenum, num);
|
close_file_sender(self, m, send_idx, NULL, TOX_FILECONTROL_FINISHED, filenum, num);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,6 @@ void do_file_senders(Tox *m)
|
|||||||
char msg[MAX_STR_SIZE];
|
char msg[MAX_STR_SIZE];
|
||||||
snprintf(msg, sizeof(msg), "File transfer for '%s' timed out.", filename);
|
snprintf(msg, sizeof(msg), "File transfer for '%s' timed out.", filename);
|
||||||
close_file_sender(self, m, i, msg, TOX_FILECONTROL_KILL, filenum, friendnum);
|
close_file_sender(self, m, i, msg, TOX_FILECONTROL_KILL, filenum, friendnum);
|
||||||
sound_notify(self, error, NT_NOFOCUS | NT_WNDALERT_2, NULL);
|
|
||||||
|
|
||||||
if (self->active_box != -1)
|
if (self->active_box != -1)
|
||||||
box_notify2(self, error, NT_NOFOCUS | NT_WNDALERT_2, self->active_box, "%s", msg);
|
box_notify2(self, error, NT_NOFOCUS | NT_WNDALERT_2, self->active_box, "%s", msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user