From e4cc9c03bf2578cbe2b8c9e909e9803ff856dd9d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 17 May 2018 03:34:41 +0200 Subject: Fix url parsing in text, sort messages by timestamp --- include/MessageBoard.hpp | 2 ++ include/StringView.hpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') 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; -- cgit v1.2.3