Added Chat#isUnread() for future use in message notifications
This commit is contained in:
		| @@ -59,6 +59,13 @@ public class Chat implements Serializable { | |||||||
| 			} | 			} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	/** | ||||||
|  | 	 * @return {@code true} if the newest message received in the chat doesn't have | ||||||
|  | 	 *         the status {@code READ} | ||||||
|  | 	 * @since Envoy v0.3-alpha | ||||||
|  | 	 */ | ||||||
|  | 	public boolean isUnread() { return !model.isEmpty() && model.get(model.size() - 1).getStatus() != MessageStatus.READ; } | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * @return all messages in the current chat | 	 * @return all messages in the current chat | ||||||
| 	 * @since Envoy v0.1-alpha | 	 * @since Envoy v0.1-alpha | ||||||
|   | |||||||
| @@ -78,6 +78,12 @@ public final class ComponentListModel<E> implements Iterable<E>, Serializable { | |||||||
| 	 */ | 	 */ | ||||||
| 	public int size() { return elements.size(); } | 	public int size() { return elements.size(); } | ||||||
|  |  | ||||||
|  | 	/** | ||||||
|  | 	 * @return {@code true} if this model contains no elements | ||||||
|  | 	 * @see java.util.List#isEmpty() | ||||||
|  | 	 */ | ||||||
|  | 	public boolean isEmpty() { return elements.isEmpty(); } | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * @return an iterator over the elements of this list model | 	 * @return an iterator over the elements of this list model | ||||||
| 	 * @see java.util.List#iterator() | 	 * @see java.util.List#iterator() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user