Skip to content
Permalink
Browse files Browse the repository at this point in the history
Checks from for received carbon messages, should be bare jid.
  • Loading branch information
damencho committed Jan 26, 2017
1 parent cf6951b commit 7d66da6
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -815,6 +815,17 @@ public void processPacket(Packet packet)
ForwardedPacketExtension.class);
if(extensions.isEmpty())
return;

// according to xep-0280 all carbons should come from
// our bare jid
if (!msg.getFrom().equals(
StringUtils.parseBareAddress(
jabberProvider.getOurJID())))
{
logger.info("Received a carbon copy with wrong from!");
return;
}

ForwardedPacketExtension forwardedExt = extensions.get(0);
msg = forwardedExt.getMessage();
if(msg == null || msg.getBody() == null)
Expand Down

0 comments on commit 7d66da6

Please sign in to comment.