anope- supernets anope source code & configuration |
git clone git://git.acid.vegas/anope.git |
Log | Files | Refs | Archive | README |
os_news.h (861B)
1 /* 2 * 3 * (C) 2011-2022 Anope Team 4 * Contact us at team@anope.org 5 * 6 * Please read COPYING and README for further details. 7 */ 8 9 #ifndef OS_NEWS 10 #define OS_NEWS 11 12 enum NewsType 13 { 14 NEWS_LOGON, 15 NEWS_RANDOM, 16 NEWS_OPER 17 }; 18 19 struct NewsMessages 20 { 21 NewsType type; 22 Anope::string name; 23 const char *msgs[10]; 24 }; 25 26 struct NewsItem : Serializable 27 { 28 NewsType type; 29 Anope::string text; 30 Anope::string who; 31 time_t time; 32 33 NewsItem() : Serializable("NewsItem") { } 34 }; 35 36 class NewsService : public Service 37 { 38 public: 39 NewsService(Module *m) : Service(m, "NewsService", "news") { } 40 41 virtual NewsItem *CreateNewsItem() = 0; 42 43 virtual void AddNewsItem(NewsItem *n) = 0; 44 45 virtual void DelNewsItem(NewsItem *n) = 0; 46 47 virtual std::vector<NewsItem *> &GetNewsList(NewsType t) = 0; 48 }; 49 50 static ServiceReference<NewsService> news_service("NewsService", "news"); 51 52 #endif // OS_NEWS