From 9267c740a4e1130cbd194a41b66d50535f9ab78e Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Mon, 9 Aug 2021 10:48:45 -0500 Subject: [PATCH] Sensible defaults for unnecessary ChatProtocol methods --- application/ChatProtocol.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/application/ChatProtocol.h b/application/ChatProtocol.h index 30d100c..589a9dc 100644 --- a/application/ChatProtocol.h +++ b/application/ChatProtocol.h @@ -59,19 +59,25 @@ public: Requires: String "_label", Message "_msg", String "class" = "BMenuItem" Bool "x_to_protocol", Bool "x_priority", int32 "x_perms", int32 "x_target_perms", int32 "x_target_antiperms" */ - virtual BObjectList UserPopUpItems() = 0; + virtual BObjectList UserPopUpItems() { + return BObjectList(); + } /*! Custom menu items used in the conversation-list right-click menu. Archived BMenuItem with some extra slots. Requires: String "_label", Message "_msg", String "class" = "BMenuItem" Bool "x_to_protocol", int32 "x_perms" */ - virtual BObjectList ChatPopUpItems() = 0; + virtual BObjectList ChatPopUpItems() { + return BObjectList(); + } /*! Custom menubar items (in the "Protocol" menu). Archived BMenuItem with some extra slots. Requires: String "_label", Message "_msg", String "class" = "BMenuItem" Bool "x_to_protocol" */ - virtual BObjectList MenuBarItems() = 0; + virtual BObjectList MenuBarItems() { + return BObjectList(); + } //! Protocol signature virtual const char* Signature() const = 0; @@ -80,7 +86,7 @@ public: virtual const char* FriendlySignature() const = 0; //! Protocol icon - virtual BBitmap* Icon() const = 0; + virtual BBitmap* Icon() const { return NULL; } //! Add-on's path virtual void SetAddOnPath(BPath path) = 0; @@ -91,7 +97,7 @@ public: virtual void SetName(const char* name) = 0; //! Preferred encoding of messages - virtual uint32 GetEncoding() = 0; + virtual uint32 GetEncoding() { return 0xffff; } //! Messenger interface used virtual ChatProtocolMessengerInterface* MessengerInterface() const = 0;