Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-uwp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-uwp
Commits
93dbe9e9
Commit
93dbe9e9
authored
Oct 18, 2016
by
Nicolas Jager
Browse files
Options
Downloads
Patches
Plain Diff
internal : add creation token to protect against crash
Change-Id: Ice9291bd774de6f8ec21058a3d99885f24c0cc6f Tuleap: #1227
parent
df0a067a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
LoadingPage.xaml.cpp
+34
-3
34 additions, 3 deletions
LoadingPage.xaml.cpp
RingD.cpp
+15
-0
15 additions, 0 deletions
RingD.cpp
with
49 additions
and
3 deletions
LoadingPage.xaml.cpp
+
34
−
3
View file @
93dbe9e9
...
...
@@ -52,11 +52,42 @@ LoadingPage::LoadingPage()
.
then
([
this
](
bool
config_exists
)
{
if
(
config_exists
)
{
Utils
::
fileExists
(
ApplicationData
::
Current
->
LocalFolder
,
"creation.token"
)
.
then
([
this
](
bool
token_exists
)
{
if
(
token_exists
)
{
/* we have a token, the config has to be considered as corrupted, summon the wizard */
Utils
::
fileExists
(
ApplicationData
::
Current
->
LocalFolder
,
".config
\\
dring.yml"
)
.
then
([
this
](
bool
token_exists
)
{
if
(
token_exists
)
{
StorageFolder
^
storageFolder
=
ApplicationData
::
Current
->
LocalFolder
;
task
<
StorageFile
^>
(
storageFolder
->
GetFileAsync
(
".config
\\
dring.yml"
)).
then
([
this
](
StorageFile
^
folder
)
{
folder
->
DeleteAsync
();
});
}
});
this
->
Dispatcher
->
RunAsync
(
Windows
::
UI
::
Core
::
CoreDispatcherPriority
::
Normal
,
ref
new
Windows
::
UI
::
Core
::
DispatchedHandler
([
this
]()
{
this
->
Frame
->
Navigate
(
Windows
::
UI
::
Xaml
::
Interop
::
TypeName
(
Wizard
::
typeid
));
}));
}
else
{
/* there is no token and we have a config.yml, summon the main page */
this
->
Dispatcher
->
RunAsync
(
Windows
::
UI
::
Core
::
CoreDispatcherPriority
::
Normal
,
ref
new
Windows
::
UI
::
Core
::
DispatchedHandler
([
this
]()
{
this
->
Frame
->
Navigate
(
Windows
::
UI
::
Xaml
::
Interop
::
TypeName
(
MainPage
::
typeid
));
}));
}
});
}
else
{
/* no config file, create the token and summon the wizard*/
StorageFolder
^
storageFolder
=
ApplicationData
::
Current
->
LocalFolder
;
storageFolder
->
CreateFileAsync
(
"creation.token"
,
CreationCollisionOption
::
ReplaceExisting
);
this
->
Dispatcher
->
RunAsync
(
Windows
::
UI
::
Core
::
CoreDispatcherPriority
::
Normal
,
ref
new
Windows
::
UI
::
Core
::
DispatchedHandler
([
this
]
()
{
this
->
Frame
->
Navigate
(
Windows
::
UI
::
Xaml
::
Interop
::
TypeName
(
Wizard
::
typeid
));
}));
...
...
This diff is collapsed.
Click to expand it.
RingD.cpp
+
15
−
0
View file @
93dbe9e9
...
...
@@ -528,6 +528,21 @@ RingClientUWP::RingD::startDaemon()
}
}
/* at this point the config.yml is safe. */
Utils
::
fileExists
(
ApplicationData
::
Current
->
LocalFolder
,
"creation.token"
)
.
then
([
this
](
bool
token_exists
)
{
if
(
token_exists
)
{
StorageFolder
^
storageFolder
=
ApplicationData
::
Current
->
LocalFolder
;
task
<
StorageFile
^>
(
storageFolder
->
GetFileAsync
(
"creation.token"
)).
then
([
this
](
StorageFile
^
file
)
{
file
->
DeleteAsync
();
});
}
});
while
(
true
)
{
DRing
::
pollEvents
();
dequeueTasks
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment