Commit c703de1e authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

presence: oops, sorted list in wrong order

parent 1b732024
...@@ -232,7 +232,7 @@ static void presence_person_add_note(LinphonePresencePerson *person, LinphonePre ...@@ -232,7 +232,7 @@ static void presence_person_add_note(LinphonePresencePerson *person, LinphonePre
} }
static int presence_model_insert_person_by_timestamp(LinphonePresencePerson *current, LinphonePresencePerson *to_insert) { static int presence_model_insert_person_by_timestamp(LinphonePresencePerson *current, LinphonePresencePerson *to_insert) {
return current->timestamp > to_insert->timestamp; return current->timestamp < to_insert->timestamp;
} }
static void presence_model_add_person(LinphonePresenceModel *model, LinphonePresencePerson *person) { static void presence_model_add_person(LinphonePresenceModel *model, LinphonePresencePerson *person) {
...@@ -368,12 +368,14 @@ struct _get_activity_st { ...@@ -368,12 +368,14 @@ struct _get_activity_st {
}; };
static void presence_model_get_activity(const LinphonePresencePerson *person, struct _get_activity_st *st) { static void presence_model_get_activity(const LinphonePresencePerson *person, struct _get_activity_st *st) {
unsigned int size = ms_list_size(person->activities); if (st->current_idx != (unsigned)-1) {
if ((st->current_idx != (unsigned)-1) && (st->requested_idx < (st->current_idx + size))) { unsigned int size = ms_list_size(person->activities);
st->activity = (LinphonePresenceActivity *)ms_list_nth_data(person->activities, st->requested_idx - st->current_idx); if (st->requested_idx < (st->current_idx + size)) {
st->current_idx = (unsigned)-1; st->activity = (LinphonePresenceActivity *)ms_list_nth_data(person->activities, st->requested_idx - st->current_idx);
} else { st->current_idx = (unsigned)-1;
st->current_idx += size; } else {
st->current_idx += size;
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment