mirror of https://github.com/sipwise/jitsi.git
Added multichat operation set definition and Gibberish protocol implementation. Related issues: Issue #241 , Issue #244, Issue #250
Added an event that would be dispatched on message events in chat roomscusax-fix
parent
e588f65a8c
commit
fee1e2be94
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* 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.*;
|
||||
|
||||
/**
|
||||
* <tt>MessageReceivedEvent</tt>s indicate reception of an instant message.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class ChatRoomMessageReceivedEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* The contact that has sent this message.
|
||||
*/
|
||||
private Contact from = null;
|
||||
|
||||
/**
|
||||
* A timestamp indicating the exact date when the event occurred.
|
||||
*/
|
||||
private Date timestamp = null;
|
||||
|
||||
/**
|
||||
* The name/id of the ChatRoom where this message was received.
|
||||
*/
|
||||
private String chatRoomID = null;
|
||||
|
||||
/**
|
||||
* Creates a <tt>MessageReceivedEvent</tt> representing reception of the
|
||||
* <tt>source</tt> message received from the specified <tt>from</tt>
|
||||
* contact.
|
||||
*
|
||||
* @param source the <tt>Message</tt> whose reception this event represents.
|
||||
* @param from the <tt>Contact</tt> 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
|
||||
*/
|
||||
public ChatRoomMessageReceivedEvent(Message source,
|
||||
Contact from,
|
||||
Date timestamp,
|
||||
String chatRoomID)
|
||||
{
|
||||
super(source);
|
||||
|
||||
this.from = from;
|
||||
this.timestamp = timestamp;
|
||||
this.chatRoomID = chatRoomID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference to the <tt>Contact</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
|
||||
* <tt>Message</tt> whose reception this event represents.
|
||||
*/
|
||||
public Contact getSourceContact()
|
||||
{
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the message that triggered this event
|
||||
* @return the <tt>Message</tt> 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 received.
|
||||
* @return the name of the chat room where this message has been received.
|
||||
*/
|
||||
public String getChatRoomID()
|
||||
{
|
||||
return chatRoomID;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue