title: How to retrieve the offline messages from pubnub?
body: <p>I am trying to create a chat application using pubnub api in javascript for first time</p>
  
  <p>Below described is the logic i created for implementing a chat</p>
  
  <p>User  A is subscribed to channel "talktoA" and "ourPublicChannel"
  User B is subscribed to  channel "talktoB" and "ourPublicChannel"</p>
  
  <p>When a User A want to talk to User B User A will a message to channel "talktoB"
  as user B is subscribed to channel "talktoB" User B will receive the message and vice versa</p>
  
  <p>When users want to send broadcast message the users need to send message to channel "ourPublicChannel"</p>
  
  <p>Following are the code for each operations</p>
  
  <pre><code>1.  **Establish a Connection**
  
   var pubnub = PUBNUB.init({
      publish_key: 'pub-mypublishkey',
      subscribe_key: 'sub-mysubkey',
      uuid : me
      });
  
  2.  **Publish Message to a Channel**
  
  
  
       //Sending a private message
          pubnub.publish({
              channel: ['privatechannelofB'],   
              message: {
              text: “Test Message to userB ”,
              username: me
              }
              });
  
      //Sending a broadcast message   
      pubnub.publish({
          channel: ['publicchannel'],   
          message: {
          text: “A Broadcast Message to all user”,
          username: me
          }
          }); 
  
      3.  **Subscribe /Receive  to a channel**
      pubnub.subscribe({
              channel: ['myprivatechannel','mypublichannel']
              message: function(data) {
  
                alert(data)//Test Message
              }
          });
  
  
  4.  **History of message**
  pubnub.history({
       channel: channelname,
       callback: function(m){console.log(m)},
   });
  </code></pre>
  
  <p>I need to confirm the following</p>
  
  <p>How to retrieve the offline messages ? if user A send message to user B and user B is offline i need to show the offline
  messages? 
  History api will give the full list of message but how sort it whether it is offline messages</p>
  
  <p>Is the approach right?</p>