Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread rajeev k

Hi,

I am not sure if RFC 2396 is applicable to Jabber world or not. If it is
applicable @ should be replaced with %40 not with %.

Regards,
Rajeev K



On 3/7/07, Alexander Gnauck [EMAIL PROTECTED] wrote:


they way all the MSN gateways work is:

if your gateway has the Jid msn.myserver.org and the Hotmail ID of your
contact is [EMAIL PROTECTED] the resulting JabberId is
[EMAIL PROTECTED]

Which means the @ in the Hotmail ID gets replaces with a %.

Alex




Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread Bruno Bechler Machado

Thanks guys, but i've tryed everything and didn't work.

basicaly, thats my sorce code:

String contact = user%hotmail.com; // tryed: user%40hotmail.com,
user\40hotmail.com, user%hotmail.com
Roster roster = connection.getRoster();
String absoluteFriend = contact + @ + gatewayName + . +
connection.getServiceName();
roster.createEntry(absoluteFriend, contact , null);

Any other ideas?


Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread Remko Tronçon

Any other ideas?


As Magnus indicated in the previous thread, you really shouldn't be
guessing the contact names yourselves. You should use the iq:gateway
protocol (see XEP-100, example 54) to determine the correct JID to add
to your roster. Ofter you added a roster, make sure that you request a
subscription for that item (not sure if Smack does this for you).
Also, please check whether your transport supports adding of contacts
by doing it in another client.

cheers,
Remko


Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread Daniel Henninger
;D  Except for the IM Gateway plugin for Wildfire, which uses JID
escaping.  @ is replaced with \40.  (of course you can still enable the
'percent hack' in it)  I must admit I don't really like how JID escaping
makes things 'look', but hey, it's an actual XEP.  ;D  As far as I can
tell, the percent hack never made it into anything official except that
nowadays it's mentioned in the jid escaping XEP as a you shouldn't use
that anymore type thing.

Daniel

-- 
The most addictive drug in the world is music.
 - The Lost Boyz

 they way all the MSN gateways work is:

 if your gateway has the Jid msn.myserver.org and the Hotmail ID of your
 contact is [EMAIL PROTECTED] the resulting JabberId is
 [EMAIL PROTECTED]

 Which means the @ in the Hotmail ID gets replaces with a %.

 Alex




Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread Bruno Bechler Machado

thanks for helping guys!
i solved the problem, if anyone needs it, here is a code example:

  public void addContact()
  {
  Roster roster = connection.getRoster();

  Presence subscribe = new Presence(Presence.Type.SUBSCRIBE);
  subscribe.setTo([EMAIL PROTECTED]);
  subscribe.setFrom(connection.getUser());
  connection.sendPacket(subscribe);
   }


Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread Remko Tronçon

i solved the problem, if anyone needs it, here is a code example:


I'm going to repeat it once more: don't forget that your code will not
work with other components (such as PyMSN-*) unless you ask for the
right JID for a given MSN account. See my previous mail and the one
from Magnus Henoch.

cheers,
Remko


Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread Benjamin Podszun

Bruno Bechler Machado wrote:

thanks for helping guys!
i solved the problem, if anyone needs it, here is a code example:
 
   public void addContact()

   {
   Roster roster = connection.getRoster();
  
   Presence subscribe = new Presence(Presence.Type.SUBSCRIBE);
   subscribe.setTo( [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]);

   subscribe.setFrom(connection.getUser());
   connection.sendPacket(subscribe);
}


What's the roster for in this sample? ;)


Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread Tomasz Sterna
Dnia 07-03-2007, śro o godzinie 11:33 +0200, rajeev k napisał(a):
 I am not sure if RFC 2396 is applicable to Jabber world or not. If it
 is applicable @ should be replaced with %40 not with %. 

We do not need urlencode in XMPP.
We fully support UTF-8 everywhere :-)


-- 
Tomasz Sterna
Xiaoka Grp.  http://www.xiaoka.com/



Re: [jdev] Re: Adding a contact to msn from jabber.

2007-03-07 Thread Bruno Bechler Machado

Every xmppConnection have its own roster :P
when you create a xmppconnection like:
XMPPConnection connection = new XMPPConnection(jabber.org);

the roster is the user that logs using the XMPPConnection, like:
connection.login(user1, password);

to get this roster, you need just to do implement:
Roster roster = connection.getRoster();


2007/3/7, Tomasz Sterna [EMAIL PROTECTED]:


Dnia 07-03-2007, śro o godzinie 11:33 +0200, rajeev k napisał(a):
 I am not sure if RFC 2396 is applicable to Jabber world or not. If it
 is applicable @ should be replaced with %40 not with %.

We do not need urlencode in XMPP.
We fully support UTF-8 everywhere :-)


--
Tomasz Sterna
Xiaoka Grp.  http://www.xiaoka.com/