Software /
code /
prosody-modules
Comparison
mod_http_roster_admin/mod_http_roster_admin.lua @ 2631:2bfa7d476092
mod_http_roster_admin: Don't call callback if it's nil
author | JC Brand <jc@opkode.com> |
---|---|
date | Tue, 21 Mar 2017 09:43:03 +0000 |
parent | 2622:ac3ca6233ded |
child | 3316:9d8098f4b652 |
comparison
equal
deleted
inserted
replaced
2630:96eb1c4f9ff7 | 2631:2bfa7d476092 |
---|---|
116 roster_push(username, roster, contact_jid); | 116 roster_push(username, roster, contact_jid); |
117 send_presence(username, contact_jid, false); | 117 send_presence(username, contact_jid, false); |
118 removed = removed + 1; | 118 removed = removed + 1; |
119 end | 119 end |
120 module:log("debug", "User %s: added %d new contacts, removed %d contacts", username, added, removed); | 120 module:log("debug", "User %s: added %d new contacts, removed %d contacts", username, added, removed); |
121 cb(true); | 121 if cb ~= nil then |
122 cb(true); | |
123 end | |
122 end); | 124 end); |
123 end | 125 end |
124 | 126 |
125 -- Fetch the named user's roster from the API, call callback (cb) | 127 -- Fetch the named user's roster from the API, call callback (cb) |
126 -- with status and result (friends list) when received. | 128 -- with status and result (friends list) when received. |