Search in sources :

Example 6 with TransportBuddy

use of net.sf.kraken.roster.TransportBuddy in project Openfire by igniterealtime.

the class OSCARSession method updateRosterNickname.

/**
     * Updates roster nickname information about a contact.
     *
     * @param sn Screenname/UIN of contact
     * @param nickname New nickname
     */
public void updateRosterNickname(String sn, String nickname) {
    try {
        TransportBuddy buddy = getBuddyManager().getBuddy(getTransport().convertIDToJID(sn));
        buddy.setNickname(nickname);
        try {
            getTransport().addOrUpdateRosterItem(getJID(), buddy.getName(), buddy.getNickname(), buddy.getGroups());
        } catch (UserNotFoundException e) {
        // Can't update something that's not really in our list.
        }
    } catch (NotFoundException e) {
    // Can't update something that's not really in our list.
    }
}
Also used : UserNotFoundException(org.jivesoftware.openfire.user.UserNotFoundException) TransportBuddy(net.sf.kraken.roster.TransportBuddy) NotFoundException(org.jivesoftware.util.NotFoundException) UserNotFoundException(org.jivesoftware.openfire.user.UserNotFoundException)

Aggregations

TransportBuddy (net.sf.kraken.roster.TransportBuddy)6 UserNotFoundException (org.jivesoftware.openfire.user.UserNotFoundException)5 NotFoundException (org.jivesoftware.util.NotFoundException)5 IsonCommand (f00f.net.irc.martyr.commands.IsonCommand)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 TransportSession (net.sf.kraken.session.TransportSession)2 Element (org.dom4j.Element)2 IRCConnection (f00f.net.irc.martyr.IRCConnection)1 Channel (f00f.net.irc.martyr.clientstate.Channel)1 Member (f00f.net.irc.martyr.clientstate.Member)1 ChannelModeCommand (f00f.net.irc.martyr.commands.ChannelModeCommand)1 CtcpMessage (f00f.net.irc.martyr.commands.CtcpMessage)1 CtcpNotice (f00f.net.irc.martyr.commands.CtcpNotice)1 InviteCommand (f00f.net.irc.martyr.commands.InviteCommand)1 JoinCommand (f00f.net.irc.martyr.commands.JoinCommand)1 KickCommand (f00f.net.irc.martyr.commands.KickCommand)1 MessageCommand (f00f.net.irc.martyr.commands.MessageCommand)1 ModeCommand (f00f.net.irc.martyr.commands.ModeCommand)1