diff options
author | fiaxh <git@mx.ax.lt> | 2017-06-13 18:14:59 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-06-13 20:12:40 +0200 |
commit | 7bbbb738fdb233f4ad91ffdd7d9247b28849d715 (patch) | |
tree | 649ac26e3feef6bae614442a7f3d6ee1057336e0 /libdino/src/service/message_processor.vala | |
parent | dabc2a8b1d2a7bf2019e5f913c736d80f11ceb53 (diff) | |
download | dino-7bbbb738fdb233f4ad91ffdd7d9247b28849d715.tar.gz dino-7bbbb738fdb233f4ad91ffdd7d9247b28849d715.zip |
Get rid of manual storage objects for delegates
Diffstat (limited to 'libdino/src/service/message_processor.vala')
-rw-r--r-- | libdino/src/service/message_processor.vala | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala index ccaec915..390199d5 100644 --- a/libdino/src/service/message_processor.vala +++ b/libdino/src/service/message_processor.vala @@ -118,23 +118,21 @@ public class MessageProcessor : StreamInteractionModule, Object { } } else { Core.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.to_string(), (stream, identities, store) => { - Triple<MessageProcessor, Entities.Message, Xmpp.Message.Stanza> triple = store as Triple<MessageProcessor, Entities.Message, Xmpp.Message.Stanza>; - Entities.Message m = triple.b; + if (stream != null) stream.get_module(Xep.ServiceDiscovery.Module.IDENTITY).get_entity_categories(stream, message.counterpart.bare_jid.to_string(), (stream, identities) => { if (identities == null) { - m.type_ = Entities.Message.Type.CHAT; - triple.a.process_message(m, triple.c); + message.type_ = Entities.Message.Type.CHAT; + process_message(message, message_stanza); return; } foreach (Xep.ServiceDiscovery.Identity identity in identities) { if (identity.category == Xep.ServiceDiscovery.Identity.CATEGORY_CONFERENCE) { - m.type_ = Entities.Message.Type.GROUPCHAT_PM; + message.type_ = Entities.Message.Type.GROUPCHAT_PM; } else { - m.type_ = Entities.Message.Type.CHAT; + message.type_ = Entities.Message.Type.CHAT; } - triple.a.process_message(m, triple.c); + process_message(message, message_stanza); } - }, Triple.create(this, message, message_stanza)); + }); } } } @@ -185,4 +183,4 @@ public class MessageProcessor : StreamInteractionModule, Object { } } -}
\ No newline at end of file +} |