ejabberd - Comments for "Unable to include both xmpp.hrl and jlib.hrl" https://www.ejabberd.im/forum/28896/unable-include-both-xmpphrl-and-jlibhrl en I believe the problems I'm https://www.ejabberd.im/forum/28896/unable-include-both-xmpphrl-and-jlibhrl#comment-67609 <p>I believe the problems I'm seeing with adding an IQ handler are specific to when my module is loaded only for a specific virtual host. If I load it globally, mod_ping is not affected. I suspect this may be an ejabberd bug.</p> Wed, 26 Jul 2017 11:25:33 +0000 nosnilmot comment 67609 at https://www.ejabberd.im Thank you for your assistance https://www.ejabberd.im/forum/28896/unable-include-both-xmpphrl-and-jlibhrl#comment-67606 <p>Thank you for your assistance so far, I think I am nearly where I want to be, but it appears that my custom IQ handler is causing problems for others.</p> <p>For example, with my module loaded and having answered one query, mod_ping is no longer processing client pings, and clients are being returned 503 / "No module is handling this query" errors.</p> Tue, 25 Jul 2017 14:39:25 +0000 nosnilmot comment 67606 at https://www.ejabberd.im See https://www.ejabberd.im/forum/28896/unable-include-both-xmpphrl-and-jlibhrl#comment-67601 <p>See <noindex><a href="https://github.com/processone/xmpp/issues/9" title="https://github.com/processone/xmpp/issues/9" rel="nofollow" >https://github.com/processone/xmpp/issues/9</a></noindex></p> Sun, 23 Jul 2017 10:03:22 +0000 zinid comment 67601 at https://www.ejabberd.im Do I need to modify XMPP https://www.ejabberd.im/forum/28896/unable-include-both-xmpphrl-and-jlibhrl#comment-67594 <p>Do I need to modify XMPP library to add support for a new namespace for IQ queries?</p> <p>I did have this part working before, when I was using jlib.hrl ...</p> <div class="codeblock"><code>2017-07-20 11:10:38.475 [debug] &lt;0.1612.0&gt;@ejabberd_receiver:process_data:284 Received XML on stream = &lt;&lt;&quot;&lt;iq to=&#039;localhost&#039; type=&#039;get&#039; id=&#039;123&#039;&gt;\n&lt;query xmlns=&#039;urn:xmpp:helloworld&#039;/&gt;\n&lt;/iq&gt;&quot;&gt;&gt;<br />...<br />2017-07-20 11:10:38.480 [debug] &lt;0.1613.0&gt;@ejabberd_socket:send:216 (tcp|&lt;0.1612.0&gt;) Send XML on stream = &lt;&lt;&quot;&lt;iq xml:lang=&#039;en&#039; to=&#039;stu@localhost/resource&#039; from=&#039;localhost&#039; type=&#039;error&#039; id=&#039;123&#039;&gt;&lt;query xmlns=&#039;urn:xmpp:helloworld&#039;/&gt;&lt;error code=&#039;400&#039; type=&#039;modify&#039;&gt;&lt;bad-request xmlns=&#039;urn:ietf:params:xml:ns:xmpp-stanzas&#039;/&gt;&lt;text xml:lang=&#039;en&#039; xmlns=&#039;urn:ietf:params:xml:ns:xmpp-stanzas&#039;&gt;Unknown tag &amp;lt;query/&amp;gt; qualified by namespace &amp;apos;urn:xmpp:helloworld&amp;apos;&lt;/text&gt;&lt;/error&gt;&lt;/iq&gt;&quot;&gt;&gt;</code></div> Thu, 20 Jul 2017 10:20:00 +0000 nosnilmot comment 67594 at https://www.ejabberd.im You cannot use both xmpp.hrl https://www.ejabberd.im/forum/28896/unable-include-both-xmpphrl-and-jlibhrl#comment-67592 <p>You cannot use both xmpp.hrl and jlib.hrl.<br /> Also, jlib.hrl is deprecated and actually is forbidden to use. Use xmpp.hrl only. Adapt your code using new xmpp library, you can find the library's description here: <noindex><a href="https://github.com/processone/xmpp/blob/master/README.md" title="https://github.com/processone/xmpp/blob/master/README.md" rel="nofollow" >https://github.com/processone/xmpp/blob/master/README.md</a></noindex></p> Thu, 20 Jul 2017 07:16:13 +0000 zinid comment 67592 at https://www.ejabberd.im using xmpp:make_error(IQ, https://www.ejabberd.im/forum/28896/unable-include-both-xmpphrl-and-jlibhrl#comment-67586 <p>using xmpp:make_error(IQ, xmpp:err_not_authorized()) allows me to avoid that error and get one step towards not including jlib.hrl (I presume that is the goal here?), but now I have these when I don't include jlib.hrl:</p> <div class="codeblock"><code>/Users/stu/.ejabberd-modules/sources/mod_hello_world/src/mod_hello_world.erl:47: field sub_el undefined in record iq<br />/Users/stu/.ejabberd-modules/sources/mod_hello_world/src/mod_hello_world.erl:47: field xmlns undefined in record iq</code></div> Wed, 19 Jul 2017 12:04:12 +0000 nosnilmot comment 67586 at https://www.ejabberd.im Don't use ?ERR_... Search in https://www.ejabberd.im/forum/28896/unable-include-both-xmpphrl-and-jlibhrl#comment-67584 <p>Don't use ?ERR_...</p> <p>Search in ejabberd source code examples of how to use xmpp:err_not_authorized(ErrText, Lang),</p> Wed, 19 Jul 2017 09:42:10 +0000 badlop comment 67584 at https://www.ejabberd.im