Source message user data can now be copyied in postponed message.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2540 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2009-03-25 10:05:06 +00:00
parent 13cc53ff77
commit 14fea4a0d1
2 changed files with 9 additions and 6 deletions

View File

@ -105,9 +105,11 @@ private:
class PostponedMessage : public Message
{
public:
inline PostponedMessage(const Message& msg, int id)
: Message(msg), m_id(id)
{ }
inline PostponedMessage(const Message& msg, int id, bool copyUserData)
: Message(msg), m_id(id) {
if (copyUserData)
userData(msg.userData());
}
inline int id() const
{ return m_id; }
private:
@ -1761,11 +1763,11 @@ bool Client::received(Message& msg, int id)
}
// Postpone messages to be redispatched from UI thread
bool Client::postpone(const Message& msg, int id)
bool Client::postpone(const Message& msg, int id, bool copyUserData)
{
if (isCurrent())
return false;
PostponedMessage* postponed = new PostponedMessage(msg,id);
PostponedMessage* postponed = new PostponedMessage(msg,id,copyUserData);
s_postponeMutex.lock();
s_postponed.append(postponed);
s_postponeMutex.unlock();

View File

@ -1072,9 +1072,10 @@ public:
* Postpone a copy of a message to be dispatched from the UI thread
* @param msg Message to be postponed
* @param id Identifier of the message to be used on dispatch
* @param copyUserData Copy source user data in postponed message
* @return True if the UI thread was not current so the message was postponed
*/
bool postpone(const Message& msg, int id);
bool postpone(const Message& msg, int id, bool copyUserData = false);
/**
* Show a file open dialog window