Uploaded image for project: 'PUBLIC - Liferay Social Office Community Edition'
  1. PUBLIC - Liferay Social Office Community Edition
  2. SOS-1940

Problem with "buddy.list.startegy" property: we can't see "friends" in chat portlet


    • Type: Bug
    • Status: Closed
    • Resolution: Fixed in LPS
    • Affects Version/s: 2.0.3 EE
    • Fix Version/s: 2.1.X EE
    • Labels:
    • Environment:
    • Fix Priority:
    • Affects Portal Version/s:
      6.1.20 EE GA2



      By default, the "buddy.list.startegy" in the chat portlet is set to "all", so you can see all the people that are currently active in Social Office.
      But this we do not want in this environment, it should be shown only the people who you have as a friend.

      The Chat Portlet does not recognize that I have friends in Social Office and show me always nothing although some of my friends are currently online.

      Important note:
      When you apply Social Networking into a LR with SO, the portal starts sending friend requests from Summary portlet with a wrong connection type. It sends "1" (coworker) as a "type_" instead of "2" (friend), then it will be stored with the wrong value in the socialrelation table. It seems the types, defined in SocialRelationConstants.java will be messed up.

      Note 2: the customer's version is: SOCIAL OFFICE VERSION: 2.0.5!

      === Reproduction
      1a. Download/gather Social Office 2.0.5 or 2.1.0 either from Marketplace or use the latest Snapshot Release (LPKG) from https://svn.liferay.com/repos/private/support/snapshot-releases/social-office/2.1.0/
      1b. You need at least Chat & Contacts portlets

      2. Start 6.1.20 EE GA2
      3. Login with Test Test
      4. Register license for SO
      5. Deploy the plugins/LPKG

      6. Create a new User called "friend, friend@liferay.com"
      7. Set password for this user in order to login with him
      8. Go to Contacts Center on the Control Panel
      9. Click on "Add Connect" and add "friend" as a new connection

      (In the background, the SocialRequest will be created with type SocialRelationConstants.TYPE_BI_CONNECTION = 12)

      10. Login with "friend" from another browser
      11. Go to his "Public Page"
      12. Place "Requests" portlet on the page
      13. Confirm the request from "Test Test"

      (In the background, a new SocialRelation will be created with the type above, see the code snippet below

      // ... line 76
      	var contactsToolbarChildren = [];
      		new A.Button(
      				on: {
      					click: function(event) {
      						<portlet:namespace />relationAction(event, '<portlet:actionURL name="requestSocialRelation" windowState="<%= LiferayWindowState.NORMAL.toString() %>"><portlet:param name="type" value="<%= String.valueOf(SocialRelationConstants.TYPE_BI_CONNECTION) %>" /></portlet:actionURL>');
      				icon: 'icon-plus-sign',
      				id: '<portlet:namespace />addConnectionButton',
      				label: '<%= UnicodeLanguageUtil.get(pageContext, "connect") %>',
      				render: true,
      				visible: <%= showAddAsConnectionButton %>

      14. Assert the both users are able to see each other on the Chat Portlet

      15. Stop portal
      16. Go to [$TOMCAT_HOME]/webapps/chat-portlet/WEB-INF/classes
      17. Open "portlet.properties"
      18. Change




      then save, close.

      19. Start portal
      20. Login in with both users

      Observed behavior
      Users are not able to see each other anymore.

      === Technical background
      When the buddy strategy is set to "friends", we try to retrieve friends with SocialRelation type SocialRelationConstants.TYPE_BI_FRIEND in

      // ...
      		else if (PortletPropsValues.BUDDY_LIST_STRATEGY.equals("friends")) {
      			buddies = StatusLocalServiceUtil.getSocialStatuses(
      				userId, SocialRelationConstants.TYPE_BI_FRIEND, modifiedDate, 0,

      That causes the problem.




            mandy.lee Mandy Lee (Inactive)
            peter.tar Peter Tar (Inactive)
            Participants of an Issue:
            0 Vote for this issue
            3 Start watching this issue


              Days since last comment:
              7 years, 3 days ago


                Version Package
                2.1.X EE