public BuddiesViewer() { chat = new Chat(); chat.addChatListener( new ChatListener() { public void newMessage(final VuzeBuddy from, final ChatMessage message) { final AvatarWidget avatarWidget = findWidget(from); if (avatarWidget != null) { avatarWidget.setChatDiscussion(chat.getChatDiscussionFor(from)); BuddyPlugin plugin = VuzeBuddyManager.getBuddyPlugin(); if (plugin != null) { BooleanParameter enabledNotifictions = plugin.getEnableChatNotificationsParameter(); if (!message.isMe() && enabledNotifictions.getValue()) { avatarWidget .getControl() .getDisplay() .asyncExec( new Runnable() { public void run() { boolean isVisible = true; if (avatarsPanel != null) { if (!avatarsPanel.isVisible()) { isVisible = false; } /*Shell mainShell = avatarsPanel.getShell(); boolean mVisible = mainShell.isVisible(); boolean mEnabled = mainShell.isEnabled(); boolean mGetEnabled = mainShell.getEnabled(); boolean isFC = mainShell.isFocusControl(); Shell activeShell = mainShell.getDisplay().getActiveShell();*/ if (avatarsPanel.getShell().getDisplay().getActiveShell() == null) { isVisible = false; } } // boolean isVisible = BuddiesViewer.this.isEnabled(); // avatarWidget.isChatWindowVisible(); if (!isVisible) { new MessageNotificationWindow(avatarWidget, message); /* * KN: MessageNotificationWindow above should really be moved into requestUserAttention() * so it can be handled in a platform-specific way if need be */ UserAlerts.requestUserAttention( PlatformManager.USER_REQUEST_INFO, null); } } }); } } } } public void updatedChat(VuzeBuddy buddy) { final AvatarWidget avatarWidget = findWidget(buddy); if (avatarWidget != null) { avatarWidget.setChatDiscussion(chat.getChatDiscussionFor(buddy)); } } }); /* * backed this change out as the desired behaviour is to continue showing * buddies when logged out as all attempts to do something with buddy will * prompt for login * LoginInfoManager.getInstance().addListener( new ILoginInfoListener() { public void loginUpdate( LoginInfo info, boolean isNewLoginID ) { Utils.execSWTThreadLater(0, new AERunnable() { public void runSupport() { boolean logged_in = LoginInfoManager.getInstance().isLoggedIn(); boolean show_no_buddies = avatarWidgets.size() < 1 || !logged_in; showNoBuddiesPanel( show_no_buddies ); } }); } }); */ }