mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Signal broken file transfers
This commit is contained in:
parent
c6e60c4c77
commit
cdb2bad7c3
|
@ -484,6 +484,7 @@ void Core::onConnectionStatusChanged(Tox*/* tox*/, uint32_t friendId, TOX_CONNEC
|
|||
emit static_cast<Core*>(core)->friendStatusChanged(friendId, friendStatus);
|
||||
if (friendStatus == Status::Offline)
|
||||
static_cast<Core*>(core)->checkLastOnline(friendId);
|
||||
CoreFile::onConnectionStatusChanged(static_cast<Core*>(core), friendId, friendStatus != Status::Offline);
|
||||
}
|
||||
|
||||
void Core::onGroupAction(Tox*, int groupnumber, int peernumber, const uint8_t *action, uint16_t length, void* _core)
|
||||
|
|
|
@ -389,3 +389,15 @@ void CoreFile::onFileRecvChunkCallback(Tox *tox, uint32_t friendId, uint32_t fil
|
|||
if (file->fileKind != TOX_FILE_KIND_AVATAR)
|
||||
emit static_cast<Core*>(core)->fileTransferInfo(*file);
|
||||
}
|
||||
|
||||
void CoreFile::onConnectionStatusChanged(Core* core, uint32_t friendId, bool online)
|
||||
{
|
||||
ToxFile::FileStatus status = online ? ToxFile::TRANSMITTING : ToxFile::BROKEN;
|
||||
for (uint64_t key : fileMap.keys())
|
||||
{
|
||||
if (key>>32 != friendId)
|
||||
continue;
|
||||
fileMap[key].status = status;
|
||||
emit core->fileTransferBrokenUnbroken(fileMap[key], !online);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ private:
|
|||
uint64_t pos, size_t length, void *core);
|
||||
static void onFileRecvChunkCallback(Tox *tox, uint32_t friendId, uint32_t fileId, uint64_t position,
|
||||
const uint8_t *data, size_t length, void *core);
|
||||
static void onConnectionStatusChanged(Core* core, uint32_t friendId, bool online);
|
||||
|
||||
private:
|
||||
static QMutex fileSendMutex;
|
||||
|
|
Loading…
Reference in New Issue
Block a user