Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, I want to add new contact to my contact list. Could you please help me to do the same by posting some sample code? #22

Open
rlochanam opened this issue Dec 13, 2012 · 1 comment

Comments

@rlochanam
Copy link

No description provided.

@golfixe
Copy link

golfixe commented Mar 10, 2013

Hello, creates a line in the script more or less well.
In this script after script jquery join jquery.xmpp.js

         setPresence: function (type, callback) {
             var msg;
             if (type == null)
                 msg = " 8 </ priority> chat </ show> </ presence>";
             else
                 msg = " 8 </ priority> " + type + "</ show> </ presence>";
             this.sendCommand (msg, callback);
         }

Join this ...

/ / Add user
         setadd: function (xml) {
              this.sendCommand (xml);
         }

Create a button and a text box that will write the contact you want to add ...
button will call the function "enviarxml()"

Add the following script in html.

enviarxml function () {
var user = document.getElementById ("user"). value;
var xml = '';
$. xmpp.setadd(xml, function () {});
}

is the simplest way I can give before the creator do something different and more funcionavel.
To receive response was accepted or even to get new applications use the "Iq - Find".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants