Search in sources :

Example 6 with SocialRelation

use of com.faforever.server.entity.SocialRelation in project faf-java-server by FAForever.

the class SocialService method addFoe.

@Transactional
public void addFoe(Player requester, int foeId) {
    removeFriend(requester, foeId);
    log.debug("Adding '{}' as a foe of player '{}'", foeId, requester);
    socialRelationRepository.save(new SocialRelation(requester.getId(), requester, foeId, SocialRelationStatus.FOE));
}
Also used : SocialRelation(com.faforever.server.entity.SocialRelation) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

SocialRelation (com.faforever.server.entity.SocialRelation)6 Test (org.junit.Test)3 Transactional (org.springframework.transaction.annotation.Transactional)3 Player (com.faforever.server.entity.Player)2 PlayerOnlineEvent (com.faforever.server.player.PlayerOnlineEvent)2 SocialRelationResponse (com.faforever.server.social.SocialRelationListResponse.SocialRelationResponse)2 ClientService (com.faforever.server.client.ClientService)1 SocialRelationStatus (com.faforever.server.entity.SocialRelationStatus)1 User (com.faforever.server.entity.User)1 FafUserDetails (com.faforever.server.security.FafUserDetails)1 RelationType (com.faforever.server.social.SocialRelationListResponse.SocialRelationResponse.RelationType)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Slf4j (lombok.extern.slf4j.Slf4j)1 EventListener (org.springframework.context.event.EventListener)1 Service (org.springframework.stereotype.Service)1