Skip to content

Instantly share code, notes, and snippets.

@protoss1010
Created July 15, 2016 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save protoss1010/073f771beecdd39d01d99ecbf7a95cd3 to your computer and use it in GitHub Desktop.
Save protoss1010/073f771beecdd39d01d99ecbf7a95cd3 to your computer and use it in GitHub Desktop.
package tw.com.fet.ecs.xmpp.level1.filter;
import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
public class EmmaDisplayedPacketFilter implements PacketFilter {
@Override
public boolean accept(Packet packet) {
if (!(packet instanceof Message)) {
return false;
} else {
Message message = (Message) packet;
// Have emmaDisplayed
return message.getEmmaDisplayeds().size() > 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment