Ignore messages if the srcAvatar is on destAvatar's ignore list.

This commit is contained in:
apathy
2016-07-26 20:00:33 -07:00
parent 98f2a8cac7
commit a377a48ecb
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -24,5 +24,9 @@ SendInstantMessage::SendInstantMessage(
throw ChatResultException(ChatResultCode::DESTAVATARDOESNTEXIST);
}
if (destAvatar->IsIgnored(srcAvatar)) {
throw ChatResultException(ChatResultCode::IGNORING);
}
client->SendInstantMessageUpdate(srcAvatar, destAvatar, request.message, request.oob);
}
+4
View File
@@ -26,6 +26,10 @@ SendPersistentMessage::SendPersistentMessage(GatewayClient * client, const Reque
throw ChatResultException{ChatResultCode::SRCAVATARDOESNTEXIST};
}
if (destAvatar->IsIgnored(srcAvatar)) {
throw ChatResultException(ChatResultCode::IGNORING);
}
message.header.fromName = srcAvatar->GetName();
message.header.fromAddress = srcAvatar->GetAddress();
} else {