Skip to content

Commit

Permalink
0.11.953
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Nov 23, 2017
1 parent 877de36 commit c7e55cf
Show file tree
Hide file tree
Showing 16 changed files with 492 additions and 233 deletions.
4 changes: 2 additions & 2 deletions Unigram/Unigram.Core/Common/ApplicationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public bool InAppSounds

#region App version

public const int CurrentVersion = 0108490;
public const string CurrentChangelog = "- Grouped Photos. Group media into an album when sharing multiple photos and videos. Choose the exact order of media you send.\n- Saved Messages. Bookmark messages by forwarding them to “Saved Messages”. Access them from the Chats list or Settings.\n- Better Search. Find bots and public channels faster by typing their titles in Search. Popular bots and channels are shown first.\n- Pinned Messages. If you are a channel admin, pin messages to focus your subscribers’ attention on important announcements.\n\nBonus Tracks: \n- Select text inside messages using your mouse\n- Right click on a link inside a message to copy it\n- Import contacts from your phonebook to Telegram\n- Tons of bug fixes and improvements";
public const int CurrentVersion = 0119530;
public const string CurrentChangelog = "- Get secure thanks to the Passcode Lock\n- Better replies: when clicking on a reply the original message will be highlighted\n- More languages: Arabic, Dutch, French, German, Indonesian, Italian, Korean, Malay, Portuguese (Brazil), Russian, Spanish and Ukranian are now supported";

private int? _appVersion;
public int Version
Expand Down
25 changes: 24 additions & 1 deletion Unigram/Unigram.Native.Tasks/NotificationTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,32 @@ void NotificationTask::UpdatePrimaryTile(String^ caption, String^ message, Strin

void NotificationTask::UpdateToast(String^ caption, String^ message, String^ sound, String^ launch, String^ tag, String^ group, String^ picture, String^ date, String^ loc_key)
{
bool allow = true;
//auto settings = ApplicationData::Current->LocalSettings;
//if (settings->Values->HasKey("SessionGuid"))
//{
// auto guid = safe_cast<String^>(settings->Values->Lookup("SessionGuid"));

// std::wstringstream path;
// path << temp->Data()
// << L"\\"
// << guid->Data()
// << L"\\passcode_params.dat";

// WIN32_FIND_DATA FindFileData;
// HANDLE handle = FindFirstFile(path.str().c_str(), &FindFileData);
// int found = handle != INVALID_HANDLE_VALUE;
// if (found)
// {
// FindClose(handle);

// allow = false;
// }
//}

std::wstring key = loc_key->Data();
std::wstring actions = L"";
if (group != nullptr && key.find(L"CHANNEL"))
if (group != nullptr && key.find(L"CHANNEL") && allow)
{
actions = L"<actions><input id='QuickMessage' type='text' placeHolderContent='Type a message...' /><action activationType='background' arguments='";
actions += launch->Data();
Expand Down
13 changes: 9 additions & 4 deletions Unigram/Unigram/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,19 @@ private void Inactivity_Detected(object sender, EventArgs e)
});
}

public static void ShowPasscode()
public static async void ShowPasscode()
{
if (Current.ModalDialog.IsModal == false)
{
Current.ModalContent = new PasscodePage();
Current.ModalDialog.CanBackButtonDismiss = false;
Current.ModalDialog.DisableBackButtonWhenModal = true;
//Current.ModalContent = new PasscodePage();
//Current.ModalDialog.CanBackButtonDismiss = false;
//Current.ModalDialog.DisableBackButtonWhenModal = true;
Current.ModalContent = new Border();
Current.ModalDialog.IsModal = true;

var dialog = new PasscodePage();
var result = await dialog.ShowQueuedAsync();
//await new PasscodePage().ShowQueuedAsync();
}
}

Expand Down
50 changes: 47 additions & 3 deletions Unigram/Unigram/Controls/MasterDetailView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Windows.UI.Xaml.Hosting;
using Windows.UI.Composition;
using System.Numerics;
using System.Collections.Generic;

// The Templated Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234235

Expand All @@ -35,6 +36,8 @@ public sealed class MasterDetailView : ContentControl
public NavigationService NavigationService { get; private set; }
public Frame ParentFrame { get; private set; }

private readonly LinkedList<BackStackType> _backStack = new LinkedList<BackStackType>();

public MasterDetailView()
{
DefaultStyleKey = typeof(MasterDetailView);
Expand All @@ -44,6 +47,35 @@ public MasterDetailView()
SizeChanged += OnSizeChanged;
}

public void Push(bool hamburger)
{
//if (hamburger)
//{
// while (_backStack.Contains(BackStackType.Hamburger))
// {
// _backStack.Remove(BackStackType.Hamburger);
// }
//}

//_backStack.AddLast(hamburger ? BackStackType.Hamburger : BackStackType.Navigation);
}

public bool Last()
{
if (_backStack.Count > 0)
{
return _backStack.Last.Value == BackStackType.Hamburger;
}

return false;
}

