public override void deserializeBody(InputStream stream, TLContext context) { this.userId = StreamingUtils.readInt(stream); this.date = StreamingUtils.readInt(stream); this.photo = StreamingUtils.readTLObject(stream, context); this.previous = StreamingUtils.readTLBool(stream); }
public override void deserializeBody(InputStream stream, TLContext context) { this.flags = StreamingUtils.readInt(stream); base.id = StreamingUtils.readInt(stream); if ((this.flags & 1) != 0) { this.accessHash = StreamingUtils.readLong(stream); } if ((this.flags & 2) != 0) { this.firstName = StreamingUtils.readTLString(stream); } if ((this.flags & 4) != 0) { this.lastName = StreamingUtils.readTLString(stream); } if ((this.flags & 8) != 0) { this.userName = StreamingUtils.readTLString(stream); } if ((this.flags & 0x10) != 0) { this.phone = StreamingUtils.readTLString(stream); } if ((this.flags & 0x20) != 0) { this.photo = StreamingUtils.readTLObject(stream, context); } if ((this.flags & 0x40) != 0) { this.status = StreamingUtils.readTLObject(stream, context); } if ((this.flags & 0x4000) != 0) { this.botInfoVersion = StreamingUtils.readInt(stream); } if ((this.flags & 0x40000) != 0) { this.restrictionReason = StreamingUtils.readTLString(stream); } if ((this.flags & 0x80000) != 0) { this.botInlinePlaceholder = StreamingUtils.readTLString(stream); } if ((this.flags & 0x200000) != 0) { this.langCode = StreamingUtils.readTLString(stream); } }
public override void deserializeResponse(BinaryReader br) { Response = (TLAbsUserProfilePhoto)ObjectUtils.DeserializeObject(br); }
public override void DeserializeResponse(BinaryReader br) { Response = (TLAbsUserProfilePhoto)ObjectUtils.DeserializeObject(br); }
private async void obtenerFoto() { var result = await MainWindow.client.GetContactsAsync(); var user = result.Users .Where(x => x.GetType() == typeof(TLUser)) .Cast <TLUser>() .FirstOrDefault(x => x.Phone == "34" + u.Telefono); bool mirarfoto = true; if (user == null) { //await MainWindow.client.ConnectAsync(); var phoneContact = new TLInputPhoneContact() { Phone = "34" + u.Telefono, FirstName = u.Nombre, LastName = u.Apellidos }; var contacts = new List <TLInputPhoneContact>() { phoneContact }; var req = new TLRequestImportContacts() { Contacts = new TLVector <TLInputPhoneContact>(contacts) }; var rrr = await MainWindow.client.SendRequestAsync <TLImportedContacts>(req); if (rrr.Imported.Count == 1) { user = result.Users .Where(x => x.GetType() == typeof(TLUser)) .Cast <TLUser>() .FirstOrDefault(x => x.Phone == "34" + u.Telefono); } else { mirarfoto = false; } } if (mirarfoto && user != null) { TLAbsUserProfilePhoto photo = user.Photo; TLUserProfilePhoto up = (TLUserProfilePhoto)photo; if (up != null && up.PhotoBig != null) { TLFileLocation tf = (TLFileLocation)up.PhotoBig; TLAbsInputFileLocation aifl = new TLInputFileLocation() { LocalId = tf.LocalId, Secret = tf.Secret, VolumeId = tf.VolumeId }; TeleSharp.TL.Upload.TLFile buffer = await MainWindow.client.GetFile(aifl, 1024 * 1024); if (buffer.Bytes != null) { u.Photo = buffer.Bytes; u.cambiarFoto(); } } } }
public virtual void setPhoto(TLAbsUserProfilePhoto photo) { this.photo = photo; }