Comments (10)
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.
That's because you've changed it to say "if the feature we're checking is not carbons, then activate carbons"
from carbons.
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.
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.
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.
Tried it; didn't make a difference. I looks like it doesn't loop through all the features returned by the discovery.
from carbons.
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.
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.
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.
Closing this as it was a Prosody bug. Might implement the technically not correct but better alternative from #40 .
from carbons.
Related Issues (20)
- Newest version not loaded on Windows HOT 9
- Unable to see encrypted carbons sent by Conversations, maybe other clients HOT 1
- Move manual writing of received carbon-copy of sent message to own handler
- Version 0.1.5 prebuilt dll HOT 2
- Typing `/carbons on` gives "Unknown Command" HOT 4
- Use discovery and activate automatically
- Carbons not working when using two separate accounts HOT 1
- have some love HOT 2
- Windows binary is outdated HOT 12
- License? HOT 1
- Migrate LGTM.com installation from OAuth to GitHub App
- Didn't receive carbons copy of messages that was sent when pidgin was offline HOT 3
- Need LICENSE HOT 8
- Optionally always send 'enable' request HOT 3
- Indication of the XEP version supported HOT 1
- Name changing request HOT 1
- Build error, possibly a linking error. HOT 7
- Duplicated messages displayed on Pidgin 2.14.5 HOT 5
- Carbons doesn't seem to work from one Pidgin instance to another HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carbons.