mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
misc: remove compilation warnings due to deprecated ms_list
This commit is contained in:
parent
d0aa3595ba
commit
792bf651df
14 changed files with 87 additions and 84 deletions
|
|
@ -29,7 +29,7 @@
|
|||
UIView *nextView;
|
||||
NSMutableArray *historyViews;
|
||||
LinphoneProxyConfig *new_config;
|
||||
int number_of_configs_before;
|
||||
size_t number_of_configs_before;
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet TPKeyboardAvoidingScrollView *contentView;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
new_config = NULL;
|
||||
[self resetTextFields];
|
||||
[self changeView:_welcomeView back:FALSE animation:FALSE];
|
||||
number_of_configs_before = ms_list_size(linphone_core_get_proxy_config_list(LC));
|
||||
number_of_configs_before = bctbx_list_size(linphone_core_get_proxy_config_list(LC));
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
|
|
@ -583,7 +583,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
switch (status) {
|
||||
case LinphoneConfiguringSuccessful:
|
||||
// we successfully loaded a remote provisioned config, go to dialer
|
||||
if (number_of_configs_before < ms_list_size(linphone_core_get_proxy_config_list(LC))) {
|
||||
if (number_of_configs_before < bctbx_list_size(linphone_core_get_proxy_config_list(LC))) {
|
||||
LOGI(@"A proxy config was set up with the remote provisioning, skip assistant");
|
||||
[self onDialerClick:nil];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#pragma mark -
|
||||
|
||||
- (void)clearMessageList {
|
||||
messageList = ms_list_free_with_data(messageList, (void (*)(void *))linphone_chat_message_unref);
|
||||
messageList = bctbx_list_free_with_data(messageList, (void (*)(void *))linphone_chat_message_unref);
|
||||
}
|
||||
|
||||
- (void)updateData {
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
const LinphoneAddress *peer = linphone_chat_room_get_peer_address(_chatRoom);
|
||||
if (linphone_address_equal(ftd_peer, peer) && linphone_chat_message_is_outgoing(ftd.message)) {
|
||||
LOGI(@"Appending transient upload message %p", ftd.message);
|
||||
messageList = ms_list_append(messageList, linphone_chat_message_ref(ftd.message));
|
||||
messageList = bctbx_list_append(messageList, linphone_chat_message_ref(ftd.message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -73,13 +73,13 @@
|
|||
// mode, "message received" notification will reload tabledata, retrieving all history
|
||||
// and THEN addChatEntry will be called, requesting the newest message to be added again
|
||||
if (messageList &&
|
||||
(linphone_chat_message_get_storage_id(chat) ==
|
||||
linphone_chat_message_get_storage_id(ms_list_nth_data(messageList, ms_list_size(messageList) - 1)))) {
|
||||
(linphone_chat_message_get_storage_id(chat) == linphone_chat_message_get_storage_id(bctbx_list_nth_data(
|
||||
messageList, (int)bctbx_list_size(messageList) - 1)))) {
|
||||
return;
|
||||
}
|
||||
|
||||
messageList = ms_list_append(messageList, linphone_chat_message_ref(chat));
|
||||
int pos = ms_list_size(messageList) - 1;
|
||||
messageList = bctbx_list_append(messageList, linphone_chat_message_ref(chat));
|
||||
int pos = (int)bctbx_list_size(messageList) - 1;
|
||||
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:pos inSection:0];
|
||||
[self.tableView beginUpdates];
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
}
|
||||
|
||||
- (void)updateChatEntry:(LinphoneChatMessage *)chat {
|
||||
NSInteger index = ms_list_index(messageList, chat);
|
||||
NSInteger index = bctbx_list_index(messageList, chat);
|
||||
if (index < 0) {
|
||||
LOGW(@"chat entry doesn't exist");
|
||||
return;
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
|
||||
- (void)scrollToBottom:(BOOL)animated {
|
||||
[self.tableView reloadData];
|
||||
int count = ms_list_size(messageList);
|
||||
size_t count = bctbx_list_size(messageList);
|
||||
if (count) {
|
||||
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(count - 1) inSection:0]
|
||||
atScrollPosition:UITableViewScrollPositionBottom
|
||||
|
|
@ -114,17 +114,17 @@
|
|||
}
|
||||
|
||||
int index = -1;
|
||||
int count = ms_list_size(messageList);
|
||||
size_t count = bctbx_list_size(messageList);
|
||||
// Find first unread & set all entry read
|
||||
for (int i = 0; i < count; ++i) {
|
||||
int read = linphone_chat_message_is_read(ms_list_nth_data(messageList, i));
|
||||
int read = linphone_chat_message_is_read(bctbx_list_nth_data(messageList, i));
|
||||
if (read == 0) {
|
||||
if (index == -1)
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
if (index == -1) {
|
||||
index = count - 1;
|
||||
if (index == -1 && count > 0) {
|
||||
index = (int)count - 1;
|
||||
}
|
||||
|
||||
linphone_chat_room_mark_as_read(_chatRoom);
|
||||
|
|
@ -155,12 +155,12 @@
|
|||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return ms_list_size(messageList);
|
||||
return bctbx_list_size(messageList);
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSString *kCellId = nil;
|
||||
LinphoneChatMessage *chat = ms_list_nth_data(messageList, (int)[indexPath row]);
|
||||
LinphoneChatMessage *chat = bctbx_list_nth_data(messageList, (int)[indexPath row]);
|
||||
if (linphone_chat_message_get_file_transfer_information(chat) ||
|
||||
linphone_chat_message_get_external_body_url(chat)) {
|
||||
kCellId = NSStringFromClass(UIChatBubblePhotoCell.class);
|
||||
|
|
@ -188,7 +188,7 @@
|
|||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
LinphoneChatMessage *chat = ms_list_nth_data(messageList, (int)[indexPath row]);
|
||||
LinphoneChatMessage *chat = bctbx_list_nth_data(messageList, (int)[indexPath row]);
|
||||
return [UIChatBubbleTextCell ViewHeightForMessage:chat withWidth:self.view.frame.size.width].height;
|
||||
}
|
||||
|
||||
|
|
@ -197,9 +197,9 @@
|
|||
forRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (editingStyle == UITableViewCellEditingStyleDelete) {
|
||||
[tableView beginUpdates];
|
||||
LinphoneChatMessage *chat = ms_list_nth_data(messageList, (int)[indexPath row]);
|
||||
LinphoneChatMessage *chat = bctbx_list_nth_data(messageList, (int)[indexPath row]);
|
||||
linphone_chat_room_delete_message(_chatRoom, chat);
|
||||
messageList = ms_list_remove(messageList, chat);
|
||||
messageList = bctbx_list_remove(messageList, chat);
|
||||
|
||||
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
|
||||
withRowAnimation:UITableViewRowAnimationBottom];
|
||||
|
|
@ -209,9 +209,9 @@
|
|||
|
||||
- (void)removeSelectionUsing:(void (^)(NSIndexPath *))remover {
|
||||
[super removeSelectionUsing:^(NSIndexPath *indexPath) {
|
||||
LinphoneChatMessage *chat = ms_list_nth_data(messageList, (int)[indexPath row]);
|
||||
LinphoneChatMessage *chat = bctbx_list_nth_data(messageList, (int)[indexPath row]);
|
||||
linphone_chat_room_delete_message(_chatRoom, chat);
|
||||
messageList = ms_list_remove(messageList, chat);
|
||||
messageList = bctbx_list_remove(messageList, chat);
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#import "Utils.h"
|
||||
|
||||
@implementation ChatsListTableView {
|
||||
MSList *data;
|
||||
bctbx_list_t *data;
|
||||
}
|
||||
|
||||
#pragma mark - Lifecycle Functions
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
- (void)dealloc {
|
||||
if (data != nil) {
|
||||
ms_list_free_with_data(data, chatTable_free_chatrooms);
|
||||
bctbx_list_free_with_data(data, chatTable_free_chatrooms);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -88,15 +88,15 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
|
|||
while (iter) {
|
||||
// store last message in user data
|
||||
LinphoneChatRoom *chat_room = iter->data;
|
||||
MSList *history = linphone_chat_room_get_history(iter->data, 1);
|
||||
bctbx_list_t *history = linphone_chat_room_get_history(iter->data, 1);
|
||||
LinphoneChatMessage *last_msg = NULL;
|
||||
if (history) {
|
||||
last_msg = linphone_chat_message_ref(history->data);
|
||||
ms_list_free(history);
|
||||
bctbx_list_free(history);
|
||||
}
|
||||
linphone_chat_room_set_user_data(chat_room, last_msg);
|
||||
sorted =
|
||||
ms_list_insert_sorted(sorted, linphone_chat_room_ref(chat_room), (MSCompareFunc)sorted_history_comparison);
|
||||
sorted = bctbx_list_insert_sorted(sorted, linphone_chat_room_ref(chat_room),
|
||||
(bctbx_compare_func)sorted_history_comparison);
|
||||
iter = iter->next;
|
||||
}
|
||||
return sorted;
|
||||
|
|
@ -113,13 +113,13 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
|
||||
- (void)loadData {
|
||||
if (data != NULL) {
|
||||
ms_list_free_with_data(data, chatTable_free_chatrooms);
|
||||
bctbx_list_free_with_data(data, chatTable_free_chatrooms);
|
||||
}
|
||||
data = [self sortChatRooms];
|
||||
[super loadData];
|
||||
|
||||
if (IPAD) {
|
||||
int idx = ms_list_index(data, VIEW(ChatConversationView).chatRoom);
|
||||
int idx = bctbx_list_index(data, VIEW(ChatConversationView).chatRoom);
|
||||
// if conversation view is using a chatroom that does not exist anymore, update it
|
||||
if (idx != -1) {
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:idx inSection:0];
|
||||
|
|
@ -137,7 +137,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return ms_list_size(data);
|
||||
return bctbx_list_size(data);
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
|
@ -147,7 +147,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
cell = [[UIChatCell alloc] initWithIdentifier:kCellId];
|
||||
}
|
||||
|
||||
[cell setChatRoom:(LinphoneChatRoom *)ms_list_nth_data(data, (int)[indexPath row])];
|
||||
[cell setChatRoom:(LinphoneChatRoom *)bctbx_list_nth_data(data, (int)[indexPath row])];
|
||||
[super accessoryForCell:cell atPath:indexPath];
|
||||
return cell;
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[super tableView:tableView didSelectRowAtIndexPath:indexPath];
|
||||
if (![self isEditing]) {
|
||||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)ms_list_nth_data(data, (int)[indexPath row]);
|
||||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)bctbx_list_nth_data(data, (int)[indexPath row]);
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[view setChatRoom:chatRoom];
|
||||
// on iPad, force unread bubble to disappear by reloading the cell
|
||||
|
|
@ -175,7 +175,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
if (editingStyle == UITableViewCellEditingStyleDelete) {
|
||||
[tableView beginUpdates];
|
||||
|
||||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)ms_list_nth_data(data, (int)[indexPath row]);
|
||||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)bctbx_list_nth_data(data, (int)[indexPath row]);
|
||||
LinphoneChatMessage *last_msg = linphone_chat_room_get_user_data(chatRoom);
|
||||
if (last_msg) {
|
||||
linphone_chat_message_unref(last_msg);
|
||||
|
|
@ -192,7 +192,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
[ftdToDelete cancel];
|
||||
|
||||
linphone_core_delete_chat_room(linphone_chat_room_get_core(chatRoom), chatRoom);
|
||||
data = ms_list_remove(data, chatRoom);
|
||||
data = bctbx_list_remove(data, chatRoom);
|
||||
|
||||
// will force a call to [self loadData]
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:self];
|
||||
|
|
@ -205,7 +205,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
|
||||
- (void)removeSelectionUsing:(void (^)(NSIndexPath *))remover {
|
||||
[super removeSelectionUsing:^(NSIndexPath *indexPath) {
|
||||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)ms_list_nth_data(data, (int)[indexPath row]);
|
||||
LinphoneChatRoom *chatRoom = (LinphoneChatRoom *)bctbx_list_nth_data(data, (int)[indexPath row]);
|
||||
LinphoneChatMessage *last_msg = linphone_chat_room_get_user_data(chatRoom);
|
||||
if (last_msg) {
|
||||
linphone_chat_message_unref(last_msg);
|
||||
|
|
@ -222,7 +222,7 @@ static void chatTable_free_chatrooms(void *data) {
|
|||
[ftdToDelete cancel];
|
||||
|
||||
linphone_core_delete_chat_room(linphone_chat_room_get_core(chatRoom), chatRoom);
|
||||
data = ms_list_remove(data, chatRoom);
|
||||
data = bctbx_list_remove(data, chatRoom);
|
||||
|
||||
// will force a call to [self loadData]
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:kLinphoneMessageReceived object:self];
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@
|
|||
linphone_friend_add_address(_friend, addr);
|
||||
linphone_address_destroy(addr);
|
||||
// ensure that it was added by checking list size
|
||||
ret = (ms_list_size(linphone_friend_get_addresses(_friend)) == _sipAddresses.count + 1);
|
||||
ret = (bctbx_list_size(linphone_friend_get_addresses(_friend)) == _sipAddresses.count + 1);
|
||||
}
|
||||
}
|
||||
if (ret) {
|
||||
|
|
@ -224,7 +224,7 @@
|
|||
phone = [NSString stringWithUTF8String:cphone];
|
||||
ms_free(cphone);
|
||||
// ensure that it was added by checking list size
|
||||
ret = (ms_list_size(linphone_friend_get_phone_numbers(_friend)) == _phoneNumbers.count + 1);
|
||||
ret = (bctbx_list_size(linphone_friend_get_phone_numbers(_friend)) == _phoneNumbers.count + 1);
|
||||
}
|
||||
}
|
||||
if (ret) {
|
||||
|
|
@ -256,7 +256,7 @@
|
|||
linphone_friend_remove_address(_friend, addr);
|
||||
linphone_address_destroy(addr);
|
||||
// ensure that it was destroyed by checking list size
|
||||
ret = (ms_list_size(linphone_friend_get_addresses(_friend)) == _sipAddresses.count - 1);
|
||||
ret = (bctbx_list_size(linphone_friend_get_addresses(_friend)) + 1 == _sipAddresses.count);
|
||||
}
|
||||
}
|
||||
if (ret) {
|
||||
|
|
@ -273,7 +273,7 @@
|
|||
const char *phone = ((NSString *)_phoneNumbers[index]).UTF8String;
|
||||
linphone_friend_remove_phone_number(_friend, phone);
|
||||
// ensure that it was destroyed by checking list size
|
||||
ret = (ms_list_size(linphone_friend_get_phone_numbers(_friend)) == _phoneNumbers.count - 1);
|
||||
ret = (bctbx_list_size(linphone_friend_get_phone_numbers(_friend)) + 1 == _phoneNumbers.count);
|
||||
}
|
||||
if (ret) {
|
||||
[_phoneNumbers removeObjectAtIndex:index];
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@
|
|||
}
|
||||
|
||||
if (peer) {
|
||||
const MSList *logs = linphone_core_get_call_history_for_address(LC, peer);
|
||||
const bctbx_list_t *logs = linphone_core_get_call_history_for_address(LC, peer);
|
||||
while (logs != NULL) {
|
||||
LinphoneCallLog *log = (LinphoneCallLog *)logs->data;
|
||||
if (linphone_address_weak_equal(linphone_call_log_get_remote_address(log), peer)) {
|
||||
[callLogs addObject:[NSValue valueWithPointer:log]];
|
||||
}
|
||||
logs = ms_list_next(logs);
|
||||
logs = bctbx_list_next(logs);
|
||||
}
|
||||
}
|
||||
[[self tableView] reloadData];
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
const MSList *logs = linphone_core_get_call_logs(LC);
|
||||
const bctbx_list_t *logs = linphone_core_get_call_logs(LC);
|
||||
self.sections = [NSMutableDictionary dictionary];
|
||||
while (logs != NULL) {
|
||||
LinphoneCallLog *log = (LinphoneCallLog *)logs->data;
|
||||
|
|
@ -130,14 +130,14 @@
|
|||
LinphoneCallLog *prev = [eventsOnThisDay lastObject] ? [[eventsOnThisDay lastObject] pointerValue] : NULL;
|
||||
if (prev && linphone_address_weak_equal(linphone_call_log_get_remote_address(prev),
|
||||
linphone_call_log_get_remote_address(log))) {
|
||||
MSList *list = linphone_call_log_get_user_data(prev);
|
||||
list = ms_list_append(list, log);
|
||||
bctbx_list_t *list = linphone_call_log_get_user_data(prev);
|
||||
list = bctbx_list_append(list, log);
|
||||
linphone_call_log_set_user_data(prev, list);
|
||||
} else {
|
||||
[eventsOnThisDay addObject:[NSValue valueWithPointer:linphone_call_log_ref(log)]];
|
||||
}
|
||||
}
|
||||
logs = ms_list_next(logs);
|
||||
logs = bctbx_list_next(logs);
|
||||
}
|
||||
|
||||
[self computeSections];
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@
|
|||
[self setCString:linphone_auth_info_get_ha1(ai) forKey:@"ha1_preference"];
|
||||
}
|
||||
|
||||
int idx = ms_list_index(linphone_core_get_proxy_config_list(LC), proxy);
|
||||
int idx = (int)bctbx_list_index(linphone_core_get_proxy_config_list(LC), proxy);
|
||||
[self setInteger:idx forKey:@"current_proxy_config_preference"];
|
||||
|
||||
int expires = linphone_proxy_config_get_expires(proxy);
|
||||
|
|
@ -227,10 +227,10 @@
|
|||
|
||||
// root section
|
||||
{
|
||||
const MSList *accounts = linphone_core_get_proxy_config_list(LC);
|
||||
int count = ms_list_size(accounts);
|
||||
for (int i = 1; i <= count; i++, accounts = accounts->next) {
|
||||
NSString *key = [NSString stringWithFormat:@"menu_account_%d", i];
|
||||
const bctbx_list_t *accounts = linphone_core_get_proxy_config_list(LC);
|
||||
size_t count = bctbx_list_size(accounts);
|
||||
for (size_t i = 1; i <= count; i++, accounts = accounts->next) {
|
||||
NSString *key = [NSString stringWithFormat:@"menu_account_%lu", i];
|
||||
LinphoneProxyConfig *proxy = (LinphoneProxyConfig *)accounts->data;
|
||||
[self setCString:linphone_address_get_username(linphone_proxy_config_get_identity_address(proxy))
|
||||
forKey:key];
|
||||
|
|
@ -478,8 +478,8 @@
|
|||
proxy = linphone_address_as_string_uri_only(proxy_addr);
|
||||
}
|
||||
|
||||
proxyCfg = ms_list_nth_data(linphone_core_get_proxy_config_list(LC),
|
||||
[self integerForKey:@"current_proxy_config_preference"]);
|
||||
proxyCfg = bctbx_list_nth_data(linphone_core_get_proxy_config_list(LC),
|
||||
[self integerForKey:@"current_proxy_config_preference"]);
|
||||
// if account was deleted, it is not present anymore
|
||||
if (proxyCfg == NULL) {
|
||||
goto bad_proxy;
|
||||
|
|
@ -842,8 +842,8 @@
|
|||
}
|
||||
|
||||
- (void)removeAccount {
|
||||
LinphoneProxyConfig *config = ms_list_nth_data(linphone_core_get_proxy_config_list(LC),
|
||||
[self integerForKey:@"current_proxy_config_preference"]);
|
||||
LinphoneProxyConfig *config = bctbx_list_nth_data(linphone_core_get_proxy_config_list(LC),
|
||||
[self integerForKey:@"current_proxy_config_preference"]);
|
||||
|
||||
BOOL isDefault = (linphone_core_get_default_proxy_config(LC) == config);
|
||||
|
||||
|
|
|
|||
|
|
@ -1594,8 +1594,8 @@ static int comp_call_id(const LinphoneCall *call, const char *callid) {
|
|||
|
||||
- (void)cancelLocalNotifTimerForCallId:(NSString *)callid {
|
||||
// first, make sure this callid is not already involved in a call
|
||||
MSList *calls = (MSList *)linphone_core_get_calls(theLinphoneCore);
|
||||
MSList *call = ms_list_find_custom(calls, (MSCompareFunc)comp_call_id, [callid UTF8String]);
|
||||
const bctbx_list_t *calls = linphone_core_get_calls(theLinphoneCore);
|
||||
bctbx_list_t *call = bctbx_list_find_custom(calls, (bctbx_compare_func)comp_call_id, [callid UTF8String]);
|
||||
if (call != NULL) {
|
||||
LinphoneCallAppData *data =
|
||||
(__bridge LinphoneCallAppData *)(linphone_call_get_user_data((LinphoneCall *)call->data));
|
||||
|
|
@ -1608,8 +1608,8 @@ static int comp_call_id(const LinphoneCall *call, const char *callid) {
|
|||
|
||||
- (void)acceptCallForCallId:(NSString *)callid {
|
||||
// first, make sure this callid is not already involved in a call
|
||||
MSList *calls = (MSList *)linphone_core_get_calls(theLinphoneCore);
|
||||
MSList *call = ms_list_find_custom(calls, (MSCompareFunc)comp_call_id, [callid UTF8String]);
|
||||
const bctbx_list_t *calls = linphone_core_get_calls(theLinphoneCore);
|
||||
bctbx_list_t *call = bctbx_list_find_custom(calls, (bctbx_compare_func)comp_call_id, [callid UTF8String]);
|
||||
if (call != NULL) {
|
||||
const LinphoneVideoPolicy *video_policy = linphone_core_get_video_policy(theLinphoneCore);
|
||||
bool with_video = video_policy->automatically_accept;
|
||||
|
|
@ -1620,8 +1620,8 @@ static int comp_call_id(const LinphoneCall *call, const char *callid) {
|
|||
|
||||
- (void)addPushCallId:(NSString *)callid {
|
||||
// first, make sure this callid is not already involved in a call
|
||||
MSList *calls = (MSList *)linphone_core_get_calls(theLinphoneCore);
|
||||
if (ms_list_find_custom(calls, (MSCompareFunc)comp_call_id, [callid UTF8String])) {
|
||||
const bctbx_list_t *calls = linphone_core_get_calls(theLinphoneCore);
|
||||
if (bctbx_list_find_custom(calls, (bctbx_compare_func)comp_call_id, [callid UTF8String])) {
|
||||
LOGW(@"Call id [%@] already handled", callid);
|
||||
return;
|
||||
};
|
||||
|
|
@ -1705,10 +1705,10 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
}
|
||||
|
||||
LinphoneCall *currentCall = linphone_core_get_current_call(theLinphoneCore);
|
||||
const MSList *callList = linphone_core_get_calls(theLinphoneCore);
|
||||
const bctbx_list_t *callList = linphone_core_get_calls(theLinphoneCore);
|
||||
if (!currentCall // no active call
|
||||
&& callList // at least one call in a non active state
|
||||
&& ms_list_find_custom((MSList *)callList, (MSCompareFunc)comp_call_state_paused, NULL)) {
|
||||
&& bctbx_list_find_custom(callList, (bctbx_compare_func)comp_call_state_paused, NULL)) {
|
||||
[self startCallPausedLongRunningTask];
|
||||
}
|
||||
if (callList) {
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
linphone_core_terminate_call(LC, currentcall);
|
||||
} else {
|
||||
const MSList *calls = linphone_core_get_calls(LC);
|
||||
if (ms_list_size(calls) == 1) { // Only one call
|
||||
if (bctbx_list_size(calls) == 1) { // Only one call
|
||||
linphone_core_terminate_call(LC, (LinphoneCall *)(calls->data));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,10 +99,10 @@
|
|||
|
||||
[ContactDisplay setDisplayNameLabel:displayNameLabel forAddress:addr];
|
||||
|
||||
int count = ms_list_size(linphone_call_log_get_user_data(callLog)) + 1;
|
||||
size_t count = bctbx_list_size(linphone_call_log_get_user_data(callLog)) + 1;
|
||||
if (count > 1) {
|
||||
displayNameLabel.text =
|
||||
[displayNameLabel.text stringByAppendingString:[NSString stringWithFormat:@" (%d)", count]];
|
||||
[displayNameLabel.text stringByAppendingString:[NSString stringWithFormat:@" (%lu)", count]];
|
||||
}
|
||||
|
||||
[_avatarImage setImage:[FastAddressBook imageForAddress:addr thumbnail:YES] bordered:NO withRoundedRadius:YES];
|
||||
|
|
|
|||
|
|
@ -496,10 +496,10 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
if ([specifier.key hasPrefix:@"menu_account_"]) {
|
||||
const MSList *accounts = linphone_core_get_proxy_config_list(LC);
|
||||
const bctbx_list_t *accounts = linphone_core_get_proxy_config_list(LC);
|
||||
int index = [specifier.key substringFromIndex:@"menu_account_".length].intValue - 1;
|
||||
if (index < ms_list_size(accounts)) {
|
||||
LinphoneProxyConfig *proxy = (LinphoneProxyConfig *)ms_list_nth_data(accounts, index);
|
||||
if (index < bctbx_list_size(accounts)) {
|
||||
LinphoneProxyConfig *proxy = (LinphoneProxyConfig *)bctbx_list_nth_data(accounts, index);
|
||||
NSString *name = [NSString
|
||||
stringWithUTF8String:linphone_address_get_username(linphone_proxy_config_get_identity_address(proxy))];
|
||||
[specifier.specifierDict setValue:name forKey:kIASKTitle];
|
||||
|
|
@ -514,8 +514,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
NSMutableSet *hiddenKeys = [NSMutableSet set];
|
||||
|
||||
const MSList *accounts = linphone_core_get_proxy_config_list(LC);
|
||||
for (int i = ms_list_size(accounts) + 1; i <= 5; i++) {
|
||||
[hiddenKeys addObject:[NSString stringWithFormat:@"menu_account_%d", i]];
|
||||
for (size_t i = bctbx_list_size(accounts) + 1; i <= 5; i++) {
|
||||
[hiddenKeys addObject:[NSString stringWithFormat:@"menu_account_%lu", i]];
|
||||
}
|
||||
|
||||
if (!linphone_core_sip_transport_supported(LC, LinphoneTransportTls)) {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@
|
|||
if (section == 0) {
|
||||
BOOL hasDefault = (linphone_core_get_default_proxy_config(LC) != NULL);
|
||||
// default account is shown in the header already
|
||||
return MAX(0, ms_list_size(linphone_core_get_proxy_config_list(LC)) - (hasDefault ? 1 : 0));
|
||||
size_t count = bctbx_list_size(linphone_core_get_proxy_config_list(LC));
|
||||
return MAX(0, (int)count - (hasDefault ? 1 : 0));
|
||||
} else {
|
||||
return [_sideMenuEntries count];
|
||||
}
|
||||
|
|
@ -74,11 +75,12 @@
|
|||
UITableViewCell *cell = [[UITableViewCell alloc] init];
|
||||
if (indexPath.section == 0) {
|
||||
// do not display default account here, it is already in header view
|
||||
int idx = linphone_core_get_default_proxy_config(LC) ? ms_list_index(linphone_core_get_proxy_config_list(LC),
|
||||
linphone_core_get_default_proxy_config(LC))
|
||||
: 0;
|
||||
LinphoneProxyConfig *proxy = ms_list_nth_data(linphone_core_get_proxy_config_list(LC),
|
||||
(int)indexPath.row + (idx <= indexPath.row ? 1 : 0));
|
||||
int idx =
|
||||
linphone_core_get_default_proxy_config(LC)
|
||||
? bctbx_list_index(linphone_core_get_proxy_config_list(LC), linphone_core_get_default_proxy_config(LC))
|
||||
: 0;
|
||||
LinphoneProxyConfig *proxy = bctbx_list_nth_data(linphone_core_get_proxy_config_list(LC),
|
||||
(int)indexPath.row + (idx <= indexPath.row ? 1 : 0));
|
||||
if (proxy) {
|
||||
cell.textLabel.text = [NSString stringWithUTF8String:linphone_proxy_config_get_identity(proxy)];
|
||||
cell.imageView.image = [StatusBarView imageForState:linphone_proxy_config_get_state(proxy)];
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@
|
|||
}
|
||||
|
||||
- (void)testPerformanceHugeConversation {
|
||||
int count = 0;
|
||||
size_t count = 0;
|
||||
LinphoneCore *lc = [LinphoneManager getLc];
|
||||
LinphoneChatRoom *room = linphone_core_get_chat_room_from_uri(lc, [[self me] UTF8String]);
|
||||
|
||||
|
|
@ -187,21 +187,22 @@
|
|||
// generate lots of messages...
|
||||
for (; count < 50; count++) {
|
||||
LinphoneChatMessage *msg =
|
||||
linphone_chat_room_create_message(room, [[NSString stringWithFormat:@"Message %d", count + 1] UTF8String]);
|
||||
linphone_chat_room_create_message(room, [[NSString stringWithFormat:@"Message %lu", count + 1] UTF8String]);
|
||||
linphone_chat_room_send_chat_message(room, msg);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 50; i++) {
|
||||
[tester waitForTimeInterval:.5f];
|
||||
|
||||
if (ms_list_size(linphone_chat_room_get_history(room, 0)) == count) {
|
||||
if (bctbx_list_size(linphone_chat_room_get_history(room, 0)) == count) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[tester waitForViewWithAccessibilityLabel:@"Contact name, Message"
|
||||
value:[NSString stringWithFormat:@"%@, Message %d (%d)", self.me, count, count]
|
||||
traits:UIAccessibilityTraitStaticText];
|
||||
[tester
|
||||
waitForViewWithAccessibilityLabel:@"Contact name, Message"
|
||||
value:[NSString stringWithFormat:@"%@, Message %lu (%lu)", self.me, count, count]
|
||||
traits:UIAccessibilityTraitStaticText];
|
||||
|
||||
NSTimeInterval before = [[NSDate date] timeIntervalSince1970];
|
||||
[tester tapRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue