Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_status')
-rw-r--r--apps/user_status/l10n/af.js1
-rw-r--r--apps/user_status/l10n/af.json1
-rw-r--r--apps/user_status/l10n/ar.js1
-rw-r--r--apps/user_status/l10n/ar.json1
-rw-r--r--apps/user_status/l10n/bg.js1
-rw-r--r--apps/user_status/l10n/bg.json1
-rw-r--r--apps/user_status/l10n/ca.js1
-rw-r--r--apps/user_status/l10n/ca.json1
-rw-r--r--apps/user_status/l10n/cs.js1
-rw-r--r--apps/user_status/l10n/cs.json1
-rw-r--r--apps/user_status/l10n/de.js1
-rw-r--r--apps/user_status/l10n/de.json1
-rw-r--r--apps/user_status/l10n/de_DE.js1
-rw-r--r--apps/user_status/l10n/de_DE.json1
-rw-r--r--apps/user_status/l10n/el.js1
-rw-r--r--apps/user_status/l10n/el.json1
-rw-r--r--apps/user_status/l10n/es.js1
-rw-r--r--apps/user_status/l10n/es.json1
-rw-r--r--apps/user_status/l10n/eu.js1
-rw-r--r--apps/user_status/l10n/eu.json1
-rw-r--r--apps/user_status/l10n/fi.js1
-rw-r--r--apps/user_status/l10n/fi.json1
-rw-r--r--apps/user_status/l10n/fr.js1
-rw-r--r--apps/user_status/l10n/fr.json1
-rw-r--r--apps/user_status/l10n/gl.js1
-rw-r--r--apps/user_status/l10n/gl.json1
-rw-r--r--apps/user_status/l10n/he.js1
-rw-r--r--apps/user_status/l10n/he.json1
-rw-r--r--apps/user_status/l10n/hr.js1
-rw-r--r--apps/user_status/l10n/hr.json1
-rw-r--r--apps/user_status/l10n/hu.js1
-rw-r--r--apps/user_status/l10n/hu.json1
-rw-r--r--apps/user_status/l10n/is.js1
-rw-r--r--apps/user_status/l10n/is.json1
-rw-r--r--apps/user_status/l10n/it.js1
-rw-r--r--apps/user_status/l10n/it.json1
-rw-r--r--apps/user_status/l10n/ja.js1
-rw-r--r--apps/user_status/l10n/ja.json1
-rw-r--r--apps/user_status/l10n/ko.js1
-rw-r--r--apps/user_status/l10n/ko.json1
-rw-r--r--apps/user_status/l10n/lt_LT.js1
-rw-r--r--apps/user_status/l10n/lt_LT.json1
-rw-r--r--apps/user_status/l10n/mk.js1
-rw-r--r--apps/user_status/l10n/mk.json1
-rw-r--r--apps/user_status/l10n/nb.js1
-rw-r--r--apps/user_status/l10n/nb.json1
-rw-r--r--apps/user_status/l10n/nl.js1
-rw-r--r--apps/user_status/l10n/nl.json1
-rw-r--r--apps/user_status/l10n/oc.js1
-rw-r--r--apps/user_status/l10n/oc.json1
-rw-r--r--apps/user_status/l10n/pl.js1
-rw-r--r--apps/user_status/l10n/pl.json1
-rw-r--r--apps/user_status/l10n/pt_BR.js1
-rw-r--r--apps/user_status/l10n/pt_BR.json1
-rw-r--r--apps/user_status/l10n/pt_PT.js1
-rw-r--r--apps/user_status/l10n/pt_PT.json1
-rw-r--r--apps/user_status/l10n/ru.js1
-rw-r--r--apps/user_status/l10n/ru.json1
-rw-r--r--apps/user_status/l10n/sc.js1
-rw-r--r--apps/user_status/l10n/sc.json1
-rw-r--r--apps/user_status/l10n/sk.js1
-rw-r--r--apps/user_status/l10n/sk.json1
-rw-r--r--apps/user_status/l10n/sl.js1
-rw-r--r--apps/user_status/l10n/sl.json1
-rw-r--r--apps/user_status/l10n/sv.js1
-rw-r--r--apps/user_status/l10n/sv.json1
-rw-r--r--apps/user_status/l10n/th.js1
-rw-r--r--apps/user_status/l10n/th.json1
-rw-r--r--apps/user_status/l10n/tr.js1
-rw-r--r--apps/user_status/l10n/tr.json1
-rw-r--r--apps/user_status/l10n/zh_CN.js1
-rw-r--r--apps/user_status/l10n/zh_CN.json1
-rw-r--r--apps/user_status/l10n/zh_HK.js1
-rw-r--r--apps/user_status/l10n/zh_HK.json1
-rw-r--r--apps/user_status/l10n/zh_TW.js1
-rw-r--r--apps/user_status/l10n/zh_TW.json1
-rw-r--r--apps/user_status/lib/Connector/UserStatusProvider.php14
-rw-r--r--apps/user_status/lib/Db/UserStatusMapper.php58
-rw-r--r--apps/user_status/lib/Service/StatusService.php133
-rw-r--r--apps/user_status/tests/Unit/Db/UserStatusMapperTest.php113
-rw-r--r--apps/user_status/tests/Unit/Service/StatusServiceTest.php116
81 files changed, 358 insertions, 152 deletions
diff --git a/apps/user_status/l10n/af.js b/apps/user_status/l10n/af.js
index e9c229935ac..0159c29095d 100644
--- a/apps/user_status/l10n/af.js
+++ b/apps/user_status/l10n/af.js
@@ -32,7 +32,6 @@ OC.L10N.register(
"4 hours" : "4 uur",
"Mute all notifications" : "Demp alle kennisgewings",
"Appear offline" : "Toon as vanlyn",
- "Clear status after" : "Wis status na",
"What's your status?" : "Wat is u status"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/af.json b/apps/user_status/l10n/af.json
index a37e1dcf6c8..48b425b4586 100644
--- a/apps/user_status/l10n/af.json
+++ b/apps/user_status/l10n/af.json
@@ -30,7 +30,6 @@
"4 hours" : "4 uur",
"Mute all notifications" : "Demp alle kennisgewings",
"Appear offline" : "Toon as vanlyn",
- "Clear status after" : "Wis status na",
"What's your status?" : "Wat is u status"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/ar.js b/apps/user_status/l10n/ar.js
index 0d2160fa5ad..5eaec0b87d1 100644
--- a/apps/user_status/l10n/ar.js
+++ b/apps/user_status/l10n/ar.js
@@ -32,7 +32,6 @@ OC.L10N.register(
"4 hours" : "4 ساعات",
"Mute all notifications" : "عدم اظهار جميع التنبيهات",
"Appear offline" : "الحالة غير متصل",
- "Clear status after" : "مسح رسالة الحالة بعد",
"What's your status?" : "ماهي حالتك؟"
},
"nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;");
diff --git a/apps/user_status/l10n/ar.json b/apps/user_status/l10n/ar.json
index 873043045a1..92c7e1ad70e 100644
--- a/apps/user_status/l10n/ar.json
+++ b/apps/user_status/l10n/ar.json
@@ -30,7 +30,6 @@
"4 hours" : "4 ساعات",
"Mute all notifications" : "عدم اظهار جميع التنبيهات",
"Appear offline" : "الحالة غير متصل",
- "Clear status after" : "مسح رسالة الحالة بعد",
"What's your status?" : "ماهي حالتك؟"
},"pluralForm" :"nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/bg.js b/apps/user_status/l10n/bg.js
index ef5b59e0fbe..061d4dc9021 100644
--- a/apps/user_status/l10n/bg.js
+++ b/apps/user_status/l10n/bg.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 часа",
"Mute all notifications" : "Заглушаване на всички известия",
"Appear offline" : "Показване като офлайн",
- "Clear status after" : "Изчистване на състоянието след",
"What's your status?" : "Какъв е вашият статус?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/bg.json b/apps/user_status/l10n/bg.json
index 23c52f510df..bd681e2565c 100644
--- a/apps/user_status/l10n/bg.json
+++ b/apps/user_status/l10n/bg.json
@@ -33,7 +33,6 @@
"4 hours" : "4 часа",
"Mute all notifications" : "Заглушаване на всички известия",
"Appear offline" : "Показване като офлайн",
- "Clear status after" : "Изчистване на състоянието след",
"What's your status?" : "Какъв е вашият статус?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/ca.js b/apps/user_status/l10n/ca.js
index 158f1c5aa10..5e83f9090ea 100644
--- a/apps/user_status/l10n/ca.js
+++ b/apps/user_status/l10n/ca.js
@@ -32,7 +32,6 @@ OC.L10N.register(
"4 hours" : "4 hores",
"Mute all notifications" : "Silenciar totes les notificacions",
"Appear offline" : "Apareix com \"desconnectat\"",
- "Clear status after" : "Esborra l'estat després",
"What's your status?" : "Quin és el teu estat?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/ca.json b/apps/user_status/l10n/ca.json
index c90b703f094..624d2ea0419 100644
--- a/apps/user_status/l10n/ca.json
+++ b/apps/user_status/l10n/ca.json
@@ -30,7 +30,6 @@
"4 hours" : "4 hores",
"Mute all notifications" : "Silenciar totes les notificacions",
"Appear offline" : "Apareix com \"desconnectat\"",
- "Clear status after" : "Esborra l'estat després",
"What's your status?" : "Quin és el teu estat?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/cs.js b/apps/user_status/l10n/cs.js
index 754bb04711e..6a4997b6fd7 100644
--- a/apps/user_status/l10n/cs.js
+++ b/apps/user_status/l10n/cs.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 hodiny",
"Mute all notifications" : "Ztlumit veškerá upozornění",
"Appear offline" : "Jevit se offline",
- "Clear status after" : "Vyčistit stav po uplynutí",
"What's your status?" : "Jaký je váš stav?"
},
"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;");
diff --git a/apps/user_status/l10n/cs.json b/apps/user_status/l10n/cs.json
index 667d9c451a5..7febf6f0aa5 100644
--- a/apps/user_status/l10n/cs.json
+++ b/apps/user_status/l10n/cs.json
@@ -33,7 +33,6 @@
"4 hours" : "4 hodiny",
"Mute all notifications" : "Ztlumit veškerá upozornění",
"Appear offline" : "Jevit se offline",
- "Clear status after" : "Vyčistit stav po uplynutí",
"What's your status?" : "Jaký je váš stav?"
},"pluralForm" :"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/de.js b/apps/user_status/l10n/de.js
index 2131337127c..791da791c28 100644
--- a/apps/user_status/l10n/de.js
+++ b/apps/user_status/l10n/de.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 Stunden",
"Mute all notifications" : "Alle Benachrichtigungen stummschalten",
"Appear offline" : "Offline erscheinen",
- "Clear status after" : "Status löschen nach",
"What's your status?" : "Wie ist Dein Status?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/de.json b/apps/user_status/l10n/de.json
index 815deec399d..7cf652ab8f0 100644
--- a/apps/user_status/l10n/de.json
+++ b/apps/user_status/l10n/de.json
@@ -33,7 +33,6 @@
"4 hours" : "4 Stunden",
"Mute all notifications" : "Alle Benachrichtigungen stummschalten",
"Appear offline" : "Offline erscheinen",
- "Clear status after" : "Status löschen nach",
"What's your status?" : "Wie ist Dein Status?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/de_DE.js b/apps/user_status/l10n/de_DE.js
index 203496b42be..a2226851f9e 100644
--- a/apps/user_status/l10n/de_DE.js
+++ b/apps/user_status/l10n/de_DE.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 Stunden",
"Mute all notifications" : "Alle Benachrichtigungen stummschalten",
"Appear offline" : "Offline erscheinen",
- "Clear status after" : "Status löschen nach",
"What's your status?" : "Wie ist Ihr Status?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/de_DE.json b/apps/user_status/l10n/de_DE.json
index f8e909ec824..b6951e4789a 100644
--- a/apps/user_status/l10n/de_DE.json
+++ b/apps/user_status/l10n/de_DE.json
@@ -33,7 +33,6 @@
"4 hours" : "4 Stunden",
"Mute all notifications" : "Alle Benachrichtigungen stummschalten",
"Appear offline" : "Offline erscheinen",
- "Clear status after" : "Status löschen nach",
"What's your status?" : "Wie ist Ihr Status?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/el.js b/apps/user_status/l10n/el.js
index fb97460859e..e70ade166d3 100644
--- a/apps/user_status/l10n/el.js
+++ b/apps/user_status/l10n/el.js
@@ -33,7 +33,6 @@ OC.L10N.register(
"4 hours" : "4 ώρες",
"Mute all notifications" : "Σίγαση όλων των ειδοποιήσεων",
"Appear offline" : "Εμφάνιση εκτός σύνδεσης",
- "Clear status after" : "Εκκαθάριση κατάστασης μετά από",
"What's your status?" : "Ποια είναι η κατάστασή σας;"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/el.json b/apps/user_status/l10n/el.json
index b280061d1b7..9488237877c 100644
--- a/apps/user_status/l10n/el.json
+++ b/apps/user_status/l10n/el.json
@@ -31,7 +31,6 @@
"4 hours" : "4 ώρες",
"Mute all notifications" : "Σίγαση όλων των ειδοποιήσεων",
"Appear offline" : "Εμφάνιση εκτός σύνδεσης",
- "Clear status after" : "Εκκαθάριση κατάστασης μετά από",
"What's your status?" : "Ποια είναι η κατάστασή σας;"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/es.js b/apps/user_status/l10n/es.js
index bc12957e43e..2772f05eb84 100644
--- a/apps/user_status/l10n/es.js
+++ b/apps/user_status/l10n/es.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 horas",
"Mute all notifications" : "Silenciar todas las notificaciones",
"Appear offline" : "Aparecer sin conexión",
- "Clear status after" : "Eliminar el estado después de",
"What's your status?" : "¿Cuál es tu estado?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/es.json b/apps/user_status/l10n/es.json
index 8080e1d8fe9..689eca66c74 100644
--- a/apps/user_status/l10n/es.json
+++ b/apps/user_status/l10n/es.json
@@ -33,7 +33,6 @@
"4 hours" : "4 horas",
"Mute all notifications" : "Silenciar todas las notificaciones",
"Appear offline" : "Aparecer sin conexión",
- "Clear status after" : "Eliminar el estado después de",
"What's your status?" : "¿Cuál es tu estado?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/eu.js b/apps/user_status/l10n/eu.js
index de84012baf6..3570ea6f8f1 100644
--- a/apps/user_status/l10n/eu.js
+++ b/apps/user_status/l10n/eu.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 ordu",
"Mute all notifications" : "Mututu jakinarazpen guztiak",
"Appear offline" : "Lineaz kanpo agertu",
- "Clear status after" : "Garbitu egoera honen ondoren",
"What's your status?" : "Zein da zure egoera?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/eu.json b/apps/user_status/l10n/eu.json
index 2b4a99d25e8..61b8ec3bee0 100644
--- a/apps/user_status/l10n/eu.json
+++ b/apps/user_status/l10n/eu.json
@@ -33,7 +33,6 @@
"4 hours" : "4 ordu",
"Mute all notifications" : "Mututu jakinarazpen guztiak",
"Appear offline" : "Lineaz kanpo agertu",
- "Clear status after" : "Garbitu egoera honen ondoren",
"What's your status?" : "Zein da zure egoera?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/fi.js b/apps/user_status/l10n/fi.js
index 3c21a8a0f7a..248b2793723 100644
--- a/apps/user_status/l10n/fi.js
+++ b/apps/user_status/l10n/fi.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 tuntia",
"Mute all notifications" : "Mykistä kaikki ilmoitukset",
"Appear offline" : "Näytä olevan poissa",
- "Clear status after" : "Tyhjennä tilatieto",
"What's your status?" : "Mikä on tilatietosi?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/fi.json b/apps/user_status/l10n/fi.json
index d5972009da5..60ff001643c 100644
--- a/apps/user_status/l10n/fi.json
+++ b/apps/user_status/l10n/fi.json
@@ -33,7 +33,6 @@
"4 hours" : "4 tuntia",
"Mute all notifications" : "Mykistä kaikki ilmoitukset",
"Appear offline" : "Näytä olevan poissa",
- "Clear status after" : "Tyhjennä tilatieto",
"What's your status?" : "Mikä on tilatietosi?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/fr.js b/apps/user_status/l10n/fr.js
index 899cb8b52ea..01abc796d3c 100644
--- a/apps/user_status/l10n/fr.js
+++ b/apps/user_status/l10n/fr.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 heures",
"Mute all notifications" : "Désactiver toutes les notifications",
"Appear offline" : "Apparaitre hors-ligne",
- "Clear status after" : "Effacer l'état après",
"What's your status?" : "Quel est votre statut ?"
},
"nplurals=2; plural=(n > 1);");
diff --git a/apps/user_status/l10n/fr.json b/apps/user_status/l10n/fr.json
index 10f371719cb..a62900e8f1f 100644
--- a/apps/user_status/l10n/fr.json
+++ b/apps/user_status/l10n/fr.json
@@ -33,7 +33,6 @@
"4 hours" : "4 heures",
"Mute all notifications" : "Désactiver toutes les notifications",
"Appear offline" : "Apparaitre hors-ligne",
- "Clear status after" : "Effacer l'état après",
"What's your status?" : "Quel est votre statut ?"
},"pluralForm" :"nplurals=2; plural=(n > 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/gl.js b/apps/user_status/l10n/gl.js
index 240de552be3..23b8f0b1404 100644
--- a/apps/user_status/l10n/gl.js
+++ b/apps/user_status/l10n/gl.js
@@ -32,7 +32,6 @@ OC.L10N.register(
"4 hours" : "4 horas",
"Mute all notifications" : "Silenciar todas as notificacións",
"Appear offline" : "Aparece coma sen conexión",
- "Clear status after" : "Limpar o estado após",
"What's your status?" : "Cal é o seu estado?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/gl.json b/apps/user_status/l10n/gl.json
index ed1a564ad58..a49caa7658b 100644
--- a/apps/user_status/l10n/gl.json
+++ b/apps/user_status/l10n/gl.json
@@ -30,7 +30,6 @@
"4 hours" : "4 horas",
"Mute all notifications" : "Silenciar todas as notificacións",
"Appear offline" : "Aparece coma sen conexión",
- "Clear status after" : "Limpar o estado após",
"What's your status?" : "Cal é o seu estado?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/he.js b/apps/user_status/l10n/he.js
index 72f83e4c520..3b7bf0fde43 100644
--- a/apps/user_status/l10n/he.js
+++ b/apps/user_status/l10n/he.js
@@ -32,7 +32,6 @@ OC.L10N.register(
"4 hours" : "4 שעות",
"Mute all notifications" : "השתקת כל ההתראות",
"Appear offline" : "להופיע במצב בלתי מקוון",
- "Clear status after" : "לפנות את המצב לאחר",
"What's your status?" : "מה המצב שלך?"
},
"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;");
diff --git a/apps/user_status/l10n/he.json b/apps/user_status/l10n/he.json
index 41e38923a33..afcd9d8c8ca 100644
--- a/apps/user_status/l10n/he.json
+++ b/apps/user_status/l10n/he.json
@@ -30,7 +30,6 @@
"4 hours" : "4 שעות",
"Mute all notifications" : "השתקת כל ההתראות",
"Appear offline" : "להופיע במצב בלתי מקוון",
- "Clear status after" : "לפנות את המצב לאחר",
"What's your status?" : "מה המצב שלך?"
},"pluralForm" :"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/hr.js b/apps/user_status/l10n/hr.js
index 6babb39adf2..cd986995419 100644
--- a/apps/user_status/l10n/hr.js
+++ b/apps/user_status/l10n/hr.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 sata",
"Mute all notifications" : "Utišaj sve obavijesti",
"Appear offline" : "Prikaži izvanmrežno",
- "Clear status after" : "Izbriši status nakon",
"What's your status?" : "Koji je vaš status?"
},
"nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;");
diff --git a/apps/user_status/l10n/hr.json b/apps/user_status/l10n/hr.json
index 362e39fb2f0..b0270a29781 100644
--- a/apps/user_status/l10n/hr.json
+++ b/apps/user_status/l10n/hr.json
@@ -33,7 +33,6 @@
"4 hours" : "4 sata",
"Mute all notifications" : "Utišaj sve obavijesti",
"Appear offline" : "Prikaži izvanmrežno",
- "Clear status after" : "Izbriši status nakon",
"What's your status?" : "Koji je vaš status?"
},"pluralForm" :"nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/hu.js b/apps/user_status/l10n/hu.js
index 725340866ae..f0b4a269340 100644
--- a/apps/user_status/l10n/hu.js
+++ b/apps/user_status/l10n/hu.js
@@ -32,7 +32,6 @@ OC.L10N.register(
"4 hours" : "4 óra",
"Mute all notifications" : "Összes értesítés némítása",
"Appear offline" : "Offline módon jelenik meg",
- "Clear status after" : "Állapot törlése ennyi idő után",
"What's your status?" : "Mi az állapota?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/hu.json b/apps/user_status/l10n/hu.json
index 046716f58f6..1d74bd92ab0 100644
--- a/apps/user_status/l10n/hu.json
+++ b/apps/user_status/l10n/hu.json
@@ -30,7 +30,6 @@
"4 hours" : "4 óra",
"Mute all notifications" : "Összes értesítés némítása",
"Appear offline" : "Offline módon jelenik meg",
- "Clear status after" : "Állapot törlése ennyi idő után",
"What's your status?" : "Mi az állapota?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/is.js b/apps/user_status/l10n/is.js
index 2475cfba24b..953e729b5bf 100644
--- a/apps/user_status/l10n/is.js
+++ b/apps/user_status/l10n/is.js
@@ -33,7 +33,6 @@ OC.L10N.register(
"4 hours" : "4 klukkustundir",
"Mute all notifications" : "Þagga allar tilkynningar",
"Appear offline" : "Birtast ótengt",
- "Clear status after" : "Hreinsa stöðu eftir",
"What's your status?" : "Hver er staðan á þér?"
},
"nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);");
diff --git a/apps/user_status/l10n/is.json b/apps/user_status/l10n/is.json
index 187bd571846..4f4784fa4f0 100644
--- a/apps/user_status/l10n/is.json
+++ b/apps/user_status/l10n/is.json
@@ -31,7 +31,6 @@
"4 hours" : "4 klukkustundir",
"Mute all notifications" : "Þagga allar tilkynningar",
"Appear offline" : "Birtast ótengt",
- "Clear status after" : "Hreinsa stöðu eftir",
"What's your status?" : "Hver er staðan á þér?"
},"pluralForm" :"nplurals=2; plural=(n % 10 != 1 || n % 100 == 11);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/it.js b/apps/user_status/l10n/it.js
index 5fc210a62a8..491519dc102 100644
--- a/apps/user_status/l10n/it.js
+++ b/apps/user_status/l10n/it.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 ore",
"Mute all notifications" : "Silenzia tutte le notifiche",
"Appear offline" : "Mostrati non in linea",
- "Clear status after" : "Togli lo stato dopo",
"What's your status?" : "Qual è il tuo stato?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/it.json b/apps/user_status/l10n/it.json
index 16ed3a04e46..d1587ee699d 100644
--- a/apps/user_status/l10n/it.json
+++ b/apps/user_status/l10n/it.json
@@ -33,7 +33,6 @@
"4 hours" : "4 ore",
"Mute all notifications" : "Silenzia tutte le notifiche",
"Appear offline" : "Mostrati non in linea",
- "Clear status after" : "Togli lo stato dopo",
"What's your status?" : "Qual è il tuo stato?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/ja.js b/apps/user_status/l10n/ja.js
index 35fba4bc652..35c87d0647f 100644
--- a/apps/user_status/l10n/ja.js
+++ b/apps/user_status/l10n/ja.js
@@ -34,7 +34,6 @@ OC.L10N.register(
"4 hours" : "4時間",
"Mute all notifications" : "全ての通知をミュート",
"Appear offline" : "オフライン",
- "Clear status after" : "ステータスの有効期限",
"What's your status?" : "現在のオンラインステータスは?"
},
"nplurals=1; plural=0;");
diff --git a/apps/user_status/l10n/ja.json b/apps/user_status/l10n/ja.json
index 1430c501b4f..9aea78f7969 100644
--- a/apps/user_status/l10n/ja.json
+++ b/apps/user_status/l10n/ja.json
@@ -32,7 +32,6 @@
"4 hours" : "4時間",
"Mute all notifications" : "全ての通知をミュート",
"Appear offline" : "オフライン",
- "Clear status after" : "ステータスの有効期限",
"What's your status?" : "現在のオンラインステータスは?"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/ko.js b/apps/user_status/l10n/ko.js
index df42dcd02fa..2d270ed983a 100644
--- a/apps/user_status/l10n/ko.js
+++ b/apps/user_status/l10n/ko.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 시간",
"Mute all notifications" : "모든 알림을 무시합니다",
"Appear offline" : "접속 안함으로 표시",
- "Clear status after" : "상태 메시지 지우기 예약",
"What's your status?" : "지금 무엇을 하나요?"
},
"nplurals=1; plural=0;");
diff --git a/apps/user_status/l10n/ko.json b/apps/user_status/l10n/ko.json
index 34c679ba1d4..a5948eb8b61 100644
--- a/apps/user_status/l10n/ko.json
+++ b/apps/user_status/l10n/ko.json
@@ -33,7 +33,6 @@
"4 hours" : "4 시간",
"Mute all notifications" : "모든 알림을 무시합니다",
"Appear offline" : "접속 안함으로 표시",
- "Clear status after" : "상태 메시지 지우기 예약",
"What's your status?" : "지금 무엇을 하나요?"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/lt_LT.js b/apps/user_status/l10n/lt_LT.js
index 7c0f43a571d..ae9823e1c0e 100644
--- a/apps/user_status/l10n/lt_LT.js
+++ b/apps/user_status/l10n/lt_LT.js
@@ -34,7 +34,6 @@ OC.L10N.register(
"4 hours" : "4 valandos",
"Mute all notifications" : "Išjungti visus pranešimus",
"Appear offline" : "Atrodyti atsijungusiu",
- "Clear status after" : "Išvalyti būseną po",
"What's your status?" : "Kokia jūsų būsena?"
},
"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);");
diff --git a/apps/user_status/l10n/lt_LT.json b/apps/user_status/l10n/lt_LT.json
index 751d3f907d9..37cc733d0a1 100644
--- a/apps/user_status/l10n/lt_LT.json
+++ b/apps/user_status/l10n/lt_LT.json
@@ -32,7 +32,6 @@
"4 hours" : "4 valandos",
"Mute all notifications" : "Išjungti visus pranešimus",
"Appear offline" : "Atrodyti atsijungusiu",
- "Clear status after" : "Išvalyti būseną po",
"What's your status?" : "Kokia jūsų būsena?"
},"pluralForm" :"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/mk.js b/apps/user_status/l10n/mk.js
index 7ea365b8bdf..ca6e5ae528d 100644
--- a/apps/user_status/l10n/mk.js
+++ b/apps/user_status/l10n/mk.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 часа",
"Mute all notifications" : "Занеми (Mute) ги сите известувања",
"Appear offline" : "Прикажи исклучен",
- "Clear status after" : "Тргни го статусот после",
"What's your status?" : "Кој е вашиот статус?"
},
"nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;");
diff --git a/apps/user_status/l10n/mk.json b/apps/user_status/l10n/mk.json
index d075b892e6a..c1629cb8b51 100644
--- a/apps/user_status/l10n/mk.json
+++ b/apps/user_status/l10n/mk.json
@@ -33,7 +33,6 @@
"4 hours" : "4 часа",
"Mute all notifications" : "Занеми (Mute) ги сите известувања",
"Appear offline" : "Прикажи исклучен",
- "Clear status after" : "Тргни го статусот после",
"What's your status?" : "Кој е вашиот статус?"
},"pluralForm" :"nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/nb.js b/apps/user_status/l10n/nb.js
index e8bea179345..78ae951ef19 100644
--- a/apps/user_status/l10n/nb.js
+++ b/apps/user_status/l10n/nb.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 timer",
"Mute all notifications" : "Demp alle varslinger",
"Appear offline" : "Vis som frakoblet",
- "Clear status after" : "Fjern status etter",
"What's your status?" : "Hva er din status?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/nb.json b/apps/user_status/l10n/nb.json
index 0e303e94fb6..0e2d5cb3824 100644
--- a/apps/user_status/l10n/nb.json
+++ b/apps/user_status/l10n/nb.json
@@ -33,7 +33,6 @@
"4 hours" : "4 timer",
"Mute all notifications" : "Demp alle varslinger",
"Appear offline" : "Vis som frakoblet",
- "Clear status after" : "Fjern status etter",
"What's your status?" : "Hva er din status?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/nl.js b/apps/user_status/l10n/nl.js
index db5ad6cb172..7861577cbbc 100644
--- a/apps/user_status/l10n/nl.js
+++ b/apps/user_status/l10n/nl.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 uur",
"Mute all notifications" : "Onderdruk alle meldingen",
"Appear offline" : "Toon afwezig",
- "Clear status after" : "Maak de status leeg na",
"What's your status?" : "Wat is je status?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/nl.json b/apps/user_status/l10n/nl.json
index 44d33d2f42d..3c1adb39f68 100644
--- a/apps/user_status/l10n/nl.json
+++ b/apps/user_status/l10n/nl.json
@@ -33,7 +33,6 @@
"4 hours" : "4 uur",
"Mute all notifications" : "Onderdruk alle meldingen",
"Appear offline" : "Toon afwezig",
- "Clear status after" : "Maak de status leeg na",
"What's your status?" : "Wat is je status?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/oc.js b/apps/user_status/l10n/oc.js
index be123c4273c..dead048130f 100644
--- a/apps/user_status/l10n/oc.js
+++ b/apps/user_status/l10n/oc.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 oras",
"Mute all notifications" : "Amudir totas las notificacions",
"Appear offline" : "Aparéisser fòra linha",
- "Clear status after" : "Escafar l’estat aprèp",
"What's your status?" : "Quin es vòstre estat ?"
},
"nplurals=2; plural=(n > 1);");
diff --git a/apps/user_status/l10n/oc.json b/apps/user_status/l10n/oc.json
index 541d36fc3d7..7a8ad9554f7 100644
--- a/apps/user_status/l10n/oc.json
+++ b/apps/user_status/l10n/oc.json
@@ -33,7 +33,6 @@
"4 hours" : "4 oras",
"Mute all notifications" : "Amudir totas las notificacions",
"Appear offline" : "Aparéisser fòra linha",
- "Clear status after" : "Escafar l’estat aprèp",
"What's your status?" : "Quin es vòstre estat ?"
},"pluralForm" :"nplurals=2; plural=(n > 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/pl.js b/apps/user_status/l10n/pl.js
index d18edff5468..e77f95de04e 100644
--- a/apps/user_status/l10n/pl.js
+++ b/apps/user_status/l10n/pl.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 godziny",
"Mute all notifications" : "Wycisz wszystkie powiadomienia",
"Appear offline" : "Widnieje jako offline",
- "Clear status after" : "Wyczyść status po",
"What's your status?" : "Jaki jest Twój status?"
},
"nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);");
diff --git a/apps/user_status/l10n/pl.json b/apps/user_status/l10n/pl.json
index 057c49fb4a5..528ff7d9f9c 100644
--- a/apps/user_status/l10n/pl.json
+++ b/apps/user_status/l10n/pl.json
@@ -33,7 +33,6 @@
"4 hours" : "4 godziny",
"Mute all notifications" : "Wycisz wszystkie powiadomienia",
"Appear offline" : "Widnieje jako offline",
- "Clear status after" : "Wyczyść status po",
"What's your status?" : "Jaki jest Twój status?"
},"pluralForm" :"nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/pt_BR.js b/apps/user_status/l10n/pt_BR.js
index 1f2ef78dcf4..a4b95c86569 100644
--- a/apps/user_status/l10n/pt_BR.js
+++ b/apps/user_status/l10n/pt_BR.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 horas",
"Mute all notifications" : "Silenciar todas as notificações",
"Appear offline" : "Aparecer offline",
- "Clear status after" : "Limpar status após",
"What's your status?" : "Qual é o seu status?"
},
"nplurals=2; plural=(n > 1);");
diff --git a/apps/user_status/l10n/pt_BR.json b/apps/user_status/l10n/pt_BR.json
index f76748b0fc2..4c73045cfce 100644
--- a/apps/user_status/l10n/pt_BR.json
+++ b/apps/user_status/l10n/pt_BR.json
@@ -33,7 +33,6 @@
"4 hours" : "4 horas",
"Mute all notifications" : "Silenciar todas as notificações",
"Appear offline" : "Aparecer offline",
- "Clear status after" : "Limpar status após",
"What's your status?" : "Qual é o seu status?"
},"pluralForm" :"nplurals=2; plural=(n > 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/pt_PT.js b/apps/user_status/l10n/pt_PT.js
index 842f6d26a7f..63bce5917ae 100644
--- a/apps/user_status/l10n/pt_PT.js
+++ b/apps/user_status/l10n/pt_PT.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 horas",
"Mute all notifications" : "Desativar todas as notificações",
"Appear offline" : "Aparecer offline",
- "Clear status after" : "Limpar mensagem de estado após",
"What's your status?" : "Qual é o seu estado?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/pt_PT.json b/apps/user_status/l10n/pt_PT.json
index 3f761a0372a..243d1a4512b 100644
--- a/apps/user_status/l10n/pt_PT.json
+++ b/apps/user_status/l10n/pt_PT.json
@@ -33,7 +33,6 @@
"4 hours" : "4 horas",
"Mute all notifications" : "Desativar todas as notificações",
"Appear offline" : "Aparecer offline",
- "Clear status after" : "Limpar mensagem de estado após",
"What's your status?" : "Qual é o seu estado?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/ru.js b/apps/user_status/l10n/ru.js
index ed32cd16a14..afe0ce63846 100644
--- a/apps/user_status/l10n/ru.js
+++ b/apps/user_status/l10n/ru.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 часа",
"Mute all notifications" : "Отключить все уведомления",
"Appear offline" : "Возможно, не в сети",
- "Clear status after" : "Удалить статус через",
"What's your status?" : "Укажите свой статус"
},
"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);");
diff --git a/apps/user_status/l10n/ru.json b/apps/user_status/l10n/ru.json
index 1d8d5c0aab9..0161434c967 100644
--- a/apps/user_status/l10n/ru.json
+++ b/apps/user_status/l10n/ru.json
@@ -33,7 +33,6 @@
"4 hours" : "4 часа",
"Mute all notifications" : "Отключить все уведомления",
"Appear offline" : "Возможно, не в сети",
- "Clear status after" : "Удалить статус через",
"What's your status?" : "Укажите свой статус"
},"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/sc.js b/apps/user_status/l10n/sc.js
index e5050c897b0..3acce4731fa 100644
--- a/apps/user_status/l10n/sc.js
+++ b/apps/user_status/l10n/sc.js
@@ -32,7 +32,6 @@ OC.L10N.register(
"4 hours" : "4 oras",
"Mute all notifications" : "Istuda totu is notìficas",
"Appear offline" : "Mustra•ti foras de lìnia",
- "Clear status after" : "Lìmpia s'istadu a pustis",
"What's your status?" : "Cale est s'istadu tuo?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/sc.json b/apps/user_status/l10n/sc.json
index 6029fb8c743..86f74faf36e 100644
--- a/apps/user_status/l10n/sc.json
+++ b/apps/user_status/l10n/sc.json
@@ -30,7 +30,6 @@
"4 hours" : "4 oras",
"Mute all notifications" : "Istuda totu is notìficas",
"Appear offline" : "Mustra•ti foras de lìnia",
- "Clear status after" : "Lìmpia s'istadu a pustis",
"What's your status?" : "Cale est s'istadu tuo?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/sk.js b/apps/user_status/l10n/sk.js
index b066a63b73e..d97a6ec4df2 100644
--- a/apps/user_status/l10n/sk.js
+++ b/apps/user_status/l10n/sk.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 hodiny",
"Mute all notifications" : "Stíšiť všetky upozornenia",
"Appear offline" : "V odpojenom režime",
- "Clear status after" : "Vyčistiť správu o stave po",
"What's your status?" : "Aký je váš stav?"
},
"nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);");
diff --git a/apps/user_status/l10n/sk.json b/apps/user_status/l10n/sk.json
index cc03c950da1..7bb3f9c56a8 100644
--- a/apps/user_status/l10n/sk.json
+++ b/apps/user_status/l10n/sk.json
@@ -33,7 +33,6 @@
"4 hours" : "4 hodiny",
"Mute all notifications" : "Stíšiť všetky upozornenia",
"Appear offline" : "V odpojenom režime",
- "Clear status after" : "Vyčistiť správu o stave po",
"What's your status?" : "Aký je váš stav?"
},"pluralForm" :"nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/sl.js b/apps/user_status/l10n/sl.js
index 2a1cff890e0..0909507c34d 100644
--- a/apps/user_status/l10n/sl.js
+++ b/apps/user_status/l10n/sl.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "po 4 urah",
"Mute all notifications" : "Utiša vsa obvestila",
"Appear offline" : "Pokaže kot brez povezave",
- "Clear status after" : "Počisti stanje",
"What's your status?" : "Kako želite nastaviti stanje?"
},
"nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);");
diff --git a/apps/user_status/l10n/sl.json b/apps/user_status/l10n/sl.json
index 338d57e4fd1..ab1638778c7 100644
--- a/apps/user_status/l10n/sl.json
+++ b/apps/user_status/l10n/sl.json
@@ -33,7 +33,6 @@
"4 hours" : "po 4 urah",
"Mute all notifications" : "Utiša vsa obvestila",
"Appear offline" : "Pokaže kot brez povezave",
- "Clear status after" : "Počisti stanje",
"What's your status?" : "Kako želite nastaviti stanje?"
},"pluralForm" :"nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/sv.js b/apps/user_status/l10n/sv.js
index 41c7bdd9a58..1ce860a949e 100644
--- a/apps/user_status/l10n/sv.js
+++ b/apps/user_status/l10n/sv.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 timmar",
"Mute all notifications" : "Dölj alla aviseringar",
"Appear offline" : "Visa som frånkopplad",
- "Clear status after" : "Rensa status efter",
"What's your status?" : "Vad är din status?"
},
"nplurals=2; plural=(n != 1);");
diff --git a/apps/user_status/l10n/sv.json b/apps/user_status/l10n/sv.json
index 2a1de6d2cb1..52ecbee3bed 100644
--- a/apps/user_status/l10n/sv.json
+++ b/apps/user_status/l10n/sv.json
@@ -33,7 +33,6 @@
"4 hours" : "4 timmar",
"Mute all notifications" : "Dölj alla aviseringar",
"Appear offline" : "Visa som frånkopplad",
- "Clear status after" : "Rensa status efter",
"What's your status?" : "Vad är din status?"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/th.js b/apps/user_status/l10n/th.js
index dc7e2341a83..e2d4a9b1e5c 100644
--- a/apps/user_status/l10n/th.js
+++ b/apps/user_status/l10n/th.js
@@ -32,7 +32,6 @@ OC.L10N.register(
"4 hours" : "4 ชั่วโมง",
"Mute all notifications" : "ปิดการแจ้งเตือนทั้งหมด",
"Appear offline" : "แสดงเป็นออฟไลน์",
- "Clear status after" : "ล้างสถานะหลังจาก",
"What's your status?" : "สถานะของคุณคืออะไร"
},
"nplurals=1; plural=0;");
diff --git a/apps/user_status/l10n/th.json b/apps/user_status/l10n/th.json
index 2c092ac0a0d..bb6364a7eb5 100644
--- a/apps/user_status/l10n/th.json
+++ b/apps/user_status/l10n/th.json
@@ -30,7 +30,6 @@
"4 hours" : "4 ชั่วโมง",
"Mute all notifications" : "ปิดการแจ้งเตือนทั้งหมด",
"Appear offline" : "แสดงเป็นออฟไลน์",
- "Clear status after" : "ล้างสถานะหลังจาก",
"What's your status?" : "สถานะของคุณคืออะไร"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/tr.js b/apps/user_status/l10n/tr.js
index 06fc3543080..b9082b44da5 100644
--- a/apps/user_status/l10n/tr.js
+++ b/apps/user_status/l10n/tr.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 saat",
"Mute all notifications" : "Tüm bildirimleri kapat",
"Appear offline" : "Çevrimdışı görün",
- "Clear status after" : "Durum şu kadar sonra kaldırılsın",
"What's your status?" : "Durumunuz nedir?"
},
"nplurals=2; plural=(n > 1);");
diff --git a/apps/user_status/l10n/tr.json b/apps/user_status/l10n/tr.json
index 57e91e81c84..f0a52887536 100644
--- a/apps/user_status/l10n/tr.json
+++ b/apps/user_status/l10n/tr.json
@@ -33,7 +33,6 @@
"4 hours" : "4 saat",
"Mute all notifications" : "Tüm bildirimleri kapat",
"Appear offline" : "Çevrimdışı görün",
- "Clear status after" : "Durum şu kadar sonra kaldırılsın",
"What's your status?" : "Durumunuz nedir?"
},"pluralForm" :"nplurals=2; plural=(n > 1);"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/zh_CN.js b/apps/user_status/l10n/zh_CN.js
index efc2446d528..d37d0687b89 100644
--- a/apps/user_status/l10n/zh_CN.js
+++ b/apps/user_status/l10n/zh_CN.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 小时",
"Mute all notifications" : "静音所有通知",
"Appear offline" : "显示为离线",
- "Clear status after" : "清除状态于",
"What's your status?" : "您现在是什么状态?"
},
"nplurals=1; plural=0;");
diff --git a/apps/user_status/l10n/zh_CN.json b/apps/user_status/l10n/zh_CN.json
index 66a032b9590..1eb70482ecc 100644
--- a/apps/user_status/l10n/zh_CN.json
+++ b/apps/user_status/l10n/zh_CN.json
@@ -33,7 +33,6 @@
"4 hours" : "4 小时",
"Mute all notifications" : "静音所有通知",
"Appear offline" : "显示为离线",
- "Clear status after" : "清除状态于",
"What's your status?" : "您现在是什么状态?"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/zh_HK.js b/apps/user_status/l10n/zh_HK.js
index b647ff71a6f..c6c385c93d3 100644
--- a/apps/user_status/l10n/zh_HK.js
+++ b/apps/user_status/l10n/zh_HK.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4 小時",
"Mute all notifications" : "靜音所有通知",
"Appear offline" : "顯示為離線",
- "Clear status after" : "繼此之後清空狀態",
"What's your status?" : "你目前的狀態?"
},
"nplurals=1; plural=0;");
diff --git a/apps/user_status/l10n/zh_HK.json b/apps/user_status/l10n/zh_HK.json
index 2fca0a5c56d..f9aaaa1f6ea 100644
--- a/apps/user_status/l10n/zh_HK.json
+++ b/apps/user_status/l10n/zh_HK.json
@@ -33,7 +33,6 @@
"4 hours" : "4 小時",
"Mute all notifications" : "靜音所有通知",
"Appear offline" : "顯示為離線",
- "Clear status after" : "繼此之後清空狀態",
"What's your status?" : "你目前的狀態?"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/user_status/l10n/zh_TW.js b/apps/user_status/l10n/zh_TW.js
index b959fed83ce..2b8bb4b6c15 100644
--- a/apps/user_status/l10n/zh_TW.js
+++ b/apps/user_status/l10n/zh_TW.js
@@ -35,7 +35,6 @@ OC.L10N.register(
"4 hours" : "4小時",
"Mute all notifications" : "所有通知靜音",
"Appear offline" : "顯示為離線",
- "Clear status after" : "清空狀態於……之後",
"What's your status?" : "您現在的狀態?"
},
"nplurals=1; plural=0;");
diff --git a/apps/user_status/l10n/zh_TW.json b/apps/user_status/l10n/zh_TW.json
index a82f2d42e50..7990e9b54e3 100644
--- a/apps/user_status/l10n/zh_TW.json
+++ b/apps/user_status/l10n/zh_TW.json
@@ -33,7 +33,6 @@
"4 hours" : "4小時",
"Mute all notifications" : "所有通知靜音",
"Appear offline" : "顯示為離線",
- "Clear status after" : "清空狀態於……之後",
"What's your status?" : "您現在的狀態?"
},"pluralForm" :"nplurals=1; plural=0;"
} \ No newline at end of file
diff --git a/apps/user_status/lib/Connector/UserStatusProvider.php b/apps/user_status/lib/Connector/UserStatusProvider.php
index f3f4c5f710e..46b89739f7c 100644
--- a/apps/user_status/lib/Connector/UserStatusProvider.php
+++ b/apps/user_status/lib/Connector/UserStatusProvider.php
@@ -57,17 +57,15 @@ class UserStatusProvider implements IProvider, ISettableProvider {
return $userStatuses;
}
- public function setUserStatus(string $userId, string $messageId, string $status, bool $createBackup = false): void {
- if ($createBackup) {
- if ($this->service->backupCurrentStatus($userId) === false) {
- return; // Already a status set automatically => abort.
- }
- }
- $this->service->setStatus($userId, $status, null, true);
- $this->service->setPredefinedMessage($userId, $messageId, null);
+ public function setUserStatus(string $userId, string $messageId, string $status, bool $createBackup): void {
+ $this->service->setUserStatus($userId, $status, $messageId, $createBackup);
}
public function revertUserStatus(string $userId, string $messageId, string $status): void {
$this->service->revertUserStatus($userId, $messageId, $status);
}
+
+ public function revertMultipleUserStatus(array $userIds, string $messageId, string $status): void {
+ $this->service->revertMultipleUserStatus($userIds, $messageId, $status);
+ }
}
diff --git a/apps/user_status/lib/Db/UserStatusMapper.php b/apps/user_status/lib/Db/UserStatusMapper.php
index 51f1b270b45..f67cfcd472d 100644
--- a/apps/user_status/lib/Db/UserStatusMapper.php
+++ b/apps/user_status/lib/Db/UserStatusMapper.php
@@ -101,8 +101,7 @@ class UserStatusMapper extends QBMapper {
$qb
->select('*')
->from($this->tableName)
- ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($isBackup ? '_' . $userId : $userId, IQueryBuilder::PARAM_STR)))
- ->andWhere($qb->expr()->eq('is_backup', $qb->createNamedParameter($isBackup, IQueryBuilder::PARAM_BOOL)));
+ ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($isBackup ? '_' . $userId : $userId, IQueryBuilder::PARAM_STR)));
return $this->findEntity($qb);
}
@@ -111,7 +110,7 @@ class UserStatusMapper extends QBMapper {
* @param array $userIds
* @return array
*/
- public function findByUserIds(array $userIds):array {
+ public function findByUserIds(array $userIds): array {
$qb = $this->db->getQueryBuilder();
$qb
->select('*')
@@ -158,4 +157,57 @@ class UserStatusMapper extends QBMapper {
$qb->execute();
}
+
+
+ /**
+ * Deletes a user status so we can restore the backup
+ *
+ * @param string $userId
+ * @param string $messageId
+ * @param string $status
+ * @return bool True if an entry was deleted
+ */
+ public function deleteCurrentStatusToRestoreBackup(string $userId, string $messageId, string $status): bool {
+ $qb = $this->db->getQueryBuilder();
+ $qb->delete($this->tableName)
+ ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)))
+ ->andWhere($qb->expr()->eq('message_id', $qb->createNamedParameter($messageId)))
+ ->andWhere($qb->expr()->eq('status', $qb->createNamedParameter($status)))
+ ->andWhere($qb->expr()->eq('is_backup', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL)));
+ return $qb->executeStatement() > 0;
+ }
+
+ public function deleteByIds(array $ids): void {
+ $qb = $this->db->getQueryBuilder();
+ $qb->delete($this->tableName)
+ ->where($qb->expr()->in('id', $qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)));
+ $qb->executeStatement();
+ }
+
+ /**
+ * @param string $userId
+ * @return bool
+ * @throws \OCP\DB\Exception
+ */
+ public function createBackupStatus(string $userId): bool {
+ // Prefix user account with an underscore because user_id is marked as unique
+ // in the table. Starting a username with an underscore is not allowed so this
+ // shouldn't create any trouble.
+ $qb = $this->db->getQueryBuilder();
+ $qb->update($this->tableName)
+ ->set('is_backup', $qb->createNamedParameter(true, IQueryBuilder::PARAM_BOOL))
+ ->set('user_id', $qb->createNamedParameter('_' . $userId))
+ ->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
+ return $qb->executeStatement() > 0;
+ }
+
+ public function restoreBackupStatuses(array $ids): void {
+ $qb = $this->db->getQueryBuilder();
+ $qb->update($this->tableName)
+ ->set('is_backup', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL))
+ ->set('user_id', $qb->func()->substring('user_id', $qb->createNamedParameter(2, IQueryBuilder::PARAM_INT)))
+ ->where($qb->expr()->in('id', $qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)));
+
+ $qb->executeStatement();
+ }
}
diff --git a/apps/user_status/lib/Service/StatusService.php b/apps/user_status/lib/Service/StatusService.php
index ad50a541a00..c7ad7afe322 100644
--- a/apps/user_status/lib/Service/StatusService.php
+++ b/apps/user_status/lib/Service/StatusService.php
@@ -35,7 +35,9 @@ use OCA\UserStatus\Exception\InvalidStatusTypeException;
use OCA\UserStatus\Exception\StatusMessageTooLongException;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\DB\Exception;
use OCP\IConfig;
+use OCP\IUser;
use OCP\UserStatus\IUserStatus;
/**
@@ -229,6 +231,7 @@ class StatusService {
$userStatus->setStatus(IUserStatus::OFFLINE);
$userStatus->setStatusTimestamp(0);
$userStatus->setIsUserDefined(false);
+ $userStatus->setIsBackup(false);
}
if (!$this->predefinedStatusService->isValidId($messageId)) {
@@ -254,6 +257,60 @@ class StatusService {
/**
* @param string $userId
+ * @param string $status
+ * @param string $messageId
+ * @param bool $createBackup
+ * @throws InvalidStatusTypeException
+ * @throws InvalidMessageIdException
+ */
+ public function setUserStatus(string $userId,
+ string $status,
+ string $messageId,
+ bool $createBackup): void {
+ // Check if status-type is valid
+ if (!\in_array($status, self::PRIORITY_ORDERED_STATUSES, true)) {
+ throw new InvalidStatusTypeException('Status-type "' . $status . '" is not supported');
+ }
+
+ if (!$this->predefinedStatusService->isValidId($messageId)) {
+ throw new InvalidMessageIdException('Message-Id "' . $messageId . '" is not supported');
+ }
+
+ if ($createBackup) {
+ if ($this->backupCurrentStatus($userId) === false) {
+ return; // Already a status set automatically => abort.
+ }
+
+ // If we just created the backup
+ $userStatus = new UserStatus();
+ $userStatus->setUserId($userId);
+ } else {
+ try {
+ $userStatus = $this->mapper->findByUserId($userId);
+ } catch (DoesNotExistException $ex) {
+ $userStatus = new UserStatus();
+ $userStatus->setUserId($userId);
+ }
+ }
+
+ $userStatus->setStatus($status);
+ $userStatus->setStatusTimestamp($this->timeFactory->getTime());
+ $userStatus->setIsUserDefined(false);
+ $userStatus->setIsBackup(false);
+ $userStatus->setMessageId($messageId);
+ $userStatus->setCustomIcon(null);
+ $userStatus->setCustomMessage(null);
+ $userStatus->setClearAt(null);
+
+ if ($userStatus->getId() !== null) {
+ $this->mapper->update($userStatus);
+ return;
+ }
+ $this->mapper->insert($userStatus);
+ }
+
+ /**
+ * @param string $userId
* @param string|null $statusIcon
* @param string $message
* @param int|null $clearAt
@@ -434,33 +491,21 @@ class StatusService {
}
/**
- * @return bool false iff there is already a backup. In this case abort the procedure.
+ * @return bool false if there is already a backup. In this case abort the procedure.
*/
public function backupCurrentStatus(string $userId): bool {
try {
- $this->mapper->findByUserId($userId, true);
- return false;
- } catch (DoesNotExistException $ex) {
- // No backup already existing => Good
- }
-
- try {
- $userStatus = $this->mapper->findByUserId($userId);
- } catch (DoesNotExistException $ex) {
- // if there is no status to backup, just return
+ $this->mapper->createBackupStatus($userId);
return true;
+ } catch (Exception $ex) {
+ if ($ex->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
+ return false;
+ }
+ throw $ex;
}
-
- $userStatus->setIsBackup(true);
- // Prefix user account with an underscore because user_id is marked as unique
- // in the table. Starting an username with an underscore is not allowed so this
- // shouldn't create any trouble.
- $userStatus->setUserId('_' . $userStatus->getUserId());
- $this->mapper->update($userStatus);
- return true;
}
- public function revertUserStatus(string $userId, ?string $messageId, string $status): void {
+ public function revertUserStatus(string $userId, string $messageId, string $status): void {
try {
/** @var UserStatus $userStatus */
$backupUserStatus = $this->mapper->findByUserId($userId, true);
@@ -468,19 +513,49 @@ class StatusService {
// No user status to revert, do nothing
return;
}
- try {
- $userStatus = $this->mapper->findByUserId($userId);
- if ($userStatus->getMessageId() !== $messageId || $userStatus->getStatus() !== $status) {
- // Another status is set automatically, do nothing
- return;
- }
- $this->removeUserStatus($userId);
- } catch (DoesNotExistException $ex) {
- // No current status => nothing to delete
+
+ $deleted = $this->mapper->deleteCurrentStatusToRestoreBackup($userId, $messageId, $status);
+ if (!$deleted) {
+ // Another status is set automatically or no status, do nothing
+ return;
}
+
$backupUserStatus->setIsBackup(false);
// Remove the underscore prefix added when creating the backup
$backupUserStatus->setUserId(substr($backupUserStatus->getUserId(), 1));
$this->mapper->update($backupUserStatus);
}
+
+ public function revertMultipleUserStatus(array $userIds, string $messageId, string $status): void {
+ // Get all user statuses and the backups
+ $findById = $userIds;
+ foreach ($userIds as $userId) {
+ $findById[] = '_' . $userId;
+ }
+ $userStatuses = $this->mapper->findByUserIds($findById);
+
+ $backups = $restoreIds = $statuesToDelete = [];
+ foreach ($userStatuses as $userStatus) {
+ if (!$userStatus->getIsBackup()
+ && $userStatus->getMessageId() === $messageId
+ && $userStatus->getStatus() === $status) {
+ $statuesToDelete[$userStatus->getUserId()] = $userStatus->getId();
+ } else if ($userStatus->getIsBackup()) {
+ $backups[$userStatus->getUserId()] = $userStatus->getId();
+ }
+ }
+
+ // For users with both (normal and backup) delete the status when matching
+ foreach ($statuesToDelete as $userId => $statusId) {
+ $backupUserId = '_' . $userId;
+ if (isset($backups[$backupUserId])) {
+ $restoreIds[] = $backups[$backupUserId];
+ }
+ }
+
+ $this->mapper->deleteByIds(array_values($statuesToDelete));
+
+ // For users that matched restore the previous status
+ $this->mapper->restoreBackupStatuses($restoreIds);
+ }
}
diff --git a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
index ddb067b862b..0d9f1c1f718 100644
--- a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
+++ b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
@@ -251,4 +251,117 @@ class UserStatusMapperTest extends TestCase {
$this->mapper->insert($userStatus2);
$this->mapper->insert($userStatus3);
}
+
+ public function dataCreateBackupStatus(): array {
+ return [
+ [false, false, false],
+ [true, false, true],
+ [false, true, false],
+ [true, true, false],
+ ];
+ }
+
+ /**
+ * @dataProvider dataCreateBackupStatus
+ * @param bool $hasStatus
+ * @param bool $hasBackup
+ * @param bool $backupCreated
+ */
+ public function testCreateBackupStatus(bool $hasStatus, bool $hasBackup, bool $backupCreated): void {
+ if ($hasStatus) {
+ $userStatus1 = new UserStatus();
+ $userStatus1->setUserId('user1');
+ $userStatus1->setStatus('online');
+ $userStatus1->setStatusTimestamp(5000);
+ $userStatus1->setIsUserDefined(true);
+ $userStatus1->setIsBackup(false);
+ $userStatus1->setCustomIcon('🚀');
+ $userStatus1->setCustomMessage('Current');
+ $userStatus1->setClearAt(50000);
+ $this->mapper->insert($userStatus1);
+ }
+
+ if ($hasBackup) {
+ $userStatus1 = new UserStatus();
+ $userStatus1->setUserId('_user1');
+ $userStatus1->setStatus('online');
+ $userStatus1->setStatusTimestamp(5000);
+ $userStatus1->setIsUserDefined(true);
+ $userStatus1->setIsBackup(true);
+ $userStatus1->setCustomIcon('🚀');
+ $userStatus1->setCustomMessage('Backup');
+ $userStatus1->setClearAt(50000);
+ $this->mapper->insert($userStatus1);
+ }
+
+ if ($hasStatus && $hasBackup) {
+ $this->expectException(Exception::class);
+ }
+
+ self::assertSame($backupCreated, $this->mapper->createBackupStatus('user1'));
+
+ if ($backupCreated) {
+ $user1Status = $this->mapper->findByUserId('user1', true);
+ $this->assertEquals('_user1', $user1Status->getUserId());
+ $this->assertEquals(true, $user1Status->getIsBackup());
+ $this->assertEquals('Current', $user1Status->getCustomMessage());
+ } else if ($hasBackup) {
+ $user1Status = $this->mapper->findByUserId('user1', true);
+ $this->assertEquals('_user1', $user1Status->getUserId());
+ $this->assertEquals(true, $user1Status->getIsBackup());
+ $this->assertEquals('Backup', $user1Status->getCustomMessage());
+ }
+ }
+
+ public function testRestoreBackupStatuses(): void {
+ $userStatus1 = new UserStatus();
+ $userStatus1->setUserId('_user1');
+ $userStatus1->setStatus('online');
+ $userStatus1->setStatusTimestamp(5000);
+ $userStatus1->setIsUserDefined(true);
+ $userStatus1->setIsBackup(true);
+ $userStatus1->setCustomIcon('🚀');
+ $userStatus1->setCustomMessage('Releasing');
+ $userStatus1->setClearAt(50000);
+ $userStatus1 = $this->mapper->insert($userStatus1);
+
+ $userStatus2 = new UserStatus();
+ $userStatus2->setUserId('_user2');
+ $userStatus2->setStatus('away');
+ $userStatus2->setStatusTimestamp(5000);
+ $userStatus2->setIsUserDefined(true);
+ $userStatus2->setIsBackup(true);
+ $userStatus2->setCustomIcon('💩');
+ $userStatus2->setCustomMessage('Do not disturb');
+ $userStatus2->setClearAt(50000);
+ $userStatus2 = $this->mapper->insert($userStatus2);
+
+ $userStatus3 = new UserStatus();
+ $userStatus3->setUserId('_user3');
+ $userStatus3->setStatus('away');
+ $userStatus3->setStatusTimestamp(5000);
+ $userStatus3->setIsUserDefined(true);
+ $userStatus3->setIsBackup(true);
+ $userStatus3->setCustomIcon('🏝️');
+ $userStatus3->setCustomMessage('Vacationing');
+ $userStatus3->setClearAt(50000);
+ $this->mapper->insert($userStatus3);
+
+ $this->mapper->restoreBackupStatuses([$userStatus1->getId(), $userStatus2->getId()]);
+
+ $user1Status = $this->mapper->findByUserId('user1', false);
+ $this->assertEquals('user1', $user1Status->getUserId());
+ $this->assertEquals(false, $user1Status->getIsBackup());
+ $this->assertEquals('Releasing', $user1Status->getCustomMessage());
+
+ $user2Status = $this->mapper->findByUserId('user2', false);
+ $this->assertEquals('user2', $user2Status->getUserId());
+ $this->assertEquals(false, $user2Status->getIsBackup());
+ $this->assertEquals('Do not disturb', $user2Status->getCustomMessage());
+
+ $user3Status = $this->mapper->findByUserId('user3', true);
+ $this->assertEquals('_user3', $user3Status->getUserId());
+ $this->assertEquals(true, $user3Status->getIsBackup());
+ $this->assertEquals('Vacationing', $user3Status->getCustomMessage());
+ }
}
diff --git a/apps/user_status/tests/Unit/Service/StatusServiceTest.php b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
index a7c183eae04..3dd397e1d36 100644
--- a/apps/user_status/tests/Unit/Service/StatusServiceTest.php
+++ b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
@@ -26,6 +26,8 @@ declare(strict_types=1);
*/
namespace OCA\UserStatus\Tests\Service;
+use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
+use OC\DB\Exceptions\DbalException;
use OCA\UserStatus\Db\UserStatus;
use OCA\UserStatus\Db\UserStatusMapper;
use OCA\UserStatus\Exception\InvalidClearAtException;
@@ -38,6 +40,7 @@ use OCA\UserStatus\Service\PredefinedStatusService;
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\DB\Exception;
use OCP\IConfig;
use OCP\UserStatus\IUserStatus;
use Test\TestCase;
@@ -723,52 +726,93 @@ class StatusServiceTest extends TestCase {
parent::invokePrivate($this->service, 'cleanStatus', [$status]);
}
- public function testBackupWorkingHasBackupAlready() {
- $status = new UserStatus();
- $status->setStatus(IUserStatus::ONLINE);
- $status->setStatusTimestamp(1337);
- $status->setIsUserDefined(true);
- $status->setMessageId('meeting');
- $status->setUserId('john');
- $status->setIsBackup(true);
+ public function testBackupWorkingHasBackupAlready(): void {
+ $p = $this->createMock(UniqueConstraintViolationException::class);
+ $e = DbalException::wrap($p);
+ $this->mapper->expects($this->once())
+ ->method('createBackupStatus')
+ ->with('john')
+ ->willThrowException($e);
+ $this->assertFalse($this->service->backupCurrentStatus('john'));
+ }
+
+ public function testBackupThrowsOther(): void {
+ $e = new Exception('', Exception::REASON_CONNECTION_LOST);
$this->mapper->expects($this->once())
- ->method('findByUserId')
- ->with('john', true)
- ->willReturn($status);
+ ->method('createBackupStatus')
+ ->with('john')
+ ->willThrowException($e);
+ $this->expectException(Exception::class);
$this->service->backupCurrentStatus('john');
}
- public function testBackup() {
- $currentStatus = new UserStatus();
- $currentStatus->setStatus(IUserStatus::ONLINE);
- $currentStatus->setStatusTimestamp(1337);
- $currentStatus->setIsUserDefined(true);
- $currentStatus->setMessageId('meeting');
- $currentStatus->setUserId('john');
+ public function testBackup(): void {
+ $e = new Exception('', Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION);
+ $this->mapper->expects($this->once())
+ ->method('createBackupStatus')
+ ->with('john')
+ ->willReturn(true);
- $this->mapper->expects($this->at(0))
- ->method('findByUserId')
- ->with('john', true)
- ->willThrowException(new DoesNotExistException(''));
- $this->mapper->expects($this->at(1))
- ->method('findByUserId')
- ->with('john', false)
- ->willReturn($currentStatus);
+ $this->assertTrue($this->service->backupCurrentStatus('john'));
+ }
- $newBackupStatus = new UserStatus();
- $newBackupStatus->setStatus(IUserStatus::ONLINE);
- $newBackupStatus->setStatusTimestamp(1337);
- $newBackupStatus->setIsUserDefined(true);
- $newBackupStatus->setMessageId('meeting');
- $newBackupStatus->setUserId('_john');
- $newBackupStatus->setIsBackup(true);
+ public function testRevertMultipleUserStatus(): void {
+ $john = new UserStatus();
+ $john->setId(1);
+ $john->setStatus(IUserStatus::AWAY);
+ $john->setStatusTimestamp(1337);
+ $john->setIsUserDefined(false);
+ $john->setMessageId('call');
+ $john->setUserId('john');
+ $john->setIsBackup(false);
+
+ $johnBackup = new UserStatus();
+ $johnBackup->setId(2);
+ $johnBackup->setStatus(IUserStatus::ONLINE);
+ $johnBackup->setStatusTimestamp(1337);
+ $johnBackup->setIsUserDefined(true);
+ $johnBackup->setMessageId('hello');
+ $johnBackup->setUserId('_john');
+ $johnBackup->setIsBackup(true);
+
+ $noBackup = new UserStatus();
+ $noBackup->setId(3);
+ $noBackup->setStatus(IUserStatus::AWAY);
+ $noBackup->setStatusTimestamp(1337);
+ $noBackup->setIsUserDefined(false);
+ $noBackup->setMessageId('call');
+ $noBackup->setUserId('nobackup');
+ $noBackup->setIsBackup(false);
+
+ $backupOnly = new UserStatus();
+ $backupOnly->setId(4);
+ $backupOnly->setStatus(IUserStatus::ONLINE);
+ $backupOnly->setStatusTimestamp(1337);
+ $backupOnly->setIsUserDefined(true);
+ $backupOnly->setMessageId('hello');
+ $backupOnly->setUserId('_backuponly');
+ $backupOnly->setIsBackup(true);
$this->mapper->expects($this->once())
- ->method('update')
- ->with($newBackupStatus);
+ ->method('findByUserIds')
+ ->with(['john', 'nobackup', 'backuponly', '_john', '_nobackup', '_backuponly'])
+ ->willReturn([
+ $john,
+ $johnBackup,
+ $noBackup,
+ $backupOnly,
+ ]);
- $this->service->backupCurrentStatus('john');
+ $this->mapper->expects($this->once())
+ ->method('deleteByIds')
+ ->with([1, 3]);
+
+ $this->mapper->expects($this->once())
+ ->method('restoreBackupStatuses')
+ ->with([2]);
+
+ $this->service->revertMultipleUserStatus(['john', 'nobackup', 'backuponly'], 'call', IUserStatus::AWAY);
}
}