Git Product home page Git Product logo

Comments (10)

petermolnar avatar petermolnar commented on May 19, 2024

If I replace the ! in https://github.com/gkdr/carbons/blob/v0.2.0/src/carbons.c#L208, it activates:

if (g_strcmp0(CARBONS_XMLNS, feature_name)) {

instead of

if (!g_strcmp0(CARBONS_XMLNS, feature_name)) {

from carbons.

EionRobb avatar EionRobb commented on May 19, 2024

That's because you've changed it to say "if the feature we're checking is not carbons, then activate carbons"

from carbons.

petermolnar avatar petermolnar commented on May 19, 2024

that's... valid, I misread https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strcmp0 .

The problem stands though, the server supports carbons, it even has it in the discovery list returned, but the plugin doesn't see it.

from carbons.

petermolnar avatar petermolnar commented on May 19, 2024

OK, I added an extra debug line:

purple_debug_info(CARBONS_LOG_CATEGORY, "parsing feature name %s.\n", feature_name);

after L#208, got the following debug log:

(07:36:32) jabber: Recv (ssl)(4095): <iq type='result' from='petermolnar.net' id='purplebdbf98bb' to='[email protected]/4teXdrTO'><query xmlns='http://jabber.org/protocol/disco#info'><identity category='proxy' name='SOCKS5 Bytestreams Service' type='bytestreams'/><identity category='pubsub' name='Prosody' type='pep'/><identity category='store' name='HTTP File Upload' type='file'/><identity category='pubsub' name='Prosody PubSub Service' type='service'/><identity category='server' name='Prosody' type='im'/><feature var='http://jabber.org/protocol/commands'/><feature var='urn:xmpp:time'/><feature var='jabber:iq:time'/><feature var='jabber:iq:roster'/><feature var='jabber:iq:version'/><feature var='msgoffline'/><feature var='http://jabber.org/protocol/bytestreams'/><feature var='jabber:iq:private'/><feature var='http://jabber.org/protocol/pubsub#publish'/><feature var='urn:xmpp:http:upload:0'/><feature var='urn:xmpp:http:upload'/><feature var='urn:xmpp:blocking'/><feature var='http://jabber.org/protocol/pubsub'/><feature var='http://jabber.org/protocol/pubsub#subscribe'/><feature var='http://jabber.org/protocol/pubsub#subscription-options'/><feature var='http://jabber.org/protocol/pubsub#create-nodes'/><feature var='http://jabber.org/protocol/pubsub#purge-nodes'/><feature var='http://jabber.org/protocol/pubsub#delete-items'/><feature var='http://jabber.org/protocol/pubsub#retract-items'/><feature var='http://jabber.org/protocol/pubsub#retrieve-subscriptions'/><feature var='http://jabber.org/protocol/pubsub#publisher-affiliation'/><feature var='http://jabber.org/protocol/pubsub#retrieve-items'/><feature var='http://jabber.org/protocol/pubsub#delete-nodes'/><feature var='http://jabber.org/protocol/pubsub#multi-items'/><feature var='http://jabber.org/protocol/pubsub#access-open'/><feature var='http://jabber.org/protocol/pubsub#member-affiliation'/><feature var='http://jabber.org/protocol/pubsub#modify-affiliations'/><feature var='http://jabber.org/protocol/pubsub#instant-nodes'/><feature var='http://jabber.org/protocol/pubsub#meta-data'/><feature var='http://jabber.org/protocol/pubsub#config-node'/><feature var='http://jabber.org/protocol/pubsub#publish-options'/><feature var='http://jabber.org/protocol/pubsub#item-ids'/><feature var='http://jabber.org/protocol/pubsub#outcast-affiliation'/><feature var='http://jabber.org/protocol/pubsub#retrieve-default'/><feature var='http://jabber.org/protocol/pubsub#create-and-configure'/><feature var='http://jabber.org/protocol/pubsub#persistent-items'/><feature var='urn:xmpp:carbons:2'/><feature var='urn:xmpp:carbons:1'/><feature var='vcard-temp'/><feature var='urn:xmpp:archive:auto'/><feature var='urn:xmpp:archive:manage'/><feature var='urn:xmpp:archive:pref'/><feature var='http://jabber.org/protocol/rsm'/><feature var='jabber:iq:last'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='http://jabber.org/protocol/disco#items'/><feature var='urn:xmpp:ping'/><x type='result' xmlns='jabber:x:data'><field type='hidden' var='FORM_TYPE'><value>http://jabber.org/network/serverinfo</value></field><field type='list-multi' var='abuse-addresses'><value>mailto:[email protected]</value></field><field type='list-multi' var='admin-addresses'><value>mailto:[email protected]</value><value>xmpp:[email protected]</value></field><field type='list-multi' var='feedback-addresses'/><field type='list-multi' var='sales-addresses'/><field type='list-multi' var='security-addresses'><value>mailto:[email protected]</value><value>xmpp:[email protected]</value></field><field type='list-multi' var='support-addresses'><value>mailto:[email protected]</value><value>xmpp:[email protected]</value></field></x><x type='result' xmlns='jabber:x:data'><field type='hidden' var='FORM_TYPE'><value>urn:xmpp:http:upload:0</value></field><field type='text-single' var='max-file-size'><value>1048576</value></field></x><x type='result' xmlns='jabber:x:data'><field type='hidden' var='FORM_TYPE'><value>urn:xmpp:http:upload</value></field><field type='text-single' var='max-file-size'><value>1048576</value></field></x><feature xmlns='u
(07:36:32) carbons: Sent feature discovery request for [email protected]/.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#subscribe.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#subscription-options.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#create-nodes.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#purge-nodes.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#access-presence.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#delete-items.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#presence-notifications.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#last-published.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#retract-items.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#auto-create.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#retrieve-subscriptions.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#multi-items.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#filtered-notifications.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#publisher-affiliation.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#retrieve-items.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#presence-subscribe.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#member-affiliation.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#publish.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#auto-subscribe.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#create-and-configure.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#instant-nodes.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#retrieve-default.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#config-node.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#publish-options.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#item-ids.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#outcast-affiliation.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#meta-data.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#modify-affiliations.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#persistent-items.
(07:36:32) carbons: parsing feature name http://jabber.org/protocol/pubsub#delete-nodes.
(07:36:32) carbons: parsing feature name urn:ietf:params:xml:ns:vcard-4.0.
(07:36:32) carbons: parsing feature name urn:xmpp:mam:2.
(07:36:32) carbons: parsing feature name urn:xmpp:sid:0.
(07:36:32) carbons: parsing feature name urn:xmpp:push:0.
(07:36:32) carbons: Server does not support message carbons, therefore doing nothing for [email protected]/.

It never gets to check the carbons feature from the discovery response.

from carbons.

EionRobb avatar EionRobb commented on May 19, 2024

Oh I see, the for() loop uses feature_node_p = feature_node_p->next instead of feature_node_p = xmlnode_get_next_twin(feature_node_p)

from carbons.

petermolnar avatar petermolnar commented on May 19, 2024

Tried it; didn't make a difference. I looks like it doesn't loop through all the features returned by the discovery.

from carbons.

gkdr avatar gkdr commented on May 19, 2024

If I remember correctly, I used the next pointer instead of the xmlnode_get_next_twin() function for this reason in the first place - it gave me a node somewhere in the middle and I couldn't get to all of them, even on my rather minimal Prosody installation.
It seems I also should not use xmlnode_get_child() for the same reason, as it only worked for me by chance.
The child pointer should definitely give me the first child though, and I can filter them by name.

from carbons.

gkdr avatar gkdr commented on May 19, 2024

After trying it that way I think it might be an issue with the new Prosody version, or how Pidgin handles what Prosody now sends. Because my VM wouldn't boot I reinstalled it and ended up with the newest version of Prosody, 0.11.1.
I had already implemented what I suggested, but I ran into the same issue. Looking at the debug log, the response looked like this:

<iq id='purple2c7f744c' type='result' to='a@localhost/fwnRayEE' from='a@localhost'><query xmlns='http://jabber.org/protocol/disco#info'><identity type='registered' category='account'/><identity type='pep' category='pubsub'/><feature var='http://jabber.org/protocol/pubsub#access-presence'/><feature var='http://jabber.org/protocol/pubsub#delete-items'/><feature var='http://jabber.org/protocol/pubsub#meta-data'/><feature var='http://jabber.org/protocol/pubsub#presence-notifications'/><feature var='http://jabber.org/protocol/pubsub#retract-items'/><feature var='http://jabber.org/protocol/pubsub#modify-affiliations'/><feature var='http://jabber.org/protocol/pubsub#member-affiliation'/><feature var='http://jabber.org/protocol/pubsub#multi-items'/><feature var='http://jabber.org/protocol/pubsub#presence-subscribe'/><feature var='http://jabber.org/protocol/pubsub#publish'/><feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/><feature var='http://jabber.org/protocol/pubsub#outcast-affiliation'/><feature var='http://jabber.org/protocol/pubsub#subscription-options'/><feature var='http://jabber.org/protocol/pubsub#retrieve-items'/><feature var='http://jabber.org/protocol/pubsub#last-published'/><feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/><feature var='http://jabber.org/protocol/pubsub#delete-nodes'/><feature var='http://jabber.org/protocol/pubsub#retrieve-default'/><feature var='http://jabber.org/protocol/pubsub#retrieve-subscriptions'/><feature var='http://jabber.org/protocol/pubsub#persistent-items'/><feature var='http://jab

Notice that it just stops in the middle, and there is no followup. I noticed the same thing in what you posted, but I assumed it was a copypaste issue, but it seems it really wasn't.
In my case, carbons was in fact not contained in the features, but who knows what the XML parser does when it runs into something like this.
(I know that carbons is installed and the code works because the same works for the second account, for which the reply was not cut off.)

I'm not sure what to do here, to be honest. It might work for you since it's in your reply, making the solution a bit more resilient, but the issue lies elsewhere. If you want, you can try it, just replace the loop with the following:

  for (child_node_p = query_node_p->child; child_node_p; child_node_p = child_node_p->next) {
    if (g_strcmp0(child_node_p->name, "feature")) {
      continue;
    }

    feature_name = xmlnode_get_attrib(child_node_p, "var");
    if (!g_strcmp0(CARBONS_XMLNS, feature_name)) {
      purple_debug_info(CARBONS_LOG_CATEGORY, "Found carbons in server features, sending enable request for %s.\n", accname);
      carbons_autoenable(purple_connection_get_account(js_p->gc));
      return;
    }
  }

from carbons.

gkdr avatar gkdr commented on May 19, 2024

I made the change I suggested on the dev branch a while ago, just to make sure it's my fault if something similar happens in the future. (But then I can point to the unit tests, yay.)

In any case, as I said I could see the same cut off discovery result and reproduce the issue. Now with Prosody 0.11.2 it seems to be gone. The question that remains is why the other clients still worked - maybe they just save the (positive) discovery result and don't ask the server every single time?

from carbons.

gkdr avatar gkdr commented on May 19, 2024

Closing this as it was a Prosody bug. Might implement the technically not correct but better alternative from #40 .

from carbons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.