aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-07-08 15:03:48 +0200
committerfiaxh <git@lightrise.org>2019-07-08 18:46:30 +0200
commit6c480b862eefc38b2d3ba8dc7e02ddbe8d13edee (patch)
treeeb5c33f5198fb5a0d87d9730dc03f227ee7c7666 /plugins
parent06db4d0aa672b234d3336318c8a629b90488be6a (diff)
downloaddino-6c480b862eefc38b2d3ba8dc7e02ddbe8d13edee.tar.gz
dino-6c480b862eefc38b2d3ba8dc7e02ddbe8d13edee.zip
OMEMO: Add debug logs for incoming bundles
Diffstat (limited to 'plugins')
-rw-r--r--plugins/omemo/src/protocol/stream_module.vala10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/omemo/src/protocol/stream_module.vala b/plugins/omemo/src/protocol/stream_module.vala
index 9d78dde5..0e4e962d 100644
--- a/plugins/omemo/src/protocol/stream_module.vala
+++ b/plugins/omemo/src/protocol/stream_module.vala
@@ -32,8 +32,7 @@ public class StreamModule : XmppStreamModule {
stream.get_module(Pubsub.Module.IDENTITY).add_filtered_notification(stream, NODE_DEVICELIST, (stream, jid, id, node) => on_devicelist(stream, jid, id, node));
}
- public override void detach(XmppStream stream) {
- }
+ public override void detach(XmppStream stream) {}
public void request_user_devicelist(XmppStream stream, Jid jid) {
if (active_devicelist_requests.add(jid)) {
@@ -55,7 +54,7 @@ public class StreamModule : XmppStreamModule {
}
}
if (!am_on_devicelist) {
- debug(@"Not on device list, adding id");
+ debug("Not on device list, adding id");
node.put_node(new StanzaNode.build("device", NS_URI).put_attribute("id", store.local_registration_id.to_string()));
stream.get_module(Pubsub.Module.IDENTITY).publish(stream, jid, NODE_DEVICELIST, NODE_DEVICELIST, id, node);
}
@@ -89,7 +88,7 @@ public class StreamModule : XmppStreamModule {
public void fetch_bundle(XmppStream stream, Jid jid, int device_id) {
if (active_bundle_requests.add(jid.bare_jid.to_string() + @":$device_id")) {
- debug(@"Asking for bundle from %s: %i", jid.bare_jid.to_string(), device_id);
+ debug("Asking for bundle from %s: %i", jid.bare_jid.to_string(), device_id);
stream.get_module(Pubsub.Module.IDENTITY).request(stream, jid.bare_jid, @"$NODE_BUNDLES:$device_id", (stream, jid, id, node) => {
on_other_bundle_result(stream, jid, device_id, id, node);
});
@@ -116,6 +115,7 @@ public class StreamModule : XmppStreamModule {
private void on_other_bundle_result(XmppStream stream, Jid jid, int device_id, string? id, StanzaNode? node) {
if (node == null) {
// Device not registered, shouldn't exist
+ debug("Ignoring device %s (%i): No bundle", jid.bare_jid.to_string(), device_id);
stream.get_module(IDENTITY).ignore_device(jid, device_id);
} else {
Bundle bundle = new Bundle(node);
@@ -149,12 +149,14 @@ public class StreamModule : XmppStreamModule {
SessionBuilder builder = store.create_session_builder(address);
builder.process_pre_key_bundle(create_pre_key_bundle(device_id, device_id, pre_key_id, pre_key, signed_pre_key_id, signed_pre_key, signed_pre_key_signature, identity_key));
} catch (Error e) {
+ debug("Can't create session with %s (%i): %s", jid.bare_jid.to_string(), device_id, e.message);
fail = true;
}
address.device_id = 0; // TODO: Hack to have address obj live longer
}
}
if (fail) {
+ debug("Ignoring device %s (%i): Bad bundle: %s", jid.bare_jid.to_string(), device_id, bundle.node.to_string());
stream.get_module(IDENTITY).ignore_device(jid, device_id);
}
return true;