Last active
          August 29, 2015 14:27 
        
      - 
      
- 
        Save safaorhan/beadbe4df7b7002759c0 to your computer and use it in GitHub Desktop. 
    QBHelper - Step 2
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public void sendMessageToUser(int opponentId, String message) { | |
| QBPrivateChat privateChat = createPrivateChatIfNotExist(opponentId); | |
| if (null == getDialogOfOpponent(opponentId)) { | |
| retrieveDialogs(); | |
| } | |
| sendMessageToChat(privateChat, message); | |
| } | |
| private QBPrivateChat createPrivateChatIfNotExist(int opponentId) { | |
| QBPrivateChat privateChat = privateChatManager.getChat(opponentId); | |
| if (privateChat == null) { | |
| privateChat = privateChatManager.createChat(opponentId, null); | |
| } | |
| return privateChat; | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment