Quantcast
Channel: ejabberd Community Site - Module development
Viewing all articles
Browse latest Browse all 56

A typical SQL Query in Erlang and Ejabberd

$
0
0

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

read more


Viewing all articles
Browse latest Browse all 56

Trending Articles