Fixed message reading
This commit is contained in:
		| @@ -45,15 +45,18 @@ public class Chat implements Serializable { | ||||
| 	public void appendMessage(Message message) { model.add(message); } | ||||
|  | ||||
| 	/** | ||||
| 	 * Sets the status of all chat messages to {@code READ} starting from the bottom | ||||
| 	 * and stopping once a read message is found. | ||||
| 	 *  | ||||
| 	 * Sets the status of all chat messages received from the recipient to | ||||
| 	 * {@code READ} starting from the bottom and stopping once a read message is | ||||
| 	 * found. | ||||
| 	 * | ||||
| 	 * @since Envoy v0.3-alpha | ||||
| 	 */ | ||||
| 	public void read() { | ||||
| 		for (int i = model.size() - 1; i >= 0; --i) | ||||
| 			if (model.get(i).getStatus() == MessageStatus.READ) break; | ||||
| 			else model.get(i).setStatus(MessageStatus.READ); | ||||
| 			if (model.get(i).getSenderId() == recipient.getId()) { | ||||
| 				if (model.get(i).getStatus() == MessageStatus.READ) break; | ||||
| 				else model.get(i).setStatus(MessageStatus.READ); | ||||
| 			} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user