From 9087449c03c04cececdd752a20deea0593c3c8ff Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Thu, 22 Feb 2007 12:36:32 +0000 Subject: [PATCH] Added multichat operation set definition and Gibberish protocol implementation. Related issues: Issue #241 , Issue #244, Issue #250 Added an event notifying listeners that a chat room message has been successfully delivered --- .../event/ChatRoomMessageDeliveredEvent.java | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java diff --git a/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java new file mode 100644 index 000000000..57116ca0d --- /dev/null +++ b/src/net/java/sip/communicator/service/protocol/event/ChatRoomMessageDeliveredEvent.java @@ -0,0 +1,100 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.service.protocol.event; + +import java.util.*; + +import net.java.sip.communicator.service.protocol.*; + +/** + * MessageDeliveredEvents confirm successful delivery of an instant + * message. + * + * @author Emil Ivov + */ +public class ChatRoomMessageDeliveredEvent + extends EventObject +{ + /** + * The contact that has sent this message. + */ + private Contact to = null; + + /** + * A timestamp indicating the exact date when the event occurred. + */ + private Date timestamp = null; + + /** + * The name/id of the chat room where the message was delivered. + */ + private String chatRoomID = 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 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, + Contact to, + Date timestamp, + String chatRoomID) + { + super(source); + + this.to = to; + this.timestamp = timestamp; + this.chatRoomID = chatRoomID; + } + + /** + * Returns a reference to the Contact that Message was + * sent to. + * + * @return a reference to the Contact that has send the + * Message whose reception this event represents. + */ + public Contact getDestinationContact() + { + return to; + } + + /** + * Returns the message that triggered this event + * @return the Message that triggered this event. + */ + public Message getSourceMessage() + { + return (Message) getSource(); + } + + + /** + * A timestamp indicating the exact date when the event ocurred. + * @return a Date indicating when the event ocurred. + */ + public Date getTimestamp() + { + return timestamp; + } + + /** + * 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. + */ + public String getChatRoomID() + { + return chatRoomID; + } + +}