Closed mxswd closed 10 years ago
Thanks for your feedback.
test-room
might be a number, and 1234_test-room
might be 1234_test-room@conf.hipchat.com
. Visit hipchat web site and follow link Rooms -> [Your Room Name] and see API ID and XMPP JID fields.
There might be also a bug of pontarius-xmpp. I wrote a patch and it has already merged into the master. Though I haven't built hipchat-plugin with the master version of pontarius-xmpp yet. https://github.com/pontarius/pontarius-xmpp/commit/49edb2081107d0506a347d48bb3c78a5f70e212e
When pontarius-xmpp receives an unknown element, it tends to close the connection. To see what elements cause closing the connection, you can enable the debug mode of lambdabot to edit lambdabot/lambdabot-core/src/Lambdabot/Config.hs.
Cheers
Thanks for the help!
I started lambdabot with lambdabot -l DEBUG
and it is logging everything.
It seems the roster is sent correctly, but fails here: https://github.com/pontarius/pontarius-xmpp/blob/master/source/Network/Xmpp/IM/Roster.hs#L135
I am investigating why…
The XML is:
<iq to='123_12345@chat.hipchat.com/none' type='result' id='1'>
<query xmlns='jabber:iq:roster' ver='2014-01-03T05:30:28Z'>
<item mention_name='Max' jid='123_12346@chat.hipchat.com' name='Maxwell' subscription='both'/>
</query>
</iq>
The XML Left e
is:
Pontarius.Xmpp.Roster: getRoster: invalid query element:
TraceStep
("xpRoot","")
(TraceStep ("xpUnliftElems","")
(TraceStep ("xpWrap","")
(TraceStep ("xpElem","\"{jabber:iq:roster}query\"")
(TraceStep ("children","")
(TraceStep ("xpWrap","")
(TraceStep ("xpElems","\"{jabber:iq:roster}item\"")
(TraceStep ("xpAll","")
(TraceStep ("xpElem","\"{jabber:iq:roster}item\"")
(TraceStep ("attrs","")
(ErrorMessage "Leftover Entities: [(Name {nameLocalName = \"mention_name\", nameNamespace = Nothing, namePrefix = Nothing},[ContentText \"Maxwell\"])]"))))))))))
Oh! The mention_name
field is a bonus HipChat field!
I'm working on a fix here: https://github.com/maxpow4h/pontarius-xmpp/tree/hipchat
I'm aware of errors of the roaster, but these don't cause any problems for me. (Of course I had better fix these errors.)
Here is my log when I start lambdabot with -l INFO
.
[NOTICE] : Initialising plugins
[INFO] : Loading module "base"
..(snip)..
[INFO] : Loading module "hipChat"
[NOTICE] : Done loading plugins
Hello hip. MYAPIKEY 999999 99999_999999 "My Account Nick Name" password 99999_roomname@conf.hipchat.com
[WARNING] Pontariusm.Xmpp: Stream has no language tag
[INFO] Pontarius.Xmpp.Tls: Running StartTLS
[INFO] Pontarius.Xmpp.Tls: Stream Secured.
[WARNING] Pontariusm.Xmpp: Stream has no language tag
[WARNING] Pontariusm.Xmpp: Stream has no language tag
[INFO] Pontarius.Xmpp: Bound JID: parseJid "99999_999999@chat.hipchat.com/none-99999"
[ERROR] Pontarius.Xmpp.Roster: getRoster: invalid query element
[ERROR] Pontarius.Xmpp: Server did not return a roster
It seems that my bot receives any commands correctly after outputting this log.
Ah yeah! It is working now! Thanks!
Sorry to resurrect a dead issue, but I'm running into this problem too. lambdabot shows up in the room, but after it tries to get the roster it fails and attempts a reconnect and enters into a loop. It's not clear to me how @maxpow4h fixed this. Mind a bit of elaboration?
@purefn I think I had the room ID wrong. It should be in the format "1234_words@conf.hipchat.com".
I did finally get it working. I just needed to use the right version of pontarius-xmpp, specifically revision 0afba3f39a83bb4b0b95925eb8d08f9e088012d2
test-room
testlambda
1234_12345@chat.hipchat.com
I'm starting it with:
Is this correct?
When I connect, it errors with:
Thanks!