forked from mirrors/linphone-iphone
Enable CPIM in basic chatrooms for linphone accounts
This commit is contained in:
parent
d6a8209e85
commit
14f61e3cef
2 changed files with 22 additions and 0 deletions
|
|
@ -1324,12 +1324,33 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat
|
|||
}
|
||||
}
|
||||
|
||||
- (void)activateBasicChatroomCPIMForLinphoneAccounts {
|
||||
const MSList *accountsList = linphone_core_get_account_list(theLinphoneCore);
|
||||
while (accountsList) {
|
||||
LinphoneAccount * account = accountsList->data;
|
||||
LinphoneAccountParams const * currentParams = linphone_account_get_params(account);
|
||||
LinphoneAddress const * currentAddress = linphone_account_params_get_identity_address(currentParams);
|
||||
|
||||
if (strcmp(linphone_address_get_domain(currentAddress), "sip.linphone.org") == 0 && !linphone_account_params_cpim_in_basic_chat_room_enabled(currentParams) ) {
|
||||
|
||||
LOGI(@"Enabling CPIM in basic chatroom for user %s", linphone_address_get_username(currentAddress));
|
||||
LinphoneAccountParams * newParams = linphone_account_params_clone(linphone_account_get_params(account));
|
||||
linphone_account_params_enable_cpim_in_basic_chat_room(newParams, true);
|
||||
linphone_account_set_params(account, newParams);
|
||||
linphone_account_params_unref(newParams);
|
||||
}
|
||||
|
||||
accountsList = accountsList->next;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)startLinphoneCore {
|
||||
bool corePushEnabled = [self lpConfigIntForKey:@"net" inSection:@"push_notification"];
|
||||
linphone_core_set_push_notification_enabled([LinphoneManager getLc], corePushEnabled);
|
||||
linphone_core_start([LinphoneManager getLc]);
|
||||
|
||||
[self configurePushProviderForAccounts];
|
||||
[self activateBasicChatroomCPIMForLinphoneAccounts];
|
||||
}
|
||||
|
||||
- (void)createLinphoneCore {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
<entry name="push_notification_allowed" overwrite="true">1</entry>
|
||||
<entry name="remote_push_notification_allowed" overwrite="true">1</entry>
|
||||
<entry name="conference_factory_uri" overwrite="true">sip:conference-factory@sip.linphone.org</entry>
|
||||
<entry name="cpim_in_basic_chat_rooms_enabled" overwrite="true">1</entry>
|
||||
</section>
|
||||
|
||||
<section name="nat_policy_default_values">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue