From 13e33b96dab976290ab3438a57f23babf04b3e38 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 19 Feb 2019 19:53:38 +0300 Subject: removed WM_JABBER_REFRESH handler restored --- protocols/JabberG/src/jabber_bookmarks.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index 550378b8f7..236419b292 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -342,7 +342,31 @@ public: m_proto->m_ThreadInfo->send(iq); } - void OnProtoCheckOnline(WPARAM, LPARAM) + void OnProtoRefresh(WPARAM, LPARAM) override + { + m_lvBookmarks.DeleteAllItems(); + + JABBER_LIST_ITEM *item = nullptr; + LISTFOREACH(i, m_proto, LIST_BOOKMARK) + { + if (item = m_proto->ListGetItemPtrFromIndex(i)) { + int itemType = mir_strcmpi(item->type, "conference") ? 1 : 0; + int iItem = m_lvBookmarks.AddItem(item->name, itemType, (LPARAM)item->jid, itemType); + m_lvBookmarks.SetItem(iItem, 1, Utf2T(item->jid)); + if (itemType == 0) + m_lvBookmarks.SetItem(iItem, 2, Utf2T(item->nick)); + } + } + + if (item) { + m_btnEdit.Enable(); + m_btnRemove.Enable(); + } + + m_btnAdd.Enable(); + } + + void OnProtoCheckOnline(WPARAM, LPARAM) override { if (!m_proto->m_bJabberOnline) { m_btnAdd.Disable(); -- cgit v1.2.3