Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Chatterino/chatterino2 into danke…
Browse files Browse the repository at this point in the history
…rino
  • Loading branch information
Mm2PL committed May 6, 2024
2 parents 779df81 + a43c4f3 commit 6b3db9e
Show file tree
Hide file tree
Showing 52 changed files with 263 additions and 189 deletions.
2 changes: 1 addition & 1 deletion .CI/chatterino-installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Chatterino"
#define MyAppVersion "2.5.0"
#define MyAppVersion "2.5.1"
#define MyAppPublisher "Chatterino Team"
#define MyAppURL "https://www.chatterino.com"
#define MyAppExeName "chatterino.exe"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
skip-artifact: false
skip-crashpad: false
# macOS
- os: macos-latest
- os: macos-13
qt-version: 5.15.2
force-lto: false
plugins: true
Expand Down Expand Up @@ -222,7 +222,7 @@ jobs:

- name: Setup sccache (Windows)
# sccache v0.7.4
uses: hendrikmuhs/[email protected].12
uses: hendrikmuhs/[email protected].13
if: startsWith(matrix.os, 'windows')
with:
variant: sccache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

- name: Setup sccache
# sccache v0.7.4
uses: hendrikmuhs/[email protected].12
uses: hendrikmuhs/[email protected].13
with:
variant: sccache
# only save on the default (master) branch
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/winget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Publish to WinGet
on:
release:
types: [released]
jobs:
publish:
runs-on: windows-latest
if: ${{ startsWith(github.event.release.tag_name, 'v') }}
steps:
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: ChatterinoTeam.Chatterino
installers-regex: ^Chatterino.Installer.exe$
token: ${{ secrets.WINGET_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unversioned

- Bugfix: If a network request errors with 200 OK, Qt's error code is now reported instead of the HTTP status. (#5378)
- Dev: Add doxygen build target. (#5377)
- Dev: Make printing of strings in tests easier. (#5379)

## 2.5.1

- Bugfix: Fixed links without a protocol not being clickable. (#5345)

## 2.5.0

### Dankerino
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if(BUILD_BENCHMARKS)
endif()

project(chatterino
VERSION 2.5.0
VERSION 2.5.1
DESCRIPTION "Chat client for twitch.tv"
HOMEPAGE_URL "https://chatterino.com/"
)
Expand Down Expand Up @@ -197,6 +197,7 @@ find_package(PajladaSerialize REQUIRED)
find_package(PajladaSignals REQUIRED)
find_package(LRUCache REQUIRED)
find_package(MagicEnum REQUIRED)
find_package(Doxygen)

if (USE_SYSTEM_PAJLADA_SETTINGS)
find_package(PajladaSettings REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion lib/settings
3 changes: 3 additions & 0 deletions resources/com.chatterino.chatterino.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<binary>chatterino</binary>
</provides>
<releases>
<release version="2.5.1" date="2024-04-28">
<url>https://github.com/Chatterino/chatterino2/releases/tag/v2.5.1</url>
</release>
<release version="2.5.0" date="2024-04-21">
<url>https://github.com/Chatterino/chatterino2/releases/tag/v2.5.0</url>
</release>
Expand Down
11 changes: 11 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1153,3 +1153,14 @@ if(NOT CHATTERINO_UPDATER)
message(STATUS "Disabling the updater.")
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC CHATTERINO_DISABLE_UPDATER)
endif()

if (DOXYGEN_FOUND)
message(STATUS "Doxygen found, adding doxygen target")
# output will be in docs/html
set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/docs")

doxygen_add_docs(
doxygen
${CMAKE_CURRENT_LIST_DIR}
)
endif ()
2 changes: 1 addition & 1 deletion src/common/Version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* - 2.4.0-alpha.2
* - 2.4.0-alpha
**/
#define CHATTERINO_VERSION "2.5.0"
#define CHATTERINO_VERSION "2.5.1"

#if defined(Q_OS_WIN)
# define CHATTERINO_OS "win"
Expand Down
11 changes: 10 additions & 1 deletion src/common/network/NetworkResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ const QByteArray &NetworkResult::getData() const

QString NetworkResult::formatError() const
{
if (this->status_)
// Print the status for errors that mirror HTTP status codes (=0 || >99)
if (this->status_ && (this->error_ == QNetworkReply::NoError ||
this->error_ > QNetworkReply::UnknownNetworkError))
{
return QString::number(*this->status_);
}
Expand All @@ -77,6 +79,13 @@ QString NetworkResult::formatError() const
this->error_);
if (name == nullptr)
{
if (this->status_)
{
return QStringLiteral("unknown error (status: %1, error: %2)")
.arg(QString::number(*this->status_),
QString::number(this->error_));
}

return QStringLiteral("unknown error (%1)").arg(this->error_);
}
return name;
Expand Down
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ option(CHATTERINO_TEST_USE_PUBLIC_HTTPBIN "Use public httpbin for testing networ
set(test_SOURCES
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
${CMAKE_CURRENT_LIST_DIR}/resources/test-resources.qrc
${CMAKE_CURRENT_LIST_DIR}/src/TestHelpers.hpp
${CMAKE_CURRENT_LIST_DIR}/src/Test.hpp
${CMAKE_CURRENT_LIST_DIR}/src/Test.cpp
${CMAKE_CURRENT_LIST_DIR}/src/ChannelChatters.cpp
${CMAKE_CURRENT_LIST_DIR}/src/AccessGuard.cpp
${CMAKE_CURRENT_LIST_DIR}/src/NetworkCommon.cpp
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ docker run --network=host --detach ghcr.io/chatterino/twitch-pubsub-server-test:
docker run -p 9051:80 --detach kennethreitz/httpbin
```

If you're unable to use docker, you can use [httpbox](github.com/kevinastone/httpbox) (`httpbox --port 9051`) and [Chatterino/twitch-pubsub-server-test](https://github.com/Chatterino/twitch-pubsub-server-test/releases/latest) manually.
If you're unable to use docker, you can use [httpbox](https://github.com/kevinastone/httpbox) (`httpbox --port 9051`) and [Chatterino/twitch-pubsub-server-test](https://github.com/Chatterino/twitch-pubsub-server-test/releases/latest) manually.
2 changes: 1 addition & 1 deletion tests/src/AccessGuard.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "common/UniqueAccess.hpp"
#include "Test.hpp"

#include <gtest/gtest.h>
#include <QDebug>
#include <QString>

Expand Down
2 changes: 1 addition & 1 deletion tests/src/BasicPubSub.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "providers/liveupdates/BasicPubSubClient.hpp"
#include "providers/liveupdates/BasicPubSubManager.hpp"
#include "Test.hpp"

#include <gtest/gtest.h>
#include <QByteArray>
#include <QJsonDocument>
#include <QJsonObject>
Expand Down
3 changes: 2 additions & 1 deletion tests/src/BttvLiveUpdates.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "providers/bttv/BttvLiveUpdates.hpp"

#include <gtest/gtest.h>
#include "Test.hpp"

#include <QString>

#include <optional>
Expand Down
2 changes: 1 addition & 1 deletion tests/src/ChannelChatters.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "common/ChannelChatters.hpp"

#include "mocks/Channel.hpp"
#include "Test.hpp"

#include <gtest/gtest.h>
#include <QColor>
#include <QStringList>

Expand Down
3 changes: 2 additions & 1 deletion tests/src/ChatterSet.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "common/ChatterSet.hpp"

#include <gtest/gtest.h>
#include "Test.hpp"

#include <QStringList>

TEST(ChatterSet, insert)
Expand Down
3 changes: 1 addition & 2 deletions tests/src/Emojis.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "providers/emoji/Emojis.hpp"

#include "common/Literals.hpp"
#include "TestHelpers.hpp"
#include "Test.hpp"

#include <gtest/gtest.h>
#include <QDebug>
#include <QString>

Expand Down
2 changes: 1 addition & 1 deletion tests/src/ExponentialBackoff.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "util/ExponentialBackoff.hpp"

#include <gtest/gtest.h>
#include "Test.hpp"

using namespace chatterino;

Expand Down
43 changes: 19 additions & 24 deletions tests/src/Filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "providers/twitch/TwitchBadge.hpp"
#include "providers/twitch/TwitchMessageBuilder.hpp"
#include "singletons/Emotes.hpp"
#include "Test.hpp"

#include <gtest/gtest.h>
#include <QColor>
#include <QVariant>

Expand Down Expand Up @@ -101,7 +101,7 @@ namespace chatterino::filters {

std::ostream &operator<<(std::ostream &os, Type t)
{
os << qUtf8Printable(typeToString(t));
os << typeToString(t);
return os;
}

Expand Down Expand Up @@ -138,8 +138,8 @@ TEST(Filters, Validity)
auto filterResult = Filter::fromString(input);
bool isValid = std::holds_alternative<Filter>(filterResult);
EXPECT_EQ(isValid, expected)
<< "Filter::fromString( " << qUtf8Printable(input)
<< " ) should be " << (expected ? "valid" : "invalid");
<< "Filter::fromString( " << input << " ) should be "
<< (expected ? "valid" : "invalid");
}
}

Expand Down Expand Up @@ -168,15 +168,14 @@ TEST(Filters, TypeSynthesis)
{
auto filterResult = Filter::fromString(input);
bool isValid = std::holds_alternative<Filter>(filterResult);
ASSERT_TRUE(isValid) << "Filter::fromString( " << qUtf8Printable(input)
<< " ) is invalid";
ASSERT_TRUE(isValid)
<< "Filter::fromString( " << input << " ) is invalid";

auto filter = std::move(std::get<Filter>(filterResult));
T type = filter.returnType();
EXPECT_EQ(type, expected)
<< "Filter{ " << qUtf8Printable(input) << " } has type " << type
<< " instead of " << expected << ".\nDebug: "
<< qUtf8Printable(filter.debugString(typingContext));
<< "Filter{ " << input << " } has type " << type << " instead of "
<< expected << ".\nDebug: " << filter.debugString(typingContext);
}
}

Expand Down Expand Up @@ -244,17 +243,16 @@ TEST(Filters, Evaluation)
{
auto filterResult = Filter::fromString(input);
bool isValid = std::holds_alternative<Filter>(filterResult);
ASSERT_TRUE(isValid) << "Filter::fromString( " << qUtf8Printable(input)
<< " ) is invalid";
ASSERT_TRUE(isValid)
<< "Filter::fromString( " << input << " ) is invalid";

auto filter = std::move(std::get<Filter>(filterResult));
auto result = filter.execute(contextMap);

EXPECT_EQ(result, expected)
<< "Filter{ " << qUtf8Printable(input) << " } evaluated to "
<< qUtf8Printable(result.toString()) << " instead of "
<< qUtf8Printable(expected.toString()) << ".\nDebug: "
<< qUtf8Printable(filter.debugString(typingContext));
<< "Filter{ " << input << " } evaluated to " << result.toString()
<< " instead of " << expected.toString()
<< ".\nDebug: " << filter.debugString(typingContext);
}
}

Expand Down Expand Up @@ -354,20 +352,17 @@ TEST_F(FiltersF, ExpressionDebug)
{
const auto filterResult = Filter::fromString(input);
const auto *filter = std::get_if<Filter>(&filterResult);
EXPECT_NE(filter, nullptr)
<< "Filter::fromString(" << qUtf8Printable(input)
<< ") did not build a proper filter";
EXPECT_NE(filter, nullptr) << "Filter::fromString(" << input
<< ") did not build a proper filter";

const auto actualDebugString = filter->debugString(typingContext);
EXPECT_EQ(actualDebugString, debugString)
<< "filter->debugString() on '" << qUtf8Printable(input)
<< "' should be '" << qUtf8Printable(debugString) << "', but got '"
<< qUtf8Printable(actualDebugString) << "'";
<< "filter->debugString() on '" << input << "' should be '"
<< debugString << "', but got '" << actualDebugString << "'";

const auto actualFilterString = filter->filterString();
EXPECT_EQ(actualFilterString, filterString)
<< "filter->filterString() on '" << qUtf8Printable(input)
<< "' should be '" << qUtf8Printable(filterString) << "', but got '"
<< qUtf8Printable(actualFilterString) << "'";
<< "filter->filterString() on '" << input << "' should be '"
<< filterString << "', but got '" << actualFilterString << "'";
}
}
13 changes: 6 additions & 7 deletions tests/src/FormatTime.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "util/FormatTime.hpp"

#include <gtest/gtest.h>
#include "Test.hpp"

#include <chrono>

Expand Down Expand Up @@ -62,8 +62,8 @@ TEST(FormatTime, Int)
const auto actual = formatTime(input);

EXPECT_EQ(actual, expected)
<< qUtf8Printable(actual) << " (" << input
<< ") did not match expected value " << qUtf8Printable(expected);
<< actual << " (" << input << ") did not match expected value "
<< expected;
}
}

Expand Down Expand Up @@ -130,8 +130,8 @@ TEST(FormatTime, QString)
const auto actual = formatTime(input);

EXPECT_EQ(actual, expected)
<< qUtf8Printable(actual) << " (" << qUtf8Printable(input)
<< ") did not match expected value " << qUtf8Printable(expected);
<< actual << " (" << input << ") did not match expected value "
<< expected;
}
}

Expand Down Expand Up @@ -202,7 +202,6 @@ TEST(FormatTime, chrono)
const auto actual = formatTime(input);

EXPECT_EQ(actual, expected)
<< qUtf8Printable(actual) << " did not match expected value "
<< qUtf8Printable(expected);
<< actual << " did not match expected value " << expected;
}
}
Loading

0 comments on commit 6b3db9e

Please sign in to comment.