1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 10:27:46 +01:00
Telegram/Share/TGPeerId.h

18 lines
589 B
C
Raw Normal View History

2015-10-01 18:19:52 +02:00
#import <Foundation/Foundation.h>
typedef struct {
int32_t namespaceId;
int32_t peerId;
} TGPeerId;
typedef enum {
TGPeerIdPrivate = 0,
2016-02-25 01:03:51 +01:00
TGPeerIdGroup = 1,
TGPeerIdChannel = 2
2015-10-01 18:19:52 +02:00
} TGPeerIdNamespace;
#define TGPeerIdPrivateMake(x) ((TGPeerId){.namespaceId = TGPeerIdPrivate, .peerId = (x)})
#define TGPeerIdGroupMake(x) ((TGPeerId){.namespaceId = TGPeerIdGroup, .peerId = (x)})
2016-02-25 01:03:51 +01:00
#define TGPeerIdChannelMake(x) ((TGPeerId){.namespaceId = TGPeerIdChannel, .peerId = (x)})
2015-10-01 18:19:52 +02:00
#define TGPeerIdEqualToPeerId(x, y) ((x).namespaceId == (y).namespaceId && (x).peerId == (y).peerId)