enum BackStackType
{
Hamburger,
Navigation
}

private void OnSizeChanged(object sender, SizeChangedEventArgs e)
{
UpdateVisualState();
Expand Down Expand Up @@ -186,6 +218,11 @@ private void OnNavigated(object sender, NavigationEventArgs e)
return;
}

if (e.NavigationMode == NavigationMode.New && DetailFrame.CanGoBack)
{
Push(false);
}

if (CurrentState == MasterDetailState.Narrow && e.SourcePageType == BlankPageType)
{
MasterPresenter.Visibility = Visibility.Visible;
Expand Down Expand Up @@ -299,7 +336,14 @@ public void Initialize(string key, Frame parent)
service.FrameFacade.FrameId = key;
service.FrameFacade.BackRequested += (s, args) =>
{
if (DetailFrame.Content is IMasterDetailPage detailPage)
//var type = BackStackType.Navigation;
//if (_backStack.Count > 0)
//{
// type = _backStack.Last.Value;
// _backStack.RemoveLast();
//}

if (DetailFrame.Content is IMasterDetailPage detailPage /*&& type == BackStackType.Navigation*/)
{
detailPage.OnBackRequested(args);
if (args.Handled)
Expand All @@ -310,12 +354,12 @@ public void Initialize(string key, Frame parent)

// TODO: maybe checking for the actual width is not the perfect way,
// but if it is 0 it means that the control is not loaded, and the event shouldn't be handled
if (CanGoBack && ActualWidth > 0)
if (CanGoBack && ActualWidth > 0 /*&& type == BackStackType.Navigation*/)
{
DetailFrame.GoBack();
args.Handled = true;
}
else if (ParentFrame.Content is IMasterDetailPage masterPage)
else if (ParentFrame.Content is IMasterDetailPage masterPage /*&& type == BackStackType.Hamburger*/)
{
masterPage.OnBackRequested(args);
if (args.Handled)
Expand Down
2 changes: 1 addition & 1 deletion Unigram/Unigram/Converters/LastSeenConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static string GetLabel(TLUser user, bool details)
}
else if (user.Status is TLUserStatusOnline online)
{
if (online.Expires > Utils.CurrentTimestamp)
if (online.Expires > Utils.CurrentTimestamp / 1000)
{
return Strings.Android.Online;
}
Expand Down
66 changes: 33 additions & 33 deletions Unigram/Unigram/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<Identity Name="38833FF26BA1D.Unigram" Publisher="CN=D89C87B4-2758-402A-8F40-3571D00882AB" Version="1.1.0.0" />
<mp:PhoneIdentity PhoneProductId="505fe6a3-c157-4260-b704-f44200dc2b8d" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>ms-resource:/Branding/PackageDisplayName</DisplayName>
<PublisherDisplayName>ms-resource:/Branding/PublisherDisplayName</PublisherDisplayName>
<DisplayName>Unigram Preview</DisplayName>
<PublisherDisplayName>Unigram, Inc.</PublisherDisplayName>
<Logo>Assets\Logos\StoreLogo\StoreLogo.png</Logo>
</Properties>
<Dependencies>
Expand All @@ -27,54 +27,54 @@
<uap:SplashScreen uap5:Optional="true" Image="Assets\Logos\SplashScreen\SplashScreen.png" BackgroundColor="transparent" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.appService" EntryPoint="Unigram.Tasks.VoIPServiceTask">
<uap:AppService Name="VoIPServiceTask" ServerName="BackgroundHost" />
<uap:Extension Category="windows.shareTarget">
<uap:ShareTarget>
<uap:SupportedFileTypes>
<uap:SupportsAnyFileType />
</uap:SupportedFileTypes>
<uap:DataFormat>Text</uap:DataFormat>
<uap:DataFormat>URI</uap:DataFormat>
<uap:DataFormat>StorageItems</uap:DataFormat>
<uap:DataFormat>Bitmap</uap:DataFormat>
</uap:ShareTarget>
</uap:Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Unigram.Native.Tasks.NotificationTask">
<BackgroundTasks ServerName="BackgroundHost">
<Task Type="pushNotification" />
</BackgroundTasks>
</Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Unigram.Tasks.VoIPCallTask">
<BackgroundTasks ServerName="BackgroundHost">
<Task Type="systemEvent" />
</BackgroundTasks>
</Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Unigram.Tasks.InteractiveTask">
<BackgroundTasks ServerName="BackgroundHost">
<Task Type="systemEvent" />
</BackgroundTasks>
</Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="tg">
<uap:Protocol Name="ms-contact-profile">
<uap:DisplayName>Unigram</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="ms-voip-call">
<uap:Protocol Name="ms-ipmessaging">
<uap:DisplayName>Unigram</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="ms-ipmessaging">
<uap:Protocol Name="ms-voip-call">
<uap:DisplayName>Unigram</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
<uap:Extension Category="windows.protocol">
<uap:Protocol Name="ms-contact-profile">
<uap:Protocol Name="tg">
<uap:DisplayName>Unigram</uap:DisplayName>
</uap:Protocol>
</uap:Extension>
<uap:Extension Category="windows.shareTarget">
<uap:ShareTarget>
<uap:SupportedFileTypes>
<uap:SupportsAnyFileType />
</uap:SupportedFileTypes>
<uap:DataFormat>Text</uap:DataFormat>
<uap:DataFormat>URI</uap:DataFormat>
<uap:DataFormat>StorageItems</uap:DataFormat>
<uap:DataFormat>Bitmap</uap:DataFormat>
</uap:ShareTarget>
<Extension Category="windows.backgroundTasks" EntryPoint="Unigram.Tasks.InteractiveTask">
<BackgroundTasks ServerName="BackgroundHost">
<Task Type="systemEvent" />
</BackgroundTasks>
</Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Unigram.Tasks.VoIPCallTask">
<BackgroundTasks ServerName="BackgroundHost">
<Task Type="systemEvent" />
</BackgroundTasks>
</Extension>
<Extension Category="windows.backgroundTasks" EntryPoint="Unigram.Native.Tasks.NotificationTask">
<BackgroundTasks ServerName="BackgroundHost">
<Task Type="pushNotification" />
</BackgroundTasks>
</Extension>
<uap:Extension Category="windows.appService" EntryPoint="Unigram.Tasks.VoIPServiceTask">
<uap:AppService Name="VoIPServiceTask" ServerName="BackgroundHost" />
</uap:Extension>
<uap:Extension Category="windows.voipCall" />
<uap3:Extension Category="windows.appUriHandler">
Expand Down
20 changes: 10 additions & 10 deletions Unigram/Unigram/Strings/en/Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// This code contains a helper class exposing property representations
// of the string resources defined in the specified .ResW file
//
// Generated: 11/22/2017 21:54:27
// Generated: 11/23/2017 17:35:36
// </auto-generatedInfo>
// --------------------------------------------------------------------------------------------------
namespace Unigram.Strings
Expand Down Expand Up @@ -449,7 +449,7 @@ public static string ActionPinnedSticker
}

/// <summary>
/// Localized resource similar to "un1 pinned \"{0}\""
/// Localized resource similar to "un1 pinned "{0}""
/// </summary>
public static string ActionPinnedText
{
Expand Down Expand Up @@ -6294,7 +6294,7 @@ public static string EventLogEditedChannelPhoto
}

/// <summary>
/// Localized resource similar to "un1 renamed the channel to \"{0}\""
/// Localized resource similar to "un1 renamed the channel to "{0}""
/// </summary>
public static string EventLogEditedChannelTitle
{
Expand Down Expand Up @@ -6327,7 +6327,7 @@ public static string EventLogEditedGroupPhoto
}

/// <summary>
/// Localized resource similar to "un1 renamed the group to \"{0}\""
/// Localized resource similar to "un1 renamed the group to "{0}""
/// </summary>
public static string EventLogEditedGroupTitle
{
Expand Down Expand Up @@ -11385,7 +11385,7 @@ public static string NotificationActionPinnedStickerEmojiChannel
}

/// <summary>
/// Localized resource similar to "{0} pinned \"{1}\" in the group {2}"
/// Localized resource similar to "{0} pinned "{1}" in the group {2}"
/// </summary>
public static string NotificationActionPinnedText
{
Expand All @@ -11396,7 +11396,7 @@ public static string NotificationActionPinnedText
}

/// <summary>
/// Localized resource similar to "{0} pinned \"{1}\""
/// Localized resource similar to "{0} pinned "{1}""
/// </summary>
public static string NotificationActionPinnedTextChannel
{
Expand Down Expand Up @@ -12309,7 +12309,7 @@ public static string OnlyIfSilent
}

/// <summary>
/// Localized resource similar to "Only when screen \"off\""
/// Localized resource similar to "Only when screen "off""
/// </summary>
public static string OnlyWhenScreenOff
{
Expand All @@ -12320,7 +12320,7 @@ public static string OnlyWhenScreenOff
}

/// <summary>
/// Localized resource similar to "Only when screen \"on\""
/// Localized resource similar to "Only when screen "on""
/// </summary>
public static string OnlyWhenScreenOn
{
Expand Down Expand Up @@ -14758,7 +14758,7 @@ public static string RevokeLink
/// <summary>
/// Localized resource similar to "Are you sure you want to revoke the link **{0}**?
///
///The group \"**{1}**\" will become private."
///The group "**{1}**" will become private."
/// </summary>
public static string RevokeLinkAlert
{
Expand All @@ -14771,7 +14771,7 @@ public static string RevokeLinkAlert
/// <summary>
/// Localized resource similar to "Are you sure you want to revoke the link **{0}**?
///
///The channel \"**{1}**\" will become private."
///The channel "**{1}**" will become private."
/// </summary>
public static string RevokeLinkAlertChannel
{
Expand Down
Loading

0 comments on commit c7e55cf

Please sign in to comment.