Added IsWriting event on common, server and partially on client side

additionally fixed NullPointerException in ContactSearchScene and typo
in Javadoc

PS: this is the 1000th commit in Envoy! 🥳 🎉
This commit is contained in:
delvh
2020-07-25 16:26:13 +02:00
parent 72d1e074f4
commit 6f8859c3fd
9 changed files with 151 additions and 18 deletions

View File

@ -0,0 +1,53 @@
package envoy.event;
/**
* This event should be sent when a user wrote anything in a chat.
* <p>
* Project: <strong>envoy-client</strong><br>
* File: <strong>IsWriting.java</strong><br>
* Created: <strong>24.07.2020</strong><br>
*
* @author Leon Hofmeister
* @since Envoy Client v0.2-beta
*/
public class IsWriting extends Event<Long> {
private final long destinationID;
private final String displayName;
private static final long serialVersionUID = 1L;
/**
* The number of milliseconds that this event will be active.<br>
* Currently set to 3.5 seconds.
*/
public static final int millisecondsActive = 3500;
/**
* Creates a new {@code IsWriting} with originator and recipient.
*
* @param sourceID the id of the originator
* @param displayName the name of the originator
* @param destinationID the id of the contact the user wrote to
* @since Envoy Client v0.2-beta
*/
public IsWriting(Long sourceID, long destinationID, String displayName) {
super(sourceID);
this.destinationID = destinationID;
this.displayName = displayName;
}
/**
* @return the id of the contact in whose chat the user wrote something
* @since Envoy Client v0.2-beta
*/
public long getDestinationID() { return destinationID; }
/**
* @return the name of the originator to display
* @since Envoy Common v0.2-beta
*/
public String getDisplayName() { return displayName; }
}