2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Removed Function<> and SharedCallback<>, using base::lambda_unique<>.

Also removed macro START_ANIMATION(anim,) using anim.start() instead.
This commit is contained in:
John Preston
2016-09-26 15:09:59 +03:00
parent 866bc4ff8a
commit 453661d611
61 changed files with 322 additions and 502 deletions

View File

@@ -42,11 +42,10 @@ ApiWrap::ApiWrap(QObject *parent) : QObject(parent)
void ApiWrap::init() {
}
void ApiWrap::requestMessageData(ChannelData *channel, MsgId msgId, std_::unique_ptr<RequestMessageDataCallback> callback) {
void ApiWrap::requestMessageData(ChannelData *channel, MsgId msgId, RequestMessageDataCallback &&callback) {
MessageDataRequest &req(channel ? _channelMessageDataRequests[channel][msgId] : _messageDataRequests[msgId]);
if (callback) {
MessageDataRequest::CallbackPtr pcallback(callback.release());
req.callbacks.append(pcallback);
req.callbacks.append(std_::move(callback));
}
if (!req.req) _messageDataResolveDelayed->call();
}
@@ -138,7 +137,7 @@ void ApiWrap::gotMessageDatas(ChannelData *channel, const MTPmessages_Messages &
for (auto i = requests->begin(); i != requests->cend();) {
if (i.value().req == req) {
for_const (auto &callback, i.value().callbacks) {
callback->call(channel, i.key());
callback(channel, i.key());
}
i = requests->erase(i);
} else {