fix some crashes

- crash when assuming group dms have someone other than urself
- crash from lifetime error with user note update
This commit is contained in:
ouwou
2021-02-23 02:51:04 -05:00
parent 66b1e2dad3
commit 5406ca7b15
2 changed files with 10 additions and 8 deletions

View File

@@ -176,10 +176,11 @@ ProfileUserInfoPane::ProfileUserInfoPane(Snowflake ID)
});
auto &discord = Abaddon::Get().GetDiscordClient();
discord.signal_note_update().connect([this](Snowflake id, std::string note) {
auto note_update_cb = [this](Snowflake id, std::string note) {
if (id == UserID)
m_note.SetNote(note);
});
};
discord.signal_note_update().connect(sigc::track_obj(note_update_cb, m_note));
auto fetch_note_cb = [this](const std::string &note) {
m_note.SetNote(note);