[sip-comm-cvs] CVS update: /sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/conference/, /sip-communicator/src/net/java/sip/communicator/service...

yanas at dev.java.net yanas at dev.java.net
Fri Apr 27 17:43:48 CEST 2007


User: yanas   
Date: 2007-04-27 15:43:48+0000
Modified:
   sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java
   sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java
   sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveryFailedEvent.java
   sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java

Log:
 change Contact to ChatRoomMember in all events concerning the chat room

File Changes:

Directory: /sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/conference/
=========================================================================================

File [changed]: ConferenceChatPanel.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java?r1=1.6&r2=1.7
Delta lines:  +14 -13
---------------------
--- ConferenceChatPanel.java	2007-04-26 11:22:00+0000	1.6
+++ ConferenceChatPanel.java	2007-04-27 15:43:45+0000	1.7
@@ -218,10 +218,11 @@
         if(!sourceChatRoom.equals(chatRoom))
             return;
 
+        ChatRoomMember sourceMember = evt.getSourceChatRoomMember();
+        
         logger.trace("MESSAGE RECEIVED from contact: "
-            + evt.getSourceContact().getAddress());
+            + sourceMember.getContactAddress());
 
-        Contact sourceContact = evt.getSourceContact();
         Date date = evt.getTimestamp();
         Message message = evt.getMessage();
 
@@ -230,15 +231,13 @@
         ChatPanel chatPanel = chatWindowManager.getChatRoom(chatRoom);
 
         chatPanel.processMessage(
-                sourceContact.getDisplayName(), date,
+                sourceMember.getName(), date,
                 Constants.INCOMING_MESSAGE, message.getContent());
 
         chatWindowManager.openChat(chatPanel, false);
 
         GuiActivator.getAudioNotifier()
             .createAudio(Sounds.INCOMING_MESSAGE).play();
-
-        chatPanel.treatReceivedMessage(sourceContact);
     }
 
     /**
@@ -254,8 +253,10 @@
         if(!sourceChatRoom.equals(chatRoom))
             return;
 
+        ChatRoomMember destMember = evt.getDestinationChatRoomMember();
+        
         logger.trace("MESSAGE DELIVERED to contact: "
-            + evt.getDestinationContact().getAddress());
+            + destMember.getContactAddress());
 
         Message msg = evt.getMessage();
 
@@ -266,11 +267,11 @@
 
         if (chatPanel != null)
         {
-            ProtocolProviderService protocolProvider = evt
-                    .getDestinationContact().getProtocolProvider();
+            ProtocolProviderService protocolProvider
+                = destMember.getProtocolProvider();
 
             logger.trace("MESSAGE DELIVERED: process message to chat for contact: "
-                    + evt.getDestinationContact().getAddress());
+                    + destMember.getContactAddress());
 
             chatPanel.processMessage(getChatWindow().getMainFrame()
                     .getAccount(protocolProvider), evt.getTimestamp(),
@@ -297,7 +298,7 @@
 
         Message sourceMessage = (Message) evt.getSource();
 
-        Contact sourceContact = evt.getDestinationContact();
+        ChatRoomMember destMember = evt.getDestinationChatRoomMember();
 
         if (evt.getErrorCode()
                 == MessageDeliveryFailedEvent.OFFLINE_MESSAGES_NOT_SUPPORTED) {
@@ -333,13 +334,13 @@
         chatPanel.refreshWriteArea();
 
         chatPanel.processMessage(
-                sourceContact.getDisplayName(),
+                destMember.getName(),
                 new Date(System.currentTimeMillis()),
                 Constants.OUTGOING_MESSAGE,
                 sourceMessage.getContent());
 
         chatPanel.processMessage(
-                sourceContact.getDisplayName(),
+                destMember.getName(),
                 new Date(System.currentTimeMillis()),
                 Constants.ERROR_MESSAGE,
                 errorMsg);

Directory: /sip-communicator/src/net/java/sip/communicator/service/protocol/event/
==================================================================================

File [changed]: ChatRoomMessageDeliveredEvent.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java?r1=1.2&r2=1.3
Delta lines:  +7 -7
-------------------
--- ChatRoomMessageDeliveredEvent.java	2007-04-26 11:22:00+0000	1.2
+++ ChatRoomMessageDeliveredEvent.java	2007-04-27 15:43:46+0000	1.3
@@ -20,9 +20,9 @@
     extends EventObject
 {
     /**
-      * The contact that has sent this message.
+      * The chat room member that has sent this message.
       */
