1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 17:38:07 +01:00
Telegram/Watch/Bridge/TGBridgeUserInfoSignals.m
2015-10-01 19:19:52 +03:00

26 lines
657 B
Objective-C

#import "TGBridgeUserInfoSignals.h"
#import "TGBridgeUserInfoSubscription.h"
#import "TGBridgeResponse.h"
#import "TGBridgeUser.h"
#import "TGBridgeClient.h"
@implementation TGBridgeUserInfoSignals
+ (SSignal *)userInfoWithUserId:(int32_t)userId;
{
return [[self usersInfoWithUserIds:@[ @(userId) ]] map:^TGBridgeUser *(NSDictionary *users)
{
return users[@(userId)];
}];
}
+ (SSignal *)usersInfoWithUserIds:(NSArray *)userIds
{
return [[[TGBridgeClient instance] requestSignalWithSubscription:[[TGBridgeUserInfoSubscription alloc] initWithUserIds:userIds]] map:^NSDictionary *(id next)
{
return next;
}];
}
@end