All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.intelie.live.plugins.messenger.data.UserMessage Maven / Gradle / Ivy

The newest version!
package net.intelie.live.plugins.messenger.data;

public class UserMessage {
    private final String uid;
    private final RoomData room;
    private final UserData author;
    private String message;
    private Boolean edited;
    private long createdAt;
    private long timestamp;
    private String timeZone;


    public UserMessage(String uid, RoomData room, UserData author, String message) {
        this(uid, room, author, message, null);
    }

    public UserMessage(String uid, RoomData room, UserData author, String message, String timeZone) {
        this.uid = uid;
        this.room = room;
        this.author = author;
        this.message = message;
        this.timestamp = System.currentTimeMillis();
        this.createdAt = timestamp;
        this.timeZone = timeZone;
    }

    public String getUid() {
        return uid;
    }

    public RoomData getRoom() {
        return room;
    }

    public String getMessage() {
        return message;
    }

    public UserData getAuthor() {
        return author;
    }

    public String getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }

    public void updateFrom(UserMessage other, MessageSanitizer sanitizer) {
        message = sanitizer.sanitize(other.getMessage());
        edited = true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy