aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-07-18 03:12:05 +0200
committerfiaxh <git@lightrise.org>2019-07-18 03:20:40 +0200
commit1853ee8b4fccefa15485c77119409dd6547586d1 (patch)
tree3c94e0eba95274b3dc99079ebf98adc464fa0da6 /libdino
parentf0abb8aaf9d06106235ca5e0e6b3ca2e425c4422 (diff)
downloaddino-1853ee8b4fccefa15485c77119409dd6547586d1.tar.gz
dino-1853ee8b4fccefa15485c77119409dd6547586d1.zip
Fix compilation with older valac versions
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/service/jingle_file_transfers.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/libdino/src/service/jingle_file_transfers.vala b/libdino/src/service/jingle_file_transfers.vala
index c90986d2..95c3266f 100644
--- a/libdino/src/service/jingle_file_transfers.vala
+++ b/libdino/src/service/jingle_file_transfers.vala
@@ -82,7 +82,10 @@ public class JingleFileSender : FileSender, Object {
XmppStream? stream = stream_interactor.get_stream(conversation.account);
if (stream == null) return false;
- foreach (Jid full_jid in stream.get_flag(Presence.Flag.IDENTITY).get_resources(conversation.counterpart)) {
+ Gee.List<Jid>? resources = stream.get_flag(Presence.Flag.IDENTITY).get_resources(conversation.counterpart);
+ if (resources == null) return false;
+
+ foreach (Jid full_jid in resources) {
if (stream.get_module(Xep.JingleFileTransfer.Module.IDENTITY).is_available(stream, full_jid)) {
return true;
}
@@ -91,6 +94,8 @@ public class JingleFileSender : FileSender, Object {
}
public bool can_send(Conversation conversation, FileTransfer file_transfer) {
+ if (conversation.encryption != Encryption.NONE) return false;
+
XmppStream? stream = stream_interactor.get_stream(file_transfer.account);
if (stream == null) return false;