aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-17 03:34:41 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-17 03:34:43 +0200
commite4cc9c03bf2578cbe2b8c9e909e9803ff856dd9d (patch)
tree88f9a2c72c678ff0df966769efb67184604c9ea1 /include
parent528a61c86876de814ff4e65855926a750ba24587 (diff)
Fix url parsing in text, sort messages by timestamp
Diffstat (limited to 'include')
-rw-r--r--include/MessageBoard.hpp2
-rw-r--r--include/StringView.hpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/MessageBoard.hpp b/include/MessageBoard.hpp
index 9025e48..a947c1b 100644
--- a/include/MessageBoard.hpp
+++ b/include/MessageBoard.hpp
@@ -25,6 +25,8 @@ namespace dchat
void processEvent(const sf::Event &event);
void draw(sf::RenderWindow &window, Cache &cache);
private:
+ usize findPositionToInsertMessageByTimestamp(Message *message);
+
void updateStaticContentTexture(const sf::Vector2u &newSize);
void addMessage(Message *message, const odhtdb::Hash &id);
void deleteMessage(const odhtdb::Hash &id, const odhtdb::Signature::PublicKey &requestedByUser);
diff --git a/include/StringView.hpp b/include/StringView.hpp
index c4e7ce3..d320a85 100644
--- a/include/StringView.hpp
+++ b/include/StringView.hpp
@@ -80,7 +80,7 @@ namespace dchat
for(usize i = offset; i < size - (substr.size - 1); ++i)
{
- if(memcmp(data + i, substr.data, substr.size) == 0)
+ if(memcmp(data + i, substr.data, substr.size * sizeof(CharType)) == 0)
return i;
}
return -1;