aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service
diff options
context:
space:
mode:
Diffstat (limited to 'libdino/src/service')
-rw-r--r--libdino/src/service/entity_capabilities_storage.vala2
-rw-r--r--libdino/src/service/message_processor.vala16
2 files changed, 8 insertions, 10 deletions
diff --git a/libdino/src/service/entity_capabilities_storage.vala b/libdino/src/service/entity_capabilities_storage.vala
index b1f5405b..12b5d022 100644
--- a/libdino/src/service/entity_capabilities_storage.vala
+++ b/libdino/src/service/entity_capabilities_storage.vala
@@ -16,6 +16,8 @@ public class EntityCapabilitiesStorage : Xep.EntityCapabilities.Storage, Object
}
public void store_features(string entity, Gee.List<string> features) {
+ if (features_cache.contains(entity)) return;
+
foreach (string feature in features) {
db.entity_feature.insert()
.value(db.entity_feature.entity, entity)
diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala
index 6bc4fc9e..266482ac 100644
--- a/libdino/src/service/message_processor.vala
+++ b/libdino/src/service/message_processor.vala
@@ -386,24 +386,20 @@ public class MessageProcessor : StreamInteractionModule, Object {
return Entities.Message.Type.GROUPCHAT_PM;
}
} else {
- SourceFunc callback = determine_message_type.callback;
XmppStream stream = stream_interactor.get_stream(account);
- if (stream != null) stream.get_module(Xep.ServiceDiscovery.Module.IDENTITY).get_entity_categories(stream, message.counterpart.bare_jid, (stream, identities) => {
+ if (stream != null) {
+ Gee.Set<Xep.ServiceDiscovery.Identity>? identities = yield stream.get_module(Xep.ServiceDiscovery.Module.IDENTITY).get_entity_identities(stream, message.counterpart.bare_jid);
if (identities == null) {
- message.type_ = Entities.Message.Type.CHAT;
- Idle.add((owned) callback);
- return;
+ return Entities.Message.Type.CHAT;
}
foreach (Xep.ServiceDiscovery.Identity identity in identities) {
if (identity.category == Xep.ServiceDiscovery.Identity.CATEGORY_CONFERENCE) {
- message.type_ = Entities.Message.Type.GROUPCHAT_PM;
+ return Entities.Message.Type.GROUPCHAT_PM;
} else {
- message.type_ = Entities.Message.Type.CHAT;
+ return Entities.Message.Type.CHAT;
}
}
- Idle.add((owned) callback);
- });
- yield;
+ }
}
}
return Entities.Message.Type.CHAT;