Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
4971ff9d
Commit
4971ff9d
authored
Jun 26, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(Chat): better core on composing
parent
c11de612
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
28 deletions
+42
-28
ChatModel.cpp
src/components/chat/ChatModel.cpp
+16
-16
ChatModel.hpp
src/components/chat/ChatModel.hpp
+1
-0
CoreHandlers.cpp
src/components/core/CoreHandlers.cpp
+7
-0
CoreHandlers.hpp
src/components/core/CoreHandlers.hpp
+6
-0
Chat.qml
ui/modules/Linphone/Chat/Chat.qml
+10
-11
ChatStyle.qml
ui/modules/Linphone/Styles/Chat/ChatStyle.qml
+2
-1
No files found.
src/components/chat/ChatModel.cpp
View file @
4971ff9d
...
@@ -197,22 +197,12 @@ ChatModel::ChatModel (QObject *parent) : QAbstractListModel(parent) {
...
@@ -197,22 +197,12 @@ ChatModel::ChatModel (QObject *parent) : QAbstractListModel(parent) {
core
->
getSipAddressesModel
()
->
connectToChatModel
(
this
);
core
->
getSipAddressesModel
()
->
connectToChatModel
(
this
);
QObject
::
connect
(
mCoreHandlers
.
get
(),
&
CoreHandlers
::
messageReceived
,
this
,
&
ChatModel
::
handleMessageReceived
);
{
QObject
::
connect
(
mCoreHandlers
.
get
(),
&
CoreHandlers
::
callStateChanged
,
this
,
&
ChatModel
::
handleCallStateChanged
);
CoreHandlers
*
coreHandlers
=
mCoreHandlers
.
get
();
QObject
::
connect
(
coreHandlers
,
&
CoreHandlers
::
messageReceived
,
this
,
&
ChatModel
::
handleMessageReceived
);
// Deal with remote composing.
QObject
::
connect
(
coreHandlers
,
&
CoreHandlers
::
callStateChanged
,
this
,
&
ChatModel
::
handleCallStateChanged
);
QTimer
*
timer
=
new
QTimer
(
this
);
QObject
::
connect
(
coreHandlers
,
&
CoreHandlers
::
isComposingChanged
,
this
,
&
ChatModel
::
handleIsComposingChanged
);
timer
->
setInterval
(
500
);
QObject
::
connect
(
timer
,
&
QTimer
::
timeout
,
this
,
[
this
]
{
bool
isRemoteComposing
=
mChatRoom
->
isRemoteComposing
();
if
(
isRemoteComposing
!=
mIsRemoteComposing
)
{
mIsRemoteComposing
=
isRemoteComposing
;
emit
isRemoteComposingChanged
(
mIsRemoteComposing
);
}
}
});
timer
->
start
();
}
}
ChatModel
::~
ChatModel
()
{
ChatModel
::~
ChatModel
()
{
...
@@ -669,6 +659,16 @@ void ChatModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
...
@@ -669,6 +659,16 @@ void ChatModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
insertCall
(
call
->
getCallLog
());
insertCall
(
call
->
getCallLog
());
}
}
void
ChatModel
::
handleIsComposingChanged
(
const
shared_ptr
<
linphone
::
ChatRoom
>
&
chatRoom
)
{
if
(
mChatRoom
==
chatRoom
)
{
bool
isRemoteComposing
=
mChatRoom
->
isRemoteComposing
();
if
(
isRemoteComposing
!=
mIsRemoteComposing
)
{
mIsRemoteComposing
=
isRemoteComposing
;
emit
isRemoteComposingChanged
(
mIsRemoteComposing
);
}
}
}
void
ChatModel
::
handleMessageReceived
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
void
ChatModel
::
handleMessageReceived
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
)
{
if
(
mChatRoom
==
message
->
getChatRoom
())
{
if
(
mChatRoom
==
message
->
getChatRoom
())
{
insertMessageAtEnd
(
message
);
insertMessageAtEnd
(
message
);
...
...
src/components/chat/ChatModel.hpp
View file @
4971ff9d
...
@@ -138,6 +138,7 @@ private:
...
@@ -138,6 +138,7 @@ private:
void
resetMessagesCount
();
void
resetMessagesCount
();
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
handleIsComposingChanged
(
const
std
::
shared_ptr
<
linphone
::
ChatRoom
>
&
chatRoom
);
void
handleMessageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
handleMessageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
bool
mIsRemoteComposing
=
false
;
bool
mIsRemoteComposing
=
false
;
...
...
src/components/core/CoreHandlers.cpp
View file @
4971ff9d
...
@@ -121,6 +121,13 @@ void CoreHandlers::onGlobalStateChanged (
...
@@ -121,6 +121,13 @@ void CoreHandlers::onGlobalStateChanged (
}
}
}
}
void
CoreHandlers
::
onIsComposingReceived
(
const
shared_ptr
<
linphone
::
Core
>
&
,
const
shared_ptr
<
linphone
::
ChatRoom
>
&
room
)
{
emit
isComposingChanged
(
room
);
}
void
CoreHandlers
::
onLogCollectionUploadStateChanged
(
void
CoreHandlers
::
onLogCollectionUploadStateChanged
(
const
shared_ptr
<
linphone
::
Core
>
&
,
const
shared_ptr
<
linphone
::
Core
>
&
,
linphone
::
CoreLogCollectionUploadState
state
,
linphone
::
CoreLogCollectionUploadState
state
,
...
...
src/components/core/CoreHandlers.hpp
View file @
4971ff9d
...
@@ -46,6 +46,7 @@ signals:
...
@@ -46,6 +46,7 @@ signals:
void
callTransferFailed
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
callTransferFailed
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
callTransferSucceeded
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
callTransferSucceeded
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
coreStarted
();
void
coreStarted
();
void
isComposingChanged
(
const
std
::
shared_ptr
<
linphone
::
ChatRoom
>
&
chatRoom
);
void
logsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
,
const
std
::
string
&
info
);
void
logsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
,
const
std
::
string
&
info
);
void
messageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
messageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
presenceReceived
(
const
QString
&
sipAddress
,
const
std
::
shared_ptr
<
const
linphone
::
PresenceModel
>
&
presenceModel
);
void
presenceReceived
(
const
QString
&
sipAddress
,
const
std
::
shared_ptr
<
const
linphone
::
PresenceModel
>
&
presenceModel
);
...
@@ -84,6 +85,11 @@ private:
...
@@ -84,6 +85,11 @@ private:
const
std
::
string
&
message
const
std
::
string
&
message
)
override
;
)
override
;
void
onIsComposingReceived
(
const
std
::
shared_ptr
<
linphone
::
Core
>
&
core
,
const
std
::
shared_ptr
<
linphone
::
ChatRoom
>
&
room
)
override
;
void
onLogCollectionUploadStateChanged
(
void
onLogCollectionUploadStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Core
>
&
core
,
const
std
::
shared_ptr
<
linphone
::
Core
>
&
core
,
linphone
::
CoreLogCollectionUploadState
state
,
linphone
::
CoreLogCollectionUploadState
state
,
...
...
ui/modules/Linphone/Chat/Chat.qml
View file @
4971ff9d
...
@@ -187,6 +187,16 @@ Rectangle {
...
@@ -187,6 +187,16 @@ Rectangle {
}
}
}
}
}
}
footer
:
Text
{
color
:
ChatStyle
.
composingText
.
color
font.pointSize
:
ChatStyle
.
composingText
.
pointSize
height
:
visible
?
ChatStyle
.
composingText
.
height
:
0
leftPadding
:
ChatStyle
.
composingText
.
leftPadding
visible
:
text
.
length
>
0
text
:
Logic
.
getIsComposingMessage
()
}
}
}
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
...
@@ -199,7 +209,6 @@ Rectangle {
...
@@ -199,7 +209,6 @@ Rectangle {
borderColor
:
ChatStyle
.
sendArea
.
border
.
color
borderColor
:
ChatStyle
.
sendArea
.
border
.
color
bottomWidth
:
ChatStyle
.
sendArea
.
border
.
width
topWidth
:
ChatStyle
.
sendArea
.
border
.
width
topWidth
:
ChatStyle
.
sendArea
.
border
.
width
DroppableTextArea
{
DroppableTextArea
{
...
@@ -216,16 +225,6 @@ Rectangle {
...
@@ -216,16 +225,6 @@ Rectangle {
onValidText
:
Logic
.
sendMessage
(
text
)
onValidText
:
Logic
.
sendMessage
(
text
)
}
}
}
}
Text
{
Layout.fillWidth
:
true
color
:
ChatStyle
.
composingText
.
color
font.pointSize
:
ChatStyle
.
composingText
.
pointSize
leftPadding
:
ChatStyle
.
composingText
.
leftPadding
text
:
Logic
.
getIsComposingMessage
()
}
}
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
...
...
ui/modules/Linphone/Styles/Chat/ChatStyle.qml
View file @
4971ff9d
...
@@ -35,8 +35,9 @@ QtObject {
...
@@ -35,8 +35,9 @@ QtObject {
property
QtObject
composingText
:
QtObject
{
property
QtObject
composingText
:
QtObject
{
property
color
color
:
Colors
.
b
property
color
color
:
Colors
.
b
property
int
pointSize
:
Units
.
dp
*
9
property
int
height
:
25
property
int
leftPadding
:
6
property
int
leftPadding
:
6
property
int
pointSize
:
Units
.
dp
*
9
}
}
property
QtObject
entry
:
QtObject
{
property
QtObject
entry
:
QtObject
{
...
...
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