Remove offline status (not fully supported and is error prone) and stabilize presence feature.

Display presence text with time of last seen.
Regroup text format into PresenceLevel.qml
Set publish expires to 2minutes in order to be more correct.
Update SDK for the last seen callback of presence model.

# Conflicts:
#	linphone-app/assets/languages/ja.ts
This commit is contained in:
Julien Wadel 2023-03-24 16:16:08 +01:00
parent 5ec263bacf
commit ee53dc8d19
41 changed files with 543 additions and 33 deletions

View file

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add/View contact from a message.
- Mute option for each chatrooms.
- New Chat Layout.
- Display last seen for contacts.
### Fixed
- Update SDK to 5.2.29

View file

@ -7,6 +7,7 @@
<entry name="avpf" overwrite="true">1</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>
<entry name="publish" overwrite="true">1</entry>
<entry name="publish_expires" overwrite="true">120</entry>
<entry name="quality_reporting_collector" overwrite="true">sip:voip-metrics@sip.linphone.org;transport=tls</entry>
<entry name="quality_reporting_enabled" overwrite="true">1</entry>
<entry name="quality_reporting_interval" overwrite="true">180</entry>

View file

@ -7,6 +7,7 @@
<entry name="avpf" overwrite="true">1</entry>
<entry name="dial_escape_plus" overwrite="true">0</entry>
<entry name="publish" overwrite="true">1</entry>
<entry name="publish_expires" overwrite="true">120</entry>
<entry name="quality_reporting_collector" overwrite="true">sip:voip-metrics@sip.linphone.org;transport=tls</entry>
<entry name="quality_reporting_enabled" overwrite="true">1</entry>
<entry name="quality_reporting_interval" overwrite="true">180</entry>

View file

