d8d89d245e
Room flags (e.g., whether or not to auto-join, whether notifications should be sent on message receive) can now be toggled through a room's right-click menu in the room-list. Two new room flags were added for notifications as well― ROOM_NOTIFY_DM and ROOM_NOTIFY_ALL. If ROOM_NOTIFY_DM is enabled, the user will receive notifications if they are in a one-on-one chat. If ROOM_NOTIFY_ALL, they will receive notifications on every message sent to the room. The default menu items for the room's pop-up menu were moved from Templates.rdef to be built into the app. Everything else in Templates.rdef should follow suit― B_TRANSLATE can't be used in rdef files!
42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
/*
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
*/
|
|
#ifndef _CONVERSATION_LIST_H
|
|
#define _CONVERSATION_LIST_H
|
|
|
|
#include <OutlineListView.h>
|
|
|
|
class BPopUpMenu;
|
|
class Conversation;
|
|
class ConversationAccountItem;
|
|
|
|
|
|
class ConversationListView : public BOutlineListView {
|
|
public:
|
|
ConversationListView(const char* name);
|
|
|
|
virtual void MessageReceived(BMessage* msg);
|
|
virtual void SelectionChanged();
|
|
virtual void MouseDown(BPoint where);
|
|
|
|
// After removing item, select another
|
|
void RemoveItemSelecting(BListItem* item);
|
|
|
|
void AddConversation(Conversation* chat);
|
|
void RemoveConversation(Conversation* chat);
|
|
void AddAccount(int64 instance);
|
|
void RemoveAccount(int64 instance);
|
|
void SortConversation(Conversation* chat);
|
|
|
|
private:
|
|
BPopUpMenu* _ConversationPopUp();
|
|
void _AddDefaultItems(BPopUpMenu* menu, Conversation* chat);
|
|
BPopUpMenu* _BlankPopUp();
|
|
|
|
ConversationAccountItem*
|
|
_EnsureAccountItem(Conversation* chat);
|
|
};
|
|
|
|
#endif // _CONVERSATION_LIST_H
|