-     private Contact to = null;
+     private ChatRoomMember to = null;
 
      /**
       * A timestamp indicating the exact date when the event occurred.
@@ -39,14 +39,14 @@
       * <tt>source</tt> message to the specified <tt>to</tt> contact.
       *
       * @param source the <tt>ChatRoom</tt> which triggered this event.
-      * @param to the <tt>Contact</tt> that this message was sent to.
+      * @param to the <tt>ChatRoomMember</tt> that this message was sent to.
       * @param timestamp a date indicating the exact moment when the event
       * ocurred
       * @param chatRoomID the name/id of the chatroom where this message was
       * delivered.
       */
      public ChatRoomMessageDeliveredEvent(ChatRoom source,
-                                          Contact to,
+                                          ChatRoomMember to,
                                           Date timestamp,
                                           Message message)
      {
@@ -58,13 +58,13 @@
      }
 
      /**
-      * Returns a reference to the <tt>Contact</tt> that <tt>Message</tt> was
-      * sent to.
+      * Returns a reference to the <tt>ChatRoomMember</tt> that <tt>Message</tt>
+      * was sent to.
       *
       * @return a reference to the <tt>Contact</tt> that has send the
       * <tt>Message</tt> whose reception this event represents.
       */
-     public Contact getDestinationContact()
+     public ChatRoomMember getDestinationChatRoomMember()
      {
          return to;
      }

File [changed]: ChatRoomMessageDeliveryFailedEvent.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveryFailedEvent.java?r1=1.2&r2=1.3
Delta lines:  +9 -9
-------------------
--- ChatRoomMessageDeliveryFailedEvent.java	2007-04-26 11:22:00+0000	1.2
+++ ChatRoomMessageDeliveryFailedEvent.java	2007-04-27 15:43:46+0000	1.3
@@ -20,9 +20,9 @@
     extends EventObject
 {
     /**
-      * The contact that this message has been sent to.
+      * The chat room member that this message has been sent to.
       */
-     private Contact to = null;
+     private ChatRoomMember to = null;
 
      /**
       * Set when no other error code can describe the exception that occurred.
@@ -74,14 +74,14 @@
       * contact.
       *
       * @param source the <tt>Message</tt> whose delivery this event represents.
-      * @param to the <tt>Contact</tt> that this message was sent to.
+      * @param to the <tt>ChatRoomMember</tt> that this message was sent to.
       * @param errorCode an errorCode indicating the reason of the failure.
       * @param timestamp the exacte Date when it was determined that delivery
       * had failed.
       * @param message the received <tt>Message</tt>.
       */
      public ChatRoomMessageDeliveryFailedEvent(ChatRoom source,
-                                               Contact to,
+                                               ChatRoomMember to,
                                                int errorCode,
                                                Date timestamp,
                                                Message message)
@@ -94,13 +94,13 @@
          this.message = message;
      }
      /**
-      * Returns a reference to the <tt>Contact</tt> that the source (failed)
-      * <tt>Message</tt> was sent to.
+      * Returns a reference to the <tt>ChatRoomMember</tt> that the source
+      * (failed) <tt>Message</tt> was sent to.
       *
-      * @return a reference to the <tt>Contact</tt> that the source failed
-      * <tt>Message</tt> wwas sent to.
+      * @return a reference to the <tt>ChatRoomMember</tt> that the source failed
+      * <tt>Message</tt> was sent to.
       */
-     public Contact getDestinationContact()
+     public ChatRoomMember getDestinationChatRoomMember()
      {
          return to;
      }

File [changed]: ChatRoomMessageReceivedEvent.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java?r1=1.2&r2=1.3
Delta lines:  +7 -7
-------------------
--- ChatRoomMessageReceivedEvent.java	2007-04-26 11:22:00+0000	1.2
+++ ChatRoomMessageReceivedEvent.java	2007-04-27 15:43:46+0000	1.3
@@ -19,9 +19,9 @@
     extends EventObject
 {
     /**
-     * The contact that has sent this message.
+     * The chat room member that has sent this message.
      */
-    private Contact from = null;
+    private ChatRoomMember from = null;
 
     /**
      * A timestamp indicating the exact date when the event occurred.
@@ -39,12 +39,12 @@
      * contact.
      *
      * @param source the <tt>ChatRoom</tt> for which the message is received.
-     * @param from the <tt>Contact</tt> that has sent this message.
+     * @param from the <tt>ChatRoomMember</tt> that has sent this message.
      * @param timestamp the exact date when the event ocurred.
      * @param message the received <tt>Message</tt>.
      */
     public ChatRoomMessageReceivedEvent(ChatRoom source,
-                                        Contact from,
+                                        ChatRoomMember from,
                                         Date timestamp,
                                         Message message)
     {
@@ -56,13 +56,13 @@
     }
 
     /**
-     * Returns a reference to the <tt>Contact</tt> that has send the
+     * Returns a reference to the <tt>ChatRoomMember</tt> that has send the
      * <tt>Message</tt> whose reception this event represents.
      *
-     * @return a reference to the <tt>Contact</tt> that has send the
+     * @return a reference to the <tt>ChatRoomMember</tt> that has send the
      * <tt>Message</tt> whose reception this event represents.
      */
-    public Contact getSourceContact()
+    public ChatRoomMember getSourceChatRoomMember()
     {
         return from;
     }




---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: cvs-help at sip-communicator.dev.java.net





More information about the commits mailing list