summary refs log tree commit diff
path: root/src/UserDirectoryModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-01-31 18:22:12 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2023-01-31 18:22:12 +0100
commit0c3d46795b589d9dfb2e6caa7f94db77fd5371bd (patch)
tree4d3bdc9cee84be37f51465e49ec38a9055452dd0 /src/UserDirectoryModel.cpp
parentUncoditionally request keyframes (diff)
downloadnheko-0c3d46795b589d9dfb2e6caa7f94db77fd5371bd.tar.xz
Make single newlines cause a <br> by default
This should match what people expect from a chat application much
better. The biggest reason not to do this, is because some people might
paste markdown documents. For those people there is now a /cmark
command, which disables most of our extensions to cmark, including the
newline behaviour. There is a long discussion on the Fediverse and on
Github linked below.

Mastodon https://fosstodon.org/@deepbluev7/109771668066978726
fixes #757
Diffstat (limited to 'src/UserDirectoryModel.cpp')
-rw-r--r--src/UserDirectoryModel.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/UserDirectoryModel.cpp b/src/UserDirectoryModel.cpp
index 2c44df40..37753ad8 100644
--- a/src/UserDirectoryModel.cpp
+++ b/src/UserDirectoryModel.cpp
@@ -6,11 +6,13 @@
 
 #include "UserDirectoryModel.h"
 
+#include <QSharedPointer>
+
+#include <mtx/responses/users.hpp>
+
 #include "Cache.h"
 #include "Logging.h"
-#include <QSharedPointer>
 #include "MatrixClient.h"
-#include "mtx/responses/users.hpp"
 
 UserDirectoryModel::UserDirectoryModel(QObject *parent)
   : QAbstractListModel{parent}
@@ -49,7 +51,7 @@ UserDirectoryModel::fetchMore(const QModelIndex &)
 
     nhlog::net()->debug("Fetching users from mtxclient...");
     std::string searchTerm = userSearchString_;
-    searchingUsers_ = true;
+    searchingUsers_        = true;
     emit searchingUsersChanged();
     auto job = QSharedPointer<FetchUsersFromDirectoryJob>::create();
     connect(job.data(),
@@ -88,7 +90,8 @@ UserDirectoryModel::data(const QModelIndex &index, int role) const
 }
 
 void
-UserDirectoryModel::displaySearchResults(std::vector<mtx::responses::User> results, const std::string &searchTerm)
+UserDirectoryModel::displaySearchResults(std::vector<mtx::responses::User> results,
+                                         const std::string &searchTerm)
 {
     if (searchTerm != this->userSearchString_)
         return;