/** * Try to get a matching chat for the given user JID. Try the full * JID map first, the try to match on the base JID if no match is * found. * * @param userJID * @return */ private Chat getUserChat(String userJID) { Chat match = jidChats.get(userJID); if (match == null) { match = baseJidChats.get(StringUtils.parseBareAddress(userJID)); } return match; }
public boolean accept(Packet p) { String from = p.getFrom(); if (from == null) { return false; } return roomAddressTable.containsKey(StringUtils.parseBareAddress(from).toLowerCase()); }
public boolean accept(Packet p) { String from = p.getFrom(); if (from == null) { return false; } return roomAddressTable.containsKey(StringUtils.parseBareAddress(from).toLowerCase()); }
public boolean accept(Packet p) { String from = p.getFrom(); if (from == null) { return false; } return roomAddressTable.containsKey(StringUtils.parseBareAddress(from).toLowerCase()); }
public String getJid() { return StringUtils.parseBareAddress(occupant.getJid()); }
private Chat createChat(String userJID, String threadID, boolean createdLocally) { Chat chat = new Chat(this, userJID, threadID); threadChats.put(threadID, chat); jidChats.put(userJID, chat); baseJidChats.put(StringUtils.parseBareAddress(userJID), chat); for(ChatManagerListener listener : chatManagerListeners) { listener.chatCreated(chat, createdLocally); } return chat; }
private Chat createChat(String userJID, String threadID, boolean createdLocally) { Chat chat = new Chat(this, userJID, threadID); threadChats.put(threadID, chat); jidChats.put(userJID, chat); baseJidChats.put(StringUtils.parseBareAddress(userJID), chat); for(ChatManagerListener listener : chatManagerListeners) { listener.chatCreated(chat, createdLocally); } return chat; }
private Chat createChat(String userJID, String threadID, boolean createdLocally) { Chat chat = new Chat(this, userJID, threadID); threadChats.put(threadID, chat); jidChats.put(userJID, chat); baseJidChats.put(StringUtils.parseBareAddress(userJID), chat); for(ChatManagerListener listener : chatManagerListeners) { listener.chatCreated(chat, createdLocally); } return chat; }
public void processPacket(Packet p) { String from = p.getFrom(); if (from == null) { return; } PacketMultiplexListener listener = roomListenersByAddress.get(StringUtils.parseBareAddress(from).toLowerCase()); if (listener != null) { listener.processPacket(p); } }
public void processPacket(Packet p) { String from = p.getFrom(); if (from == null) { return; } PacketMultiplexListener listener = roomListenersByAddress.get(StringUtils.parseBareAddress(from).toLowerCase()); if (listener != null) { listener.processPacket(p); } }
public void processPacket(Packet p) { String from = p.getFrom(); if (from == null) { return; } PacketMultiplexListener listener = roomListenersByAddress.get(StringUtils.parseBareAddress(from).toLowerCase()); if (listener != null) { listener.processPacket(p); } }
public void userHasLogged(String user) { boolean isAnonymous = "".equals(StringUtils.parseName(user)); String title = "Smack Debug Window -- " + (isAnonymous ? "" : StringUtils.parseBareAddress(user)) + "@" + connection.getServiceName() + ":" + connection.getPort(); title += "/" + StringUtils.parseResource(user); frame.setTitle(title); }
public void userHasLogged(String user) { boolean isAnonymous = "".equals(StringUtils.parseName(user)); String title = "Smack Debug Window -- " + (isAnonymous ? "" : StringUtils.parseBareAddress(user)) + "@" + connection.getServiceName() + ":" + connection.getPort(); title += "/" + StringUtils.parseResource(user); frame.setTitle(title); }
public void userHasLogged(String user) { boolean isAnonymous = "".equals(StringUtils.parseName(user)); String title = "Smack Debug Window -- " + (isAnonymous ? "" : StringUtils.parseBareAddress(user)) + "@" + connection.getServiceName() + ":" + connection.getPort(); title += "/" + StringUtils.parseResource(user); frame.setTitle(title); }
public void userHasLogged(String user) { boolean isAnonymous = "".equals(StringUtils.parseName(user)); String title = "User logged (" + connection.hashCode() + "): " + (isAnonymous ? "" : StringUtils.parseBareAddress(user)) + "@" + connection.getServiceName() + ":" + connection.getPort(); title += "/" + StringUtils.parseResource(user); System.out.println(title); // Add the connection listener to the connection so that the debugger can be notified // whenever the connection is closed. connection.addConnectionListener(connListener); }
public void actionPerformed(ActionEvent arg0) { final ChatTopComponent chatTc = ChatTopComponent.findInstance(); ChatTopComponent.openAction(chatTc, "", "", false).actionPerformed(arg0); // NOI18N chatTc.setActiveGroup(StringUtils.parseBareAddress(msg.getFrom())); } };
public void userHasLogged(String user) { boolean isAnonymous = "".equals(StringUtils.parseName(user)); String title = "User logged (" + connection.hashCode() + "): " + (isAnonymous ? "" : StringUtils.parseBareAddress(user)) + "@" + connection.getServiceName() + ":" + connection.getPort(); title += "/" + StringUtils.parseResource(user); System.out.println(title); // Add the connection listener to the connection so that the debugger can be notified // whenever the connection is closed. connection.addConnectionListener(connListener); }
public void run() { if (chatNotifications.isEnabled(StringUtils.parseBareAddress(msg.getFrom())) && (listener == null || !ChatTopComponent.isGroupInitedAndVisible(StringUtils.parseBareAddress(msg.getFrom())))) { chatNotifications.addGroupMessage(msg); } else { try { chatNotifications.getMessagingHandle(kenai.getProject(name)).notifyMessageReceived(msg); chatNotifications.getMessagingHandle(kenai.getProject(name)).notifyMessagesRead(); } catch (KenaiException ex) { Exceptions.printStackTrace(ex); } } } });
/** * @param packet */ public void processPacket(Packet packet) { PresenceIndicator.getDefault().label.setText(KenaiUser.getOnlineUserCount()>0?KenaiUser.getOnlineUserCount()-1+"":""); // NOI18N PresenceIndicator.getDefault().label.setToolTipText(NbBundle.getMessage(PresenceIndicator.class, "LBL_LoggedIn_Tooltip", KenaiUser.getOnlineUserCount()>0?KenaiUser.getOnlineUserCount()-1:"")); for (MultiUserChat muc : KenaiConnection.getDefault(KenaiConnection.getKenai(StringUtils.parseBareAddress(packet.getFrom()))).getChats()) { String chatName = StringUtils.parseName(muc.getRoom()); assert chatName != null : "muc.getRoom() = " + muc.getRoom(); // NOI18N ChatNotifications.getDefault().getMessagingHandle(KenaiConnection.getKenaiProject(muc)).setOnlineCount(muc.getOccupantsCount()); } } }
public void processPacket(Packet packet) { if(packet instanceof Presence){ Presence presence = (Presence)packet; if(entityJID.equals(presence.getFrom()) && roster.contains(presence.getFrom()) && presence.getType().equals(Presence.Type.subscribe)){ Presence response = new Presence(Presence.Type.subscribed); response.setTo(presence.getFrom()); response.setFrom(StringUtils.parseBareAddress(connection.getUser())); connection.sendPacket(response); } } } }