From a889183a6fcf000f123b1d397f12faf9983e9426 Mon Sep 17 00:00:00 2001 From: paulc Date: Mon, 28 Jan 2008 17:24:55 +0000 Subject: [PATCH] Made custom relay installer protected so it can be used for private messages. git-svn-id: http://yate.null.ro/svn/yate/trunk@1697 acf43c95-373e-0410-b603-e72c3f656dc1 --- engine/Channel.cpp | 6 +++--- yatephone.h | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/engine/Channel.cpp b/engine/Channel.cpp index dac12fe6..01e16d20 100644 --- a/engine/Channel.cpp +++ b/engine/Channel.cpp @@ -781,7 +781,7 @@ void* Module::getObject(const String& name) const return Plugin::getObject(name); } -bool Module::installRelay(const char* name, int id, unsigned priority) +bool Module::installRelay(int id, const char* name, unsigned priority) { if (!(id && name)) return false; @@ -799,12 +799,12 @@ bool Module::installRelay(const char* name, int id, unsigned priority) bool Module::installRelay(int id, unsigned priority) { - return installRelay(messageName(id),id,priority); + return installRelay(id,messageName(id),priority); } bool Module::installRelay(const char* name, unsigned priority) { - return installRelay(name,lookup(name,s_messages),priority); + return installRelay(lookup(name,s_messages),name,priority); } bool Module::installRelay(MessageRelay* relay) diff --git a/yatephone.h b/yatephone.h index 0382c97b..f9bdbf66 100644 --- a/yatephone.h +++ b/yatephone.h @@ -1350,6 +1350,15 @@ protected: */ bool installRelay(const char* name, unsigned priority = 100); + /** + * Install a custom message relay + * @param id RelayID of the new relay to create + * @param name Name of the custom relay to create + * @param priority Priority of the handler, 0 = top + * @return True if installed or already was one installed + */ + bool installRelay(int id, const char* name, unsigned priority = 100); + /** * Install a custom message relay * @param relay Custom message relay @@ -1466,7 +1475,6 @@ private: Module(); // no default constructor please static TokenDict s_messages[]; ObjList m_relayList; - bool installRelay(const char* name, int id, unsigned priority); }; /**