Hey I'm trying to make an ejabberd module which uses mnesia. I make a mnesia table with disk copies. I'm having this bug where any tables I make are lost on restart. When I do the call to create the tables, I check for {aborted, {already_exists, _}}, but it returns {atomic, ok} every single time. I gathered from the mnesia guide that I should call the function which waits until timeout for the tables to load. They always timeout, even with a timeframe of multiple minutes.
Mnesia table being deleted?
can't parse packet/payload on ejabberd 13 (xmlelements)
I'm using the pubsub_publish_item hook (from mod_pubsub @master) and I'm unable to parse the payload/packet.
I've tried using xml:get_tag_attr_s("x", Payload) and other xml:functions with no luck.
This is what I get as payload:
How to change required fields for mod_register in ejabberd
Going through http://xmpp.org/extensions/xep-0077.html#intro, section 3.1 I see that the client should request which fields are required for in-band registration from the host. In case of ejabberd mod_register is used for in-band registration. I would be thankful if someone could tell me what would be the best way to customize the required fields for registration in mod_register.
gen_mod:start_module:78 Problem starting the module my_module for host
Hi,
I run a small private group of users on an XMPP server and recently I have been wanting to write a custom module that that will timestamp all messages. I figure something like an ejabberd hook using filter_packets would work perfect (adding something like this to the message body 2014-04-11 12:30:00 and then parse it on the client side).
As I have not written a custom module before and being at an low intermediate level with Erlang I decided to go for the basics - following Jack Moffits mod_sunshine.erl example as well as Anders Conbere's examples.
Compiling a module for dummies
Hello,
I installed Ejabberd on Debian "Out-Of-The-Box" and it worked well from the beginning. I started to configure it to my needs, which was no problem a all. I got brave an started to build an own Sign-Up-System with PHP and Shell-Scripting, which worked flawless, too. Unfortunately I had to realize, that there is no way to prevent users from altering their Vcard-Information, so I googled and found a little tweak for mod_vcard, which would perfectly solve my problem.
mod_amp not taking effect
Dear Friends,
I am relatively new to Ejabberd, recently I had a requirement wherein I needed to implement Advanced Message Processing specification which is implemented by mod_amp. I downloaded the "mod_amp.tgz" from the following link:
https://support.process-one.net/browse/EJAB-449
I ran build.sh and got the .beam file done, placed the same in Ejabberd beam files directory, added the entry in modules section of config file. I even made changes as per the attached .diff file as on "06/10/11 16:17" the top-most link, "449-amp.diff" file.
Handling of Requests in ejabberd_http (a.k.a. is ejabberd_http useful for large files)
Hi,
i would like to develop a module, that handles up- and downloads of large files. Therefor it would be necessary, that the body of the request is not loaded completely before the control is handed over to my module. If I understand the sources correctly, this is not the case in 'ejabberd_http' as the request has the field 'data' holding the entire body. Do I understand that correctly?
Cheers,
Tobias
When to use what and why
I want to know what is the exact difference between mod_roster and mod_shared_roster and in what cases to use it.
Thanks
Jeet
Deliver message to multiple JIDs atomically?
Hi guys. Is there a way to send a message to multiple JIDs atomically?
I don't think XEP 0033 guarantees atomicity.
Thanks
Newbie module development
Hi,
I’m trying to start with developing modules.
After compiling my module, I don’t seem to be able to produce a .beam file... Using the command:
erlc -I /path/to/my/installation/ebin/ mod_test.erl
I get only one warning:
Warning: behaviour gen_mod undefined
And that’s as far as I can get. Any advices please?
Group chat issue
Hi folks,
I'm getting started with ejabberd and I'm seeking to find out what it can and can't do.
I really appreciate the ejabberd features: its modularity, and its scalability (still having few issues with auto-scaling on a cloud IaaS, but this is another story) mostly.
But now I really get stucked on Group Chat Feature, (whatsapp group like), I'm sure it has been a well discussed topic, but I swear, I've been looking for it for a while.
I've found few possible solutions for this task:
Disabling offline_message storage for a chat session or depending on a Mysql Query
Hello Developers,
I am using ejabberd 2.1.11 for a IOS chat application. I have a special 60 seconds chat apart from the regular chat, I need to disable offline message archiving for a custom type of stanza, I already disabled the archiving when users are online, but need to stop offline messages from storing it.
Query 1 : if there is any way to disable offline message archiving for chat session?
Query 2 : if no direct way, then can we prevent it using sql query? I need to check if the user have that special chat in last 60 seconds (I have user id and start time of chat).
A typical SQL Query in Erlang and Ejabberd
I want some help in writing a typical SQL query in Erlang. I just want to prevent logging the offline message based on this query.
Want to put this query at start of this function.
store_offline_msg(Host, {User, _Server}, Msgs, Len, MaxOfflineMsgs, odbc) ->
Count = if MaxOfflineMsgs =/= infinity ->
Len + count_offline_messages(User, Host);
true -> 0
end,
if Count > MaxOfflineMsgs -> discard_warn_sender(Msgs);
Mysql Table
ID | user | touser | starttime | end
How to store/handle messages for unregistered user
Guys,
How can I force ejabberd to save messages sent to unregistered users. Currently ejabberd returns error 503 service-unavailable.
It would be great if I could store these messages in offline storage and then clear them when user logs in for the first time. Else is there any event that can be used to handle the messages for unregistered users?
how to get "Server" in iq_handler?
Hi, I'm a newbie, writing an iq handler.
I need to run odbc sql query in iq handler but I haven't figured it out how to get Server to call sql query.
I have been very struggling to figure this out..please help me.
process_iq(From, To, IQ) ->
LServer = jlib:nameprep(Server),
Result = ejabberd_odbc:sql_query(LServer,[<<"select * from sample_table where username='">>, User,<<"';">>]),
?INFO_MSG("~s", Result),
And I'm using im(). for debugging. but It keep crushing on mac, so not really helpful. Is there any other debugging tool I can use??
Thanks
Can't use Logger
I know this issue was raised few times but I didn't found a solution yet. I cant use the logger
My steps:
1. Download Erlang
2. Download & compile eJabrred with the code from https://github.com/processone/ejabberd.git
3. My code:
-module(mod_hello).
-behavior(gen_mod).
-include("ejabberd.hrl").
-include("lager.hrl").
-include("jlib.hrl").-export([
start/2,
stop/1
]).
start(_Host, _Opt) ->
?DEBUG("Loaded mode_hello", []).
%ok.
stop(_Host) ->
ok.
Error: