title: How i can delete firestore listener?
body: <p>I set the listener if <code>isNeedToListen = true</code>, otherwise I remove it, but it still works and I have set listeners that contradict each other when I enter the same chat room from different accounts</p>
  <pre><code>override fun listenMessage(
      receiver_id: String,
      user_id: String,
      messages: MutableLiveData&lt;ArrayList&lt;Message&gt;&gt;,
      onSuccess: (ArrayList&lt;Message&gt;) -&gt; Unit,
      isNeedToListen:Boolean
  ) {
      var listenUserMessage: ListenerRegistration? =  null
      var listenReceiverMessage: ListenerRegistration? =  null
      if(isNeedToListen){
          listenUserMessage = database
              .collection(KEY_COLLECTION_USERS)
              .document(user_id)
              .collection(KEY_COLLECTION_CHAT)
              .addSnapshotListener { value, error -&gt; ...
              }
  
          listenReceiverMessage = database
              .collection(KEY_COLLECTION_USERS)
              .document(receiver_id)
              .collection(KEY_COLLECTION_CHAT)
              .addSnapshotListener { value, error -&gt;...
              }
      }else{
          if(listenUserMessage !=null){
              listenUserMessage.remove()
          }
          if(listenReceiverMessage !=null){
              listenReceiverMessage.remove()
          }
      }
  
  }
  </code></pre>
  <p><strong>UPD</strong>
  <code>isNeedToListen</code> coming from</p>
  <pre><code>firebaseRepostory.listenMessage(receiver_id, user_id, messages, onSuccess,false)
  </code></pre>
  <p>this code is executed <code>onStop()</code></p>
  <pre><code>firebaseRepostory.listenMessage(receiver_id, user_id, messages, onSuccess,true)
  </code></pre>
  <p>this code is executed <code>onStart()</code></p>