weechat-xmpp icon indicating copy to clipboard operation
weechat-xmpp copied to clipboard

xmpp config file not saved

Open blob42 opened this issue 2 years ago • 4 comments

Is the config save procedure implemented ? When I hit /save xmpp I get Error writing configuration file "xmpp.conf". The file is read/writeable and accessible, I can save other plugin options.

Also I hade to remove -fuse-ld=mold from LDFLAGS to be able to compile, I wonder if this can be the cause.

blob42 avatar Jan 19 '23 19:01 blob42

sorry, i havent ignored this, i just haven't gotten around to checking. also, i will remove fuse-ld in my next commit

bqv avatar Jan 27 '23 18:01 bqv

Ok thanks for this plugin

blob42 avatar Mar 01 '23 11:03 blob42

any update on that? Looks like it is still an issue.

gordon-quad avatar Mar 23 '25 12:03 gordon-quad

@blob42 can you pls re-open this?

gordon-quad avatar Mar 23 '25 13:03 gordon-quad

@bqv I have had a quick look at it, one thing that is definitely wrong is that in https://github.com/bqv/weechat-xmpp/blob/e14d928aefa9b2b95c5a0f76eb16e65bf84be895/config.cpp#L149 it should definitely be file.write() instead of file.read(), this does however not fix it still. tbh I cant make heads or tails or how to get through the code, I will try over the coming time and mess about with it to see if I can get it so save but nothing checks out yet. it seems the most that somewhere its putting a wrong return code that just makes weechat say its not saving. did this ever work post all the cpp refacturing?

so far checked:

  • previously mentioned correciton does not fix anything
  • content coming through account_write_cb is valid
  • account_write_cb gets to the return WEECHAT_CONFIG_WRITE_OK part without issues

even if you dont feel like fixing it or looking at it any pointer would be helpful, no one is helping me in weechat either as for any reason why plugins cause this failure to save behaviour, and it being cpp is really not helping me get any further quickly either its all very indirect and abstract use of the weechat api calls

Ckath avatar Jul 22 '25 17:07 Ckath

after some messing around, I managed to mess up internals enough to the point it threw a WEECHAT_CONFIG_WRITE_ERROR, which then caused some values to be saved correctly. this led me to trace back and find that it makes a boolean from these and then incorrectly translates it back to the return codes. both fixed in pr. I think I'll throw together all my bodged fixes in a branch on my fork in case it'll take a while for maintainer to notice

Ckath avatar Jul 22 '25 19:07 Ckath

I don't imagine this is actually fixed; from what I remember, this was a pretty messy situation..

bqv avatar Jul 23 '25 09:07 bqv

for the record this does fix it and lets you save and reload again. its just a bit odd how it falls together now. also pretty sure it returns a function thats a void in weechat api docs at some point

Ckath avatar Jul 23 '25 15:07 Ckath

sweet thanks @Ckath I can finally use weechat with xmpp

blob42 avatar Jul 23 '25 16:07 blob42