The source project of this merge request has been removed.
Remove payload keys when no payload exists
Summary
qobject2qvariant
always adds payloadSize
and payloadTransferInfo
keys to a NetworkPacket
, because payloadSize
and payloadTransferInfo
are properties of NetworkPacket
.
Why are the changes needed:
- GSConnect has a bug, because it checks only on the existence of
payloadTransferInfo
key: https://github.com/andyholmes/gnome-shell-extension-gsconnect/pull/745 . This is probably not the last related bug. - The logic is confusing. I first thought that the payload related keys are only added when a payload exists.
Test Plan
Before:
Add a debug message in KdeConnectPlugin::sendPacket
like qCDebug(coreLogger) << "data:" << np.serialize().constData();
.
Message without a payload will contain "payloadSize":0,"payloadTransferInfo":{}
.
After:
After the change "payloadSize":0,"payloadTransferInfo":{}
will be not part of a message.
/label ~bugfix
Edited by Richard Liebscher