public TableAccessibleChatListViewItem(IProtoService protoService) { _protoService = protoService; }
public SearchAnimationsCollection(IProtoService protoService, IEventAggregator aggregator, string query) { _protoService = protoService; _aggregator = aggregator; _query = query; }
public TranslateService(IProtoService protoService, ISettingsService settings) { _protoService = protoService; _settings = settings; }
public ItemsCollection(IProtoService protoService, ICacheService cacheService) { _protoService = protoService; _cacheService = cacheService; }
public SupergroupStickerSetViewModel(IProtoService protoService, IEventAggregator aggregator, StickerSetInfo info, StickerSet set) : base(protoService, aggregator, info, set) { }
public void UpdateChat(IProtoService protoService, Chat chat) { _protoService = protoService; Update(chat); }
public SettingsPrivacyAllowChatInvitesViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator) : base(protoService, cacheService, aggregator, new UserPrivacySettingAllowChatInvites()) { }
public SettingsMasksArchivedViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator) : base(protoService, cacheService, aggregator, true) { }
public BasicGroupCreateStep1ViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator) : base(protoService, cacheService, settingsService, aggregator) { SendCommand = new RelayCommand(SendExecute, () => !string.IsNullOrWhiteSpace(Title)); EditPhotoCommand = new RelayCommand <StorageFile>(EditPhotoExecute); }
public SearchChatsFilterChat(IProtoService protoService, Chat chat) { _protoService = protoService; _chat = chat; }
public UserCreateViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator) : base(protoService, cacheService, aggregator) { SendCommand = new RelayCommand(SendExecute, () => !string.IsNullOrEmpty(_firstName) && !string.IsNullOrEmpty(_phoneCode) && !string.IsNullOrEmpty(_phoneNumber)); }
public SettingsPhoneIntroViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator) : base(protoService, cacheService, aggregator) { }
public ChatGridViewAutomationPeer(ChatGridViewItem owner, IProtoService protoService) : base(owner) { _owner = owner; _protoService = protoService; }
public ChatGridViewItem(IProtoService protoService) { _protoService = protoService; }
public SettingsStickersArchivedViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator) : base(protoService, cacheService, settingsService, aggregator, false) { }
public SupergroupMembersViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator) : base(protoService, cacheService, aggregator, new SupergroupMembersFilterRecent(), query => new SupergroupMembersFilterSearch(query)) { ParticipantPromoteCommand = new RelayCommand <ChatMember>(ParticipantPromoteExecute); MemberRemoveCommand = new RelayCommand <ChatMember>(MemberRemoveExecute); }
public OutputTypingManager(IProtoService protoService, Chat chat, double delay = 5.0) { _chat = chat; _delay = delay; _protoService = protoService; }
public PaymentFormStep3ViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator) : base(protoService, cacheService, settingsService, aggregator) { SendCommand = new RelayCommand(SendExecute, () => !IsLoading); }
public ChatInviteViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator) : base(protoService, cacheService, aggregator) { }
public SettingsPasswordDoneViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator) : base(protoService, cacheService, settingsService, aggregator) { SendCommand = new RelayCommand(SendExecute); }
public SettingsPhoneSentCodeViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator) : base(protoService, cacheService, aggregator) { SendCommand = new RelayCommand(SendExecute, () => !IsLoading); ResendCommand = new RelayCommand(ResendExecute, () => !IsLoading); }
public static string GetSummary(IProtoService protoService, Message message) { if (message.IsService()) { return(MessageService.GetText(new ViewModels.MessageViewModel(protoService, null, null, message)) + ", "); } if (message.Content is MessageText text) { return(text.Text.Text + ", "); } if (message.Content is MessageDice dice) { return(dice.Emoji + ", "); } if (message.Content is MessageGame gameMedia) { return(Strings.Resources.AttachGame + ", " + gameMedia.Game.Title + ", "); } if (message.Content is MessageExpiredVideo) { return(Strings.Resources.AttachVideoExpired + ", "); } else if (message.Content is MessageExpiredPhoto) { return(Strings.Resources.AttachPhotoExpired + ", "); } else if (message.Content is MessageVideoNote) { return(Strings.Resources.AttachRound + ", "); } else if (message.Content is MessageSticker sticker) { if (string.IsNullOrEmpty(sticker.Sticker.Emoji)) { return(Strings.Resources.AttachSticker + ", "); } return($"{sticker.Sticker.Emoji} {Strings.Resources.AttachSticker}" + ", "); } string GetCaption(string caption) { return(string.IsNullOrEmpty(caption) ? string.Empty : ", " + caption); } if (message.Content is MessageVoiceNote voiceNote) { return(Strings.Resources.AttachAudio + GetCaption(voiceNote.Caption.Text) + ", "); } else if (message.Content is MessageVideo video) { return((video.IsSecret ? Strings.Resources.AttachDestructingVideo : Strings.Resources.AttachVideo) + GetCaption(video.Caption.Text) + ", "); } else if (message.Content is MessageAnimation animation) { return(Strings.Resources.AttachGif + GetCaption(animation.Caption.Text) + ", "); } else if (message.Content is MessageAudio audio) { var performer = string.IsNullOrEmpty(audio.Audio.Performer) ? null : audio.Audio.Performer; var title = string.IsNullOrEmpty(audio.Audio.Title) ? null : audio.Audio.Title; if (performer == null && title == null) { return(Strings.Resources.AttachMusic + GetCaption(audio.Caption.Text) + ", "); } else { return($"{performer ?? Strings.Resources.AudioUnknownArtist} - {title ?? Strings.Resources.AudioUnknownTitle}" + GetCaption(audio.Caption.Text) + ", "); } } else if (message.Content is MessageDocument document) { if (string.IsNullOrEmpty(document.Document.FileName)) { return(Strings.Resources.AttachDocument + GetCaption(document.Caption.Text) + ", "); } return(document.Document.FileName + GetCaption(document.Caption.Text) + ", "); } else if (message.Content is MessageInvoice invoice) { return(Strings.Resources.PaymentInvoice + ", " + invoice.Title + ", "); } else if (message.Content is MessageContact) { return(Strings.Resources.AttachContact + ", "); } else if (message.Content is MessageLocation location) { return((location.LivePeriod > 0 ? Strings.Resources.AttachLiveLocation : Strings.Resources.AttachLocation) + ", "); } else if (message.Content is MessageVenue vanue) { return(Strings.Resources.AttachLocation + ", "); } else if (message.Content is MessagePhoto photo) { return((photo.IsSecret ? Strings.Resources.AttachDestructingPhoto : Strings.Resources.AttachPhoto) + GetCaption(photo.Caption.Text) + ", "); } else if (message.Content is MessagePoll poll) { return(Strings.Resources.Poll + ", " + poll.Poll.Question + ", "); } else if (message.Content is MessageCall call) { var outgoing = message.IsOutgoing; var missed = call.DiscardReason is CallDiscardReasonMissed || call.DiscardReason is CallDiscardReasonDeclined; return((missed ? (outgoing ? Strings.Resources.CallMessageOutgoingMissed : Strings.Resources.CallMessageIncomingMissed) : (outgoing ? Strings.Resources.CallMessageOutgoing : Strings.Resources.CallMessageIncoming)) + ", "); } else if (message.Content is MessageUnsupported) { return(Strings.Resources.UnsupportedAttachment + ", "); } return(null); }
public GalleryContent(IProtoService protoService) { _protoService = protoService; }
public static string GetDescription(IProtoService cacheService, Message message) { var chat = cacheService.GetChat(message.ChatId); var content = message.Content; var sticker = content is MessageSticker; var light = sticker || content is MessageVideoNote; var title = string.Empty; if (!light && /*message.IsFirst &&*/ !message.IsOutgoing && !message.IsChannelPost && (chat.Type is ChatTypeBasicGroup || chat.Type is ChatTypeSupergroup)) { var sender = cacheService.GetUser(message.SenderUserId); title = sender?.GetFullName(); } else if (!light && message.IsChannelPost && chat.Type is ChatTypeSupergroup) { title = cacheService.GetTitle(chat); } else if (!light && /*message.IsFirst &&*/ message.IsSaved(cacheService.Options.MyId)) { if (message.ForwardInfo?.Origin is MessageForwardOriginUser fromUser) { title = cacheService.GetUser(fromUser.SenderUserId)?.GetFullName(); } else if (message.ForwardInfo?.Origin is MessageForwardOriginChannel post) { title = cacheService.GetTitle(cacheService.GetChat(post.ChatId)); } else if (message.ForwardInfo?.Origin is MessageForwardOriginHiddenUser fromHiddenUser) { title = fromHiddenUser.SenderName; } } var builder = new StringBuilder(); if (title?.Length > 0) { builder.AppendLine($"{title}. "); } //if (message.ReplyToMessage != null) //{ // var user = message.ProtoService.GetUser(message.ReplyToMessage.SenderUserId); // if (user != null) // { // builder.AppendLine($"{Strings.Resources.AccDescrReplying} {user.GetFullName()}. "); // } //} builder.Append(Automation.GetSummary(cacheService, message)); var date = string.Format(Strings.Resources.TodayAtFormatted, BindConvert.Current.ShortTime.Format(Utils.UnixTimestampToDateTime(message.Date))); if (message.IsOutgoing) { builder.Append(string.Format(Strings.Resources.AccDescrSentDate, date)); } else { builder.Append(string.Format(Strings.Resources.AccDescrReceivedDate, date)); } builder.Append(". "); var maxId = 0L; if (chat != null) { maxId = chat.LastReadOutboxMessageId; } if (message.SendingState is MessageSendingStateFailed) { } else if (message.SendingState is MessageSendingStatePending) { } else if (message.Id <= maxId) { builder.Append(Strings.Resources.AccDescrMsgRead); } else { builder.Append(Strings.Resources.AccDescrMsgUnread); } builder.Append("."); return(builder.ToString()); }
public StickerSetViewModel(IProtoService protoService, IEventAggregator aggregator, StickerSetInfo info, StickerSet set) : this(protoService, aggregator, info) { IsLoaded = true; Update(set); }
public GalleryMessage(IProtoService protoService, Message message) : base(protoService) { _message = message; }
public SettingsPrivacyShowStatusViewModel(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator) : base(protoService, cacheService, settingsService, aggregator, new UserPrivacySettingShowStatus()) { }
public TLMultipleViewModelBase(IProtoService protoService, ICacheService cacheService, ISettingsService settingsService, IEventAggregator aggregator) : base(protoService, cacheService, settingsService, aggregator) { Children = new List <TLViewModelBase>(); }
public GalleryItem(IProtoService protoService) { _protoService = protoService; }
public SupergroupEventLogViewModel(IProtoService protoService, ICacheService cacheService, IEventAggregator aggregator) : base(protoService, cacheService, aggregator) { }