Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Timo Jyrinki
calls
Commits
6af2e266
Commit
6af2e266
authored
Jul 07, 2020
by
Mohammed Sadiq
Browse files
util: Add API to test for USSD command
parent
939a5973
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/util.c
View file @
6af2e266
...
...
@@ -144,6 +144,29 @@ calls_date_time_is_same_year (GDateTime *a,
}
gboolean
calls_number_is_ussd
(
const
char
*
number
)
{
/* USSD numbers start with *, #, **, ## or *# and are finished by # */
if
(
!
number
||
(
*
number
!=
'*'
&&
*
number
!=
'#'
))
return
FALSE
;
number
++
;
if
(
*
number
==
'#'
)
number
++
;
while
(
g_ascii_isdigit
(
*
number
)
||
*
number
==
'*'
)
number
++
;
if
(
g_str_equal
(
number
,
"#"
))
return
TRUE
;
return
FALSE
;
}
gboolean
calls_find_in_store
(
GListModel
*
list
,
gpointer
item
,
...
...
src/util.h
View file @
6af2e266
...
...
@@ -137,6 +137,7 @@ gboolean calls_date_time_is_yesterday (GDateTime *now,
GDateTime
*
t
);
gboolean
calls_date_time_is_same_year
(
GDateTime
*
a
,
GDateTime
*
b
);
gboolean
calls_number_is_ussd
(
const
char
*
number
);
gboolean
calls_find_in_store
(
GListModel
*
list
,
gpointer
item
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment