     }
 
     func loadMoreMessages(completion: (() -> Void)? = nil) {
-        guard !isLoadingMoreMessages else { return }
+        guard !isLoadingMoreMessages && hasMoreMessages else { return }
 
         if isListingMentions {
             loadMentions(completion: completion)


    var query: String?
    private var isLoadingMoreMessages = false

    func searchMessages(withText text: String, completion: (() -> Void)? = nil) {
        guard let subscription = subscription else {

        API.current()?.fetch(request, options: options) { [weak self] response in
            switch response {
            case .resource(let resource):
                self?.hasMoreMessages = resource.count ?? 0 > 0
                self?.handleMessages(
                    fetchingWith: resource.fetchMessagesFromRealm,
                    showing: resource.count,
