code: function() {
                  chatSendQueueHandlerTimeout && clearTimeout(chatSendQueueHandlerTimeout);
                  if (chatSendQueue.length) {
                      var messageToBeSend = chatSendQueue[0];
  
                      /**
                       * Getting chatSendQueue from either cache or
                       * memory and scrolling through the send queue
                       * to send all the messages which are waiting
                       * for chatState to become TRUE
                       *
                       * There is a small possibility that a Message
                       * wouldn't make it through network, so it Will
                       * not reach chat server. To avoid losing those
                       * messages, we put a clone of every message
                       * in waitQ, and when ack of the message comes,
                       * we delete that message from waitQ. otherwise
                       * we assume that these messages have been failed to
                       * send and keep them to be either canceled or resent
                       * by user later. When user calls getHistory(), they
                       * will have failed messages alongside with typical
                       * messages history.
                       */
                      if (chatState) {
                          getChatSendQueue(0, function(chatSendQueue) {
                              deleteFromChatSentQueue(messageToBeSend,
                                  function() {
                                      sendMessage(messageToBeSend.message, messageToBeSend.callbacks, function() {
                                          if (chatSendQueue.length) {
                                              chatSendQueueHandler();
                                          }
                                      });
                                  });
                          });
                      }
                  }
              }
docs: *****************************************************
  P R I V A T E   M E T H O D S            *
  *****************************************************