fix topic not loading properly

This commit is contained in:
Sorunome 2019-10-21 17:00:10 +02:00
parent d8edadc372
commit 7d8970d1b4
No known key found for this signature in database
GPG key ID: 63E31F7B5993A9C4

View file

@ -26,11 +26,11 @@
#endif #endif
#if DEBUG #if DEBUG
PrintConsole* topScreenConsole = NULL; PrintConsole* topScreenDebugConsole = NULL;
#endif #endif
#if DEBUG #if DEBUG
#define printf_top(f_, ...) do {consoleSelect(topScreenConsole);printf((f_), ##__VA_ARGS__);} while(0) #define printf_top(f_, ...) do {consoleSelect(topScreenDebugConsole);printf((f_), ##__VA_ARGS__);} while(0)
#else #else
#define printf_top(f_, ...) do {} while(0) #define printf_top(f_, ...) do {} while(0)
#endif #endif
@ -50,9 +50,9 @@ Client::Client(std::string homeserverUrl, std::string matrixToken, Store* client
} }
store = clientStore; store = clientStore;
#if DEBUG #if DEBUG
if (!topScreenConsole) { if (!topScreenDebugConsole) {
topScreenConsole = new PrintConsole; topScreenDebugConsole = new PrintConsole;
consoleInit(GFX_TOP, topScreenConsole); consoleInit(GFX_TOP, topScreenDebugConsole);
} }
#endif #endif
} }
@ -492,13 +492,13 @@ void Client::processSync(json_t* sync) {
addedInfo = true; addedInfo = true;
} }
} else if (strcmp(typeCStr, "m.room.topic") == 0) { } else if (strcmp(typeCStr, "m.room.topic") == 0) {
const char* topicCStr = json_object_get_string_value(event, "topic"); const char* topicCStr = json_object_get_string_value(content, "topic");
if (topicCStr) { if (topicCStr) {
info.topic = topicCStr; info.topic = topicCStr;
addedInfo = true; addedInfo = true;
} }
} else if (strcmp(typeCStr, "m.room.avatar") == 0) { } else if (strcmp(typeCStr, "m.room.avatar") == 0) {
const char* urlCStr = json_object_get_string_value(event, "url"); const char* urlCStr = json_object_get_string_value(content, "url");
if (urlCStr) { if (urlCStr) {
info.avatarUrl = urlCStr; info.avatarUrl = urlCStr;
addedInfo = true; addedInfo = true;