summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/JabberG/src/jabber_bookmarks.cpp4
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp33
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.h2
4 files changed, 23 insertions, 18 deletions
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp
index 6c939bc5c4..931953910f 100644
--- a/protocols/JabberG/src/jabber_bookmarks.cpp
+++ b/protocols/JabberG/src/jabber_bookmarks.cpp
@@ -422,13 +422,13 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleBookmarks(WPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
// Launches the Bookmark details window, lParam is JABBER_BOOKMARK_ITEM*
-int CJabberProto::AddEditBookmark(JABBER_LIST_ITEM *item)
+int CJabberProto::AddEditBookmark(JABBER_LIST_ITEM *item, MWindow hwndParent)
{
if (m_bJabberOnline) {
JabberAddBookmarkDlgParam param;
param.ppro = this;
param.m_item = item;//(JABBER_LIST_ITEM*)lParam;
- DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BOOKMARK_ADD), nullptr, JabberAddBookmarkDlgProc, (LPARAM)&param);
+ DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BOOKMARK_ADD), hwndParent, JabberAddBookmarkDlgProc, (LPARAM)&param);
}
return 0;
}
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index f4f2e1b0d0..2160784660 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -1166,30 +1166,31 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g
{
CMStringW szBuffer, szTitle;
T2Utf roomJid(gch->si->ptszID);
+ auto *pDlg = gch->si->pDlg;
switch (gch->dwData) {
case IDM_LST_PARTICIPANT:
- ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "role", "participant", &CJabberProto::OnIqResultMucGetVoiceList, gch->si->pDlg);
+ ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "role", "participant", &CJabberProto::OnIqResultMucGetVoiceList, pDlg);
break;
case IDM_LST_MEMBER:
- ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "member", &CJabberProto::OnIqResultMucGetMemberList, gch->si->pDlg);
+ ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "member", &CJabberProto::OnIqResultMucGetMemberList, pDlg);
break;
case IDM_LST_MODERATOR:
- ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "role", "moderator", &CJabberProto::OnIqResultMucGetModeratorList, gch->si->pDlg);
+ ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "role", "moderator", &CJabberProto::OnIqResultMucGetModeratorList, pDlg);
break;
case IDM_LST_BAN:
- ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "outcast", &CJabberProto::OnIqResultMucGetBanList, gch->si->pDlg);
+ ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "outcast", &CJabberProto::OnIqResultMucGetBanList, pDlg);
break;
case IDM_LST_ADMIN:
- ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "admin", &CJabberProto::OnIqResultMucGetAdminList, gch->si->pDlg);
+ ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "admin", &CJabberProto::OnIqResultMucGetAdminList, pDlg);
break;
case IDM_LST_OWNER:
- ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "owner", &CJabberProto::OnIqResultMucGetOwnerList, gch->si->pDlg);
+ ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "owner", &CJabberProto::OnIqResultMucGetOwnerList, pDlg);
break;
case IDM_AVATAR:
@@ -1226,11 +1227,10 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g
break;
case IDM_INVITE:
- {
- auto *pDlg = new CGroupchatInviteDlg(ppro, roomJid);
- if (gch->si->pDlg)
- pDlg->SetParent(gch->si->pDlg->GetHwnd());
- pDlg->Show();
+ if (auto *pInviteDlg = new CGroupchatInviteDlg(ppro, roomJid)) {
+ if (pDlg)
+ pInviteDlg->SetParent(pDlg->GetHwnd());
+ pInviteDlg->Show();
}
break;
@@ -1246,9 +1246,14 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g
item = ppro->ListGetItemPtr(LIST_CHATROOM, roomJid);
if (item != nullptr) {
replaceStr(item->type, "conference");
- MCONTACT hContact = ppro->HContactFromJID(item->jid);
- item->name = Clist_GetContactDisplayName(hContact);
- ppro->AddEditBookmark(item);
+ if (MCONTACT hContact = ppro->HContactFromJID(item->jid))
+ replaceStrW(item->name, Clist_GetContactDisplayName(hContact));
+ else {
+ ptrA szNick(JabberNickFromJID(roomJid));
+ if (szNick)
+ replaceStrW(item->name, Utf2T(szNick));
+ }
+ ppro->AddEditBookmark(item, pDlg ? pDlg->GetHwnd() : 0);
}
}
break;
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 029390e44b..779cc0447c 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -1143,7 +1143,7 @@ public:
}
replaceStr(item->type, "conference");
- m_proto->AddEditBookmark(item);
+ m_proto->AddEditBookmark(item, m_hwnd);
}
}
break;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 0ed03b0bc9..fdd063bc0e 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -496,7 +496,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
INT_PTR __cdecl OnMenuHandleBookmarks(WPARAM wParam, LPARAM lParam);
- int AddEditBookmark(JABBER_LIST_ITEM *item);
+ int AddEditBookmark(JABBER_LIST_ITEM *item, MWindow hwndParent = 0);
//---- jabber_notes.c -----------------------------------------------------------------