Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-macos
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-client-macos
Commits
84101913
Commit
84101913
authored
4 years ago
by
Kateryna Kostiuk
Browse files
Options
Downloads
Patches
Plain Diff
conference: update when one of the call finished
Change-Id: I1884bbe96c8327045c47abd903f422131601afb6
parent
23ed02ec
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/CurrentCallVC.mm
+41
-43
41 additions, 43 deletions
src/CurrentCallVC.mm
with
41 additions
and
43 deletions
src/CurrentCallVC.mm
+
41
−
43
View file @
84101913
...
@@ -162,8 +162,11 @@ CVPixelBufferRef pixelBufferPreview;
...
@@ -162,8 +162,11 @@ CVPixelBufferRef pixelBufferPreview;
callUid_
=
callUid
;
callUid_
=
callUid
;
convUid_
=
convUid
;
convUid_
=
convUid
;
accountInfo_
=
account
;
accountInfo_
=
account
;
auto
convIt
=
getConversationFromUid
(
convUid_
,
*
accountInfo_
->
conversationModel
);
auto
conv
=
accountInfo_
->
conversationModel
->
getConversationForUID
(
convUid_
);
confUid_
=
convIt
->
confId
;
if
(
conv
.
uid
.
isEmpty
())
{
return
;
}
confUid_
=
conv
.
confId
;
[
self
.
chatVC
setConversationUid
:
convUid
model
:
account
->
conversationModel
.
get
()];
[
self
.
chatVC
setConversationUid
:
convUid
model
:
account
->
conversationModel
.
get
()];
[
self
connectSignals
];
[
self
connectSignals
];
}
}
...
@@ -190,17 +193,14 @@ CVPixelBufferRef pixelBufferPreview;
...
@@ -190,17 +193,14 @@ CVPixelBufferRef pixelBufferPreview;
}
}
}
}
-
(
void
)
switchToNextConferenceCall
{
-
(
void
)
switchToNextConferenceCall
:(
QString
)
confId
{
auto
*
callModel
=
accountInfo_
->
callModel
.
get
();
auto
*
callModel
=
accountInfo_
->
callModel
.
get
();
if
(
!
callModel
->
hasCall
(
confUid_
))
{
return
;
}
AppDelegate
*
appDelegate
=
(
AppDelegate
*
)[[
NSApplication
sharedApplication
]
delegate
];
AppDelegate
*
appDelegate
=
(
AppDelegate
*
)[[
NSApplication
sharedApplication
]
delegate
];
auto
activeCalls
=
[
appDelegate
getActiveCalls
];
auto
activeCalls
=
[
appDelegate
getActiveCalls
];
if
(
activeCalls
.
isEmpty
())
{
if
(
activeCalls
.
isEmpty
())
{
return
;
return
;
}
}
auto
subcalls
=
[
appDelegate
getConferenceSubcalls
:
conf
Uid_
];
auto
subcalls
=
[
appDelegate
getConferenceSubcalls
:
conf
Id
];
QString
callId
;
QString
callId
;
if
(
subcalls
.
isEmpty
())
{
if
(
subcalls
.
isEmpty
())
{
for
(
auto
subcall
:
activeCalls
)
{
for
(
auto
subcall
:
activeCalls
)
{
...
@@ -271,15 +271,11 @@ CVPixelBufferRef pixelBufferPreview;
...
@@ -271,15 +271,11 @@ CVPixelBufferRef pixelBufferPreview;
QObject
::
connect
(
accountInfo_
->
contactModel
.
get
(),
QObject
::
connect
(
accountInfo_
->
contactModel
.
get
(),
&
lrc
::
api
::
ContactModel
::
contactAdded
,
&
lrc
::
api
::
ContactModel
::
contactAdded
,
[
self
](
const
QString
&
contactUri
)
{
[
self
](
const
QString
&
contactUri
)
{
auto
conv
It
=
getConversationFromUid
(
convUid_
,
*
accountInfo_
->
conversationModel
.
get
()
);
auto
conv
=
accountInfo_
->
conversationModel
->
get
ConversationForUID
(
convUid_
);
if
(
convIt
==
accountInfo_
->
conversationModel
->
allFilteredConversations
().
end
())
{
if
(
conv
.
uid
.
isEmpty
()
||
conv
.
participants
.
empty
())
{
return
;
return
;
}
}
if
(
convIt
->
participants
.
empty
())
{
auto
&
contact
=
accountInfo_
->
contactModel
->
getContact
(
conv
.
participants
[
0
]);
return
;
}
auto
&
contact
=
accountInfo_
->
contactModel
->
getContact
(
convIt
->
participants
[
0
]);
if
(
contact
.
profileInfo
.
type
==
lrc
::
api
::
profile
::
Type
::
RING
&&
contact
.
profileInfo
.
uri
==
contactUri
)
if
(
contact
.
profileInfo
.
type
==
lrc
::
api
::
profile
::
Type
::
RING
&&
contact
.
profileInfo
.
uri
==
contactUri
)
accountInfo_
->
conversationModel
->
makePermanent
(
convUid_
);
accountInfo_
->
conversationModel
->
makePermanent
(
convUid_
);
[
contactPhoto
setImage
:
[
self
getContactImageOfSize
:
120.0
withDefaultAvatar
:
YES
]];
[
contactPhoto
setImage
:
[
self
getContactImageOfSize
:
120.0
withDefaultAvatar
:
YES
]];
...
@@ -448,18 +444,18 @@ CVPixelBufferRef pixelBufferPreview;
...
@@ -448,18 +444,18 @@ CVPixelBufferRef pixelBufferPreview;
}
}
auto
currentCall
=
callModel
->
getCall
(
callUid_
);
auto
currentCall
=
callModel
->
getCall
(
callUid_
);
auto
convIt
=
getConversationFromUid
(
convUid_
,
*
accountInfo_
->
conversationModel
);
auto
convIt
=
accountInfo_
->
conversationModel
->
getConversationForUID
(
convUid_
);
if
(
conv
ersationExists
(
convIt
,
*
accountInfo_
->
conversationModel
))
{
if
(
!
conv
It
.
uid
.
isEmpty
(
))
{
NSString
*
bestName
=
bestNameForConversation
(
*
convIt
,
*
accountInfo_
->
conversationModel
);
NSString
*
bestName
=
bestNameForConversation
(
convIt
,
*
accountInfo_
->
conversationModel
);
[
contactNameLabel
setStringValue
:
bestName
];
[
contactNameLabel
setStringValue
:
bestName
];
NSString
*
ringID
=
bestIDForConversation
(
*
convIt
,
*
accountInfo_
->
conversationModel
);
NSString
*
ringID
=
bestIDForConversation
(
convIt
,
*
accountInfo_
->
conversationModel
);
if
([
bestName
isEqualToString
:
ringID
])
{
if
([
bestName
isEqualToString
:
ringID
])
{
ringID
=
@""
;
ringID
=
@""
;
}
}
[
contactIdLabel
setStringValue
:
ringID
];
[
contactIdLabel
setStringValue
:
ringID
];
}
}
[
self
setupContactInfo
:
contactPhoto
];
[
self
setupContactInfo
:
contactPhoto
];
confUid_
=
convIt
->
confId
;
confUid_
=
convIt
.
confId
;
[
muteAudioButton
setHidden
:
!
confUid_
.
isEmpty
()];
[
muteAudioButton
setHidden
:
!
confUid_
.
isEmpty
()];
[
muteVideoButton
setHidden
:
!
confUid_
.
isEmpty
()];
[
muteVideoButton
setHidden
:
!
confUid_
.
isEmpty
()];
[
recordOnOffButton
setHidden
:
!
confUid_
.
isEmpty
()];
[
recordOnOffButton
setHidden
:
!
confUid_
.
isEmpty
()];
...
@@ -563,7 +559,7 @@ CVPixelBufferRef pixelBufferPreview;
...
@@ -563,7 +559,7 @@ CVPixelBufferRef pixelBufferPreview;
connectingCalls
[
callUid_
.
toNSString
()]
=
nil
;
connectingCalls
[
callUid_
.
toNSString
()]
=
nil
;
[
self
removeConferenceLayout
];
[
self
removeConferenceLayout
];
[
self
.
delegate
callFinished
];
[
self
.
delegate
callFinished
];
[
self
switchToNextConferenceCall
];
[
self
switchToNextConferenceCall
:
confUid_
];
break
;
break
;
}
}
}
}
...
@@ -621,16 +617,16 @@ CVPixelBufferRef pixelBufferPreview;
...
@@ -621,16 +617,16 @@ CVPixelBufferRef pixelBufferPreview;
-
(
NSImage
*
)
getContactImageOfSize
:
(
double
)
size
withDefaultAvatar
:
(
BOOL
)
shouldDrawDefault
{
-
(
NSImage
*
)
getContactImageOfSize
:
(
double
)
size
withDefaultAvatar
:
(
BOOL
)
shouldDrawDefault
{
auto
*
convModel
=
accountInfo_
->
conversationModel
.
get
();
auto
*
convModel
=
accountInfo_
->
conversationModel
.
get
();
auto
conv
It
=
getConversationF
romUid
(
convUid_
,
*
convModel
);
auto
conv
=
accountInfo_
->
conversationModel
->
getConversationF
orUID
(
convUid_
);
if
(
conv
It
==
convModel
->
allFilteredConversations
().
end
())
{
if
(
conv
.
uid
.
isEmpty
()
||
conv
.
participants
.
empty
())
{
return
nil
;
return
nil
;
}
}
if
(
shouldDrawDefault
)
{
if
(
shouldDrawDefault
)
{
auto
&
imgManip
=
reinterpret_cast
<
Interfaces
::
ImageManipulationDelegate
&>
(
GlobalInstances
::
pixmapManipulator
());
auto
&
imgManip
=
reinterpret_cast
<
Interfaces
::
ImageManipulationDelegate
&>
(
GlobalInstances
::
pixmapManipulator
());
QVariant
photo
=
imgManip
.
conversationPhoto
(
*
conv
It
,
*
accountInfo_
,
QSize
(
size
,
size
),
NO
);
QVariant
photo
=
imgManip
.
conversationPhoto
(
conv
,
*
accountInfo_
,
QSize
(
size
,
size
),
NO
);
return
QtMac
::
toNSImage
(
qvariant_cast
<
QPixmap
>
(
photo
));
return
QtMac
::
toNSImage
(
qvariant_cast
<
QPixmap
>
(
photo
));
}
}
auto
contact
=
accountInfo_
->
contactModel
->
getContact
(
conv
It
->
participants
[
0
]);
auto
contact
=
accountInfo_
->
contactModel
->
getContact
(
conv
.
participants
[
0
]);
NSData
*
imageData
=
[[
NSData
alloc
]
initWithBase64EncodedString
:
contact
.
profileInfo
.
avatar
.
toNSString
()
options
:
NSDataBase64DecodingIgnoreUnknownCharacters
];
NSData
*
imageData
=
[[
NSData
alloc
]
initWithBase64EncodedString
:
contact
.
profileInfo
.
avatar
.
toNSString
()
options
:
NSDataBase64DecodingIgnoreUnknownCharacters
];
return
[[
NSImage
alloc
]
initWithData
:
imageData
];
return
[[
NSImage
alloc
]
initWithData
:
imageData
];
}
}
...
@@ -949,15 +945,16 @@ CVPixelBufferRef pixelBufferPreview;
...
@@ -949,15 +945,16 @@ CVPixelBufferRef pixelBufferPreview;
return
;
return
;
// If we accept a conversation with a non trusted contact, we first accept it
// If we accept a conversation with a non trusted contact, we first accept it
auto
convIt
=
getConversationFromUid
(
convUid_
,
*
accountInfo_
->
conversationModel
.
get
());
auto
conv
=
accountInfo_
->
conversationModel
->
getConversationForUID
(
convUid_
);
if
(
convIt
!=
accountInfo_
->
conversationModel
->
allFilteredConversations
().
end
())
{
if
(
conv
.
uid
.
isEmpty
()
||
conv
.
participants
.
empty
())
{
auto
&
contact
=
accountInfo_
->
contactModel
->
getContact
(
convIt
->
participants
[
0
]);
return
;
if
(
contact
.
profileInfo
.
type
==
lrc
::
api
::
profile
::
Type
::
PENDING
)
}
auto
&
contact
=
accountInfo_
->
contactModel
->
getContact
(
conv
.
participants
[
0
]);
if
(
contact
.
profileInfo
.
type
==
lrc
::
api
::
profile
::
Type
::
PENDING
)
{
accountInfo_
->
conversationModel
->
makePermanent
(
convUid_
);
accountInfo_
->
conversationModel
->
makePermanent
(
convUid_
);
}
}
auto
*
callModel
=
accountInfo_
->
callModel
.
get
();
auto
*
callModel
=
accountInfo_
->
callModel
.
get
();
callModel
->
accept
(
callUid_
);
callModel
->
accept
(
callUid_
);
}
}
...
@@ -1311,15 +1308,16 @@ CVPixelBufferRef pixelBufferPreview;
...
@@ -1311,15 +1308,16 @@ CVPixelBufferRef pixelBufferPreview;
}
}
-
(
BOOL
)
isMasterCall
{
-
(
BOOL
)
isMasterCall
{
auto
conv
It
=
getConversationFromUid
(
convUid_
,
*
accountInfo_
->
conversationModel
);
auto
conv
=
accountInfo_
->
conversationModel
->
getConversationForUID
(
convUid_
);
if
(
conv
It
->
uid
.
isEmpty
())
{
if
(
conv
.
uid
.
isEmpty
())
{
return
tru
e
;
return
fals
e
;
}
}
auto
*
callModel
=
accountInfo_
->
callModel
.
get
();
auto
*
callModel
=
accountInfo_
->
callModel
.
get
();
if
(
!
conv
It
->
confId
.
isEmpty
()
&&
callModel
->
hasCall
(
conv
It
->
confId
))
{
if
(
!
conv
.
confId
.
isEmpty
()
&&
callModel
->
hasCall
(
conv
.
confId
))
{
return
true
;
return
true
;
}
else
{
}
else
{
auto
call
=
callModel
->
getCall
(
conv
It
->
callId
);
auto
call
=
callModel
->
getCall
(
conv
.
callId
);
return
call
.
participantsInfos
.
size
()
==
0
;
return
call
.
participantsInfos
.
size
()
==
0
;
}
}
}
}
...
...
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