summaryrefslogtreecommitdiff
path: root/protocols/Dummy/src/dummy_proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Dummy/src/dummy_proto.cpp')
-rw-r--r--protocols/Dummy/src/dummy_proto.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp
index 65e0c46e4e..bd5b556649 100644
--- a/protocols/Dummy/src/dummy_proto.cpp
+++ b/protocols/Dummy/src/dummy_proto.cpp
@@ -17,24 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-void CDummyProto::SendMsgAck(void *p)
-{
- if (p == nullptr)
- return;
-
- message_data *data = static_cast<message_data*>(p);
-
- Sleep(100);
-
- if (getByte(DUMMY_KEY_ALLOW_SENDING, 0))
- ProtoBroadcastAck(data->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)data->msgid);
- else
- ProtoBroadcastAck(data->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)data->msgid,
- (LPARAM)TranslateT("This Dummy account has disabled sending messages. Enable it in account options."));
-
- delete data;
-}
-
void CDummyProto::SearchIdAckThread(void *targ)
{
PROTOSEARCHRESULT psr = { 0 };
@@ -126,7 +108,10 @@ int CDummyProto::SendMsg(MCONTACT hContact, int, const char *msg)
std::string message = msg;
unsigned int id = InterlockedIncrement(&this->msgid);
- ForkThread(&CDummyProto::SendMsgAck, new message_data(hContact, message, id));
+ if (getByte(DUMMY_KEY_ALLOW_SENDING, 0))
+ ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id);
+ else
+ ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)id, (LPARAM)TranslateT("This Dummy account has disabled sending messages. Enable it in account options."));
return id;
}