Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
0833b397
Verified
Commit
0833b397
authored
2 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Log registration flows
parent
a90b4602
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
io.github.NhekoReborn.Nheko.yaml
+1
-1
1 addition, 1 deletion
io.github.NhekoReborn.Nheko.yaml
src/MatrixClient.h
+0
-113
0 additions, 113 deletions
src/MatrixClient.h
src/RegisterPage.cpp
+4
-0
4 additions, 0 deletions
src/RegisterPage.cpp
with
6 additions
and
115 deletions
CMakeLists.txt
+
1
−
1
View file @
0833b397
...
...
@@ -595,7 +595,7 @@ if(USE_BUNDLED_MTXCLIENT)
FetchContent_Declare
(
MatrixClient
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
GIT_TAG
176242b1d2c68878c0ce610c109d0779fe7fa8fb
GIT_TAG
b8f0e821066946fd567ea6a11933ebce69d72b6f
)
set
(
BUILD_LIB_EXAMPLES OFF CACHE INTERNAL
""
)
set
(
BUILD_LIB_TESTS OFF CACHE INTERNAL
""
)
...
...
This diff is collapsed.
Click to expand it.
io.github.NhekoReborn.Nheko.yaml
+
1
−
1
View file @
0833b397
...
...
@@ -182,7 +182,7 @@ modules:
buildsystem
:
cmake-ninja
name
:
mtxclient
sources
:
-
commit
:
176242b1d2c68878c0ce610c109d0779fe7fa8fb
-
commit
:
b8f0e821066946fd567ea6a11933ebce69d72b6f
#tag: v0.8.2
type
:
git
url
:
https://github.com/Nheko-Reborn/mtxclient.git
...
...
This diff is collapsed.
Click to expand it.
src/MatrixClient.h
+
0
−
113
View file @
0833b397
...
...
@@ -8,8 +8,6 @@
#include
<mtxclient/http/client.hpp>
#include
<curl/curl.h>
#include
"Logging.h"
namespace
http
{
...
...
@@ -24,114 +22,3 @@ void
init
();
}
template
<
>
struct
fmt
::
formatter
<
mtx
::
http
::
ClientError
>
{
// Presentation format: 'f' - fixed, 'e' - exponential.
bool
print_network_error
=
false
;
bool
print_http_error
=
false
;
bool
print_parser_error
=
false
;
bool
print_matrix_error
=
false
;
// Parses format specifications of the form ['f' | 'e'].
constexpr
auto
parse
(
fmt
::
format_parse_context
&
ctx
)
->
decltype
(
ctx
.
begin
())
{
// [ctx.begin(), ctx.end()) is a character range that contains a part of
// the format string starting from the format specifications to be parsed,
// e.g. in
//
// fmt::format("{:f} - point of interest", point{1, 2});
//
// the range will contain "f} - point of interest". The formatter should
// parse specifiers until '}' or the end of the range. In this example
// the formatter should parse the 'f' specifier and return an iterator
// pointing to '}'.
// Parse the presentation format and store it in the formatter:
auto
it
=
ctx
.
begin
(),
end
=
ctx
.
end
();
while
(
it
!=
end
&&
*
it
!=
'}'
)
{
auto
tmp
=
*
it
++
;
switch
(
tmp
)
{
case
'n'
:
print_matrix_error
=
true
;
break
;
case
'h'
:
print_matrix_error
=
true
;
break
;
case
'p'
:
print_matrix_error
=
true
;
break
;
case
'm'
:
print_matrix_error
=
true
;
break
;
default:
throw
format_error
(
"invalid format specifier for mtx error"
);
}
}
// Check if reached the end of the range:
if
(
it
!=
end
&&
*
it
!=
'}'
)
throw
fmt
::
format_error
(
"invalid format"
);
// Return an iterator past the end of the parsed range:
return
it
;
}
// Formats the point p using the parsed format specification (presentation)
// stored in this formatter.
template
<
typename
FormatContext
>
auto
format
(
const
mtx
::
http
::
ClientError
&
e
,
FormatContext
&
ctx
)
->
decltype
(
ctx
.
out
())
{
// ctx.out() is an output iterator to write to.
bool
prepend_comma
=
false
;
fmt
::
format_to
(
ctx
.
out
(),
"("
);
if
(
print_network_error
||
e
.
error_code
)
{
fmt
::
format_to
(
ctx
.
out
(),
"connection: {}"
,
e
.
error_code_string
());
prepend_comma
=
true
;
}
if
(
print_http_error
||
(
e
.
status_code
!=
0
&&
(
e
.
status_code
<
200
||
e
.
status_code
>=
300
)))
{
if
(
prepend_comma
)
fmt
::
format_to
(
ctx
.
out
(),
", "
);
fmt
::
format_to
(
ctx
.
out
(),
"http: {}"
,
e
.
status_code
);
prepend_comma
=
true
;
}
if
(
print_parser_error
||
!
e
.
parse_error
.
empty
())
{
if
(
prepend_comma
)
fmt
::
format_to
(
ctx
.
out
(),
", "
);
fmt
::
format_to
(
ctx
.
out
(),
"parser: {}"
,
e
.
parse_error
);
prepend_comma
=
true
;
}
if
(
print_parser_error
||
(
e
.
matrix_error
.
errcode
!=
mtx
::
errors
::
ErrorCode
::
M_UNRECOGNIZED
&&
!
e
.
matrix_error
.
error
.
empty
()))
{
if
(
prepend_comma
)
fmt
::
format_to
(
ctx
.
out
(),
", "
);
fmt
::
format_to
(
ctx
.
out
(),
"matrix: {}:'{}'"
,
to_string
(
e
.
matrix_error
.
errcode
),
e
.
matrix_error
.
error
);
}
return
fmt
::
format_to
(
ctx
.
out
(),
")"
);
}
};
template
<
>
struct
fmt
::
formatter
<
std
::
optional
<
mtx
::
http
::
ClientError
>>
:
formatter
<
mtx
::
http
::
ClientError
>
{
// parse is inherited from formatter<string_view>.
template
<
typename
FormatContext
>
auto
format
(
std
::
optional
<
mtx
::
http
::
ClientError
>
c
,
FormatContext
&
ctx
)
{
if
(
!
c
)
return
fmt
::
format_to
(
ctx
.
out
(),
"(no error)"
);
else
return
formatter
<
mtx
::
http
::
ClientError
>::
format
(
*
c
,
ctx
);
}
};
This diff is collapsed.
Click to expand it.
src/RegisterPage.cpp
+
4
−
0
View file @
0833b397
...
...
@@ -164,6 +164,10 @@ RegisterPage::versionsCheck()
return
;
}
for
(
const
auto
&
f
:
e
->
matrix_error
.
unauthorized
.
flows
)
nhlog
::
ui
()
->
debug
(
"Registration flows for server: {}"
,
fmt
::
join
(
f
.
stages
,
", "
));
supported_
=
true
;
lookingUpHs_
=
false
;
emit
lookingUpHsChanged
();
...
...
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