if(server.indexOf("conference")>-1 ||
server.indexOf("private")>-1 ||
server.indexOf("groupchat")>-1)
{//private messages from groupchat should have a window per resource
chatWindow = getChatwindow(from,true);
jidStatus = new UnknownJIDStatus(from,from.getResource());
}
else chatWindow = getChatwindow(from,Preferences.getBoolean("jeti","chatwindowPerResource",false));
if(tabs!=null)
{
int index = tabs.indexOfComponent(chatWindow);
if(index!=-1)
{
if(tabs.getSelectedIndex()!=index)
{
tabs.setBackgroundAt(index,Color.BLUE);
tabs.setForegroundAt(index,Color.RED);
}
tabs.setToolTipTextAt(index,message.getBody());
}
}
if (chatWindow == null)
{
if (jidStatus == null) chatWindow = startChat(new UnknownJIDStatus(from),message.getThread()); // ,"images",true,"unknown",e.getThread());
else chatWindow = startChat(jidStatus, message.getThread());
// chatWindow.setExtendedState(JFrame.ICONIFIED); //prevent focus stealing, does not work anymore for some stupid reason
//Thread.yield();
//chatWindow.show();
//chatWindow.setVisible(true);