@Override
public RemoveContactResult execute(@Valid RemoveContact action,
ExecutionContext context) throws ActionException {
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
UserBeanOAM oam = provider.get();
oam.removeContact(user.getEmail(), action.getEmail(), action.isPending());
// Pending contacts exists only in one user, but contacts in two
if(!action.isPending()){
oam.removeContact(action.getEmail(), user.getEmail(), false);
String json = toJson.getJson(null, user.getEmail(), MessageType.removeContact);
ChannelService channelService = ChannelServiceFactory.getChannelService();
channelService.sendMessage(new ChannelMessage(action.getEmail(), json));
}
return new RemoveContactResult();