No functional change; remove unused 'join' message
… also slight formatting tweaks, safer fetching of a Conversation's list item in MainWindow, and an extra accessor for ConversationListView.
This commit is contained in:
parent
3689f6cee3
commit
2f69f2fa04
|
@ -24,7 +24,7 @@ public:
|
|||
virtual void ObserveInteger(int32 what, int32 value);
|
||||
|
||||
void SetDefaultSelection(BMenuItem* item);
|
||||
int64 GetDefaultSelection() { return fDefaultSelection; }
|
||||
static int64 GetDefaultSelection() { return fDefaultSelection; }
|
||||
|
||||
private:
|
||||
void _PopulateMenu();
|
||||
|
|
|
@ -242,20 +242,20 @@ ConversationListView::_ConversationPopUp()
|
|||
}
|
||||
|
||||
|
||||
#define add_flag_item(name, flag) { \
|
||||
msg = new BMessage(APP_ROOM_FLAG); \
|
||||
msg->AddString("chat_id", id); \
|
||||
msg->AddInt64("instance", instance); \
|
||||
msg->AddInt32("flag", flag); \
|
||||
\
|
||||
item = new BMenuItem(name, msg); \
|
||||
item->SetTarget(Window()); \
|
||||
\
|
||||
if (!(chat->DisallowedFlags() &flag)) { \
|
||||
if (chat->GetFlags() & flag) \
|
||||
item->SetMarked(true); \
|
||||
menu->AddItem(item); \
|
||||
} \
|
||||
#define add_flag_item(name, flag) { \
|
||||
msg = new BMessage(APP_ROOM_FLAG); \
|
||||
msg->AddString("chat_id", id); \
|
||||
msg->AddInt64("instance", instance); \
|
||||
msg->AddInt32("flag", flag); \
|
||||
\
|
||||
item = new BMenuItem(name, msg); \
|
||||
item->SetTarget(Window()); \
|
||||
\
|
||||
if (!(chat->DisallowedFlags() &flag)) { \
|
||||
if (chat->GetFlags() & flag) \
|
||||
item->SetMarked(true); \
|
||||
menu->AddItem(item); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -136,20 +136,6 @@ ConversationView::ImMessage(BMessage* msg)
|
|||
fReceiveView->ScrollToBottom();
|
||||
break;
|
||||
}
|
||||
case IM_ROOM_JOINED:
|
||||
{
|
||||
BMessage msg;
|
||||
msg.AddString("body", B_TRANSLATE("** You joined the room.\n"));
|
||||
_AppendOrEnqueueMessage(&msg);
|
||||
fReceiveView->ScrollToBottom();
|
||||
}
|
||||
case IM_ROOM_CREATED:
|
||||
{
|
||||
BMessage msg;
|
||||
msg.AddString("body", B_TRANSLATE("** You created the room.\n"));
|
||||
_AppendOrEnqueueMessage(&msg);
|
||||
fReceiveView->ScrollToBottom();
|
||||
}
|
||||
case IM_ROOM_PARTICIPANT_JOINED:
|
||||
{
|
||||
_UserMessage(B_TRANSLATE("%user% has joined the room.\n"),
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include <iostream>
|
||||
/*
|
||||
* Copyright 2009-2011, Andrea Anzani. All rights reserved.
|
||||
* Copyright 2009-2011, Pier Luigi Fiorini. All rights reserved.
|
||||
|
@ -641,9 +640,8 @@ MainWindow::_EnsureConversationItem(BMessage* msg)
|
|||
|
||||
BString chat_id = msg->FindString("chat_id");
|
||||
Conversation* chat = fServer->ConversationById(chat_id, msg->FindInt64("instance"));
|
||||
ConversationItem* item = chat->GetListItem();
|
||||
|
||||
if (chat != NULL) {
|
||||
ConversationItem* item;
|
||||
if (chat != NULL && (item = chat->GetListItem()) != NULL) {
|
||||
if (fListView->HasItem(item))
|
||||
fListView->InvalidateItem(fListView->IndexOf(item));
|
||||
else if (item != NULL) {
|
||||
|
|
Ŝarĝante…
Reference in New Issue