ejabberd - Comments for "mod_presence - Presence on the Web"
https://www.ejabberd.im/mod_presence
enDocs?
https://www.ejabberd.im/mod_presence#comment-3363
<p>I don't see any documentation on how this module works. Looking at the comments here, I've installed the module, set the PIXMAPS environment variable (what about putting that in as an option to the module?), registered via Discovery, then browsed to localhost:5280/presence/user/host/image/, but I get a 404. Anything I can do to fix this issue, or to help, please advise.</p>
Sat, 17 Mar 2007 00:42:48 +0000breadcrustcomment 3363 at https://www.ejabberd.imLooks good!
https://www.ejabberd.im/mod_presence#comment-2404
<div class="quote-msg">
<div class="quote-author"><em>badlop</em> wrote:</div>
<p>I can reproduce the problem and found the problematic code. This patch seems to solve the problem, but since I didn't write the original code and didn't test it, I cannot guarantee it is completely safe.</p></div>
<p>Just applied the patch, and it looks like it's working correctly. I'll test it out more later today. Thanks very much for your prompt response! :-)</p>
Sun, 15 Oct 2006 15:13:54 +0000jasonawardcomment 2404 at https://www.ejabberd.imI can reproduce the problem
https://www.ejabberd.im/mod_presence#comment-2403
<p>I can reproduce the problem and found the problematic code. This patch seems to solve the problem, but since I didn't write mod_presence and didn't test this patch, I cannot guarantee it is completely safe. </p>
<p>Note that I removed a lot of code that I consider unnecesary. I've reported this patch to the author, and he will decide.</p>
<p>Save as file.diff on ejabberd/src and apply with: patch -p0<file.diff</p>
<pre>--- mod_presence.erl 2006-10-15 12:48:19.000000000 +0200
+++ mod_presence.erl 2006-10-15 12:34:08.000000000 +0200
@@ -269,7 +269,7 @@
[{xmlelement, "identity",
[{"category", "presence"},
{"type", "text"},
- {"name", "ejabberd/mod_presence"}], []},
+ {"name", "Web Presence"}], []},
{xmlelement, "feature", [{"var", ?NS_REGISTER}], []},
{xmlelement, "feature", [{"var", ?NS_VCARD}], []}].
@@ -315,47 +315,18 @@
] ++ available_themes(xdata)},
?XFIELD("boolean", "Raw XML", "xml", XML)]}].
-iq_set_register_info(Host, From, XML, Icon, Lang) ->
+iq_set_register_info(Host, From, XML, Icon, _Lang) ->
{LUser, LServer, _} = jlib:jid_tolower(From),
LUS = {LUser, LServer},
F = fun() ->
- case XML of
- "" ->
- mnesia:delete({presence_registered, {LUS, Host}}),
- ok;
- _ ->
- Allow =
- case mnesia:select(
- presence_registered,
- [{#presence_registered{us_host = '$1',
- xml = XML,
- icon = Icon,
- _ = '_'},
- [{'==', {element, 2, '$1'}, Host}],
- ['$_']}]) of
- [] ->
- true;
- [#presence_registered{us_host = {U, _Host}}] ->
- U == LUS
- end,
- if
- Allow ->
- mnesia:write(
- #presence_registered{us_host = {LUS, Host},
- xml = XML,
- icon = Icon}),
- ok;
- true ->
- false
- end
- end
- end,
+ mnesia:write(
+ #presence_registered{us_host = {LUS, Host},
+ xml = XML,
+ icon = Icon})
+ end,
case mnesia:transaction(F) of
{atomic, ok} ->
{result, []};
- {atomic, false} ->
- ErrText = "Specified presence is already registered",
- {error, ?ERRT_CONFLICT(Lang, ErrText)};
_ ->
{error, ?ERR_INTERNAL_SERVER_ERROR}
end.</pre>Sun, 15 Oct 2006 11:07:03 +0000mfosscomment 2403 at https://www.ejabberd.imBug?
https://www.ejabberd.im/mod_presence#comment-2401
<p>So I think I've found a bug in mod_presence (at least 0.0.4) that took me all day to realize. I was trying to automatically register all users for mod_presence using a PHP script against "Jabber Client Library". FYI - the script simply logs in as each user, and then makes the appropriate register request to mod_presence.</p>
<p>For simplicity, I was simply attempting to use the same icon set and xml setting for every user. But that didn't work. Every time, the first user would succeed, and then I'd get a "cancel" error ("Specified presence is already registered"). After many hours of work, I narrowed the problem down not to my script, but to a server-side problem.</p>
<p>I then tried to duplicate the problem through the Exodus client. If I attempted to register multiple users against mod_presence with the same icon set and xml setting combination, the registration failed as above. But if I chose a different icon set or xml setting, it would succeed.</p>
<p>FYI, I'm using ejabberd 1.1.2.</p>
<p>Any thoughts about what might be the problem would be greatly appreciated. If you need any additional debugging on my side, please let me know. Thanks!</p>
Sat, 14 Oct 2006 21:17:13 +0000jasonawardcomment 2401 at https://www.ejabberd.imTo answer my own question...
https://www.ejabberd.im/mod_presence#comment-2284
<p>To answer my own question, which should have been an obvious answer, but apparently I was dense at the moment... the pixmaps directory is supposed to be within your HOME directory. Personally mine is specified in my init.d file (on Gentoo as /var/run/jabber). Thanks.</p>
Tue, 19 Sep 2006 19:03:46 +0000jasonawardcomment 2284 at https://www.ejabberd.imLocation of pixmaps directory
https://www.ejabberd.im/mod_presence#comment-2276
<p>Where is the pixmaps directory supposed to end up when all is finished? The module is working, but instead of a list of themes, I'm simply getting "disabled"... which, by looking at the code indicates that it can't find the pixmaps directory.</p>
Sat, 16 Sep 2006 21:38:52 +0000jasonawardcomment 2276 at https://www.ejabberd.imFound; quick fix
https://www.ejabberd.im/mod_presence#comment-2199
<p>You are right. The problem is that the register form on mod_presence.erl stores on the database "1" or "0", but the web code on ejabberd_web.erl expects true or false. Since I don't know what is more efficient, or what will be the definitive solution, I tell you the easier way to fix it. Note that if the final solution is not the same, your users will need to reregister on the service once you update.</p>
<p>On ejabberd/src/web/ejabberd_web.erl line 142 and following, the patch added some code. Replace those lines with the later code:
<ul>
<li>Replace
<pre> case XML of
true -></pre>
with
<pre> case XML of
'1' -></pre>
</li><li>And
<pre> case Icon of
true -></pre>
with
<pre> case Icon of
'1' -></pre>
</li><li>And again
<pre> case Icon of
true -></pre>
with
<pre> case Icon of
'1' -></pre>
</li></ul></p>Mon, 04 Sep 2006 17:14:18 +0000mfosscomment 2199 at https://www.ejabberd.imProblems accessing /presence
https://www.ejabberd.im/mod_presence#comment-2198
<p>Hi there,<br />
I am trying to get this module functioning. It is being loaded because I am able to browse it via DISCO, once I have "registered" with the presence agent I try and access /presence/dan/f-box.org/image/ and get a 404.</p>
<p>Am I missing some configuration step? </p>
<p>I have only this line in my ejabberd.cfd<br />
{mod_presence, []},</p>
<p>Cheers,<br />
Dan.</p>
Mon, 04 Sep 2006 13:08:40 +0000DanBUKcomment 2198 at https://www.ejabberd.im