aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java28
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomJabberImpl.java7
-rw-r--r--src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java23
3 files changed, 52 insertions, 6 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
index 744d978..ae0f2af 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatManager.java
@@ -44,7 +44,7 @@ public class ConferenceChatManager
AdHocChatRoomInvitationRejectionListener,
LocalUserChatRoomPresenceListener,
LocalUserAdHocChatRoomPresenceListener,
- ServiceListener
+ ServiceListener, ChatRoomLocalUserRoleListener
{
/**
* The object used for logging.
@@ -277,10 +277,10 @@ public class ConferenceChatManager
message.getMessageUID(),
null);
- chatWindowManager.openChat(chatPanel, false);
+ if(evt.isImportantMessage())
+ chatWindowManager.openChat(chatPanel, true);
}
-
-
+
/**
* Implements the <tt>ChatRoomMessageListener.messageDeliveryFailed</tt>
* method.
@@ -489,8 +489,8 @@ public class ConferenceChatManager
if(chatPanel.isShown())
((ConferenceChatSession) chatPanel.getChatSession())
.loadChatRoom(sourceChatRoom);
- else
- chatWindowManager.openChat(chatPanel, true);
+// else
+// chatWindowManager.openChat(chatPanel, true);
}
if (sourceChatRoom.isSystem())
@@ -504,6 +504,7 @@ public class ConferenceChatManager
}
sourceChatRoom.addMessageListener(this);
+ sourceChatRoom.addLocalUserRoleListener(this);
}
else if (LocalUserChatRoomPresenceChangeEvent
.LOCAL_USER_JOIN_FAILED.equals(eventType))
@@ -536,6 +537,7 @@ public class ConferenceChatManager
}
sourceChatRoom.removeMessageListener(this);
+ sourceChatRoom.removelocalUserRoleListener(this);
}
}
@@ -1259,5 +1261,19 @@ public class ConferenceChatManager
}
public void invitationRejected(AdHocChatRoomInvitationRejectedEvent evt) {}
+
+ @Override
+ public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent evt)
+ {
+ ChatRoom sourceChatRoom = evt.getSourceChatRoom();
+ ChatRoomWrapper chatRoomWrapper
+ = GuiActivator.getMUCService().findChatRoomWrapperFromChatRoom(
+ sourceChatRoom);
+ ChatWindowManager chatWindowManager
+ = GuiActivator.getUIService().getChatWindowManager();
+ ChatPanel chatPanel
+ = chatWindowManager.getMultiChat(chatRoomWrapper, true);
+ chatWindowManager.openChat(chatPanel, true);
+ }
}
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomJabberImpl.java
index 1152c9e..bdef78e 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ChatRoomJabberImpl.java
@@ -2008,6 +2008,13 @@ public class ChatRoomJabberImpl
if(delay != null)
msgReceivedEvt.setHistoryMessage(true);
+ if(messageReceivedEventType
+ == ChatRoomMessageReceivedEvent.CONVERSATION_MESSAGE_RECEIVED
+ && newMessage.getContent().contains(getUserNickname() + ":"))
+ {
+ msgReceivedEvt.setImportantMessage(true);
+ }
+
fireMessageEvent(msgReceivedEvt);
}
}
diff --git a/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java
index 701e22d..c448aa2 100644
--- a/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java
+++ b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java
@@ -72,6 +72,11 @@ public class ChatRoomMessageReceivedEvent
* Some services can fill our room with message history.
*/
private boolean historyMessage = false;
+
+ /**
+ * Indicates whether the message is important or not.
+ */
+ private boolean isImportantMessage = false;
/**
* Creates a <tt>MessageReceivedEvent</tt> representing reception of the
@@ -167,4 +172,22 @@ public class ChatRoomMessageReceivedEvent
{
this.historyMessage = historyMessage;
}
+
+ /**
+ * Sets the the important message flag of the event.
+ * @param isImportant the value to be set.
+ */
+ public void setImportantMessage(boolean isImportant)
+ {
+ isImportantMessage = isImportant;
+ }
+
+ /**
+ * Returns <tt>true</tt> if message is important and <tt>false</tt> if not.
+ * @return <tt>true</tt> if message is important and <tt>false</tt> if not.
+ */
+ public boolean isImportantMessage()
+ {
+ return isImportantMessage;
+ }
}