class XmppExchangeContactsJob < ApplicationJob queue_as :default def perform(inviter, username, domain) ejabberd = EjabberdApiClient.new ejabberd.add_rosteritem({ "localuser": username, "localhost": domain, "user": inviter.cn, "host": inviter.ou, "nick": inviter.cn, "group": Setting.ejabberd_buddy_roster, "subs": "both" }) ejabberd.add_rosteritem({ "localuser": inviter.cn, "localhost": inviter.ou, "user": username, "host": domain, "nick": username, "group": Setting.ejabberd_buddy_roster, "subs": "both" }) end end