Fórumok
Automatic Friend association when users are in the same organization
Brian Scott Schupbach, módosítva 11 év-val korábban
Automatic Friend association when users are in the same organization
Expert Bejegyzések: 329 Csatlakozás dátuma: 2008.10.23. Legújabb bejegyzések
Is there a way to have users be automatically associated as "friends" without the need to send friend requests? It seems the chat functionality works this way but not any of the socialnetworking portlets.
Thanks,
Brian
Thanks,
Brian
Anil T, módosítva 11 év-val korábban
RE: Automatic Friend association when users are in the same organization
Expert Bejegyzések: 313 Csatlakozás dátuma: 2012.01.14. Legújabb bejegyzések
Hi,
You can get it through SocialRelationLocalServiceUtil class. First get all users from organization and use SocialRelationLocalServiceUtil.hasRelation(userId1,userId2,type) to check whether the user in friends or not. If he is not a friend then add him to socialrelation table through SocialRelationLocalServiceUtil.addRelation(userId1,userid2,type);
You can get it through SocialRelationLocalServiceUtil class. First get all users from organization and use SocialRelationLocalServiceUtil.hasRelation(userId1,userId2,type) to check whether the user in friends or not. If he is not a friend then add him to socialrelation table through SocialRelationLocalServiceUtil.addRelation(userId1,userid2,type);
Brian Scott Schupbach, módosítva 11 év-val korábban
RE: Automatic Friend association when users are in the same organization
Expert Bejegyzések: 329 Csatlakozás dátuma: 2008.10.23. Legújabb bejegyzések
Thanks..I appreciate that. That's kind of a bummer that each user of an organization would need to loop through every other user.