Fix link parsing in IRC (#3334)

This commit is contained in:
pajlada
2021-11-07 14:55:43 +01:00
committed by GitHub
parent 7f4b73910a
commit 3c4331b8cb
6 changed files with 111 additions and 343 deletions
-30
View File
@@ -333,36 +333,6 @@ public:
MessageElementFlags flags) override;
};
// contains a full message string that's split into words on space and parses IRC colors that are then put into segments
// these segments are later passed to "MultiColorTextLayoutElement" elements to be rendered :)
class IrcTextElement : public MessageElement
{
public:
IrcTextElement(const QString &text, MessageElementFlags flags,
FontStyle style = FontStyle::ChatMedium);
~IrcTextElement() override = default;
void addToContainer(MessageLayoutContainer &container,
MessageElementFlags flags) override;
private:
FontStyle style_;
struct Segment {
QString text;
int fg = -1;
int bg = -1;
};
struct Word {
QString text;
int width = -1;
std::vector<Segment> segments;
};
std::vector<Word> words_;
};
// Forces a linebreak
class LinebreakElement : public MessageElement
{