Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] Retrieving nickname from ID

Hi,

In my chat app I add a message listener using this code:

chatroom.addMessageListener(new IMessageListener() {
    public void handleMessage(final ID from, final ID to,
                              final IMessageListener.Type type,
			      final String subject, final String msg) {
        XMPPID id = (XMPPID) from;
	chatUI.handleMessage(from.getUsername(), msg);
   }
});

I have to cast the ID to XMPPID to be able to use getUsername(). That
restricts my code to xmpp. What about introducing ChatID? It could be an
interface that XMPPID and IRCID implements.

Tim


Back to the top