~singpolyma/snikket-sdk

6f3c08946abf058cd77d955f10625f40176a01ef — Stephen Paul Weber 22 days ago d350811
Persist block even if already closed
1 files changed, 5 insertions(+), 1 deletions(-)

M snikket/Chat.hx
M snikket/Chat.hx => snikket/Chat.hx +5 -1
@@ 290,7 290,11 @@ abstract class Chat {
	public function block(reportSpam: Null<ChatMessage>, onServer: Bool): Void {
		if (reportSpam != null && !onServer) throw "Can't report SPAM if not sending to server";
		isBlocked = true;
		if (uiState != Closed) close(); // close persists
		if (uiState == Closed) {
			persistence.storeChat(client.accountId(), this);
		} else {
			close(); // close persists
		}
		if (onServer) {
			final iq = new Stanza("iq", { type: "set", id: ID.short() })
				.tag("block", { xmlns: "urn:xmpp:blocking" })