fix(xep): Fix the OOB fallback for SFS

This commit is contained in:
PapaTutuWawa 2023-06-09 00:07:18 +02:00
parent 925a46c0da
commit 88545e3308

View File

@ -151,14 +151,17 @@ class SFSManager extends XmppManagerBase {
// TODO(Unknown): Consider all sources?
final source = data.sources.first;
OOBData? oob;
MessageBodyData? body;
if (source is StatelessFileSharingUrlSource && data.includeOOBFallback) {
// SFS recommends OOB as a fallback
oob = OOBData(source.url, null);
body = MessageBodyData(source.url);
}
return [
data.toXML(),
if (oob != null) oob.toXML(),
if (body != null) body.toXML(),
];
}