Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
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-libclient
Commits
cc3b0c63
Commit
cc3b0c63
authored
Jun 29, 2015
by
Emmanuel Lepage Vallee
Committed by
Emmanuel Lepage Vallée
Jul 6, 2015
Browse files
Options
Downloads
Patches
Plain Diff
account: Use the new daemon settings
Refs #76374 Change-Id: I24832c3c5f899a48fa28446e5f1cc4bbe5bc9589
parent
9a6fdbf7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/account.cpp
+56
-6
56 additions, 6 deletions
src/account.cpp
src/account.h
+7
-1
7 additions, 1 deletion
src/account.h
src/accountmodel.cpp
+2
-0
2 additions, 0 deletions
src/accountmodel.cpp
src/private/account_p.h
+0
-2
0 additions, 2 deletions
src/private/account_p.h
with
65 additions
and
9 deletions
src/account.cpp
+
56
−
6
View file @
cc3b0c63
...
...
@@ -90,8 +90,7 @@ m_pStatusModel(nullptr),m_LastTransportCode(0),m_RegistrationState(Account::Regi
m_UseDefaultPort
(
false
),
m_pProtocolModel
(
nullptr
),
m_pBootstrapModel
(
nullptr
),
m_RemoteEnabledState
(
false
),
m_HaveCalled
(
false
),
m_TotalCount
(
0
),
m_LastWeekCount
(
0
),
m_LastTrimCount
(
0
),
m_LastUsed
(
0
),
m_pKnownCertificates
(
nullptr
),
m_pBannedCertificates
(
nullptr
),
m_pAllowedCertificates
(
nullptr
),
m_InternalId
(
++
p_sAutoIncrementId
),
m_pNetworkInterfaceModel
(
nullptr
),
m_pAllowedCerts
(
nullptr
),
m_pBannedCerts
(
nullptr
),
m_AllowIncomingFromHistory
(
true
),
m_AllowIncomingFromContact
(
true
)
m_pNetworkInterfaceModel
(
nullptr
),
m_pAllowedCerts
(
nullptr
),
m_pBannedCerts
(
nullptr
)
{
}
...
...
@@ -948,12 +947,28 @@ bool Account::allowIncomingFromUnknown() const
bool
Account
::
allowIncomingFromHistory
()
const
{
return
d_ptr
->
m_AllowIncomingFromHistory
;
if
(
protocol
()
!=
Account
::
Protocol
::
RING
)
return
false
;
return
d_ptr
->
accountDetail
(
DRing
::
Account
::
ConfProperties
::
ALLOW_CERT_FROM_HISTORY
)
IS_TRUE
;
}
bool
Account
::
allowIncomingFromContact
()
const
{
return
d_ptr
->
m_AllowIncomingFromContact
;
if
(
protocol
()
!=
Account
::
Protocol
::
RING
)
return
false
;
return
d_ptr
->
accountDetail
(
DRing
::
Account
::
ConfProperties
::
ALLOW_CERT_FROM_CONTACT
)
IS_TRUE
;
}
int
Account
::
activeCallLimit
()
const
{
return
d_ptr
->
accountDetail
(
DRing
::
Account
::
ConfProperties
::
ACTIVE_CALL_LIMIT
).
toInt
();
}
bool
Account
::
hasActiveCallLimit
()
const
{
return
activeCallLimit
()
>
-
1
;
}
...
...
@@ -1143,6 +1158,10 @@ QVariant Account::roleData(int role) const
return
allowIncomingFromContact
();
case
CAST
(
Account
::
Role
::
AllowIncomingFromUnknown
)
:
return
allowIncomingFromUnknown
();
case
CAST
(
Account
::
Role
::
ActiveCallLimit
)
:
return
activeCallLimit
();
case
CAST
(
Account
::
Role
::
HasActiveCallLimit
)
:
return
hasActiveCallLimit
();
default
:
return
QVariant
();
}
...
...
@@ -1185,11 +1204,17 @@ bool Account::supportScheme( URI::SchemeType type )
bool
Account
::
allowCertificate
(
Certificate
*
c
)
{
if
(
protocol
()
!=
Account
::
Protocol
::
RING
)
return
false
;
return
CertificateModel
::
instance
()
->
d_ptr
->
allowCertificate
(
c
,
this
);
}
bool
Account
::
banCertificate
(
Certificate
*
c
)
{
if
(
protocol
()
!=
Account
::
Protocol
::
RING
)
return
false
;
return
CertificateModel
::
instance
()
->
d_ptr
->
banCertificate
(
c
,
this
);
}
...
...
@@ -1687,16 +1712,35 @@ void Account::setAllowIncomingFromUnknown(bool value)
void
Account
::
setAllowIncomingFromHistory
(
bool
value
)
{
d_ptr
->
m_AllowIncomingFromHistory
=
value
;
if
(
protocol
()
!=
Account
::
Protocol
::
RING
)
return
;
d_ptr
->
setAccountProperty
(
DRing
::
Account
::
ConfProperties
::
ALLOW_CERT_FROM_HISTORY
,
value
TO_BOOL
);
performAction
(
Account
::
EditAction
::
MODIFY
);
}
void
Account
::
setAllowIncomingFromContact
(
bool
value
)
{
d_ptr
->
m_AllowIncomingFromContact
=
value
;
if
(
protocol
()
!=
Account
::
Protocol
::
RING
)
return
;
d_ptr
->
setAccountProperty
(
DRing
::
Account
::
ConfProperties
::
ALLOW_CERT_FROM_CONTACT
,
value
TO_BOOL
);
performAction
(
Account
::
EditAction
::
MODIFY
);
}
void
Account
::
setActiveCallLimit
(
int
value
)
{
d_ptr
->
setAccountProperty
(
DRing
::
Account
::
ConfProperties
::
ACTIVE_CALL_LIMIT
,
QString
::
number
(
value
));
}
void
Account
::
setHasActiveCallLimit
(
bool
value
)
{
if
((
!
value
)
&&
activeCallLimit
()
!=
-
1
)
return
;
setActiveCallLimit
(
value
?
1
:-
1
);
}
///Set the DTMF type
void
Account
::
setDTMFType
(
DtmfType
type
)
{
...
...
@@ -1899,6 +1943,12 @@ void Account::setRoleData(int role, const QVariant& value)
case
CAST
(
Account
::
Role
::
AllowIncomingFromUnknown
)
:
setAllowIncomingFromUnknown
(
value
.
toBool
());
break
;
case
CAST
(
Account
::
Role
::
ActiveCallLimit
)
:
return
setActiveCallLimit
(
value
.
toInt
());
break
;
case
CAST
(
Account
::
Role
::
HasActiveCallLimit
)
:
return
setHasActiveCallLimit
(
value
.
toBool
());
break
;
}
}
#undef CAST
...
...
This diff is collapsed.
Click to expand it.
src/account.h
+
7
−
1
View file @
cc3b0c63
...
...
@@ -287,7 +287,9 @@ class LIB_EXPORT Account : public QObject {
AllowedCertificatesModel
=
186
,
AllowIncomingFromHistory
=
187
,
AllowIncomingFromContact
=
188
,
AllowIncomingFromUnknown
=
189
AllowIncomingFromUnknown
=
189
,
ActiveCallLimit
=
190
,
HasActiveCallLimit
=
191
};
///@enum RoleState Whether a role can be used in a certain context
...
...
@@ -412,6 +414,8 @@ class LIB_EXPORT Account : public QObject {
bool
allowIncomingFromUnknown
()
const
;
bool
allowIncomingFromHistory
()
const
;
bool
allowIncomingFromContact
()
const
;
int
activeCallLimit
()
const
;
bool
hasActiveCallLimit
()
const
;
bool
isUsedForOutgogingCall
()
const
;
uint
totalCallCount
()
const
;
...
...
@@ -472,6 +476,7 @@ class LIB_EXPORT Account : public QObject {
void
setAudioPortMin
(
int
port
);
void
setVideoPortMax
(
int
port
);
void
setVideoPortMin
(
int
port
);
void
setActiveCallLimit
(
int
value
);
void
setDTMFType
(
DtmfType
type
);
void
setUserAgent
(
const
QString
&
agent
);
void
setUpnpEnabled
(
bool
enable
);
...
...
@@ -481,6 +486,7 @@ class LIB_EXPORT Account : public QObject {
void
setAllowIncomingFromHistory
(
bool
value
);
void
setAllowIncomingFromContact
(
bool
value
);
void
setAllowIncomingFromUnknown
(
bool
value
);
void
setHasActiveCallLimit
(
bool
value
);
void
setRoleData
(
int
role
,
const
QVariant
&
value
);
...
...
This diff is collapsed.
Click to expand it.
src/accountmodel.cpp
+
2
−
0
View file @
cc3b0c63
...
...
@@ -184,6 +184,8 @@ QHash<int,QByteArray> AccountModel::roleNames() const
roles
.
insert
(
CAST
(
Account
::
Role
::
AllowIncomingFromHistory
)
,
QByteArray
(
"allowIncomingFromHistory"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
AllowIncomingFromContact
)
,
QByteArray
(
"allowIncomingFromContact"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
AllowIncomingFromUnknown
)
,
QByteArray
(
"allowIncomingFromUnknown"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
ActiveCallLimit
)
,
QByteArray
(
"activeCallLimit"
));
roles
.
insert
(
CAST
(
Account
::
Role
::
HasActiveCallLimit
)
,
QByteArray
(
"hasActiveCallLimit"
));
}
return
roles
;
}
...
...
This diff is collapsed.
Click to expand it.
src/private/account_p.h
+
0
−
2
View file @
cc3b0c63
...
...
@@ -136,8 +136,6 @@ public:
DaemonCertificateCollection
*
m_pAllowedCerts
;
DaemonCertificateCollection
*
m_pBannedCerts
;
Account
::
EditState
m_CurrentState
;
bool
m_AllowIncomingFromHistory
;
bool
m_AllowIncomingFromContact
;
QHash
<
int
,
Account
::
RoleStatus
>
m_hRoleStatus
;
...
...
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