1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-07-03 16:27:46 +02:00

small fix

This commit is contained in:
Jfreegman 2014-08-04 18:04:54 -04:00
parent 64db9f73a2
commit 09fd5cb69f
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -170,7 +170,8 @@ static void send_file_data(ToxWindow *self, Tox *m, int i, int32_t friendnum, in
double remain = (double) tox_file_data_remaining(m, friendnum, filenum, 0);
/* refresh line with percentage complete and transfer speed (must be called once per second) */
if ((self->chatwin != NULL && timed_out(file_senders[i].last_progress, curtime, 1)) || !remain) {
if ( (self->chatwin != NULL && timed_out(file_senders[i].last_progress, curtime, 1))
|| (!remain && !file_senders[i].finished) ) {
file_senders[i].last_progress = curtime;
double pct_done = remain > 0 ? (1 - (remain / file_senders[i].size)) * 100 : 100;
print_progress_bar(self, i, -1, pct_done);