Skip to content

Commit

Permalink
Orphaned code
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Sep 19, 2021
1 parent 4682ded commit 27f1ea7
Show file tree
Hide file tree
Showing 18 changed files with 216 additions and 32 deletions.
8 changes: 4 additions & 4 deletions Unigram/Unigram.Native.Calls/Unigram.Native.Calls.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
Expand Down Expand Up @@ -478,15 +478,15 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\FFmpeg.UWP.4.1.5\build\native\FFmpeg.UWP.targets" Condition="Exists('..\packages\FFmpeg.UWP.4.1.5\build\native\FFmpeg.UWP.targets')" />
<Import Project="..\packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets" Condition="Exists('..\packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\FFmpeg.UWP.4.1.5\build\native\FFmpeg.UWP.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\FFmpeg.UWP.4.1.5\build\native\FFmpeg.UWP.targets'))" />
<Error Condition="!Exists('..\packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Unigram/Unigram.Native.Calls/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FFmpeg.UWP" version="4.1.5" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210629.4" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210913.7" targetFramework="native" />
<package id="Win2D.uwp" version="1.26.0" targetFramework="native" />
</packages>
8 changes: 4 additions & 4 deletions Unigram/Unigram.Native/Unigram.Native.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -505,15 +505,15 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\FFmpeg.UWP.4.1.5\build\native\FFmpeg.UWP.targets" Condition="Exists('..\packages\FFmpeg.UWP.4.1.5\build\native\FFmpeg.UWP.targets')" />
<Import Project="..\packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets" Condition="Exists('..\packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\FFmpeg.UWP.4.1.5\build\native\FFmpeg.UWP.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\FFmpeg.UWP.4.1.5\build\native\FFmpeg.UWP.targets'))" />
<Error Condition="!Exists('..\packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210629.4\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.210913.7\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Unigram/Unigram.Native/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FFmpeg.UWP" version="4.1.5" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210629.4" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210913.7" targetFramework="native" />
<package id="Win2D.uwp" version="1.26.0" targetFramework="native" />
</packages>
3 changes: 2 additions & 1 deletion Unigram/Unigram/Assets/Fonts/Telegram.json
Original file line number Diff line number Diff line change
Expand Up @@ -7152,5 +7152,6 @@
},
"gridSize": 16
},
"uid": -1
"uid": -1,
"time": 1631371331612
}
15 changes: 15 additions & 0 deletions Unigram/Unigram/Common/MenuFlyoutHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public static void CreateFlyoutItem<T>(this IList<MenuFlyoutItemBase> items, Fun
{
if (icon is FontIcon fontIcon)
{
//fontIcon.Margin = new Thickness(-2);
fontIcon.FontSize = 20;
fontIcon.FontFamily = BootStrapper.Current.Resources["TelegramThemeFontFamily"] as FontFamily;
}
Expand Down Expand Up @@ -157,6 +158,7 @@ public static void CreateFlyoutItem<T1, T2, T3>(this MenuFlyout flyout, Func<T1,
{
if (icon is FontIcon fontIcon)
{
//fontIcon.Margin = new Thickness(-2);
fontIcon.FontSize = 20;
fontIcon.FontFamily = BootStrapper.Current.Resources["TelegramThemeFontFamily"] as FontFamily;
}
Expand Down Expand Up @@ -189,6 +191,8 @@ public static MenuFlyoutItem CreateFlyoutItem(this MenuFlyout flyout, ICommand c
{
if (icon is FontIcon fontIcon)
{
//fontIcon.Margin = new Thickness(-2);
fontIcon.FontSize = 20;
fontIcon.FontFamily = BootStrapper.Current.Resources["TelegramThemeFontFamily"] as FontFamily;
}

Expand Down Expand Up @@ -246,6 +250,7 @@ public static MenuFlyoutItem CreateFlyoutItem(this IList<MenuFlyoutItemBase> ite
{
if (icon is FontIcon fontIcon)
{
//fontIcon.Margin = new Thickness(-2);
fontIcon.FontSize = 20;
fontIcon.FontFamily = BootStrapper.Current.Resources["TelegramThemeFontFamily"] as FontFamily;
}
Expand All @@ -261,5 +266,15 @@ public static MenuFlyoutItem CreateFlyoutItem(this IList<MenuFlyoutItemBase> ite
items.Add(flyoutItem);
return flyoutItem;
}

public static FontIcon Icon(string glyph)
{
return new FontIcon
{
Glyph = glyph,
FontFamily = BootStrapper.Current.Resources["TelegramThemeFontFamily"] as FontFamily,
Margin = new Thickness(-2)
};
}
}
}
5 changes: 2 additions & 3 deletions Unigram/Unigram/Controls/Cells/SharedFileCell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,12 @@ private string UpdateTimeLabel(Message message)

private void Button_Click(object sender, RoutedEventArgs e)
{
var data = _message.GetFileAndName(false);
if (data.File == null)
var file = _message.GetFile();
if (file == null)
{
return;
}

var file = data.File;
if (file.Local.IsDownloadingActive)
{
_protoService.Send(new CancelDownloadFile(file.Id, false));
Expand Down
1 change: 1 addition & 0 deletions Unigram/Unigram/Navigation/Services/FrameFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ private void FacadeNavigatedEventHandler(object sender, NavigationEventArgs e)
}

var args = new NavigatedEventArgs(e, Content as Page);
args.Parameter = CurrentPageParam;

if (NavigationModeHint != NavigationMode.New)
{
Expand Down
5 changes: 5 additions & 0 deletions Unigram/Unigram/Selectors/MessageContentTemplateSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class MessageContentTemplateSelector : DataTemplateSelector
public DataTemplate PhotoTemplate { get; set; }
public DataTemplate VideoTemplate { get; set; }
public DataTemplate TextTemplate { get; set; }
public DataTemplate AnimationTemplate { get; set; }
public DataTemplate MessageTemplate { get; set; }
public DataTemplate HeaderDateTemplate { get; set; }

Expand All @@ -25,6 +26,8 @@ protected override DataTemplate SelectTemplateCore(object item, DependencyObject
return MessageTemplate ?? VideoTemplate;
case MessageText:
return MessageTemplate ?? TextTemplate;
case MessageAnimation:
return MessageTemplate ?? AnimationTemplate;
case MessageHeaderDate:
return HeaderDateTemplate;
default:
Expand All @@ -41,6 +44,8 @@ protected override DataTemplate SelectTemplateCore(object item, DependencyObject
return MessageTemplate ?? VideoTemplate;
case MessageText:
return MessageTemplate ?? TextTemplate;
case MessageAnimation:
return MessageTemplate ?? AnimationTemplate;
case MessageHeaderDate:
return HeaderDateTemplate;
default:
Expand Down
33 changes: 20 additions & 13 deletions Unigram/Unigram/Unigram.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -537,15 +537,21 @@
<Compile Include="Views\Popups\BackgroundPopup.xaml.cs">
<DependentUpon>BackgroundPopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\ChooseColorPopup.xaml.cs">
<DependentUpon>ChooseColorPopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\ChooseRadioPopup.xaml.cs">
<DependentUpon>ChooseRadioPopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\InputPopup.xaml.cs">
<DependentUpon>InputPopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\RecordVoiceChatPopup.xaml.cs">
<DependentUpon>RecordVoiceChatPopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\ScheduleVoiceChatPopup.xaml.cs">
<DependentUpon>ScheduleVoiceChatPopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\SelectColorPopup.xaml.cs">
<DependentUpon>SelectColorPopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\ChatThemePopup.xaml.cs">
<DependentUpon>ChatThemePopup.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -880,9 +886,6 @@
<Compile Include="Views\Popups\ScheduleMessagePopup.xaml.cs">
<DependentUpon>ScheduleMessagePopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\SelectRadioPopup.xaml.cs">
<DependentUpon>SelectRadioPopup.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Popups\SendFilesPopup.xaml.cs">
<DependentUpon>SendFilesPopup.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -1711,15 +1714,23 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Popups\ChooseColorPopup.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Popups\ChooseRadioPopup.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Popups\InputPopup.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Popups\ScheduleVoiceChatPopup.xaml">
<Page Include="Views\Popups\RecordVoiceChatPopup.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Popups\SelectColorPopup.xaml">
<Page Include="Views\Popups\ScheduleVoiceChatPopup.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down Expand Up @@ -1907,10 +1918,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Popups\SelectRadioPopup.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Popups\SendFilesPopup.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -2273,7 +2280,7 @@
</Reference>
<ReferenceCopyLocalPaths Include="$(ProjectDir)\..\Libraries\rlottie\$(Platform)\RLottie.dll" />
<ReferenceCopyLocalPaths Include="$(ProjectDir)\..\Libraries\rlottie\$(Platform)\RLottie.pri" />
<ReferenceCopyLocalPaths Condition=" '$(Configuration)' == 'Debug' " Include="$(ProjectDir)\..\Libraries\rlottie\$(Platform)\zlib1.dll" />
<!--<ReferenceCopyLocalPaths Condition=" '$(Configuration)' == 'Debug' " Include="$(ProjectDir)\..\Libraries\rlottie\$(Platform)\zlib1.dll" />-->
</ItemGroup>
<ItemGroup />
<!--<ItemGroup>
Expand Down
13 changes: 12 additions & 1 deletion Unigram/Unigram/ViewModels/Chats/ChatSharedMediaViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ public override async Task OnNavigatedToAsync(object parameter, NavigationMode m
Links = new MediaCollection(ProtoService, chatId, new SearchMessagesFilterUrl());
Music = new MediaCollection(ProtoService, chatId, new SearchMessagesFilterAudio());
Voice = new MediaCollection(ProtoService, chatId, new SearchMessagesFilterVoiceNote());
Animations = new MediaCollection(ProtoService, chatId, new SearchMessagesFilterAnimation());

RaisePropertyChanged(nameof(Media));
RaisePropertyChanged(nameof(Files));
RaisePropertyChanged(nameof(Links));
RaisePropertyChanged(nameof(Music));
RaisePropertyChanged(nameof(Voice));
RaisePropertyChanged(nameof(Animations));

Aggregator.Subscribe(this);

Expand All @@ -86,7 +88,8 @@ private async Task UpdateSharedCountAsync(long chatId)
new SearchMessagesFilterDocument(),
new SearchMessagesFilterUrl(),
new SearchMessagesFilterAudio(),
new SearchMessagesFilterVoiceNote()
new SearchMessagesFilterVoiceNote(),
new SearchMessagesFilterAnimation(),
};

for (int i = 0; i < filters.Length; i++)
Expand All @@ -98,6 +101,8 @@ private async Task UpdateSharedCountAsync(long chatId)
}
}

SharedCount[SharedCount.Length - 1] = 0;

RaisePropertyChanged(nameof(SharedCount));
}

Expand Down Expand Up @@ -125,6 +130,7 @@ public void Handle(UpdateDeleteMessages update)
UpdateDeleteMessages(Links, table);
UpdateDeleteMessages(Music, table);
UpdateDeleteMessages(Voice, table);
UpdateDeleteMessages(Animations, table);
});
}
}
Expand Down Expand Up @@ -161,6 +167,7 @@ public int SelectedIndex
public MediaCollection Links { get; private set; }
public MediaCollection Music { get; private set; }
public MediaCollection Voice { get; private set; }
public MediaCollection Animations { get; private set; }

public void Find(SearchMessagesFilter filter, string query)
{
Expand All @@ -186,6 +193,10 @@ public void Find(SearchMessagesFilter filter, string query)
Voice = new MediaCollection(ProtoService, Chat.Id, voiceNote, query);
RaisePropertyChanged(nameof(Voice));
break;
case SearchMessagesFilterAnimation animation:
Animations = new MediaCollection(ProtoService, Chat.Id, animation, query);
RaisePropertyChanged(nameof(Animations));
break;
}
}

Expand Down
10 changes: 10 additions & 0 deletions Unigram/Unigram/Views/Chats/ChatSharedMediaPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ public ChatSharedMediaPage()
DataContext = View.DataContext = TLContainer.Current.Resolve<ChatSharedMediaViewModel, IFileDelegate>(View);
}

public void NavigatedTo(NavigationEventArgs e)
{
View.OnNavigatedTo(e);
}

public void NavigatedFrom(NavigationEventArgs e)
{
View.OnNavigatedFrom(e);
}

protected override void OnNavigatedTo(NavigationEventArgs e)
{
View.OnNavigatedTo(e);
Expand Down
Loading

0 comments on commit 27f1ea7

Please sign in to comment.