mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Merge branch 'master' of github.com:fourtf/chatterino2
This commit is contained in:
commit
a6d87ead9b
2 changed files with 14 additions and 3 deletions
|
@ -22,3 +22,11 @@ download the [boost library](https://sourceforge.net/projects/boost/files/boost/
|
|||
|
||||
### linux
|
||||
???
|
||||
|
||||
### Mac OSX
|
||||
1. Install XCode and XCode Command Line Utilites
|
||||
2. Install QT Creator
|
||||
3. Install brew https://brew.sh/
|
||||
4. `brew install boost openssl rapidjson`
|
||||
5. Build the garbage using QT creator
|
||||
6. gachiGASM
|
|
@ -10,7 +10,7 @@ MessageBuilder::MessageBuilder()
|
|||
: _words()
|
||||
{
|
||||
_parseTime = std::chrono::system_clock::now();
|
||||
regex.setPattern("\\bhttps?:\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[A-Z0-9+&@#\/%=~_|]");
|
||||
regex.setPattern("(\\bhttps?:\/\/)?[-A-Z0-9+&@#\/%?=~_|!:,.;]*[A-Z0-9+&@#\/%=~_|]");
|
||||
regex.setPatternOptions(QRegularExpression::CaseInsensitiveOption);
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,11 @@ void MessageBuilder::appendTimestamp(time_t time)
|
|||
|
||||
QString MessageBuilder::matchLink(const QString &string)
|
||||
{
|
||||
QRegularExpressionMatch match = regex.match(string);
|
||||
return match.captured();
|
||||
QString match = regex.match(string,0,QRegularExpression::PartialPreferCompleteMatch,QRegularExpression::NoMatchOption).captured();
|
||||
if(!match.contains(QRegularExpression("\\bhttps?:\/\/"))){
|
||||
match.insert(0,"https://");
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
} // namespace messages
|
||||
|
|
Loading…
Reference in a new issue