summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--CMakeLists.txt13
-rw-r--r--README.md2
-rw-r--r--src/components/chatinput.cpp5
-rw-r--r--src/components/chatmessage.cpp3
-rw-r--r--src/discord/objects.cpp10
-rw-r--r--src/startup.cpp3
-rw-r--r--src/util.cpp5
8 files changed, 24 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore
index be20737..e47837d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -362,3 +362,6 @@ fonts/fonts.conf
*.zip
*.tar.*
*.rar
+
+#macOS resource forks
+.DS_Store
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a55057..b7fe511 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -161,12 +161,6 @@ if (ENABLE_VOICE)
target_link_libraries(abaddon ${CMAKE_DL_LIBS})
- if (APPLE)
- target_link_libraries(abaddon "-framework CoreFoundation")
- target_link_libraries(abaddon "-framework CoreAudio")
- target_link_libraries(abaddon "-framework AudioToolbox")
- endif ()
-
endif ()
if (${ENABLE_NOTIFICATION_SOUNDS})
@@ -180,6 +174,13 @@ if (USE_MINIAUDIO)
HINTS subprojects
PATH_SUFFIXES miniaudio
REQUIRED)
+
+ if (APPLE)
+ target_link_libraries(abaddon "-framework CoreFoundation")
+ target_link_libraries(abaddon "-framework CoreAudio")
+ target_link_libraries(abaddon "-framework AudioToolbox")
+ endif ()
+
target_include_directories(abaddon PUBLIC ${MINIAUDIO_INCLUDE_DIR})
target_compile_definitions(abaddon PRIVATE WITH_MINIAUDIO)
endif ()
diff --git a/README.md b/README.md
index 70996b2..8625ce1 100644
--- a/README.md
+++ b/README.md
@@ -68,7 +68,7 @@ the result of fundamental issues with Discord's thread implementation.
#### Mac:
1. `git clone https://github.com/uowuo/abaddon --recurse-submodules="subprojects" && cd abaddon`
-2. `brew install gtkmm3 nlohmann-json libhandy opus libsodium spdlog`
+2. `brew install gtkmm3 nlohmann-json libhandy opus libsodium spdlog adwaita-icon-theme`
3. `mkdir build && cd build`
4. `cmake ..`
5. `make`
diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp
index 1133302..24fc22b 100644
--- a/src/components/chatinput.cpp
+++ b/src/components/chatinput.cpp
@@ -149,11 +149,6 @@ void ChatInputTextContainer::ShowFileChooser() {
}
});
- auto filter_all = Gtk::FileFilter::create();
- filter_all->set_name("All files (*.*)");
- filter_all->add_pattern("*.*");
- dlg->add_filter(filter_all);
-
dlg->run();
}
diff --git a/src/components/chatmessage.cpp b/src/components/chatmessage.cpp
index 23ee36f..d1d9f72 100644
--- a/src/components/chatmessage.cpp
+++ b/src/components/chatmessage.cpp
@@ -204,7 +204,8 @@ void ChatMessageItemContainer::UpdateTextComponent(Gtk::TextView *tv) {
if (data->Application.has_value()) {
static const auto regex = Glib::Regex::create(R"(</(.*?):(\d+)>)");
Glib::MatchInfo match;
- if (regex->match(data->Content, match)) {
+ Glib::ustring string = data->Content;
+ if (regex->match(string, match)) {
const auto cmd = match.fetch(1);
const auto app = data->Application->Name;
b->insert_markup(s, "<i>used <span color='#697ec4'>" + cmd + "</span> with " + app + "</i>");
diff --git a/src/discord/objects.cpp b/src/discord/objects.cpp
index cb0a685..4ad17c3 100644
--- a/src/discord/objects.cpp
+++ b/src/discord/objects.cpp
@@ -27,7 +27,7 @@ void from_json(const nlohmann::json &j, MessageDeleteBulkData &m) {
void from_json(const nlohmann::json &j, GuildMemberListUpdateMessage::GroupItem &m) {
m.Type = "group";
JS_D("id", m.ID);
- JS_D("count", m.Count);
+ JS_ON("count", m.Count);
}
GuildMember GuildMemberListUpdateMessage::MemberItem::GetAsMemberData() const {
@@ -54,16 +54,16 @@ void from_json(const nlohmann::json &j, GuildMemberListUpdateMessage::OpObject &
m.Items.emplace();
JS_D("range", m.Range);
for (const auto &ij : j.at("items")) {
- if (ij.contains("group"))
- m.Items->push_back(std::make_unique<GuildMemberListUpdateMessage::GroupItem>(ij.at("group")));
- else if (ij.contains("member"))
+ if (ij.contains("member")) {
m.Items->push_back(std::make_unique<GuildMemberListUpdateMessage::MemberItem>(ij.at("member")));
+ }
}
} else if (m.Op == "UPDATE") {
JS_D("index", m.Index);
const auto &ij = j.at("item");
- if (ij.contains("member"))
+ if (ij.contains("member")) {
m.OpItem = std::make_unique<GuildMemberListUpdateMessage::MemberItem>(ij.at("member"));
+ }
}
}
diff --git a/src/startup.cpp b/src/startup.cpp
index 6d1ac96..06d6402 100644
--- a/src/startup.cpp
+++ b/src/startup.cpp
@@ -54,7 +54,8 @@ std::optional<uint32_t> GetBuildNumberFromJSURL(const Glib::ustring &url, const
auto regex = Glib::Regex::create(R"("buildNumber",null!==\(t="(\d+)\"\))");
Glib::MatchInfo match;
- if (regex->match(res.text, match)) {
+ Glib::ustring string = res.text;
+ if (regex->match(string, match)) {
const auto str_value = match.fetch(1);
try {
return std::stoul(str_value);
diff --git a/src/util.cpp b/src/util.cpp
index 8d21ff4..ae948ea 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -160,7 +160,10 @@ std::string GetExtension(std::string url) {
}
bool IsURLViewableImage(const std::string &url) {
- const auto ext = GetExtension(url);
+ std::string lw_url = url;
+ std::transform(lw_url.begin(), lw_url.end(), lw_url.begin(), ::tolower);
+
+ const auto ext = GetExtension(lw_url);
static const char *exts[] = { ".jpeg",
".jpg",
".png", nullptr };