Added send chat method to contact.
git-svn-id: http://voip.null.ro/svn/yate@3218 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
1e1e9ed5ba
commit
6272daa183
|
@ -3646,6 +3646,19 @@ ClientContact::ClientContact(ClientAccount* owner, NamedList& params, bool chat)
|
||||||
createChatWindow();
|
createChatWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Send chat to contact (enqueue a msg.execute message)
|
||||||
|
bool ClientContact::sendChat(const char* body, const String& res, const char* type)
|
||||||
|
{
|
||||||
|
Message* m = Client::buildMessage("msg.execute",accountName());
|
||||||
|
if (!TelEngine::null(type))
|
||||||
|
m->addParam("type",type);
|
||||||
|
m->addParam("called",m_uri);
|
||||||
|
if (res)
|
||||||
|
m->addParam("called_instance",res);
|
||||||
|
m->addParam("body",body);
|
||||||
|
return Engine::enqueue(m);
|
||||||
|
}
|
||||||
|
|
||||||
// Show or hide this contact's chat window
|
// Show or hide this contact's chat window
|
||||||
bool ClientContact::showChat(bool visible, bool active)
|
bool ClientContact::showChat(bool visible, bool active)
|
||||||
{
|
{
|
||||||
|
|
10
yatecbase.h
10
yatecbase.h
|
@ -3093,6 +3093,16 @@ public:
|
||||||
inline bool hasChat()
|
inline bool hasChat()
|
||||||
{ return Client::self() && Client::self()->getWindow(m_chatWndName); }
|
{ return Client::self() && Client::self()->getWindow(m_chatWndName); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send chat to contact (enqueue a msg.execute message)
|
||||||
|
* @param body Chat body
|
||||||
|
* @param res Optional target instance
|
||||||
|
* @param type Optional message type parameter
|
||||||
|
* @return True on success
|
||||||
|
*/
|
||||||
|
virtual bool sendChat(const char* body, const String& res = String::empty(),
|
||||||
|
const char* type = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if this contact's chat window is visible
|
* Check if this contact's chat window is visible
|
||||||
* @return True if this contact's chat window is visible
|
* @return True if this contact's chat window is visible
|
||||||
|
|
Loading…
Reference in New Issue