Merge branch 'develop' into f/new_ui

This commit is contained in:
DieGurke
2020-08-01 10:49:40 +02:00
committed by GitHub
51 changed files with 1157 additions and 239 deletions

View File

@ -18,29 +18,28 @@ public class Attachment implements Serializable {
/**
* Defines the type of the attachment.
*
*
* @since Envoy Common v0.1-beta
*/
public enum AttachmentType {
/**
* This attachment type denotes a picture.
*
*
* @since Envoy Common v0.1-beta
*/
PICTURE,
/**
* This attachment type denotes a video.
*
*
* @since Envoy Common v0.1-beta
*/
VIDEO,
/**
* This attachment type denotes a voice message.
*
*
* @since Envoy Common v0.1-beta
*/
VOICE,
@ -55,18 +54,21 @@ public class Attachment implements Serializable {
private final byte[] data;
private final AttachmentType type;
private final String name;
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 2L;
/**
* Constructs an attachment.
*
*
* @param data the data of the attachment
* @param name the name of the attachment
* @param type the type of the attachment
* @since Envoy Common v0.1-beta
*/
public Attachment(byte[] data, AttachmentType type) {
public Attachment(byte[] data, String name, AttachmentType type) {
this.data = data;
this.name = name;
this.type = type;
}
@ -81,4 +83,10 @@ public class Attachment implements Serializable {
* @since Envoy Common v0.1-beta
*/
public AttachmentType getType() { return type; }
/**
* @return the name
* @since Envoy Common v0.2-beta
*/
public String getName() { return name; }
}

View File

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