aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/xep/0085_chat_state_notifications.vala')
-rw-r--r--xmpp-vala/src/module/xep/0085_chat_state_notifications.vala18
1 files changed, 7 insertions, 11 deletions
diff --git a/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala b/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala
index 3e92cd44..6dbbb6f6 100644
--- a/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala
+++ b/xmpp-vala/src/module/xep/0085_chat_state_notifications.vala
@@ -27,27 +27,23 @@ public class Module : XmppStreamModule {
message.to = jid;
message.type_ = Message.Stanza.TYPE_CHAT;
message.stanza.put_node(new StanzaNode.build(state, NS_URI).add_self_xmlns());
- Message.Module.get_module(stream).send_message(stream, message);
+ stream.get_module(Message.Module.IDENTITY).send_message(stream, message);
}
public override void attach(XmppStream stream) {
ServiceDiscovery.Module.require(stream);
- ServiceDiscovery.Module.get_module(stream).add_feature(stream, NS_URI);
- Message.Module.get_module(stream).pre_send_message.connect(on_pre_send_message);
- Message.Module.get_module(stream).received_message.connect(on_received_message);
+ stream.get_module(ServiceDiscovery.Module.IDENTITY).add_feature(stream, NS_URI);
+ stream.get_module(Message.Module.IDENTITY).pre_send_message.connect(on_pre_send_message);
+ stream.get_module(Message.Module.IDENTITY).received_message.connect(on_received_message);
}
public override void detach(XmppStream stream) {
- Message.Module.get_module(stream).pre_send_message.disconnect(on_pre_send_message);
- Message.Module.get_module(stream).received_message.disconnect(on_received_message);
- }
-
- public static Module? get_module(XmppStream stream) {
- return (Module?) stream.get_module(IDENTITY);
+ stream.get_module(Message.Module.IDENTITY).pre_send_message.disconnect(on_pre_send_message);
+ stream.get_module(Message.Module.IDENTITY).received_message.disconnect(on_received_message);
}
public static void require(XmppStream stream) {
- if (get_module(stream) == null) stream.add_module(new Module()); ;
+ if (stream.get_module(IDENTITY) == null) stream.add_module(new Module()); ;
}
public override string get_ns() { return NS_URI; }