Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-client-macos
Commits
b65c0270
Commit
b65c0270
authored
Jul 22, 2015
by
Alexandre Lision
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chat: open panel on incoming text messages
Refs #78021 Change-Id: Ic190618cd68b02d16b80fe699350ca6f00d22d20
parent
21d20636
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
+35
-6
src/ChatVC.mm
src/ChatVC.mm
+4
-6
src/CurrentCallVC.mm
src/CurrentCallVC.mm
+31
-0
No files found.
src/ChatVC.mm
View file @
b65c0270
...
...
@@ -133,12 +133,10 @@
mediaHolder
.
newMessage
=
QObject
::
connect
(
model
,
&
QAbstractItemModel
::
rowsInserted
,
[
self
,
model
]
(
const
QModelIndex
&
parent
,
int
first
,
int
last
)
{
for
(
int
row
=
first
;
row
<=
last
;
++
row
)
{
QModelIndex
idx
=
model
->
index
(
row
,
0
,
parent
);
[
self
appendNewMessage
:
idx
];
}
}
);
for
(
int
row
=
first
;
row
<=
last
;
++
row
)
{
[
self
appendNewMessage
:
model
->
index
(
row
,
0
,
parent
)];
}
});
}
-
(
void
)
appendNewMessage
:(
const
QModelIndex
&
)
msgIdx
...
...
src/CurrentCallVC.mm
View file @
b65c0270
...
...
@@ -88,6 +88,8 @@
@property
RendererConnectionsHolder
*
previewHolder
;
@property
RendererConnectionsHolder
*
videoHolder
;
@property
QMetaObject
::
Connection
videoStarted
;
@property
QMetaObject
::
Connection
messageConnection
;
@property
QMetaObject
::
Connection
mediaAddedConnection
;
@end
...
...
@@ -268,6 +270,18 @@
});
}
-
(
void
)
monitorIncomingTextMessages
:(
Media
::
Text
*
)
media
{
/* connect to incoming chat messages to open the chat view */
QObject
::
disconnect
(
self
.
messageConnection
);
self
.
messageConnection
=
QObject
::
connect
(
media
,
&
Media
::
Text
::
messageReceived
,
[
self
]
(
const
QMap
<
QString
,
QString
>&
m
)
{
if
([[
self
splitView
]
isSubviewCollapsed
:[[[
self
splitView
]
subviews
]
objectAtIndex
:
1
]])
[
self
uncollapseRightView
];
});
}
-
(
void
)
connectVideoSignals
{
QModelIndex
idx
=
CallModel
::
instance
()
->
selectionModel
()
->
currentIndex
();
...
...
@@ -404,6 +418,23 @@
[
animation
setTimingFunction
:[
CAMediaTimingFunction
functionWithControlPoints
:
.7
:
0.9
:
1
:
1
]];
[
CATransaction
setCompletionBlock
:
^
{
[
self
connectVideoSignals
];
/* check if text media is already present */
if
(
CallModel
::
instance
()
->
selectedCall
()
->
hasMedia
(
Media
::
Media
::
Type
::
TEXT
,
Media
::
Media
::
Direction
::
IN
))
{
Media
::
Text
*
text
=
CallModel
::
instance
()
->
selectedCall
()
->
firstMedia
<
Media
::
Text
>
(
Media
::
Media
::
Direction
::
IN
);
[
self
monitorIncomingTextMessages
:
text
];
}
else
if
(
CallModel
::
instance
()
->
selectedCall
()
->
hasMedia
(
Media
::
Media
::
Type
::
TEXT
,
Media
::
Media
::
Direction
::
OUT
))
{
Media
::
Text
*
text
=
CallModel
::
instance
()
->
selectedCall
()
->
firstMedia
<
Media
::
Text
>
(
Media
::
Media
::
Direction
::
OUT
);
[
self
monitorIncomingTextMessages
:
text
];
}
else
{
/* monitor media for messaging text messaging */
self
.
mediaAddedConnection
=
QObject
::
connect
(
CallModel
::
instance
()
->
selectedCall
(),
&
Call
::
mediaAdded
,
[
self
]
(
Media
::
Media
*
media
)
{
if
(
media
->
type
()
==
Media
::
Media
::
Type
::
TEXT
)
{
[
self
monitorIncomingTextMessages
:(
Media
:
:
Text
*
)
media
];
QObject
::
disconnect
(
self
.
mediaAddedConnection
);
}
});
}
}];
[
self
.
view
.
layer
addAnimation
:
animation
forKey
:
animation
.
keyPath
];
...
...
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