diff options
author | George Hazan <ghazan@miranda.im> | 2020-06-08 10:39:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-06-08 10:39:30 +0300 |
commit | d7fe6d0e8eba772af6603ac2631b4553687b433c (patch) | |
tree | cf3d695d130925489bad7f6696643705aa46e3eb /plugins/NewStory/src/templates.h | |
parent | 12c3f22b43ece1cea4a0bb4a2ef21a2dfbb789ac (diff) |
fixes #2433 (NewStory: XMPP Chat States отображаются как неизвестные события)
Diffstat (limited to 'plugins/NewStory/src/templates.h')
-rw-r--r-- | plugins/NewStory/src/templates.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/NewStory/src/templates.h b/plugins/NewStory/src/templates.h index 4349ea79d5..2368aa731b 100644 --- a/plugins/NewStory/src/templates.h +++ b/plugins/NewStory/src/templates.h @@ -9,22 +9,26 @@ enum struct TemplateVars { - bool del[256]; - wchar_t* val[256]; + struct { + wchar_t *val; + bool del; + } + vars[256]; __forceinline wchar_t* GetVar(uint8_t id) { - return val[id]; + return vars[id].val; } __forceinline void SetVar(uint8_t id, const wchar_t *v, bool d) { - if (val[id] && del[id]) - mir_free(val[id]); - val[id] = mir_wstrdup(v); - del[id] = d; + auto &V = vars[id]; + if (V.val && V.del) + mir_free(V.val); + V.val = mir_wstrdup(v); + V.del = d; } }; -typedef void(*VarFunc)(int mode, TemplateVars* vars, MCONTACT hContact, ItemData* item); +typedef void (*VarFunc)(int mode, TemplateVars *vars, MCONTACT hContact, ItemData *item); struct TemplateInfo { |