mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Hacks::contactHasParam() can now be removed thanks to an update of belle-sip.
This commit is contained in:
parent
9f9da0fda1
commit
14311c8786
6 changed files with 14 additions and 14 deletions
|
|
@ -200,7 +200,7 @@ void ClientGroupChatRoom::onCallSessionStateChanged (const CallSession &session,
|
|||
Address addr(session.getRemoteContact());
|
||||
addr.clean();
|
||||
onConferenceCreated(addr);
|
||||
if (Hacks::contactHasParam(session.getRemoteContact(), "isfocus"))
|
||||
if (session.getRemoteContactAddress()->hasParam("isfocus"))
|
||||
eventHandler->subscribe(conferenceAddress);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ protected:
|
|||
CallSessionParams *params = nullptr;
|
||||
mutable CallSessionParams *currentParams = nullptr;
|
||||
CallSessionParams *remoteParams = nullptr;
|
||||
mutable Address remoteContactAddress;
|
||||
|
||||
std::string subject;
|
||||
LinphoneCallDir direction = LinphoneCallOutgoing;
|
||||
|
|
|
|||
|
|
@ -1002,6 +1002,17 @@ string CallSession::getRemoteContact () const {
|
|||
return string();
|
||||
}
|
||||
|
||||
const Address *CallSession::getRemoteContactAddress () const {
|
||||
L_D();
|
||||
if (!d->op) {
|
||||
return nullptr;
|
||||
}
|
||||
char *addrStr = sal_address_as_string(d->op->get_remote_contact_address());
|
||||
d->remoteContactAddress = Address(addrStr);
|
||||
bctbx_free(addrStr);
|
||||
return &d->remoteContactAddress;
|
||||
}
|
||||
|
||||
const CallSessionParams * CallSession::getRemoteParams () {
|
||||
L_D();
|
||||
if (d->op){
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ public:
|
|||
const Address& getRemoteAddress () const;
|
||||
std::string getRemoteAddressAsString () const;
|
||||
std::string getRemoteContact () const;
|
||||
const Address *getRemoteContactAddress () const;
|
||||
const CallSessionParams *getRemoteParams ();
|
||||
LinphoneCallState getState () const;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,16 +30,4 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
bool Hacks::contactHasParam(const string &contact, const string ¶mName) {
|
||||
// This is very ugly!!! The handling of Contact headers and addresses is a real
|
||||
// crap that really needs to be reworked. Meanwhile, we cannot get the params on the
|
||||
// remote contact address and need to forge and parse a contact header.
|
||||
ostringstream os;
|
||||
os << "Contact: " << contact;
|
||||
belle_sip_header_contact_t *contactHeader = belle_sip_header_contact_parse(os.str().c_str());
|
||||
bool result = belle_sip_parameters_has_parameter(BELLE_SIP_PARAMETERS(contactHeader), paramName.c_str());
|
||||
belle_sip_object_unref(contactHeader);
|
||||
return result;
|
||||
}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
// can be located more easily.
|
||||
class Hacks {
|
||||
public:
|
||||
static bool contactHasParam(const std::string &contact, const std::string ¶mName);
|
||||
|
||||
private:
|
||||
Hacks () = default;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue