diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java
index 8cb0d6e29..4a0c4d66a 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/conference/ConferenceChatPanel.java
@@ -223,7 +223,7 @@ public void messageReceived(ChatRoomMessageReceivedEvent evt)
Contact sourceContact = evt.getSourceContact();
Date date = evt.getTimestamp();
- Message message = evt.getSourceMessage();
+ Message message = evt.getMessage();
ChatRoom chatRoom = (ChatRoom) evt.getSource();
@@ -257,7 +257,7 @@ public void messageDelivered(ChatRoomMessageDeliveredEvent evt)
logger.trace("MESSAGE DELIVERED to contact: "
+ evt.getDestinationContact().getAddress());
- Message msg = evt.getSourceMessage();
+ Message msg = evt.getMessage();
ChatPanel chatPanel = null;
diff --git a/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java
index 57116ca0d..1883d1b1e 100644
--- a/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java
+++ b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java
@@ -30,31 +30,31 @@ public class ChatRoomMessageDeliveredEvent
private Date timestamp = null;
/**
- * The name/id of the chat room where the message was delivered.
+ * The received Message.
*/
- private String chatRoomID = null;
+ private Message message = null;
/**
* Creates a MessageDeliveredEvent representing delivery of the
* source message to the specified to contact.
*
- * @param source the Message whose delivery this event represents.
+ * @param source the ChatRoom which triggered this event.
* @param to the Contact 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(Message source,
+ public ChatRoomMessageDeliveredEvent(ChatRoom source,
Contact to,
Date timestamp,
- String chatRoomID)
+ Message message)
{
super(source);
this.to = to;
this.timestamp = timestamp;
- this.chatRoomID = chatRoomID;
+ this.message = message;
}
/**
@@ -70,15 +70,14 @@ public Contact getDestinationContact()
}
/**
- * Returns the message that triggered this event
+ * Returns the received message.
* @return the Message that triggered this event.
*/
- public Message getSourceMessage()
+ public Message getMessage()
{
- return (Message) getSource();
+ return message;
}
-
/**
* A timestamp indicating the exact date when the event ocurred.
* @return a Date indicating when the event ocurred.
@@ -89,12 +88,11 @@ public Date getTimestamp()
}
/**
- * Returns the name of the chat room where this message has been delivered.
- * @return the name of the chat room where this message has been delivered.
+ * Returns the ChatRoom that triggered this event.
+ * @return the ChatRoom that triggered this event.
*/
- public String getChatRoomID()
+ public ChatRoom getSourceChatRoom()
{
- return chatRoomID;
+ return (ChatRoom) getSource();
}
-
}
diff --git a/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveryFailedEvent.java b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveryFailedEvent.java
index ffe5b4ae3..bc22eb57d 100644
--- a/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveryFailedEvent.java
+++ b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveryFailedEvent.java
@@ -64,9 +64,9 @@ public class ChatRoomMessageDeliveryFailedEvent
private Date timestamp = null;
/**
- * The name/id of the chat room where the message was delivered.
+ * The received Message.
*/
- private String chatRoomID = null;
+ private Message message = null;
/**
* Creates a MessageDeliveryFailedEvent indicating failure of
@@ -78,21 +78,20 @@ public class ChatRoomMessageDeliveryFailedEvent
* @param errorCode an errorCode indicating the reason of the failure.
* @param timestamp the exacte Date when it was determined that delivery
* had failed.
- * @param chatRoomID the name/id of the chat room that the failed message
- * was destined to.
+ * @param message the received Message.
*/
- public ChatRoomMessageDeliveryFailedEvent(Message source,
+ public ChatRoomMessageDeliveryFailedEvent(ChatRoom source,
Contact to,
int errorCode,
Date timestamp,
- String chatRoomID)
+ Message message)
{
super(source);
this.to = to;
this.errorCode = errorCode;
this.timestamp = timestamp;
- this.chatRoomID = chatRoomID;
+ this.message = message;
}
/**
* Returns a reference to the Contact that the source (failed)
@@ -105,6 +104,15 @@ public Contact getDestinationContact()
{
return to;
}
+
+ /**
+ * Returns the received message.
+ * @return the Message that triggered this event.
+ */
+ public Message getMessage()
+ {
+ return message;
+ }
/**
* Returns an error code descibing the reason for the failure of the
@@ -130,13 +138,11 @@ public Date getTimestamp()
}
/**
- * Returns the name of the chat room where this message was meant to be
- * delivered.
- * @return the name of the chat room where this message was meant to be
- * delivered.
+ * Returns the ChatRoom that triggered this event.
+ * @return the ChatRoom that triggered this event.
*/
- public String getChatRoomID()
+ public ChatRoom getSourceChatRoom()
{
- return chatRoomID;
+ return (ChatRoom) getSource();
}
}
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 0b6c7f2eb..dd3d27233 100644
--- a/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java
+++ b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageReceivedEvent.java
@@ -29,31 +29,30 @@ public class ChatRoomMessageReceivedEvent
private Date timestamp = null;
/**
- * The name/id of the ChatRoom where this message was received.
+ * The received Message.
*/
- private String chatRoomID = null;
+ private Message message = null;
/**
* Creates a MessageReceivedEvent representing reception of the
* source message received from the specified from
* contact.
*
- * @param source the Message whose reception this event represents.
+ * @param source the ChatRoom for which the message is received.
* @param from the Contact that has sent this message.
* @param timestamp the exact date when the event ocurred.
- * @param chatRoomID the name/id of the chat room where this message has
- * been received
+ * @param message the received Message.
*/
- public ChatRoomMessageReceivedEvent(Message source,
+ public ChatRoomMessageReceivedEvent(ChatRoom source,
Contact from,
Date timestamp,
- String chatRoomID)
+ Message message)
{
super(source);
this.from = from;
this.timestamp = timestamp;
- this.chatRoomID = chatRoomID;
+ this.message = message;
}
/**
@@ -69,12 +68,12 @@ public Contact getSourceContact()
}
/**
- * Returns the message that triggered this event
+ * Returns the received message.
* @return the Message that triggered this event.
*/
- public Message getSourceMessage()
+ public Message getMessage()
{
- return (Message)getSource();
+ return message;
}
/**
@@ -87,11 +86,11 @@ public Date getTimestamp()
}
/**
- * Returns the name of the chat room where this message has been received.
- * @return the name of the chat room where this message has been received.
+ * Returns the ChatRoom that triggered this event.
+ * @return the ChatRoom that triggered this event.
*/
- public String getChatRoomID()
+ public ChatRoom getSourceChatRoom()
{
- return chatRoomID;
+ return (ChatRoom) getSource();
}
}