Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
91196256
Commit
91196256
authored
Dec 12, 2017
by
Benjamin REIS
Browse files
fix how to send multiârt notify
parent
d2fd296e
Changes
3
Hide whitespace changes
Inline
Side-by-side
coreapi/linphonecore.c
View file @
91196256
...
...
@@ -51,6 +51,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "chat/chat-room/client-group-chat-room-p.h"
#include "chat/chat-room/server-group-chat-room-p.h"
#include "conference/handlers/remote-conference-event-handler.h"
#include "content/content-manager.h"
#include "content/content-type.h"
#include "core/core-p.h"
// For migration purpose.
...
...
@@ -2138,11 +2140,17 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
));
if
(
chatRoom
)
{
if
(
linphone_content_is_multipart
(
body
))
L_GET_PRIVATE
(
static_pointer_cast
<
ClientGroupChatRoom
>
(
chatRoom
))
->
multipartNotifyReceived
(
linphone_content_get_string_buffer
(
body
)
);
else
if
(
linphone_content_is_multipart
(
body
))
{
// TODO : migrate to c++ 'Content'.
int
i
=
0
;
LinphoneContent
*
part
=
NULL
;
while
((
part
=
linphone_content_get_part
(
body
,
i
)))
{
i
++
;
L_GET_PRIVATE
(
static_pointer_cast
<
ClientGroupChatRoom
>
(
chatRoom
))
->
notifyReceived
(
linphone_content_get_string_buffer
(
part
)
);
}
}
else
L_GET_PRIVATE
(
static_pointer_cast
<
ClientGroupChatRoom
>
(
chatRoom
))
->
notifyReceived
(
linphone_content_get_string_buffer
(
body
)
);
...
...
src/conference/handlers/local-conference-event-handler-p.h
View file @
91196256
...
...
@@ -57,7 +57,7 @@ private:
std
::
string
createNotify
(
Xsd
::
ConferenceInfo
::
ConferenceType
confInfo
,
int
notifyId
=
-
1
,
bool
isFullState
=
false
);
std
::
string
createNotifySubjectChanged
(
const
std
::
string
&
subject
,
int
notifyId
=
-
1
);
void
notifyParticipant
(
const
std
::
string
&
notify
,
const
std
::
shared_ptr
<
Participant
>
&
participant
);
void
notifyParticipantDevice
(
const
std
::
string
&
notify
,
const
std
::
shared_ptr
<
ParticipantDevice
>
&
device
);
void
notifyParticipantDevice
(
const
std
::
string
&
notify
,
const
std
::
shared_ptr
<
ParticipantDevice
>
&
device
,
bool
multipart
=
false
);
L_DECLARE_PUBLIC
(
LocalConferenceEventHandler
);
};
...
...
src/conference/handlers/local-conference-event-handler.cpp
View file @
91196256
...
...
@@ -67,11 +67,18 @@ void LocalConferenceEventHandlerPrivate::notifyParticipant (const string ¬ify
notifyParticipantDevice
(
notify
,
device
);
}
void
LocalConferenceEventHandlerPrivate
::
notifyParticipantDevice
(
const
string
&
notify
,
const
shared_ptr
<
ParticipantDevice
>
&
device
)
{
void
LocalConferenceEventHandlerPrivate
::
notifyParticipantDevice
(
const
string
&
notify
,
const
shared_ptr
<
ParticipantDevice
>
&
device
,
bool
multipart
)
{
if
(
device
->
isSubscribedToConferenceEventPackage
()
&&
!
notify
.
empty
())
{
LinphoneEvent
*
ev
=
device
->
getConferenceSubscribeEvent
();
LinphoneContent
*
content
=
linphone_core_create_content
(
ev
->
lc
);
linphone_content_set_buffer
(
content
,
(
const
uint8_t
*
)
notify
.
c_str
(),
strlen
(
notify
.
c_str
()));
if
(
multipart
)
{
linphone_content_set_type
(
content
,
"multipart"
);
linphone_content_set_subtype
(
content
,
"mixed;boundary=---------------------------14737809831466499882746641449"
);
}
else
{
linphone_content_set_type
(
content
,
"application"
);
linphone_content_set_subtype
(
content
,
"conference-info"
);
}
linphone_event_notify
(
ev
,
content
);
linphone_content_unref
(
content
);
}
...
...
@@ -394,7 +401,7 @@ void LocalConferenceEventHandler::subscribeReceived (LinphoneEvent *lev) {
lInfo
()
<<
"Sending all missed notify ["
<<
lastNotify
<<
"-"
<<
d
->
lastNotify
<<
"] for conference:"
<<
d
->
conf
->
getConferenceAddress
().
asString
()
<<
" to: "
<<
participant
->
getAddress
().
asString
();
d
->
notifyParticipantDevice
(
d
->
createNotifyMultipart
(
static_cast
<
int
>
(
lastNotify
)),
device
);
d
->
notifyParticipantDevice
(
d
->
createNotifyMultipart
(
static_cast
<
int
>
(
lastNotify
)),
device
,
true
);
}
else
if
(
lastNotify
>
d
->
lastNotify
)
{
lError
()
<<
"last notify received by client: ["
<<
lastNotify
<<
"] for conference:"
<<
d
->
conf
->
getConferenceAddress
().
asString
()
<<
...
...
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