Disallow right-clicking on ConversationAccountItems

This commit is contained in:
Jaidyn Ann 2021-08-14 21:25:46 -05:00
parent 3ed7dac050
commit 5b4d8c9413

View File

@ -114,8 +114,11 @@ ConversationListView::MouseDown(BPoint where)
if (!(buttons & B_SECONDARY_MOUSE_BUTTON)) if (!(buttons & B_SECONDARY_MOUSE_BUTTON))
return; return;
if (CurrentSelection() >= 0) if (CurrentSelection() >= 0) {
_ConversationPopUp()->Go(ConvertToScreen(where), true, false); BPopUpMenu* menu = _ConversationPopUp();
if (menu != NULL)
menu->Go(ConvertToScreen(where), true, false);
}
else else
_BlankPopUp()->Go(ConvertToScreen(where), true, false); _BlankPopUp()->Go(ConvertToScreen(where), true, false);
} }
@ -163,8 +166,8 @@ ConversationListView::_ConversationPopUp()
int32 selIndex = CurrentSelection(); int32 selIndex = CurrentSelection();
ConversationItem* item; ConversationItem* item;
if ((item = (ConversationItem*)ItemAt(selIndex)) == NULL) if ((item = dynamic_cast<ConversationItem*>(ItemAt(selIndex))) == NULL)
return _BlankPopUp(); return NULL;
Conversation* chat = item->GetConversation(); Conversation* chat = item->GetConversation();
ProtocolLooper* looper = chat->GetProtocolLooper(); ProtocolLooper* looper = chat->GetProtocolLooper();