@ -2437,6 +2437,29 @@ Klik her: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Offline</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Tilgængelig</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3273,6 +3296,10 @@ Klik her: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2437,6 +2437,29 @@ Klicken Sie hier: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Offline</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Verfügbar</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3273,6 +3296,10 @@ Klicken Sie hier: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2438,6 +2438,29 @@ Click here: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Offline</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation>Online</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation>Online today at %1</translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation>Online yesterday at %1</translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation>Online on %1</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3297,6 +3320,10 @@ Click here: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation>invalid E2E encryption keys server URL</translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation>Publish duration (sec)</translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2437,6 +2437,29 @@ Haga clic aquí: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<translation>Desconectado</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Disponible</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3273,6 +3296,10 @@ Haga clic aquí: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2437,6 +2437,29 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Hors-ligne</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation>En ligne</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation>En ligne aujourd&apos;hui à %1</translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation>En ligne hier à %1</translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation>En ligne le %1</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3273,6 +3296,10 @@ Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation>URL du serveur de clés pour le chiffrement de bout en bout invalide</translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation>Durée de présence (sec)</translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2424,6 +2424,29 @@ Kattintson ide: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Kapcsolat nélküli</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Elérhető</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3260,6 +3283,10 @@ Kattintson ide: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2437,6 +2437,29 @@ Clicca: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Offline</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Disponibile</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3273,6 +3296,10 @@ Clicca: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2424,6 +2424,29 @@
<translation></translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3260,6 +3283,10 @@
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2450,6 +2450,29 @@ Spustelėkite čia: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Atsijungęs</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Pasiekiamas</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3286,6 +3309,10 @@ Spustelėkite čia: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2437,6 +2437,29 @@ Clique aqui: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<translation>Offline</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Disponível</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3273,6 +3296,10 @@ Clique aqui: &lt;a href=&quot;%1&quot;&gt;%1 &lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation>URL de servidor de chaves de criptografia E2E inválida</translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2450,6 +2450,29 @@
<translation>Офлайн</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Доступен</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3286,6 +3309,10 @@
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation>неверный адрес сервера ключей шифрования E2E</translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2437,6 +2437,29 @@ Klicka här: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Frånkopplad</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Tillgänglig</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3273,6 +3296,10 @@ Klicka här: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2424,6 +2424,29 @@ Buraya tıklayın: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<translation>Çevrim dışı</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Uygun</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3260,6 +3283,10 @@ Buraya tıklayın: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2450,6 +2450,29 @@
<translation>Не в мережі</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished">Доступний</translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3286,6 +3309,10 @@
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -2424,6 +2424,29 @@
<translation>线</translation>
</message>
</context>
<context>
<name>PresenceLevel</name>
<message>
<source>presenceOnline</source>
<extracomment>&apos;Online&apos;: Presence text</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenToday</source>
<extracomment>&apos;Online today at %1&apos; : Presence text for today (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeenYesterday</source>
<extracomment>&apos;Online yesterday at %1&apos; : Presence text for yesterday (%1 is the hour)</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>presenceLastSeen</source>
<extracomment>&apos;Online on %1&apos; : Presence text for latter days (%1 is a date)</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
@ -3260,6 +3283,10 @@
<extracomment>&quot;invalid E2E encryption keys server URL&quot; : Error text about E2E encryption keys server URL.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>publishDurationLabel</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsTunnel</name>

View file

@ -14,6 +14,7 @@ accept_any_encryption=1
chat_messages_aggregation_delay=1000
chat_messages_aggregation=1
zrtp_key_agreements_suites=MS_ZRTP_KEY_AGREEMENT_K255_KYB512
update_presence_model_timestamp_before_publish_expires_refresh=1
[video]
max_conference_size=vga

View file

@ -392,6 +392,19 @@ int ChatRoomModel::getPresenceStatus() const {
return -1;
}
QDateTime ChatRoomModel::getPresenceTimestamp() const {
if( mChatRoom && mChatRoom->getNbParticipants() == 1 && !isGroupEnabled()){
auto participants = getParticipants(false);
auto contact = CoreManager::getInstance()->getContactsListModel()->findContactModelFromSipAddress(Utils::coreStringToAppString((*participants.begin())->getAddress()->asString()));
if(contact) {
return contact->getPresenceTimestamp();
}
else
return QDateTime();
}else
return QDateTime();
}
ParticipantListModel* ChatRoomModel::getParticipantListModel() const{
return mParticipantListModel.get();
}

View file

@ -82,6 +82,7 @@ public:
Q_PROPERTY(QString username READ getUsername NOTIFY usernameChanged)
Q_PROPERTY(QString avatar READ getAvatar NOTIFY avatarChanged)
Q_PROPERTY(int presenceStatus READ getPresenceStatus NOTIFY presenceStatusChanged)
Q_PROPERTY(QDateTime presenceTimestamp READ getPresenceTimestamp NOTIFY presenceStatusChanged)
Q_PROPERTY(LinphoneEnums::ChatRoomState state READ getState NOTIFY stateChanged)
Q_PROPERTY(long ephemeralLifetime READ getEphemeralLifetime WRITE setEphemeralLifetime NOTIFY ephemeralLifetimeChanged)
@ -120,6 +121,7 @@ public:
QString getUsername () const;
QString getAvatar () const;
int getPresenceStatus() const;
QDateTime getPresenceTimestamp() const;
LinphoneEnums::ChatRoomState getState() const;
bool isReadOnly() const;
bool isEphemeralEnabled() const;

View file

@ -210,10 +210,19 @@ Presence::PresenceStatus ContactModel::getPresenceStatus () const {
return static_cast<Presence::PresenceStatus>(mLinphoneFriend->getConsolidatedPresence());
}
QDateTime ContactModel::getPresenceTimestamp() const{
if(mLinphoneFriend->getPresenceModel()){
return QDateTime::fromMSecsSinceEpoch(mLinphoneFriend->getPresenceModel()->getTimestamp() * 1000);
}else
return QDateTime();
}
Presence::PresenceLevel ContactModel::getPresenceLevel () const {
return Presence::getPresenceLevel(getPresenceStatus());
}
bool ContactModel::hasCapability(const LinphoneEnums::FriendCapability& capability){
return mLinphoneFriend->hasCapability(LinphoneEnums::toLinphone(capability));
}

View file

@ -24,6 +24,7 @@
#include "components/presence/Presence.hpp"
#include "utils/LinphoneEnums.hpp"
#include <QDateTime>
#include <QSharedPointer>
// =============================================================================
@ -39,6 +40,7 @@ class ContactModel : public QObject {
Q_OBJECT
Q_PROPERTY(Presence::PresenceStatus presenceStatus READ getPresenceStatus NOTIFY presenceStatusChanged)
Q_PROPERTY(QDateTime presenceTimestamp READ getPresenceTimestamp NOTIFY presenceStatusChanged)
Q_PROPERTY(Presence::PresenceLevel presenceLevel READ getPresenceLevel NOTIFY presenceLevelChanged)
Q_PROPERTY(VcardModel * vcard READ getVcardModel WRITE setVcardModel NOTIFY contactUpdated)
@ -56,6 +58,7 @@ public:
Q_INVOKABLE VcardModel *cloneVcardModel () const;
Presence::PresenceLevel getPresenceLevel () const;
QDateTime getPresenceTimestamp() const;
Q_INVOKABLE bool hasCapability(const LinphoneEnums::FriendCapability& capability);
std::shared_ptr<linphone::Friend> getFriend() const;
@ -73,7 +76,6 @@ private:
void updateSipAddresses (VcardModel *oldVcardModel);
Presence::PresenceStatus getPresenceStatus () const;
VcardModel *mVcardModel = nullptr;
std::shared_ptr<linphone::Friend> mLinphoneFriend;

View file

@ -364,6 +364,10 @@ void CoreManager::migrate () {
qInfo() << "Migrating" << accountIdentity << "for version 5. Video conference factory URI" << (exists ? std::string("unchanged") : std::string("= ") +Constants::DefaultVideoConferenceURI).c_str();
// note: using std::string.c_str() to avoid having double quotes in qInfo()
}
if( rcVersion < 6) {
newParams->setPublishExpires(Constants::DefaultPublishExpires);
qInfo() << "Migrating" << accountIdentity << "for version 6. publish expires =" << Constants::DefaultPublishExpires;
}
if(newParams->getLimeServerUrl().empty()){
if(!oldLimeServerUrl.empty())
newParams->setLimeServerUrl(oldLimeServerUrl);

View file

@ -75,7 +75,7 @@ QVariantList OwnPresenceModel::getStatuses () const {
addBuildStatus(statuses, Presence::Online);
addBuildStatus(statuses, Presence::Busy);
addBuildStatus(statuses, Presence::DoNotDisturb);
addBuildStatus(statuses, Presence::Offline);
//addBuildStatus(statuses, Presence::Offline); // Do not propose this status as it is not fully supported
return statuses;
}

View file

@ -43,6 +43,14 @@ void SipAddressObserver::setPresenceStatus (const Presence::PresenceStatus &pres
emit presenceStatusChanged(presenceStatus);
}
void SipAddressObserver::setPresenceTimestamp(const QDateTime &presenceTimestamp){
if (presenceTimestamp == mPresenceTimestamp)
return;
mPresenceTimestamp = presenceTimestamp;
emit presenceTimestampChanged(presenceTimestamp);
}
void SipAddressObserver::setUnreadMessageCount (int unreadMessageCount) {
if (unreadMessageCount == mUnreadMessageCount)
return;

View file

@ -24,6 +24,7 @@
#include "components/presence/Presence.hpp"
#include <QSharedPointer>
#include <QDateTime>
// =============================================================================
@ -39,6 +40,7 @@ class SipAddressObserver : public QObject {
Q_PROPERTY(ContactModel *contact READ getContact NOTIFY contactChanged);
Q_PROPERTY(Presence::PresenceStatus presenceStatus READ getPresenceStatus NOTIFY presenceStatusChanged);
Q_PROPERTY(QDateTime presenceTimestamp READ getPresenceTimestamp NOTIFY presenceTimestampChanged);
Q_PROPERTY(int unreadMessageCount READ getUnreadMessageCount NOTIFY unreadMessageCountChanged);
Q_PROPERTY(bool isOneToOne MEMBER isOneToOne CONSTANT);
@ -54,6 +56,7 @@ public:
signals:
void contactChanged (QSharedPointer<ContactModel>);
void presenceStatusChanged (const Presence::PresenceStatus &presenceStatus);
void presenceTimestampChanged (const QDateTime &presenceTimestamp);
void unreadMessageCountChanged (int unreadMessageCount);
private:
@ -78,8 +81,12 @@ private:
Presence::PresenceStatus getPresenceStatus () const {
return mPresenceStatus;
}
QDateTime getPresenceTimestamp() const{
return mPresenceTimestamp;
}
void setPresenceStatus (const Presence::PresenceStatus &presenceStatus);
void setPresenceTimestamp (const QDateTime &presenceTimestamp);
// ---------------------------------------------------------------------------
@ -94,6 +101,7 @@ private:
QSharedPointer<ContactModel> mContact;
Presence::PresenceStatus mPresenceStatus = Presence::PresenceStatus::Offline;
QDateTime mPresenceTimestamp;
int mUnreadMessageCount = 0;
};

View file

@ -135,6 +135,7 @@ SipAddressObserver *SipAddressesModel::getSipAddressObserver (const QString &pee
if (it != mPeerAddressToSipAddressEntry.end()) {
model->setContact(it->contact);
model->setPresenceStatus(it->presenceStatus);
model->setPresenceTimestamp(it->presenceTimestamp);
auto it2 = it->localAddressToConferenceEntry.find(cleanedLocalAddress);
if (it2 != it->localAddressToConferenceEntry.end())
@ -364,18 +365,19 @@ void SipAddressesModel::handlePresenceReceived (
status = Presence::PresenceStatus::Offline;
break;
}
QDateTime presenceTimestamp = QDateTime::fromMSecsSinceEpoch(presenceModel->getTimestamp()*1000);
auto it = mPeerAddressToSipAddressEntry.find(sipAddress);
if (it != mPeerAddressToSipAddressEntry.end()) {
qInfo() << QStringLiteral("Update presence of `%1`: %2.").arg(sipAddress).arg(status);
it->presenceStatus = status;
it->presenceTimestamp = presenceTimestamp;
int row = mRefs.indexOf(&(*it));
Q_ASSERT(row != -1);
emit dataChanged(index(row, 0), index(row, 0));
}
updateObservers(sipAddress, status);
updateObservers(sipAddress, status, presenceTimestamp);
}
void SipAddressesModel::handleAllEntriesRemoved (ChatRoomModel *chatRoomModel) {
@ -663,9 +665,11 @@ void SipAddressesModel::updateObservers (const QString &sipAddress, QSharedPoint
observer->setContact(contact);
}
void SipAddressesModel::updateObservers (const QString &sipAddress, const Presence::PresenceStatus &presenceStatus) {
for (auto &observer : mObservers.values(sipAddress))
void SipAddressesModel::updateObservers (const QString &sipAddress, const Presence::PresenceStatus &presenceStatus, const QDateTime &presenceTimestamp) {
for (auto &observer : mObservers.values(sipAddress)){
observer->setPresenceStatus(presenceStatus);
observer->setPresenceTimestamp(presenceTimestamp);
}
}
void SipAddressesModel::updateObservers (const QString &peerAddress, const QString &localAddress, int messageCount, int missedCallCount) {

View file

@ -50,6 +50,7 @@ public:
QString sipAddress;
QSharedPointer<ContactModel> contact;
Presence::PresenceStatus presenceStatus;
QDateTime presenceTimestamp;
QHash<QString, ConferenceEntry> localAddressToConferenceEntry;
};
@ -147,7 +148,7 @@ private:
void initRefs ();
void updateObservers (const QString &sipAddress, QSharedPointer<ContactModel> contact);
void updateObservers (const QString &sipAddress, const Presence::PresenceStatus &presenceStatus);
void updateObservers (const QString &sipAddress, const Presence::PresenceStatus &presenceStatus, const QDateTime &presenceTimestamp);
void updateObservers (const QString &peerAddress, const QString &localAddress, int messageCount, int missedCallCount);
// ---------------------------------------------------------------------------

View file

@ -124,6 +124,7 @@ constexpr char Constants::LinphoneDomain[];
constexpr char Constants::DefaultContactParameters[];
constexpr char Constants::DefaultContactParametersOnRemove[];
constexpr int Constants::DefaultExpires;
constexpr int Constants::DefaultPublishExpires;
constexpr char Constants::DownloadUrl[];
constexpr char Constants::VersionCheckReleaseUrl[];
constexpr char Constants::VersionCheckNightlyUrl[];

View file

@ -50,7 +50,8 @@ public:
static constexpr char DefaultUploadLogsServer[] = "https://www.linphone.org:444/lft.php";
static constexpr char DefaultContactParameters[] = "message-expires=2419200";
static constexpr char DefaultContactParametersOnRemove[] = "message-expires=0";
static constexpr int DefaultExpires = 3600;
static constexpr int DefaultExpires = 600;
static constexpr int DefaultPublishExpires = 120;
static constexpr char DownloadUrl[] = "https://www.linphone.org/technical-corner/linphone";
static constexpr char VersionCheckReleaseUrl[] = "https://linphone.org/releases";
static constexpr char VersionCheckNightlyUrl[] = "https://linphone.org/snapshots";
@ -157,10 +158,11 @@ public:
static constexpr char VcardScheme[] = EXECUTABLE_NAME "-desktop:/";
static constexpr int CbsCallInterval = 20;
static constexpr char RcVersionName[] = "rc_version";
static constexpr int RcVersionCurrent = 5; // 2 = Conference URI
static constexpr int RcVersionCurrent = 6; // 2 = Conference URI
// 3 = CPIM on basic chat rooms
// 4 = RTP bundle mode
// 5 = Video Conference URI
// 6 = Publish expires
//--------------------------------------------------------------------------------
// CISCO
//--------------------------------------------------------------------------------

View file

@ -13,8 +13,10 @@ Item {
id: avatar
// ---------------------------------------------------------------------------
property alias hasPresence: presenceLevelIcon.visible
property alias presenceLevel: presenceLevelIcon.level
property alias presenceText: presenceLevelIcon.text
property alias presenceTimestamp: presenceLevelIcon.timestamp
property bool isDarkMode: false
property color backgroundColor: isDarkMode ? AvatarStyle.backgroundDarkModeColor.color : AvatarStyle.backgroundColor.color
property color foregroundColor: 'transparent'
@ -83,7 +85,6 @@ Item {
PresenceLevel {
id: presenceLevelIcon
visible: level >= 0
anchors {
bottom: parent.bottom

View file

@ -68,7 +68,7 @@ Rectangle {
: (entry.presenceStatus >= 0 ? Presence.getPresenceLevel(entry.presenceStatus) : -1)
)
:-1
presenceTimestamp: entry && entry.contactModel && entry.contactModel.presenceTimestamp
username: entry!=undefined
? entry.conferenceInfoModel
? item.organizer

View file

@ -3,21 +3,46 @@ import QtQuick 2.7
import Common 1.0
import Linphone 1.0
import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
// Wrapper to use `icon` property.
Item {
property var level: null
property bool betterIcon : false
Icon {
anchors.centerIn: parent
icon: (level !== -1 && level != null)
? (betterIcon? Presence.getBetterPresenceLevelIconName(level) : Presence.getPresenceLevelIconName(level))
: ''
iconSize: parent.height > parent.width
? parent.width
: parent.height
}
property var level: null
property bool betterIcon : false
property var timestamp
property string text: {
if( level === 0)
//: 'Online': Presence text
return qsTr('presenceOnline');
else if(visible){
var d = new Date(timestamp)
var yesterday = new Date()
yesterday.setDate(yesterday.getDate() - 1)
if (Utils.equalDate(d, new Date()))
//: 'Online today at %1' : Presence text for today (%1 is the hour)
return qsTr('presenceLastSeenToday').arg(d.toLocaleString(App.locale, 'HH:mm'))
else if(Utils.equalDate(d,yesterday))
//: 'Online yesterday at %1' : Presence text for yesterday (%1 is the hour)
return qsTr('presenceLastSeenYesterday').arg(d.toLocaleString(App.locale, 'HH:mm'))
else
//: 'Online on %1' : Presence text for latter days (%1 is a date)
return qsTr('presenceLastSeen').arg(d.toLocaleDateString(App.locale))
}else
return Presence.getPresenceStatusAsString(level)
}
visible: icon.icon != ''
Icon {
id: icon
anchors.centerIn: parent
icon: (level !== -1 && level != null && level !== 3)// Hide Offline status as it is not fully supported
? (betterIcon? Presence.getBetterPresenceLevelIconName(level) : Presence.getPresenceLevelIconName(level))
: ''
iconSize: parent.height > parent.width
? parent.width
: parent.height
}
}

View file

@ -113,6 +113,7 @@ ColumnLayout {
image: _vcard ? _vcard.avatar : ''
username: _vcard ? _vcard.username : ''
presenceLevel: _contact ? _contact.presenceLevel : -1
presenceTimestamp: _contact && _contact.presenceTimestamp
visible: (isLoaded() && !parent.hovered) || !_edition
}
}

View file

@ -108,9 +108,11 @@ ColumnLayout {
spacing: ContactsStyle.contact.spacing
PresenceLevel {
id: presenceLevel
Layout.preferredHeight: ContactsStyle.contact.presenceLevelSize
Layout.preferredWidth: ContactsStyle.contact.presenceLevelSize
level: $modelData.presenceLevel
timestamp: $modelData.presenceTimestamp
}
Text {
@ -118,7 +120,8 @@ ColumnLayout {
color: ContactsStyle.contact.presence.colorModel.color
elide: Text.ElideRight
font.pointSize: ContactsStyle.contact.presence.pointSize
text: Presence.getPresenceStatusAsString($modelData.presenceStatus)
text: presenceLevel.presenceText
visible: presenceLevel.visible
}
}
}

View file

@ -100,6 +100,7 @@ ColumnLayout {
image: Logic.getAvatar()
presenceLevel: chatRoomModel && chatRoomModel.presenceStatus
presenceTimestamp: chatRoomModel && chatRoomModel.presenceTimestamp
//username: Logic.getUsername()
username: chatRoomModel?chatRoomModel.username:( conversation._sipAddressObserver ? UtilsCpp.getDisplayName(conversation._sipAddressObserver.peerAddress) : '')
@ -158,12 +159,14 @@ ColumnLayout {
titleText: avatar.username
titleClickable: chatRoomModel && chatRoomModel.isMeAdmin && !chatRoomModel.isOneToOne
subtitleText: if(chatRoomModel) {
if(chatRoomModel.groupEnabled) {
return chatRoomModel.participants.displayNamesToString;
}else if(chatRoomModel.isSecure()) {
return chatRoomModel.participants.addressesToString;
}else
return SipAddressesModel.cleanSipAddress(chatRoomModel.sipAddress)
if(chatRoomModel.groupEnabled) {
return chatRoomModel.participants.displayNamesToString;
}else if(avatar.hasPresence) {
return avatar.presenceText
}else if(chatRoomModel.isSecure())
return chatRoomModel.participants.addressesToString;
else
return SipAddressesModel.cleanSipAddress(chatRoomModel.sipAddress)
}else
return ''

View file

@ -57,6 +57,9 @@ ColumnLayout {
presenceLevel: historyView._sipAddressObserver?Presence.getPresenceLevel(
historyView._sipAddressObserver.presenceStatus
):null
presenceTimestamp: historyView._sipAddressObserver?Presence.getPresenceTimestamp(
historyView._sipAddressObserver.presenceStatus
):null
username: historyView.entry && historyView.entry.wasConference
? historyView.entry.title

View file

@ -41,6 +41,7 @@ function initForm (account) {
sipAddress.text = config.sipAddress
serverAddress.text = config.serverAddress
registrationDuration.text = config.registrationDuration
publishDuration.text = config.publishDuration
var currentTransport = config.transport.toUpperCase()
transport.currentIndex = Number(
@ -83,6 +84,7 @@ function validAccount (account) {
sipAddress: sipAddress.text,
serverAddress: serverAddress.text,
registrationDuration: registrationDuration.text,
publishDuration: publishDuration.text,
transport: transport.currentText,
route: route.text,
conferenceUri: conferenceUri.text,

View file

@ -232,6 +232,15 @@ DialogPlus {
onClicked: checked = !checked
}
}
FormGroup {
label: qsTr('publishDurationLabel')
NumericField {
id: publishDuration
Keys.onEnterPressed: route.forceActiveFocus()
Keys.onReturnPressed: route.forceActiveFocus()
}
}
}
FormLine {

@ -1 +1 @@
Subproject commit e8ec1a4b79a5082ee9f98157199ccaa14f89594e
Subproject commit 2eadea70597365f32e66cceb54d949c8c4a1b94f