feat(github): offline label ()

Adds `format-offline` and `label-offline`

* feat(github): offline label & fixes

* Clear label if there are no notifications and empty-notifications = false

* clang-format

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
This commit is contained in:
Cooper Pierce 2020-02-21 07:58:23 -05:00 committed by GitHub
parent 8d2b0d2747
commit 683cfc0738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 11 deletions
include/modules

View file

@ -16,18 +16,24 @@ namespace modules {
bool update();
bool build(builder* builder, const string& tag) const;
string get_format() const;
private:
void update_label(int);
int get_number_of_notification();
string request();
static constexpr auto TAG_LABEL = "<label>";
static constexpr auto TAG_LABEL_OFFLINE = "<label-offline>";
static constexpr auto FORMAT_OFFLINE = "format-offline";
label_t m_label{};
label_t m_label_offline{};
string m_api_url;
string m_accesstoken{};
unique_ptr<http_downloader> m_http{};
bool m_empty_notifications{false};
std::atomic<bool> m_offline{false};
};
}