\n
\n \n
\n
\n \n \n \n \n \n \n
\n
\n \n
\n \n \n \n \n \n {{ $t('settings.seeDocs') }}\n \n \n \n
\n
\n
\n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=2b61d370&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&id=2b61d370&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"2b61d370\",\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Metadata.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Metadata.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AutoLinker.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AutoLinker.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Instance.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Instance.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Other.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Other.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MRF.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./MRF.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Frontend.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Frontend.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./RateLimitInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./RateLimitInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./JobQueue.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./JobQueue.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Logger.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Logger.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProxyUrlInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProxyUrlInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CrontabInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CrontabInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EditableKeywordInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EditableKeywordInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Setting.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Setting.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ActivityPub.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ActivityPub.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.needReboot)?_c('el-tooltip',{attrs:{\"content\":_vm.$t('settings.restartApp'),\"placement\":\"bottom-end\"}},[_c('el-button',{staticClass:\"reboot-button\",attrs:{\"type\":\"warning\"},on:{\"click\":_vm.restartApp}},[_c('span',[_c('i',{staticClass:\"el-icon-refresh\"}),_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.instanceReboot'))+\"\\n \")])])],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","
\n \n \n \n \n {{ $t('settings.instanceReboot') }}\n \n \n \n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=53cfaf1d&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports","import mod from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IconsInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../../node_modules/css-loader/index.js??ref--11-1!../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IconsInput.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Gopher.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Gopher.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Inputs.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Inputs.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\""],"sourceRoot":""}
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-970d.2457e066.js b/priv/static/adminfe/static/js/chunk-970d.2457e066.js
deleted file mode 100644
index 0f99d835e..000000000
--- a/priv/static/adminfe/static/js/chunk-970d.2457e066.js
+++ /dev/null
@@ -1,2 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-970d"],{"07OA":function(t,e,s){"use strict";var a=s("51EY");s.n(a).a},"51EY":function(t,e,s){},"8rU9":function(t,e,s){},Eg1M:function(t,e,s){"use strict";var a=s("8rU9");s.n(a).a},"G/Mk":function(t,e,s){"use strict";var a=s("xdcp");s.n(a).a},Kw8l:function(t,e,s){"use strict";var a=s("cRgN");s.n(a).a},Lbbz:function(t,e,s){"use strict";var a=s("Sxb/");s.n(a).a},RnhZ:function(t,e,s){var a={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-SG":"zavE","./en-SG.js":"zavE","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function n(t){var e=r(t);return s(e)}function r(t){if(!s.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}n.keys=function(){return Object.keys(a)},n.resolve=r,t.exports=n,n.id="RnhZ"},"Sxb/":function(t,e,s){},cEOe:function(t,e,s){"use strict";s.r(e);var a=s("ZhIB"),n=s.n(a),r=s("wd/R"),o=s.n(r),i={name:"NoteCard",props:{report:{type:Object,required:!0},note:{type:Object,required:!0}},methods:{parseTimestamp:function(t){return o()(t).format("YYYY-MM-DD HH:mm")},handleNoteDeletion:function(t,e){this.$store.dispatch("DeleteReportNote",{noteID:t,reportID:e})}}},c=(s("G/Mk"),s("KHd+")),l=Object(c.a)(i,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-card",{staticClass:"note-card"},[s("div",{attrs:{slot:"header"},slot:"header"},[s("div",{staticClass:"note-header"},[s("div",{staticClass:"note-actor-container"},[s("div",{staticClass:"note-actor"},[s("img",{staticClass:"note-avatar-img",attrs:{src:t.note.user.avatar}}),t._v(" "),s("h3",{staticClass:"note-actor-name"},[t._v(t._s(t.note.user.display_name))])]),t._v(" "),s("a",{attrs:{href:t.note.user.url,target:"_blank"}},[t._v("\n @"+t._s(t.note.user.display_name)+"\n ")])]),t._v(" "),s("div",[s("el-popconfirm",{attrs:{title:"Are you sure to delete this?","confirm-button-text":"Yes","cancel-button-text":"No"},on:{onConfirm:function(e){return t.handleNoteDeletion(t.note.id,t.report.id)}}},[s("el-button",{attrs:{slot:"reference",size:"mini"},slot:"reference"},[t._v("\n "+t._s(t.$t("reports.deleteNote"))+"\n ")])],1)],1)])]),t._v(" "),s("div",{staticClass:"note-body"},[s("span",{staticClass:"note-content",domProps:{innerHTML:t._s(t.note.content)}}),t._v("\n "+t._s(t.parseTimestamp(t.note.created_at))+"\n ")])])},[],!1,null,null,null);l.options.__file="NoteCard.vue";var u=l.exports,d=s("ot3S"),p={name:"ModerateUserDropdown",props:{account:{type:Object,required:!0}},computed:{tags:function(){return this.account.tags||[]}},methods:{handleDeactivation:function(t){var e=t.nickname;this.$store.dispatch("ToggleUserActivation",e)},handleDeletion:function(t){this.$store.dispatch("DeleteUser",t)},showDeactivatedButton:function(t){return this.$store.state.user.id!==t},toggleTag:function(t,e){t.tags.includes(e)?this.$store.dispatch("RemoveTag",{users:[t],tag:e}):this.$store.dispatch("AddTag",{users:[t],tag:e})}}},v=Object(c.a)(p,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-dropdown",{attrs:{trigger:"click"}},[s("el-button",{attrs:{disabled:!t.account.id,plain:"",size:"small",icon:"el-icon-files"}},[t._v(t._s(t.$t("reports.moderateUser"))+"\n "),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t.showDeactivatedButton(t.account)?s("el-dropdown-item",{nativeOn:{click:function(e){return t.handleDeactivation(t.account)}}},[t._v("\n "+t._s(t.account.deactivated?t.$t("users.activateAccount"):t.$t("users.deactivateAccount"))+"\n ")]):t._e(),t._v(" "),t.showDeactivatedButton(t.account.id)?s("el-dropdown-item",{nativeOn:{click:function(e){return t.handleDeletion(t.account.id)}}},[t._v("\n "+t._s(t.$t("users.deleteAccount"))+"\n ")]):t._e(),t._v(" "),s("el-dropdown-item",{class:{"active-tag":t.tags.includes("force_nsfw")},attrs:{divided:!0},nativeOn:{click:function(e){return t.toggleTag(t.account,"force_nsfw")}}},[t._v("\n "+t._s(t.$t("users.forceNsfw"))+"\n "),t.tags.includes("force_nsfw")?s("i",{staticClass:"el-icon-check"}):t._e()]),t._v(" "),s("el-dropdown-item",{class:{"active-tag":t.tags.includes("strip_media")},nativeOn:{click:function(e){return t.toggleTag(t.account,"strip_media")}}},[t._v("\n "+t._s(t.$t("users.stripMedia"))+"\n "),t.tags.includes("strip_media")?s("i",{staticClass:"el-icon-check"}):t._e()]),t._v(" "),s("el-dropdown-item",{class:{"active-tag":t.tags.includes("force_unlisted")},nativeOn:{click:function(e){return t.toggleTag(t.account,"force_unlisted")}}},[t._v("\n "+t._s(t.$t("users.forceUnlisted"))+"\n "),t.tags.includes("force_unlisted")?s("i",{staticClass:"el-icon-check"}):t._e()]),t._v(" "),s("el-dropdown-item",{class:{"active-tag":t.tags.includes("sandbox")},nativeOn:{click:function(e){return t.toggleTag(t.account,"sandbox")}}},[t._v("\n "+t._s(t.$t("users.sandbox"))+"\n "),t.tags.includes("sandbox")?s("i",{staticClass:"el-icon-check"}):t._e()]),t._v(" "),t.account.local?s("el-dropdown-item",{class:{"active-tag":t.tags.includes("disable_remote_subscription")},nativeOn:{click:function(e){return t.toggleTag(t.account,"disable_remote_subscription")}}},[t._v("\n "+t._s(t.$t("users.disableRemoteSubscription"))+"\n "),t.tags.includes("disable_remote_subscription")?s("i",{staticClass:"el-icon-check"}):t._e()]):t._e(),t._v(" "),t.account.local?s("el-dropdown-item",{class:{"active-tag":t.tags.includes("disable_any_subscription")},nativeOn:{click:function(e){return t.toggleTag(t.account,"disable_any_subscription")}}},[t._v("\n "+t._s(t.$t("users.disableAnySubscription"))+"\n "),t.tags.includes("disable_any_subscription")?s("i",{staticClass:"el-icon-check"}):t._e()]):t._e()],1)],1)},[],!1,null,null,null);v.options.__file="ModerateUserDropdown.vue";var _=v.exports,h={name:"Report",components:{Status:d.a,ModerateUserDropdown:_,NoteCard:u},props:{reports:{type:Array,required:!0}},data:function(){return{notes:{}}},computed:{loading:function(){return this.$store.state.reports.loading},pageSize:function(){return this.$store.state.reports.pageSize},totalReportsCount:function(){return this.$store.state.reports.totalReportsCount},currentPage:function(){return this.$store.state.reports.currentPage}},methods:{accountExists:function(t,e){return t[e]},changeReportState:function(t,e){this.$store.dispatch("ChangeReportState",[{state:t,id:e}])},capitalizeFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},getStateType:function(t){switch(t){case"closed":return"info";case"resolved":return"success";default:return"primary"}},getStatusesTitle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return"Reported statuses: ".concat(t.length," item(s)")},getNotesTitle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return"Notes: ".concat(t.length," item(s)")},handleNewNote:function(t){this.$store.dispatch("CreateReportNote",{content:this.notes[t],reportID:t}),this.notes[t]=""},handlePageChange:function(t){this.$store.dispatch("FetchReports",t)},parseTimestamp:function(t){return o()(t).format("L HH:mm")},showStatuses:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).length>0}}},m=(s("07OA"),Object(c.a)(h,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("el-timeline",{staticClass:"reports-timeline"},t._l(t.reports,function(e){return s("el-timeline-item",{key:e.id,staticClass:"timeline-item-container",attrs:{timestamp:t.parseTimestamp(e.created_at),placement:"top"}},[s("el-card",{staticClass:"report"},[s("div",{staticClass:"report-header-container"},[s("div",{staticClass:"title-container"},[t.accountExists(e.account,"display_name")?s("h3",{staticClass:"report-title"},[t._v(t._s(t.$t("reports.reportOn"))+" "+t._s(e.account.display_name))]):s("h3",{staticClass:"report-title"},[t._v(t._s(t.$t("reports.report")))]),t._v(" "),s("h5",{staticClass:"id"},[t._v(t._s(t.$t("reports.id"))+": "+t._s(e.id))])]),t._v(" "),s("div",[s("el-tag",{staticClass:"report-tag",attrs:{type:t.getStateType(e.state),size:"large"}},[t._v(t._s(t.capitalizeFirstLetter(e.state)))]),t._v(" "),s("el-dropdown",{attrs:{trigger:"click"}},[s("el-button",{staticClass:"report-actions-button",attrs:{plain:"",size:"small",icon:"el-icon-edit"}},[t._v(t._s(t.$t("reports.changeState"))),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},["resolved"!==e.state?s("el-dropdown-item",{nativeOn:{click:function(s){return t.changeReportState("resolved",e.id)}}},[t._v(t._s(t.$t("reports.resolve")))]):t._e(),t._v(" "),"open"!==e.state?s("el-dropdown-item",{nativeOn:{click:function(s){return t.changeReportState("open",e.id)}}},[t._v(t._s(t.$t("reports.reopen")))]):t._e(),t._v(" "),"closed"!==e.state?s("el-dropdown-item",{nativeOn:{click:function(s){return t.changeReportState("closed",e.id)}}},[t._v(t._s(t.$t("reports.close")))]):t._e()],1)],1),t._v(" "),s("moderate-user-dropdown",{attrs:{account:e.account}})],1)]),t._v(" "),s("div",[s("el-divider",{staticClass:"divider"}),t._v(" "),s("span",{staticClass:"report-row-key"},[t._v(t._s(t.$t("reports.account"))+":")]),t._v(" "),t.accountExists(e.account,"avatar")&&t.accountExists(e.account,"display_name")?s("span",[s("img",{staticClass:"avatar-img",attrs:{src:e.account.avatar,alt:"avatar"}}),t._v(" "),e.account.deactivated?s("span",[t._v("\n "+t._s(e.account.display_name)+"\n "),s("span",{staticClass:"deactivated"},[t._v(" (deactivated)")])]):s("a",{staticClass:"account",attrs:{href:e.account.url,target:"_blank"}},[s("span",[t._v(t._s(e.account.display_name))])])]):s("span",{staticClass:"deactivated"},[t._v("("+t._s(t.$t("reports.notFound"))+")")])],1),t._v(" "),e.content&&e.content.length>0?s("div",[s("el-divider",{staticClass:"divider"}),t._v(" "),s("span",{staticClass:"report-row-key"},[t._v(t._s(t.$t("reports.content"))+":\n "),s("span",[t._v(t._s(e.content))])])],1):t._e(),t._v(" "),s("div",{style:t.showStatuses(e.statuses)?"":"margin-bottom:15px"},[s("el-divider",{staticClass:"divider"}),t._v(" "),s("span",{staticClass:"report-row-key"},[t._v(t._s(t.$t("reports.actor"))+":")]),t._v(" "),t.accountExists(e.actor,"avatar")&&t.accountExists(e.actor,"display_name")?s("span",[s("img",{staticClass:"avatar-img",attrs:{src:e.actor.avatar,alt:"avatar"}}),t._v(" "),s("a",{staticClass:"account",attrs:{href:e.actor.url,target:"_blank"}},[s("span",[t._v(t._s(e.actor.display_name))])])]):s("span",{staticClass:"deactivated"},[t._v("("+t._s(t.$t("reports.notFound"))+")")])],1),t._v(" "),t.showStatuses(e.statuses)?s("div",{staticClass:"statuses"},[s("el-collapse",[s("el-collapse-item",{attrs:{title:t.getStatusesTitle(e.statuses)}},t._l(e.statuses,function(a){return s("div",{key:a.id},[s("status",{attrs:{status:a,account:a.account.display_name?a.account:e.account,"show-checkbox":!1,page:t.currentPage}})],1)}),0)],1)],1):t._e(),t._v(" "),s("div",{staticClass:"report-notes"},[s("el-collapse",[s("el-collapse-item",{attrs:{title:t.getNotesTitle(e.notes)}},t._l(e.notes,function(t,a){return s("note-card",{key:a,attrs:{note:t,report:e}})}),1)],1),t._v(" "),s("div",{staticClass:"report-note-form"},[s("el-input",{attrs:{placeholder:t.$t("reports.leaveNote"),type:"textarea",rows:"2"},model:{value:t.notes[e.id],callback:function(s){t.$set(t.notes,e.id,s)},expression:"notes[report.id]"}}),t._v(" "),s("div",{staticClass:"report-post-note"},[s("el-button",{on:{click:function(s){return t.handleNewNote(e.id)}}},[t._v(t._s(t.$t("reports.postNote")))])],1)],1)],1)])],1)}),1),t._v(" "),t.loading?t._e():s("div",{staticClass:"reports-pagination"},[s("el-pagination",{attrs:{total:t.totalReportsCount,"current-page":t.currentPage,"page-size":t.pageSize,background:"",layout:"prev, pager, next"},on:{"current-change":t.handlePageChange}})],1)],1)},[],!1,null,null,null));m.options.__file="Report.vue";var g=m.exports,f=s("mSNy"),j={data:function(){return{filter:"open",options:[{value:"open",label:f.a.t("reportsFilter.open")},{value:"closed",label:f.a.t("reportsFilter.closed")},{value:"resolved",label:f.a.t("reportsFilter.resolved")}]}},created:function(){this.$store.dispatch("SetFilter",this.$data.filter)},methods:{toggleFilters:function(){this.$store.dispatch("SetFilter",this.$data.filter),this.$store.dispatch("ClearFetchedReports"),this.$store.dispatch("FetchReports",1)}}},b=(s("Eg1M"),Object(c.a)(j,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-select",{staticClass:"select-field",attrs:{placeholder:t.$t("reportsFilter.inputPlaceholder"),clearable:"","value-key":"value"},on:{change:t.toggleFilters},model:{value:t.filter,callback:function(e){t.filter=e},expression:"filter"}},t._l(t.options,function(e){return s("el-option",{key:e.value,attrs:{label:e.label,value:e.value}},[t._v(t._s(e.label))])}),1)},[],!1,null,"ecc36f5a",null));b.options.__file="ReportsFilter.vue";var C=b.exports,y={components:{RebootButton:s("rIUS").a,Report:g,ReportsFilter:C},computed:{loading:function(){return this.$store.state.reports.loading},normalizedReportsCount:function(){return n()(this.$store.state.reports.totalReportsCount).format("0a")},reports:function(){return this.$store.state.reports.fetchedReports}},mounted:function(){this.$store.dispatch("GetNodeInfo"),this.$store.dispatch("NeedReboot"),this.$store.dispatch("FetchReports",1)}},k=(s("Lbbz"),Object(c.a)(y,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"reports-container"},[s("div",{staticClass:"reports-header-container"},[s("h1",[t._v("\n "+t._s(t.$t("reports.reports"))+"\n "),s("span",{staticClass:"report-count"},[t._v("("+t._s(t.normalizedReportsCount)+")")])]),t._v(" "),s("reboot-button")],1),t._v(" "),s("div",{staticClass:"reports-filter-container"},[s("reports-filter")],1),t._v(" "),s("div",{staticClass:"block"},[s("report",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{reports:t.reports}}),t._v(" "),0===t.reports.length?s("div",{staticClass:"no-reports-message"},[s("p",[t._v("There are no reports to display")])]):t._e()],1)])},[],!1,null,"fa601560",null));k.options.__file="index.vue";e.default=k.exports},cRgN:function(t,e,s){},ot3S:function(t,e,s){"use strict";var a=s("wd/R"),n=s.n(a),r={name:"Status",props:{account:{type:Object,required:!1,default:function(){return{}}},fetchStatusesByInstance:{type:Boolean,required:!1,default:!1},showCheckbox:{type:Boolean,required:!0,default:!1},status:{type:Object,required:!0},page:{type:Number,required:!1,default:0},userId:{type:String,required:!1,default:""},godmode:{type:Boolean,required:!1,default:!1}},data:function(){return{showHiddenStatus:!1}},methods:{capitalizeFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},changeStatus:function(t,e,s){this.$store.dispatch("ChangeStatusScope",{statusId:t,isSensitive:e,visibility:s,reportCurrentPage:this.page,userId:this.userId,godmode:this.godmode,fetchStatusesByInstance:this.fetchStatusesByInstance})},deleteStatus:function(t){var e=this;this.$confirm("Are you sure you want to delete this status?","Warning",{confirmButtonText:"OK",cancelButtonText:"Cancel",type:"warning"}).then(function(){e.$store.dispatch("DeleteStatus",{statusId:t,reportCurrentPage:e.page,userId:e.userId,godmode:e.godmode,fetchStatusesByInstance:e.fetchStatusesByInstance}),e.$message({type:"success",message:"Delete completed"})}).catch(function(){e.$message({type:"info",message:"Delete canceled"})})},optionPercent:function(t,e){var s=t.options.reduce(function(t,e){return t+e.votes_count},0);return 0===s?0:+(e.votes_count/s*100).toFixed(1)},parseTimestamp:function(t){return n()(t).format("YYYY-MM-DD HH:mm")},handleStatusSelection:function(t){this.$emit("status-selection",t)}}},o=(s("Kw8l"),s("KHd+")),i=Object(o.a)(r,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[t.status.deleted?s("el-card",{staticClass:"status-card"},[s("div",{attrs:{slot:"header"},slot:"header"},[s("div",{staticClass:"status-header"},[s("div",{staticClass:"status-account-container"},[s("div",{staticClass:"status-account"},[s("h4",{staticClass:"status-deleted"},[t._v(t._s(t.$t("reports.statusDeleted")))])])])])]),t._v(" "),s("div",{staticClass:"status-body"},[t.status.content?s("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}):s("span",{staticClass:"status-without-content"},[t._v("no content")])]),t._v(" "),t.status.created_at?s("a",{staticClass:"account",attrs:{href:t.status.url,target:"_blank"}},[t._v("\n "+t._s(t.parseTimestamp(t.status.created_at))+"\n ")]):t._e()]):s("el-card",{staticClass:"status-card"},[s("div",{attrs:{slot:"header"},slot:"header"},[s("div",{staticClass:"status-header"},[s("div",{staticClass:"status-account-container"},[s("div",{staticClass:"status-account"},[t.showCheckbox?s("el-checkbox",{staticClass:"status-checkbox",on:{change:function(e){return t.handleStatusSelection(t.account)}}}):t._e(),t._v(" "),s("img",{staticClass:"status-avatar-img",attrs:{src:t.account.avatar}}),t._v(" "),t.account.deactivated?s("span",[s("h3",{staticClass:"status-account-name"},[t._v(t._s(t.account.display_name))]),t._v(" "),s("h3",{staticClass:"status-account-name deactivated"},[t._v(" (deactivated)")])]):s("a",{staticClass:"account",attrs:{href:t.account.url,target:"_blank"}},[s("h3",{staticClass:"status-account-name"},[t._v(t._s(t.account.display_name))])])],1)]),t._v(" "),s("div",{staticClass:"status-actions"},[t.status.sensitive?s("el-tag",{attrs:{type:"warning",size:"large"}},[t._v(t._s(t.$t("reports.sensitive")))]):t._e(),t._v(" "),s("el-tag",{attrs:{size:"large"}},[t._v(t._s(t.capitalizeFirstLetter(t.status.visibility)))]),t._v(" "),s("el-dropdown",{attrs:{trigger:"click"}},[s("el-button",{staticClass:"status-actions-button",attrs:{plain:"",size:"small",icon:"el-icon-edit"}},[t._v("\n "+t._s(t.$t("reports.changeScope"))),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t.status.sensitive?t._e():s("el-dropdown-item",{nativeOn:{click:function(e){return t.changeStatus(t.status.id,!0,t.status.visibility)}}},[t._v("\n "+t._s(t.$t("reports.addSensitive"))+"\n ")]),t._v(" "),t.status.sensitive?s("el-dropdown-item",{nativeOn:{click:function(e){return t.changeStatus(t.status.id,!1,t.status.visibility)}}},[t._v("\n "+t._s(t.$t("reports.removeSensitive"))+"\n ")]):t._e(),t._v(" "),"public"!==t.status.visibility?s("el-dropdown-item",{nativeOn:{click:function(e){return t.changeStatus(t.status.id,t.status.sensitive,"public")}}},[t._v("\n "+t._s(t.$t("reports.public"))+"\n ")]):t._e(),t._v(" "),"private"!==t.status.visibility?s("el-dropdown-item",{nativeOn:{click:function(e){return t.changeStatus(t.status.id,t.status.sensitive,"private")}}},[t._v("\n "+t._s(t.$t("reports.private"))+"\n ")]):t._e(),t._v(" "),"unlisted"!==t.status.visibility?s("el-dropdown-item",{nativeOn:{click:function(e){return t.changeStatus(t.status.id,t.status.sensitive,"unlisted")}}},[t._v("\n "+t._s(t.$t("reports.unlisted"))+"\n ")]):t._e(),t._v(" "),s("el-dropdown-item",{nativeOn:{click:function(e){return t.deleteStatus(t.status.id)}}},[t._v("\n "+t._s(t.$t("reports.deleteStatus"))+"\n ")])],1)],1)],1)])]),t._v(" "),s("div",{staticClass:"status-body"},[t.status.spoiler_text?s("div",[s("strong",[t._v(t._s(t.status.spoiler_text))]),t._v(" "),t.showHiddenStatus?t._e():s("el-button",{staticClass:"show-more-button",attrs:{size:"mini"},on:{click:function(e){t.showHiddenStatus=!0}}},[t._v("Show more")]),t._v(" "),t.showHiddenStatus?s("el-button",{staticClass:"show-more-button",attrs:{size:"mini"},on:{click:function(e){t.showHiddenStatus=!1}}},[t._v("Show less")]):t._e(),t._v(" "),t.showHiddenStatus?s("div",[s("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}),t._v(" "),t.status.poll?s("div",{staticClass:"poll"},[s("ul",t._l(t.status.poll.options,function(e,a){return s("li",{key:a},[t._v("\n "+t._s(e.title)+"\n "),s("el-progress",{attrs:{percentage:t.optionPercent(t.status.poll,e)}})],1)}),0)]):t._e(),t._v(" "),t._l(t.status.media_attachments,function(t,e){return s("div",{key:e,staticClass:"image"},[s("img",{attrs:{src:t.preview_url}})])})],2):t._e()],1):t._e(),t._v(" "),t.status.spoiler_text?t._e():s("div",[s("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}),t._v(" "),t.status.poll?s("div",{staticClass:"poll"},[s("ul",t._l(t.status.poll.options,function(e,a){return s("li",{key:a},[t._v("\n "+t._s(e.title)+"\n "),s("el-progress",{attrs:{percentage:t.optionPercent(t.status.poll,e)}})],1)}),0)]):t._e(),t._v(" "),t._l(t.status.media_attachments,function(t,e){return s("div",{key:e,staticClass:"image"},[s("img",{attrs:{src:t.preview_url}})])})],2),t._v(" "),s("a",{staticClass:"account",attrs:{href:t.status.url,target:"_blank"}},[t._v("\n "+t._s(t.parseTimestamp(t.status.created_at))+"\n ")])])])],1)},[],!1,null,null,null);i.options.__file="index.vue";e.a=i.exports},rIUS:function(t,e,s){"use strict";var a=s("o0o1"),n=s.n(a),r=s("yXPU"),o=s.n(r),i=s("mSNy"),c={name:"RebootButton",computed:{needReboot:function(){return this.$store.state.app.needReboot}},methods:{restartApp:function(){var t=o()(n.a.mark(function t(){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.$store.dispatch("RestartApplication");case 3:t.next=8;break;case 5:return t.prev=5,t.t0=t.catch(0),t.abrupt("return");case 8:this.$message({type:"success",message:i.a.t("settings.restartSuccess")});case 9:case"end":return t.stop()}},t,this,[[0,5]])}));return function(){return t.apply(this,arguments)}}()}},l=s("KHd+"),u=Object(l.a)(c,function(){var t=this.$createElement,e=this._self._c||t;return this.needReboot?e("el-tooltip",{attrs:{content:this.$t("settings.restartApp"),placement:"bottom-end"}},[e("el-button",{staticClass:"reboot-button",attrs:{type:"warning"},on:{click:this.restartApp}},[e("span",[e("i",{staticClass:"el-icon-refresh"}),this._v("\n "+this._s(this.$t("settings.instanceReboot"))+"\n ")])])],1):this._e()},[],!1,null,null,null);u.options.__file="index.vue";e.a=u.exports},xdcp:function(t,e,s){}}]);
-//# sourceMappingURL=chunk-970d.2457e066.js.map
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-970d.2457e066.js.map b/priv/static/adminfe/static/js/chunk-970d.2457e066.js.map
deleted file mode 100644
index 6896407b0..000000000
--- a/priv/static/adminfe/static/js/chunk-970d.2457e066.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///./src/views/reports/components/Report.vue?ad5f","webpack:///./src/views/reports/components/ReportsFilter.vue?a490","webpack:///./src/views/reports/components/NoteCard.vue?b93a","webpack:///./src/components/Status/index.vue?aecc","webpack:///./src/views/reports/index.vue?cda2","webpack:///./node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./src/views/reports/index.vue?43f7","webpack:///./src/views/reports/components/NoteCard.vue?6205","webpack:///src/views/reports/components/NoteCard.vue","webpack:///./src/views/reports/components/NoteCard.vue","webpack:///./src/views/reports/components/NoteCard.vue?b0ed","webpack:///./src/views/reports/components/ModerateUserDropdown.vue?6745","webpack:///src/views/reports/components/ModerateUserDropdown.vue","webpack:///./src/views/reports/components/ModerateUserDropdown.vue","webpack:///./src/views/reports/components/ModerateUserDropdown.vue?65ad","webpack:///./src/views/reports/components/Report.vue?a764","webpack:///src/views/reports/components/Report.vue","webpack:///./src/views/reports/components/Report.vue","webpack:///./src/views/reports/components/Report.vue?b7da","webpack:///./src/views/reports/components/ReportsFilter.vue?e3b7","webpack:///src/views/reports/components/ReportsFilter.vue","webpack:///./src/views/reports/components/ReportsFilter.vue","webpack:///./src/views/reports/components/ReportsFilter.vue?f6ad","webpack:///./src/views/reports/index.vue?3bcc","webpack:///src/views/reports/index.vue","webpack:///./src/views/reports/index.vue","webpack:///./src/components/Status/index.vue?f9b2","webpack:///./src/components/Status/index.vue?6071","webpack:///src/components/Status/index.vue","webpack:///./src/components/Status/index.vue","webpack:///./src/components/RebootButton/index.vue?8db4","webpack:///./src/components/RebootButton/index.vue?2f45","webpack:///src/components/RebootButton/index.vue","webpack:///./src/components/RebootButton/index.vue"],"names":["_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Report_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","n","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_ReportsFilter_vue_vue_type_style_index_0_id_ecc36f5a_rel_stylesheet_2Fscss_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_NoteCard_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_fa601560_rel_stylesheet_2Fscss_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__","map","./af","./af.js","./ar","./ar-dz","./ar-dz.js","./ar-kw","./ar-kw.js","./ar-ly","./ar-ly.js","./ar-ma","./ar-ma.js","./ar-sa","./ar-sa.js","./ar-tn","./ar-tn.js","./ar.js","./az","./az.js","./be","./be.js","./bg","./bg.js","./bm","./bm.js","./bn","./bn.js","./bo","./bo.js","./br","./br.js","./bs","./bs.js","./ca","./ca.js","./cs","./cs.js","./cv","./cv.js","./cy","./cy.js","./da","./da.js","./de","./de-at","./de-at.js","./de-ch","./de-ch.js","./de.js","./dv","./dv.js","./el","./el.js","./en-SG","./en-SG.js","./en-au","./en-au.js","./en-ca","./en-ca.js","./en-gb","./en-gb.js","./en-ie","./en-ie.js","./en-il","./en-il.js","./en-nz","./en-nz.js","./eo","./eo.js","./es","./es-do","./es-do.js","./es-us","./es-us.js","./es.js","./et","./et.js","./eu","./eu.js","./fa","./fa.js","./fi","./fi.js","./fo","./fo.js","./fr","./fr-ca","./fr-ca.js","./fr-ch","./fr-ch.js","./fr.js","./fy","./fy.js","./ga","./ga.js","./gd","./gd.js","./gl","./gl.js","./gom-latn","./gom-latn.js","./gu","./gu.js","./he","./he.js","./hi","./hi.js","./hr","./hr.js","./hu","./hu.js","./hy-am","./hy-am.js","./id","./id.js","./is","./is.js","./it","./it-ch","./it-ch.js","./it.js","./ja","./ja.js","./jv","./jv.js","./ka","./ka.js","./kk","./kk.js","./km","./km.js","./kn","./kn.js","./ko","./ko.js","./ku","./ku.js","./ky","./ky.js","./lb","./lb.js","./lo","./lo.js","./lt","./lt.js","./lv","./lv.js","./me","./me.js","./mi","./mi.js","./mk","./mk.js","./ml","./ml.js","./mn","./mn.js","./mr","./mr.js","./ms","./ms-my","./ms-my.js","./ms.js","./mt","./mt.js","./my","./my.js","./nb","./nb.js","./ne","./ne.js","./nl","./nl-be","./nl-be.js","./nl.js","./nn","./nn.js","./pa-in","./pa-in.js","./pl","./pl.js","./pt","./pt-br","./pt-br.js","./pt.js","./ro","./ro.js","./ru","./ru.js","./sd","./sd.js","./se","./se.js","./si","./si.js","./sk","./sk.js","./sl","./sl.js","./sq","./sq.js","./sr","./sr-cyrl","./sr-cyrl.js","./sr.js","./ss","./ss.js","./sv","./sv.js","./sw","./sw.js","./ta","./ta.js","./te","./te.js","./tet","./tet.js","./tg","./tg.js","./th","./th.js","./tl-ph","./tl-ph.js","./tlh","./tlh.js","./tr","./tr.js","./tzl","./tzl.js","./tzm","./tzm-latn","./tzm-latn.js","./tzm.js","./ug-cn","./ug-cn.js","./uk","./uk.js","./ur","./ur.js","./uz","./uz-latn","./uz-latn.js","./uz.js","./vi","./vi.js","./x-pseudo","./x-pseudo.js","./yo","./yo.js","./zh-cn","./zh-cn.js","./zh-hk","./zh-hk.js","./zh-tw","./zh-tw.js","webpackContext","req","id","webpackContextResolve","o","e","Error","code","keys","Object","resolve","module","exports","components_NoteCardvue_type_script_lang_js_","name","props","report","type","required","note","methods","parseTimestamp","timestamp","moment_default","format","handleNoteDeletion","noteID","reportID","this","$store","dispatch","component","componentNormalizer","_vm","_h","$createElement","_c","_self","staticClass","attrs","slot","src","user","avatar","_v","_s","display_name","href","url","target","title","confirm-button-text","cancel-button-text","on","onConfirm","$event","size","$t","domProps","innerHTML","content","created_at","options","__file","NoteCard","components_ModerateUserDropdownvue_type_script_lang_js_","account","computed","tags","handleDeactivation","_ref","nickname","handleDeletion","showDeactivatedButton","state","toggleTag","tag","includes","users","ModerateUserDropdown_component","trigger","disabled","plain","icon","nativeOn","click","deactivated","_e","class","active-tag","divided","ModerateUserDropdown","components_Reportvue_type_script_lang_js_","components","Status","reports","Array","data","notes","loading","pageSize","totalReportsCount","currentPage","accountExists","key","changeReportState","capitalizeFirstLetter","str","charAt","toUpperCase","slice","getStateType","getStatusesTitle","statuses","arguments","length","undefined","concat","getNotesTitle","handleNewNote","handlePageChange","page","showStatuses","Report_component","_l","placement","alt","style","actor","status","show-checkbox","index","placeholder","rows","model","value","callback","$$v","$set","expression","total","current-page","page-size","background","layout","current-change","Report","components_ReportsFiltervue_type_script_lang_js_","filter","label","lang","t","created","$data","toggleFilters","ReportsFilter_component","clearable","value-key","change","item","ReportsFilter","views_reportsvue_type_script_lang_js_","RebootButton","normalizedReportsCount","numeral_default","fetchedReports","mounted","reports_component","directives","rawName","__webpack_exports__","components_Statusvue_type_script_lang_js_","default","fetchStatusesByInstance","Boolean","showCheckbox","Number","userId","String","godmode","showHiddenStatus","changeStatus","statusId","isSensitive","visibility","reportCurrentPage","deleteStatus","_this","$confirm","confirmButtonText","cancelButtonText","then","$message","message","catch","optionPercent","poll","pollOption","allVotes","reduce","acc","option","votes_count","toFixed","handleStatusSelection","$emit","deleted","sensitive","spoiler_text","percentage","attachment","preview_url","components_RebootButtonvue_type_script_lang_js_","needReboot","app","restartApp","_restartApp","asyncToGenerator_default","regenerator_default","a","mark","_callee","wrap","_context","prev","next","t0","abrupt","stop","apply"],"mappings":"wGAAA,IAAAA,EAAAC,EAAA,QAAAA,EAAAC,EAAAF,GAA0e,uFCA1e,IAAAG,EAAAF,EAAA,QAAAA,EAAAC,EAAAC,GAAygB,uCCAzgB,IAAAC,EAAAH,EAAA,QAAAA,EAAAC,EAAAE,GAA4e,qCCA5e,IAAAC,EAAAJ,EAAA,QAAAA,EAAAC,EAAAG,GAAud,qCCAvd,IAAAC,EAAAL,EAAA,QAAAA,EAAAC,EAAAI,GAA+e,wBCA/e,IAAAC,GACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAA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ACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,UAAA,OACAC,aAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,YAAA,OACAC,eAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,QAAA,OACAC,WAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,UAAA,OACAC,aAAA,OACAC,QAAA,OACAC,WAAA,OACAC,OAAA,OACAC,UAAA,OACAC,QAAA,OACAC,WAAA,OACAC,QAAA,OACAC,aAAA,OACAC,gBAAA,OACAC,WAAA,OACAC,UAAA,OACAC,aAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,YAAA,OACAC,eAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,gBAAA,OACAC,OAAA,OACAC,UAAA,OACA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gBAAAC,OAAmCtB,KAAA,WAAiBoC,IAAKgC,MAA5PzD,KAA4P2L,cAAwBnL,EAAA,QAAAA,EAAA,KAAqBE,YAAA,oBAAzSV,KAAuUgB,GAAA,WAAvUhB,KAAuUiB,GAAvUjB,KAAuU6B,GAAA,8CAAvU7B,KAAuU2D,UGWjW,EACA,KACA,KACA,MAIAxD,EAAA+B,QAAAC,OAAA,YACe2G,EAAA,EAAA3I","file":"static/js/chunk-970d.2457e066.js","sourcesContent":["import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Report.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Report.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportsFilter.vue?vue&type=style&index=0&id=ecc36f5a&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportsFilter.vue?vue&type=style&index=0&id=ecc36f5a&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NoteCard.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NoteCard.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=fa601560&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=fa601560&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"","var map = {\n\t\"./af\": \"K/tc\",\n\t\"./af.js\": \"K/tc\",\n\t\"./ar\": \"jnO4\",\n\t\"./ar-dz\": \"o1bE\",\n\t\"./ar-dz.js\": \"o1bE\",\n\t\"./ar-kw\": \"Qj4J\",\n\t\"./ar-kw.js\": \"Qj4J\",\n\t\"./ar-ly\": \"HP3h\",\n\t\"./ar-ly.js\": \"HP3h\",\n\t\"./ar-ma\": \"CoRJ\",\n\t\"./ar-ma.js\": \"CoRJ\",\n\t\"./ar-sa\": \"gjCT\",\n\t\"./ar-sa.js\": \"gjCT\",\n\t\"./ar-tn\": \"bYM6\",\n\t\"./ar-tn.js\": \"bYM6\",\n\t\"./ar.js\": \"jnO4\",\n\t\"./az\": \"SFxW\",\n\t\"./az.js\": \"SFxW\",\n\t\"./be\": \"H8ED\",\n\t\"./be.js\": \"H8ED\",\n\t\"./bg\": \"hKrs\",\n\t\"./bg.js\": \"hKrs\",\n\t\"./bm\": \"p/rL\",\n\t\"./bm.js\": \"p/rL\",\n\t\"./bn\": \"kEOa\",\n\t\"./bn.js\": \"kEOa\",\n\t\"./bo\": \"0mo+\",\n\t\"./bo.js\": \"0mo+\",\n\t\"./br\": \"aIdf\",\n\t\"./br.js\": \"aIdf\",\n\t\"./bs\": \"JVSJ\",\n\t\"./bs.js\": \"JVSJ\",\n\t\"./ca\": \"1xZ4\",\n\t\"./ca.js\": \"1xZ4\",\n\t\"./cs\": \"PA2r\",\n\t\"./cs.js\": \"PA2r\",\n\t\"./cv\": \"A+xa\",\n\t\"./cv.js\": \"A+xa\",\n\t\"./cy\": \"l5ep\",\n\t\"./cy.js\": \"l5ep\",\n\t\"./da\": \"DxQv\",\n\t\"./da.js\": \"DxQv\",\n\t\"./de\": \"tGlX\",\n\t\"./de-at\": \"s+uk\",\n\t\"./de-at.js\": \"s+uk\",\n\t\"./de-ch\": \"u3GI\",\n\t\"./de-ch.js\": \"u3GI\",\n\t\"./de.js\": \"tGlX\",\n\t\"./dv\": \"WYrj\",\n\t\"./dv.js\": \"WYrj\",\n\t\"./el\": \"jUeY\",\n\t\"./el.js\": \"jUeY\",\n\t\"./en-SG\": \"zavE\",\n\t\"./en-SG.js\": \"zavE\",\n\t\"./en-au\": \"Dmvi\",\n\t\"./en-au.js\": \"Dmvi\",\n\t\"./en-ca\": \"OIYi\",\n\t\"./en-ca.js\": \"OIYi\",\n\t\"./en-gb\": \"Oaa7\",\n\t\"./en-gb.js\": \"Oaa7\",\n\t\"./en-ie\": \"4dOw\",\n\t\"./en-ie.js\": \"4dOw\",\n\t\"./en-il\": \"czMo\",\n\t\"./en-il.js\": \"czMo\",\n\t\"./en-nz\": \"b1Dy\",\n\t\"./en-nz.js\": \"b1Dy\",\n\t\"./eo\": \"Zduo\",\n\t\"./eo.js\": \"Zduo\",\n\t\"./es\": \"iYuL\",\n\t\"./es-do\": \"CjzT\",\n\t\"./es-do.js\": \"CjzT\",\n\t\"./es-us\": \"Vclq\",\n\t\"./es-us.js\": \"Vclq\",\n\t\"./es.js\": \"iYuL\",\n\t\"./et\": \"7BjC\",\n\t\"./et.js\": \"7BjC\",\n\t\"./eu\": \"D/JM\",\n\t\"./eu.js\": \"D/JM\",\n\t\"./fa\": \"jfSC\",\n\t\"./fa.js\": \"jfSC\",\n\t\"./fi\": \"gekB\",\n\t\"./fi.js\": \"gekB\",\n\t\"./fo\": \"ByF4\",\n\t\"./fo.js\": \"ByF4\",\n\t\"./fr\": \"nyYc\",\n\t\"./fr-ca\": \"2fjn\",\n\t\"./fr-ca.js\": \"2fjn\",\n\t\"./fr-ch\": \"Dkky\",\n\t\"./fr-ch.js\": \"Dkky\",\n\t\"./fr.js\": \"nyYc\",\n\t\"./fy\": \"cRix\",\n\t\"./fy.js\": \"cRix\",\n\t\"./ga\": \"USCx\",\n\t\"./ga.js\": \"USCx\",\n\t\"./gd\": \"9rRi\",\n\t\"./gd.js\": \"9rRi\",\n\t\"./gl\": \"iEDd\",\n\t\"./gl.js\": \"iEDd\",\n\t\"./gom-latn\": \"DKr+\",\n\t\"./gom-latn.js\": \"DKr+\",\n\t\"./gu\": \"4MV3\",\n\t\"./gu.js\": \"4MV3\",\n\t\"./he\": \"x6pH\",\n\t\"./he.js\": \"x6pH\",\n\t\"./hi\": \"3E1r\",\n\t\"./hi.js\": \"3E1r\",\n\t\"./hr\": \"S6ln\",\n\t\"./hr.js\": \"S6ln\",\n\t\"./hu\": \"WxRl\",\n\t\"./hu.js\": \"WxRl\",\n\t\"./hy-am\": \"1rYy\",\n\t\"./hy-am.js\": \"1rYy\",\n\t\"./id\": \"UDhR\",\n\t\"./id.js\": \"UDhR\",\n\t\"./is\": \"BVg3\",\n\t\"./is.js\": \"BVg3\",\n\t\"./it\": \"bpih\",\n\t\"./it-ch\": \"bxKX\",\n\t\"./it-ch.js\": \"bxKX\",\n\t\"./it.js\": \"bpih\",\n\t\"./ja\": \"B55N\",\n\t\"./ja.js\": \"B55N\",\n\t\"./jv\": \"tUCv\",\n\t\"./jv.js\": \"tUCv\",\n\t\"./ka\": \"IBtZ\",\n\t\"./ka.js\": \"IBtZ\",\n\t\"./kk\": \"bXm7\",\n\t\"./kk.js\": \"bXm7\",\n\t\"./km\": \"6B0Y\",\n\t\"./km.js\": \"6B0Y\",\n\t\"./kn\": \"PpIw\",\n\t\"./kn.js\": \"PpIw\",\n\t\"./ko\": \"Ivi+\",\n\t\"./ko.js\": \"Ivi+\",\n\t\"./ku\": \"JCF/\",\n\t\"./ku.js\": \"JCF/\",\n\t\"./ky\": \"lgnt\",\n\t\"./ky.js\": \"lgnt\",\n\t\"./lb\": \"RAwQ\",\n\t\"./lb.js\": \"RAwQ\",\n\t\"./lo\": \"sp3z\",\n\t\"./lo.js\": \"sp3z\",\n\t\"./lt\": \"JvlW\",\n\t\"./lt.js\": \"JvlW\",\n\t\"./lv\": \"uXwI\",\n\t\"./lv.js\": \"uXwI\",\n\t\"./me\": \"KTz0\",\n\t\"./me.js\": \"KTz0\",\n\t\"./mi\": \"aIsn\",\n\t\"./mi.js\": \"aIsn\",\n\t\"./mk\": \"aQkU\",\n\t\"./mk.js\": \"aQkU\",\n\t\"./ml\": \"AvvY\",\n\t\"./ml.js\": \"AvvY\",\n\t\"./mn\": \"lYtQ\",\n\t\"./mn.js\": \"lYtQ\",\n\t\"./mr\": \"Ob0Z\",\n\t\"./mr.js\": \"Ob0Z\",\n\t\"./ms\": \"6+QB\",\n\t\"./ms-my\": \"ZAMP\",\n\t\"./ms-my.js\": \"ZAMP\",\n\t\"./ms.js\": \"6+QB\",\n\t\"./mt\": \"G0Uy\",\n\t\"./mt.js\": \"G0Uy\",\n\t\"./my\": \"honF\",\n\t\"./my.js\": \"honF\",\n\t\"./nb\": \"bOMt\",\n\t\"./nb.js\": \"bOMt\",\n\t\"./ne\": \"OjkT\",\n\t\"./ne.js\": \"OjkT\",\n\t\"./nl\": \"+s0g\",\n\t\"./nl-be\": \"2ykv\",\n\t\"./nl-be.js\": \"2ykv\",\n\t\"./nl.js\": \"+s0g\",\n\t\"./nn\": \"uEye\",\n\t\"./nn.js\": \"uEye\",\n\t\"./pa-in\": \"8/+R\",\n\t\"./pa-in.js\": \"8/+R\",\n\t\"./pl\": \"jVdC\",\n\t\"./pl.js\": \"jVdC\",\n\t\"./pt\": \"8mBD\",\n\t\"./pt-br\": \"0tRk\",\n\t\"./pt-br.js\": \"0tRk\",\n\t\"./pt.js\": \"8mBD\",\n\t\"./ro\": \"lyxo\",\n\t\"./ro.js\": \"lyxo\",\n\t\"./ru\": \"lXzo\",\n\t\"./ru.js\": \"lXzo\",\n\t\"./sd\": \"Z4QM\",\n\t\"./sd.js\": \"Z4QM\",\n\t\"./se\": \"//9w\",\n\t\"./se.js\": \"//9w\",\n\t\"./si\": \"7aV9\",\n\t\"./si.js\": \"7aV9\",\n\t\"./sk\": \"e+ae\",\n\t\"./sk.js\": \"e+ae\",\n\t\"./sl\": \"gVVK\",\n\t\"./sl.js\": \"gVVK\",\n\t\"./sq\": \"yPMs\",\n\t\"./sq.js\": \"yPMs\",\n\t\"./sr\": \"zx6S\",\n\t\"./sr-cyrl\": \"E+lV\",\n\t\"./sr-cyrl.js\": \"E+lV\",\n\t\"./sr.js\": \"zx6S\",\n\t\"./ss\": \"Ur1D\",\n\t\"./ss.js\": \"Ur1D\",\n\t\"./sv\": \"X709\",\n\t\"./sv.js\": \"X709\",\n\t\"./sw\": \"dNwA\",\n\t\"./sw.js\": \"dNwA\",\n\t\"./ta\": \"PeUW\",\n\t\"./ta.js\": \"PeUW\",\n\t\"./te\": \"XLvN\",\n\t\"./te.js\": \"XLvN\",\n\t\"./tet\": \"V2x9\",\n\t\"./tet.js\": \"V2x9\",\n\t\"./tg\": \"Oxv6\",\n\t\"./tg.js\": \"Oxv6\",\n\t\"./th\": \"EOgW\",\n\t\"./th.js\": \"EOgW\",\n\t\"./tl-ph\": \"Dzi0\",\n\t\"./tl-ph.js\": \"Dzi0\",\n\t\"./tlh\": \"z3Vd\",\n\t\"./tlh.js\": \"z3Vd\",\n\t\"./tr\": \"DoHr\",\n\t\"./tr.js\": \"DoHr\",\n\t\"./tzl\": \"z1FC\",\n\t\"./tzl.js\": \"z1FC\",\n\t\"./tzm\": \"wQk9\",\n\t\"./tzm-latn\": \"tT3J\",\n\t\"./tzm-latn.js\": \"tT3J\",\n\t\"./tzm.js\": \"wQk9\",\n\t\"./ug-cn\": \"YRex\",\n\t\"./ug-cn.js\": \"YRex\",\n\t\"./uk\": \"raLr\",\n\t\"./uk.js\": \"raLr\",\n\t\"./ur\": \"UpQW\",\n\t\"./ur.js\": \"UpQW\",\n\t\"./uz\": \"Loxo\",\n\t\"./uz-latn\": \"AQ68\",\n\t\"./uz-latn.js\": \"AQ68\",\n\t\"./uz.js\": \"Loxo\",\n\t\"./vi\": \"KSF8\",\n\t\"./vi.js\": \"KSF8\",\n\t\"./x-pseudo\": \"/X5v\",\n\t\"./x-pseudo.js\": \"/X5v\",\n\t\"./yo\": \"fzPg\",\n\t\"./yo.js\": \"fzPg\",\n\t\"./zh-cn\": \"XDpg\",\n\t\"./zh-cn.js\": \"XDpg\",\n\t\"./zh-hk\": \"SatO\",\n\t\"./zh-hk.js\": \"SatO\",\n\t\"./zh-tw\": \"kOpN\",\n\t\"./zh-tw.js\": \"kOpN\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"RnhZ\";","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"reports-container\"},[_c('div',{staticClass:\"reports-header-container\"},[_c('h1',[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.reports'))+\"\\n \"),_c('span',{staticClass:\"report-count\"},[_vm._v(\"(\"+_vm._s(_vm.normalizedReportsCount)+\")\")])]),_vm._v(\" \"),_c('reboot-button')],1),_vm._v(\" \"),_c('div',{staticClass:\"reports-filter-container\"},[_c('reports-filter')],1),_vm._v(\" \"),_c('div',{staticClass:\"block\"},[_c('report',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.loading),expression:\"loading\"}],attrs:{\"reports\":_vm.reports}}),_vm._v(\" \"),(_vm.reports.length === 0)?_c('div',{staticClass:\"no-reports-message\"},[_c('p',[_vm._v(\"There are no reports to display\")])]):_vm._e()],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NoteCard.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NoteCard.vue?vue&type=script&lang=js&\"","
\n \n \n \n
\n \n \n {{ parseTimestamp(note.created_at) }}\n
\n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./NoteCard.vue?vue&type=template&id=3e6c4f7e&\"\nimport script from \"./NoteCard.vue?vue&type=script&lang=js&\"\nexport * from \"./NoteCard.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NoteCard.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"NoteCard.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-card',{staticClass:\"note-card\"},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('div',{staticClass:\"note-header\"},[_c('div',{staticClass:\"note-actor-container\"},[_c('div',{staticClass:\"note-actor\"},[_c('img',{staticClass:\"note-avatar-img\",attrs:{\"src\":_vm.note.user.avatar}}),_vm._v(\" \"),_c('h3',{staticClass:\"note-actor-name\"},[_vm._v(_vm._s(_vm.note.user.display_name))])]),_vm._v(\" \"),_c('a',{attrs:{\"href\":_vm.note.user.url,\"target\":\"_blank\"}},[_vm._v(\"\\n @\"+_vm._s(_vm.note.user.display_name)+\"\\n \")])]),_vm._v(\" \"),_c('div',[_c('el-popconfirm',{attrs:{\"title\":\"Are you sure to delete this?\",\"confirm-button-text\":\"Yes\",\"cancel-button-text\":\"No\"},on:{\"onConfirm\":function($event){return _vm.handleNoteDeletion(_vm.note.id, _vm.report.id)}}},[_c('el-button',{attrs:{\"slot\":\"reference\",\"size\":\"mini\"},slot:\"reference\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.deleteNote'))+\"\\n \")])],1)],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"note-body\"},[_c('span',{staticClass:\"note-content\",domProps:{\"innerHTML\":_vm._s(_vm.note.content)}}),_vm._v(\"\\n \"+_vm._s(_vm.parseTimestamp(_vm.note.created_at))+\"\\n \")])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModerateUserDropdown.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModerateUserDropdown.vue?vue&type=script&lang=js&\"","
\n \n {{ $t('reports.moderateUser') }}\n \n \n \n \n {{ account.deactivated ? $t('users.activateAccount') : $t('users.deactivateAccount') }}\n \n \n {{ $t('users.deleteAccount') }}\n \n \n {{ $t('users.forceNsfw') }}\n \n \n \n {{ $t('users.stripMedia') }}\n \n \n \n {{ $t('users.forceUnlisted') }}\n \n \n \n {{ $t('users.sandbox') }}\n \n \n \n {{ $t('users.disableRemoteSubscription') }}\n \n \n \n {{ $t('users.disableAnySubscription') }}\n \n \n \n \n\n\n\n","import { render, staticRenderFns } from \"./ModerateUserDropdown.vue?vue&type=template&id=bcf0134c&\"\nimport script from \"./ModerateUserDropdown.vue?vue&type=script&lang=js&\"\nexport * from \"./ModerateUserDropdown.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"ModerateUserDropdown.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dropdown',{attrs:{\"trigger\":\"click\"}},[_c('el-button',{attrs:{\"disabled\":!_vm.account.id,\"plain\":\"\",\"size\":\"small\",\"icon\":\"el-icon-files\"}},[_vm._v(_vm._s(_vm.$t('reports.moderateUser'))+\"\\n \"),_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"})]),_vm._v(\" \"),_c('el-dropdown-menu',{attrs:{\"slot\":\"dropdown\"},slot:\"dropdown\"},[(_vm.showDeactivatedButton(_vm.account))?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.handleDeactivation(_vm.account)}}},[_vm._v(\"\\n \"+_vm._s(_vm.account.deactivated ? _vm.$t('users.activateAccount') : _vm.$t('users.deactivateAccount'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.showDeactivatedButton(_vm.account.id))?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.handleDeletion(_vm.account.id)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.deleteAccount'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('force_nsfw') },attrs:{\"divided\":true},nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'force_nsfw')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.forceNsfw'))+\"\\n \"),(_vm.tags.includes('force_nsfw'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('strip_media') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'strip_media')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.stripMedia'))+\"\\n \"),(_vm.tags.includes('strip_media'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('force_unlisted') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'force_unlisted')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.forceUnlisted'))+\"\\n \"),(_vm.tags.includes('force_unlisted'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('sandbox') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'sandbox')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.sandbox'))+\"\\n \"),(_vm.tags.includes('sandbox'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),(_vm.account.local)?_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('disable_remote_subscription') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'disable_remote_subscription')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.disableRemoteSubscription'))+\"\\n \"),(_vm.tags.includes('disable_remote_subscription'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]):_vm._e(),_vm._v(\" \"),(_vm.account.local)?_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('disable_any_subscription') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'disable_any_subscription')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.disableAnySubscription'))+\"\\n \"),(_vm.tags.includes('disable_any_subscription'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Report.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Report.vue?vue&type=script&lang=js&\"","
\n \n
\n \n \n \n \n 0\">\n \n {{ $t('reports.content') }}:\n {{ report.content }}\n \n
\n \n \n \n \n \n \n \n
\n\n\n\n\n\n","import { render, staticRenderFns } from \"./Report.vue?vue&type=template&id=2161c30a&\"\nimport script from \"./Report.vue?vue&type=script&lang=js&\"\nexport * from \"./Report.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Report.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"Report.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('el-timeline',{staticClass:\"reports-timeline\"},_vm._l((_vm.reports),function(report){return _c('el-timeline-item',{key:report.id,staticClass:\"timeline-item-container\",attrs:{\"timestamp\":_vm.parseTimestamp(report.created_at),\"placement\":\"top\"}},[_c('el-card',{staticClass:\"report\"},[_c('div',{staticClass:\"report-header-container\"},[_c('div',{staticClass:\"title-container\"},[(_vm.accountExists(report.account, 'display_name'))?_c('h3',{staticClass:\"report-title\"},[_vm._v(_vm._s(_vm.$t('reports.reportOn'))+\" \"+_vm._s(report.account.display_name))]):_c('h3',{staticClass:\"report-title\"},[_vm._v(_vm._s(_vm.$t('reports.report')))]),_vm._v(\" \"),_c('h5',{staticClass:\"id\"},[_vm._v(_vm._s(_vm.$t('reports.id'))+\": \"+_vm._s(report.id))])]),_vm._v(\" \"),_c('div',[_c('el-tag',{staticClass:\"report-tag\",attrs:{\"type\":_vm.getStateType(report.state),\"size\":\"large\"}},[_vm._v(_vm._s(_vm.capitalizeFirstLetter(report.state)))]),_vm._v(\" \"),_c('el-dropdown',{attrs:{\"trigger\":\"click\"}},[_c('el-button',{staticClass:\"report-actions-button\",attrs:{\"plain\":\"\",\"size\":\"small\",\"icon\":\"el-icon-edit\"}},[_vm._v(_vm._s(_vm.$t('reports.changeState'))),_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"})]),_vm._v(\" \"),_c('el-dropdown-menu',{attrs:{\"slot\":\"dropdown\"},slot:\"dropdown\"},[(report.state !== 'resolved')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeReportState('resolved', report.id)}}},[_vm._v(_vm._s(_vm.$t('reports.resolve')))]):_vm._e(),_vm._v(\" \"),(report.state !== 'open')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeReportState('open', report.id)}}},[_vm._v(_vm._s(_vm.$t('reports.reopen')))]):_vm._e(),_vm._v(\" \"),(report.state !== 'closed')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeReportState('closed', report.id)}}},[_vm._v(_vm._s(_vm.$t('reports.close')))]):_vm._e()],1)],1),_vm._v(\" \"),_c('moderate-user-dropdown',{attrs:{\"account\":report.account}})],1)]),_vm._v(\" \"),_c('div',[_c('el-divider',{staticClass:\"divider\"}),_vm._v(\" \"),_c('span',{staticClass:\"report-row-key\"},[_vm._v(_vm._s(_vm.$t('reports.account'))+\":\")]),_vm._v(\" \"),(_vm.accountExists(report.account, 'avatar') && _vm.accountExists(report.account, 'display_name'))?_c('span',[_c('img',{staticClass:\"avatar-img\",attrs:{\"src\":report.account.avatar,\"alt\":\"avatar\"}}),_vm._v(\" \"),(!report.account.deactivated)?_c('a',{staticClass:\"account\",attrs:{\"href\":report.account.url,\"target\":\"_blank\"}},[_c('span',[_vm._v(_vm._s(report.account.display_name))])]):_c('span',[_vm._v(\"\\n \"+_vm._s(report.account.display_name)+\"\\n \"),_c('span',{staticClass:\"deactivated\"},[_vm._v(\" (deactivated)\")])])]):_c('span',{staticClass:\"deactivated\"},[_vm._v(\"(\"+_vm._s(_vm.$t('reports.notFound'))+\")\")])],1),_vm._v(\" \"),(report.content && report.content.length > 0)?_c('div',[_c('el-divider',{staticClass:\"divider\"}),_vm._v(\" \"),_c('span',{staticClass:\"report-row-key\"},[_vm._v(_vm._s(_vm.$t('reports.content'))+\":\\n \"),_c('span',[_vm._v(_vm._s(report.content))])])],1):_vm._e(),_vm._v(\" \"),_c('div',{style:(_vm.showStatuses(report.statuses) ? '' : 'margin-bottom:15px')},[_c('el-divider',{staticClass:\"divider\"}),_vm._v(\" \"),_c('span',{staticClass:\"report-row-key\"},[_vm._v(_vm._s(_vm.$t('reports.actor'))+\":\")]),_vm._v(\" \"),(_vm.accountExists(report.actor, 'avatar') && _vm.accountExists(report.actor, 'display_name'))?_c('span',[_c('img',{staticClass:\"avatar-img\",attrs:{\"src\":report.actor.avatar,\"alt\":\"avatar\"}}),_vm._v(\" \"),_c('a',{staticClass:\"account\",attrs:{\"href\":report.actor.url,\"target\":\"_blank\"}},[_c('span',[_vm._v(_vm._s(report.actor.display_name))])])]):_c('span',{staticClass:\"deactivated\"},[_vm._v(\"(\"+_vm._s(_vm.$t('reports.notFound'))+\")\")])],1),_vm._v(\" \"),(_vm.showStatuses(report.statuses))?_c('div',{staticClass:\"statuses\"},[_c('el-collapse',[_c('el-collapse-item',{attrs:{\"title\":_vm.getStatusesTitle(report.statuses)}},_vm._l((report.statuses),function(status){return _c('div',{key:status.id},[_c('status',{attrs:{\"status\":status,\"account\":status.account.display_name ? status.account : report.account,\"show-checkbox\":false,\"page\":_vm.currentPage}})],1)}),0)],1)],1):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"report-notes\"},[_c('el-collapse',[_c('el-collapse-item',{attrs:{\"title\":_vm.getNotesTitle(report.notes)}},_vm._l((report.notes),function(note,index){return _c('note-card',{key:index,attrs:{\"note\":note,\"report\":report}})}),1)],1),_vm._v(\" \"),_c('div',{staticClass:\"report-note-form\"},[_c('el-input',{attrs:{\"placeholder\":_vm.$t('reports.leaveNote'),\"type\":\"textarea\",\"rows\":\"2\"},model:{value:(_vm.notes[report.id]),callback:function ($$v) {_vm.$set(_vm.notes, report.id, $$v)},expression:\"notes[report.id]\"}}),_vm._v(\" \"),_c('div',{staticClass:\"report-post-note\"},[_c('el-button',{on:{\"click\":function($event){return _vm.handleNewNote(report.id)}}},[_vm._v(_vm._s(_vm.$t('reports.postNote')))])],1)],1)],1)])],1)}),1),_vm._v(\" \"),(!_vm.loading)?_c('div',{staticClass:\"reports-pagination\"},[_c('el-pagination',{attrs:{\"total\":_vm.totalReportsCount,\"current-page\":_vm.currentPage,\"page-size\":_vm.pageSize,\"background\":\"\",\"layout\":\"prev, pager, next\"},on:{\"current-change\":_vm.handlePageChange}})],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportsFilter.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportsFilter.vue?vue&type=script&lang=js&\"","
\n \n {{ item.label }}\n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./ReportsFilter.vue?vue&type=template&id=ecc36f5a&scoped=true&\"\nimport script from \"./ReportsFilter.vue?vue&type=script&lang=js&\"\nexport * from \"./ReportsFilter.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ReportsFilter.vue?vue&type=style&index=0&id=ecc36f5a&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"ecc36f5a\",\n null\n \n)\n\ncomponent.options.__file = \"ReportsFilter.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-select',{staticClass:\"select-field\",attrs:{\"placeholder\":_vm.$t('reportsFilter.inputPlaceholder'),\"clearable\":\"\",\"value-key\":\"value\"},on:{\"change\":_vm.toggleFilters},model:{value:(_vm.filter),callback:function ($$v) {_vm.filter=$$v},expression:\"filter\"}},_vm._l((_vm.options),function(item){return _c('el-option',{key:item.value,attrs:{\"label\":item.label,\"value\":item.value}},[_vm._v(_vm._s(item.label))])}),1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","
\n \n \n
\n \n
\n
\n
\n \n
There are no reports to display
\n
\n \n
\n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=fa601560&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&id=fa601560&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"fa601560\",\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(!_vm.status.deleted)?_c('el-card',{staticClass:\"status-card\"},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('div',{staticClass:\"status-header\"},[_c('div',{staticClass:\"status-account-container\"},[_c('div',{staticClass:\"status-account\"},[(_vm.showCheckbox)?_c('el-checkbox',{staticClass:\"status-checkbox\",on:{\"change\":function($event){return _vm.handleStatusSelection(_vm.account)}}}):_vm._e(),_vm._v(\" \"),_c('img',{staticClass:\"status-avatar-img\",attrs:{\"src\":_vm.account.avatar}}),_vm._v(\" \"),(!_vm.account.deactivated)?_c('a',{staticClass:\"account\",attrs:{\"href\":_vm.account.url,\"target\":\"_blank\"}},[_c('h3',{staticClass:\"status-account-name\"},[_vm._v(_vm._s(_vm.account.display_name))])]):_c('span',[_c('h3',{staticClass:\"status-account-name\"},[_vm._v(_vm._s(_vm.account.display_name))]),_vm._v(\" \"),_c('h3',{staticClass:\"status-account-name deactivated\"},[_vm._v(\" (deactivated)\")])])],1)]),_vm._v(\" \"),_c('div',{staticClass:\"status-actions\"},[(_vm.status.sensitive)?_c('el-tag',{attrs:{\"type\":\"warning\",\"size\":\"large\"}},[_vm._v(_vm._s(_vm.$t('reports.sensitive')))]):_vm._e(),_vm._v(\" \"),_c('el-tag',{attrs:{\"size\":\"large\"}},[_vm._v(_vm._s(_vm.capitalizeFirstLetter(_vm.status.visibility)))]),_vm._v(\" \"),_c('el-dropdown',{attrs:{\"trigger\":\"click\"}},[_c('el-button',{staticClass:\"status-actions-button\",attrs:{\"plain\":\"\",\"size\":\"small\",\"icon\":\"el-icon-edit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.changeScope'))),_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"})]),_vm._v(\" \"),_c('el-dropdown-menu',{attrs:{\"slot\":\"dropdown\"},slot:\"dropdown\"},[(!_vm.status.sensitive)?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, true, _vm.status.visibility)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.addSensitive'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.sensitive)?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, false, _vm.status.visibility)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.removeSensitive'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'public')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'public')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.public'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'private')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'private')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.private'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'unlisted')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'unlisted')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.unlisted'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.deleteStatus(_vm.status.id)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.deleteStatus'))+\"\\n \")])],1)],1)],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"status-body\"},[(_vm.status.spoiler_text)?_c('div',[_c('strong',[_vm._v(_vm._s(_vm.status.spoiler_text))]),_vm._v(\" \"),(!_vm.showHiddenStatus)?_c('el-button',{staticClass:\"show-more-button\",attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.showHiddenStatus = true}}},[_vm._v(\"Show more\")]):_vm._e(),_vm._v(\" \"),(_vm.showHiddenStatus)?_c('el-button',{staticClass:\"show-more-button\",attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.showHiddenStatus = false}}},[_vm._v(\"Show less\")]):_vm._e(),_vm._v(\" \"),(_vm.showHiddenStatus)?_c('div',[_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}),_vm._v(\" \"),(_vm.status.poll)?_c('div',{staticClass:\"poll\"},[_c('ul',_vm._l((_vm.status.poll.options),function(option,index){return _c('li',{key:index},[_vm._v(\"\\n \"+_vm._s(option.title)+\"\\n \"),_c('el-progress',{attrs:{\"percentage\":_vm.optionPercent(_vm.status.poll, option)}})],1)}),0)]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.status.media_attachments),function(attachment,index){return _c('div',{key:index,staticClass:\"image\"},[_c('img',{attrs:{\"src\":attachment.preview_url}})])})],2):_vm._e()],1):_vm._e(),_vm._v(\" \"),(!_vm.status.spoiler_text)?_c('div',[_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}),_vm._v(\" \"),(_vm.status.poll)?_c('div',{staticClass:\"poll\"},[_c('ul',_vm._l((_vm.status.poll.options),function(option,index){return _c('li',{key:index},[_vm._v(\"\\n \"+_vm._s(option.title)+\"\\n \"),_c('el-progress',{attrs:{\"percentage\":_vm.optionPercent(_vm.status.poll, option)}})],1)}),0)]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.status.media_attachments),function(attachment,index){return _c('div',{key:index,staticClass:\"image\"},[_c('img',{attrs:{\"src\":attachment.preview_url}})])})],2):_vm._e(),_vm._v(\" \"),_c('a',{staticClass:\"account\",attrs:{\"href\":_vm.status.url,\"target\":\"_blank\"}},[_vm._v(\"\\n \"+_vm._s(_vm.parseTimestamp(_vm.status.created_at))+\"\\n \")])])]):_c('el-card',{staticClass:\"status-card\"},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('div',{staticClass:\"status-header\"},[_c('div',{staticClass:\"status-account-container\"},[_c('div',{staticClass:\"status-account\"},[_c('h4',{staticClass:\"status-deleted\"},[_vm._v(_vm._s(_vm.$t('reports.statusDeleted')))])])])])]),_vm._v(\" \"),_c('div',{staticClass:\"status-body\"},[(_vm.status.content)?_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}):_c('span',{staticClass:\"status-without-content\"},[_vm._v(\"no content\")])]),_vm._v(\" \"),(_vm.status.created_at)?_c('a',{staticClass:\"account\",attrs:{\"href\":_vm.status.url,\"target\":\"_blank\"}},[_vm._v(\"\\n \"+_vm._s(_vm.parseTimestamp(_vm.status.created_at))+\"\\n \")]):_vm._e()])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","
\n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0fdc1bba&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.needReboot)?_c('el-tooltip',{attrs:{\"content\":_vm.$t('settings.restartApp'),\"placement\":\"bottom-end\"}},[_c('el-button',{staticClass:\"reboot-button\",attrs:{\"type\":\"warning\"},on:{\"click\":_vm.restartApp}},[_c('span',[_c('i',{staticClass:\"el-icon-refresh\"}),_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.instanceReboot'))+\"\\n \")])])],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","
\n \n \n \n \n {{ $t('settings.instanceReboot') }}\n \n \n \n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=53cfaf1d&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports"],"sourceRoot":""}
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-c5f4.304479e7.js b/priv/static/adminfe/static/js/chunk-c5f4.304479e7.js
new file mode 100644
index 000000000..4220621be
--- /dev/null
+++ b/priv/static/adminfe/static/js/chunk-c5f4.304479e7.js
@@ -0,0 +1,2 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-c5f4"],{"26YS":function(e,t,a){"use strict";a.r(t);var o=a("o0o1"),s=a.n(o),i=a("yXPU"),c=a.n(i),l=a("MVZn"),n=a.n(l),r=a("mm8V"),m={props:{host:{type:String,required:!0},packName:{type:String,required:!0},shortcode:{type:String,required:!0},file:{type:String,required:!0},isLocal:{type:Boolean,required:!0}},data:function(){return{newShortcode:null,newFile:null,copyToLocalPackName:null,copyPopoverVisible:!1,copyToShortcode:"",copyToFilename:""}},computed:{emojiName:{get:function(){return null!==this.newShortcode?this.newShortcode:this.shortcode},set:function(e){this.newShortcode=e}},emojiFile:{get:function(){return null!==this.newFile?this.newFile:this.file},set:function(e){this.newFile=e}},isDesktop:function(){return"desktop"===this.$store.state.app.device},isMobile:function(){return"mobile"===this.$store.state.app.device},localPacks:function(){return this.$store.state.emojiPacks.localPacks},remoteInstance:function(){return new URL(this.$store.state.emojiPacks.remoteInstance).host}},methods:{update:function(){var e=c()(s.a.mark(function e(){return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.$store.dispatch("UpdateEmojiFile",{packName:this.packName,shortcode:this.shortcode,newShortcode:this.emojiName,newFilename:this.emojiFile,force:!0}),e.next=7;break;case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return");case 7:this.newShortcode=null,this.newFile=null,this.$store.dispatch("ReloadEmoji");case 10:case"end":return e.stop()}},e,this,[[0,4]])}));return function(){return e.apply(this,arguments)}}(),remove:function(){var e=this;this.$confirm("This will delete the emoji, are you sure?","Warning",{confirmButtonText:"Yes, delete the emoji",cancelButtonText:"No, leave it be",type:"warning"}).then(function(){e.$store.dispatch("DeleteEmojiFile",{packName:e.packName,shortcode:e.shortcode}).then(function(){e.newShortcode=null,e.newFile=null,e.$store.dispatch("ReloadEmoji")})})},copyToLocal:function(){try{this.$store.dispatch("AddNewEmojiFile",{packName:this.copyToLocalPackName,file:this.addressOfEmojiInPack(this.remoteInstance,this.packName,this.file),shortcode:""!==this.copyToShortcode.trim()?this.copyToShortcode.trim():this.shortcode,filename:""!==this.copyToFilename.trim()?this.copyToFilename.trim():this.file})}catch(e){return}this.copyToLocalPackName=null,this.copyToLocalVisible=!1,this.copyToShortcode="",this.copyToFilename="",this.$store.dispatch("ReloadEmoji")},addressOfEmojiInPack:r.b}},p=(a("4ySm"),a("KHd+")),d=Object(p.a)(m,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[e.isLocal?a("div",{class:e.isMobile?"emoji-container-flex":"emoji-container-grid"},[a("img",{staticClass:"emoji-preview-img",attrs:{src:e.addressOfEmojiInPack(e.host,e.packName,e.file)}}),e._v(" "),a("el-input",{staticClass:"emoji-info",attrs:{placeholder:e.$t("emoji.shortcode")},model:{value:e.emojiName,callback:function(t){e.emojiName=t},expression:"emojiName"}}),e._v(" "),a("el-input",{staticClass:"emoji-info",attrs:{placeholder:e.$t("emoji.file")},model:{value:e.emojiFile,callback:function(t){e.emojiFile=t},expression:"emojiFile"}}),e._v(" "),a("div",{staticClass:"emoji-buttons"},[a("el-button",{attrs:{type:"primary"},on:{click:e.update}},[e._v(e._s(e.$t("emoji.update")))]),e._v(" "),a("el-button",{staticClass:"remove-emoji-button",on:{click:e.remove}},[e._v(e._s(e.$t("emoji.remove")))])],1)],1):e._e(),e._v(" "),e.isLocal?e._e():a("div",{class:e.isMobile?"emoji-container-flex":"remote-emoji-container-grid"},[a("img",{staticClass:"emoji-preview-img",attrs:{src:e.addressOfEmojiInPack(e.remoteInstance,e.packName,e.file)}}),e._v(" "),a("el-input",{staticClass:"emoji-info",attrs:{value:e.emojiName,placeholder:e.$t("emoji.shortcode")}}),e._v(" "),a("el-input",{staticClass:"emoji-info",attrs:{value:e.emojiFile,placeholder:e.$t("emoji.file")}}),e._v(" "),a("el-popover",{staticClass:"copy-pack-container",attrs:{placement:"left-start","popper-class":"copy-popover"},model:{value:e.copyPopoverVisible,callback:function(t){e.copyPopoverVisible=t},expression:"copyPopoverVisible"}},[a("p",[e._v(e._s(e.$t("emoji.selectLocalPack")))]),e._v(" "),a("el-select",{staticClass:"copy-pack-select",attrs:{placeholder:e.$t("emoji.localPack")},model:{value:e.copyToLocalPackName,callback:function(t){e.copyToLocalPackName=t},expression:"copyToLocalPackName"}},e._l(e.localPacks,function(e,t){return a("el-option",{key:t,attrs:{label:t,value:t}})}),1),e._v(" "),a("p",[e._v(e._s(e.$t("emoji.specifyShortcode")))]),e._v(" "),a("el-input",{attrs:{placeholder:e.$t("emoji.leaveEmptyShortcode")},model:{value:e.copyToShortcode,callback:function(t){e.copyToShortcode=t},expression:"copyToShortcode"}}),e._v(" "),a("p",[e._v(e._s(e.$t("emoji.specifyFilename")))]),e._v(" "),a("el-input",{attrs:{placeholder:e.$t("emoji.leaveEmptyFilename")},model:{value:e.copyToFilename,callback:function(t){e.copyToFilename=t},expression:"copyToFilename"}}),e._v(" "),a("el-button",{staticClass:"copy-to-local-pack-button",attrs:{disabled:!e.copyToLocalPackName,type:"primary"},on:{click:e.copyToLocal}},[e._v(e._s(e.$t("emoji.copy")))]),e._v(" "),a("el-button",{staticClass:"emoji-button",attrs:{slot:"reference",type:"primary"},slot:"reference"},[e._v(e._s(e.$t("emoji.copyToLocalPack")))])],1)],1)])},[],!1,null,null,null);d.options.__file="SingleEmojiEditor.vue";var u=d.exports,h={props:{packName:{type:String,required:!0}},data:function(){return{shortcode:"",imageUploadURL:"",customFileName:""}},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device},isMobile:function(){return"mobile"===this.$store.state.app.device}},methods:{uploadEmoji:function(){var e=c()(s.a.mark(function e(t){var a;return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:a=t.file,e.prev=1,this.$store.dispatch("AddNewEmojiFile",{packName:this.packName,file:a||this.imageUploadURL,shortcode:this.shortcode,filename:this.customFileName}),e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(1),e.abrupt("return");case 8:this.shortcode="",this.imageUploadURL="",this.customFileName="",this.$store.dispatch("ReloadEmoji");case 12:case"end":return e.stop()}},e,this,[[1,5]])}));return function(t){return e.apply(this,arguments)}}()}},k=(a("IVv3"),Object(p.a)(h,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-form",{staticClass:"new-emoji-uploader-form",attrs:{"label-position":e.isMobile?"top":"left","label-width":"130px",size:"small"}},[a("el-form-item",{attrs:{label:e.$t("emoji.shortcode")}},[a("el-input",{attrs:{placeholder:e.$t("emoji.optional")},model:{value:e.shortcode,callback:function(t){e.shortcode=t},expression:"shortcode"}})],1),e._v(" "),a("el-form-item",{attrs:{label:e.$t("emoji.customFilename")}},[a("el-input",{attrs:{placeholder:e.$t("emoji.optional")},model:{value:e.customFileName,callback:function(t){e.customFileName=t},expression:"customFileName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:e.$t("emoji.uploadFile")}},[a("div",{staticClass:"upload-file-url"},[a("el-input",{attrs:{placeholder:e.$t("emoji.url")},model:{value:e.imageUploadURL,callback:function(t){e.imageUploadURL=t},expression:"imageUploadURL"}}),e._v(" "),a("el-button",{staticClass:"upload-button",attrs:{type:"primary"},on:{click:e.uploadEmoji}},[e._v(e._s(e.$t("emoji.upload")))])],1),e._v(" "),a("div",{staticClass:"upload-container"},[a("p",{staticClass:"text"},[e._v("or")]),e._v(" "),a("el-upload",{attrs:{"http-request":e.uploadEmoji,multiple:!1,"show-file-list":!1,action:"add"}},[a("el-button",{attrs:{type:"primary"}},[e._v(e._s(e.$t("emoji.clickToUpload")))])],1)],1)])],1)},[],!1,null,null,null));k.options.__file="NewEmojiUploader.vue";var f={components:{SingleEmojiEditor:u,NewEmojiUploader:k.exports},props:{name:{type:String,required:!0},pack:{type:Object,required:!0},host:{type:String,required:!0},isLocal:{type:Boolean,required:!0}},data:function(){return{showPackContent:[]}},computed:{isMobile:function(){return"mobile"===this.$store.state.app.device},isTablet:function(){return"tablet"===this.$store.state.app.device},labelWidth:function(){return this.isMobile?"90px":(this.isTablet,"155px")},share:{get:function(){return this.pack.pack["share-files"]},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"share-files",value:e})}},homepage:{get:function(){return this.pack.pack.homepage},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"homepage",value:e})}},description:{get:function(){return this.pack.pack.description},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"description",value:e})}},license:{get:function(){return this.pack.pack.license},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"license",value:e})}},fallbackSrc:{get:function(){return this.pack.pack["fallback-src"]},set:function(e){""!==e.trim()?this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src",value:e}):(this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src",value:null}),this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src-sha256",value:null}))}}},methods:{deletePack:function(){var e=this;this.$confirm("This will delete the pack, are you sure?","Warning",{confirmButtonText:"Yes, delete the pack",cancelButtonText:"No, leave it be",type:"warning"}).then(function(){e.$store.dispatch("DeletePack",{name:e.name}).then(function(){return e.$store.dispatch("ReloadEmoji")}).then(function(){return e.$store.dispatch("SetLocalEmojiPacks")})}).catch(function(){})},savePackMetadata:function(){this.$store.dispatch("SavePackMetadata",{packName:this.name})}}},v=(a("LE4i"),Object(p.a)(f,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-collapse-item",{staticClass:"has-background",attrs:{title:e.name,name:e.name}},[a("el-form",{staticClass:"emoji-pack-metadata",attrs:{"label-width":e.labelWidth,"label-position":"left",size:"small"}},[a("el-form-item",{attrs:{label:e.$t("emoji.sharePack")}},[a("el-switch",{model:{value:e.share,callback:function(t){e.share=t},expression:"share"}})],1),e._v(" "),a("el-form-item",{attrs:{label:e.$t("emoji.homepage")}},[a("el-input",{model:{value:e.homepage,callback:function(t){e.homepage=t},expression:"homepage"}})],1),e._v(" "),a("el-form-item",{attrs:{label:e.$t("emoji.description")}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}})],1),e._v(" "),a("el-form-item",{attrs:{label:e.$t("emoji.license")}},[a("el-input",{model:{value:e.license,callback:function(t){e.license=t},expression:"license"}})],1),e._v(" "),a("el-form-item",{attrs:{label:e.$t("emoji.fallbackSrc")}},[a("el-input",{model:{value:e.fallbackSrc,callback:function(t){e.fallbackSrc=t},expression:"fallbackSrc"}})],1),e._v(" "),e.fallbackSrc&&""!==e.fallbackSrc.trim()?a("el-form-item",{attrs:{label:e.$t("emoji.fallbackSrcSha")}},[e._v("\n "+e._s(e.pack.pack["fallback-src-sha256"])+"\n ")]):e._e()],1),e._v(" "),a("div",{staticClass:"pack-button-container"},[a("div",{staticClass:"save-pack-button-container"},[a("el-button",{staticClass:"save-pack-button",attrs:{type:"primary"},on:{click:e.savePackMetadata}},[e._v(e._s(e.$t("emoji.saveMetadata")))]),e._v(" "),a("el-button",{staticClass:"delete-pack-button",on:{click:e.deletePack}},[e._v(e._s(e.$t("emoji.deletePack")))])],1),e._v(" "),a("div",{staticClass:"download-pack-button-container"},[e.pack.pack["can-download"]?a("el-link",{attrs:{href:"//"+e.host+"/api/pleroma/emoji/packs/"+e.name+"/download_shared",underline:!1,type:"primary",target:"_blank"}},[a("el-button",{staticClass:"download-archive"},[e._v(e._s(e.$t("emoji.downloadPackArchive")))])],1):e._e()],1)]),e._v(" "),a("el-collapse",{staticClass:"contents-collapse",model:{value:e.showPackContent,callback:function(t){e.showPackContent=t},expression:"showPackContent"}},[e.isLocal?a("el-collapse-item",{staticClass:"no-background",attrs:{title:e.$t("emoji.addNewEmoji"),name:"addEmoji"}},[a("new-emoji-uploader",{attrs:{"pack-name":e.name}})],1):e._e(),e._v(" "),e.pack.files.length>0?a("el-collapse-item",{staticClass:"no-background",attrs:{title:e.$t("emoji.manageEmoji"),name:"manageEmoji"}},e._l(e.pack.files,function(t){var o=t[0],s=t[1];return a("single-emoji-editor",{key:o,attrs:{host:e.host,"pack-name":e.name,shortcode:o,file:s,"is-local":e.isLocal}})}),1):e._e()],1)],1)},[],!1,null,null,null));v.options.__file="LocalEmojiPack.vue";var b=v.exports,j={components:{SingleEmojiEditor:u},props:{name:{type:String,required:!0},pack:{type:Object,required:!0},host:{type:String,required:!0},isLocal:{type:Boolean,required:!0}},data:function(){return{showPackContent:[],downloadSharedAs:""}},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device},isMobile:function(){return"mobile"===this.$store.state.app.device},isTablet:function(){return"tablet"===this.$store.state.app.device},labelWidth:function(){return this.isMobile?"90px":(this.isTablet,"120px")},loadRemotePack:function(){return this.$store.state.emojiPacks.activeCollapseItems.includes(this.name)},remoteInstanceAddress:function(){return this.$store.state.emojiPacks.remoteInstance},share:{get:function(){return this.pack.pack["share-files"]},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"share-files",value:e})}},homepage:{get:function(){return this.pack.pack.homepage},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"homepage",value:e})}},description:{get:function(){return this.pack.pack.description},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"description",value:e})}},license:{get:function(){return this.pack.pack.license},set:function(e){this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"license",value:e})}},fallbackSrc:{get:function(){return this.pack.pack["fallback-src"]},set:function(e){""!==e.trim()?this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src",value:e}):(this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src",value:null}),this.$store.dispatch("UpdateLocalPackVal",{name:this.name,key:"fallback-src-sha256",value:null}))}}},methods:{downloadFromInstance:function(){var e=this;this.$store.dispatch("DownloadFrom",{instanceAddress:this.remoteInstanceAddress,packName:this.name,as:this.downloadSharedAs}).then(function(){return e.$store.dispatch("ReloadEmoji")}).then(function(){return e.$store.dispatch("SetLocalEmojiPacks")})}}},_=(a("Zd0x"),Object(p.a)(j,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-collapse-item",{staticClass:"has-background",attrs:{title:e.name,name:e.name}},[e.loadRemotePack?a("div",[a("el-form",{staticClass:"emoji-pack-metadata remote-pack-metadata",attrs:{"label-width":e.labelWidth,"label-position":"left",size:"small"}},[a("el-form-item",{attrs:{label:e.$t("emoji.sharePack")}},[a("el-switch",{attrs:{disabled:""},model:{value:e.share,callback:function(t){e.share=t},expression:"share"}})],1),e._v(" "),e.homepage?a("el-form-item",{attrs:{label:e.$t("emoji.homepage")}},[a("span",[e._v(e._s(e.homepage))])]):e._e(),e._v(" "),e.description?a("el-form-item",{attrs:{label:e.$t("emoji.description")}},[a("span",[e._v(e._s(e.description))])]):e._e(),e._v(" "),e.license?a("el-form-item",{attrs:{label:e.$t("emoji.license")}},[a("span",[e._v(e._s(e.license))])]):e._e(),e._v(" "),e.fallbackSrc?a("el-form-item",{attrs:{label:e.$t("emoji.fallbackSrc")}},[a("span",[e._v(e._s(e.fallbackSrc))])]):e._e(),e._v(" "),e.fallbackSrc&&""!==e.fallbackSrc.trim()?a("el-form-item",{attrs:{label:e.$t("emoji.fallbackSrcSha")}},[e._v("\n "+e._s(e.pack.pack["fallback-src-sha256"])+"\n ")]):e._e(),e._v(" "),a("el-form-item",[e.pack.pack["can-download"]?a("el-link",{attrs:{href:e.pack.pack["fallback-src"],underline:!1,type:"primary",target:"_blank"}},[a("el-button",{staticClass:"download-archive"},[e._v(e._s(e.$t("emoji.downloadPackArchive")))])],1):e._e()],1)],1),e._v(" "),a("el-collapse",{staticClass:"contents-collapse",model:{value:e.showPackContent,callback:function(t){e.showPackContent=t},expression:"showPackContent"}},[e.pack.files.length>0?a("el-collapse-item",{staticClass:"no-background",attrs:{title:e.$t("emoji.manageEmoji"),name:"manageEmoji"}},e._l(e.pack.files,function(t){var o=t[0],s=t[1];return a("single-emoji-editor",{key:o,attrs:{host:e.host,"pack-name":e.name,shortcode:o,file:s,"is-local":e.isLocal}})}),1):e._e(),e._v(" "),a("el-collapse-item",{staticClass:"no-background",attrs:{title:e.$t("emoji.downloadPack"),name:"downloadPack"}},[a("p",[e._v("\n "+e._s(e.$t("emoji.thisWillDownload"))+' "'+e._s(e.name)+'" '+e._s(e.$t("emoji.downloadToCurrentInstance"))+'\n "'+e._s(""===e.downloadSharedAs.trim()?e.name:e.downloadSharedAs)+'" ('+e._s(e.$t("emoji.canBeChanged"))+").\n "+e._s(e.$t("emoji.willBeUsable"))+".\n ")]),e._v(" "),a("div",{staticClass:"download-shared-pack"},[a("el-input",{attrs:{placeholder:e.$t("emoji.downloadAsOptional")},model:{value:e.downloadSharedAs,callback:function(t){e.downloadSharedAs=t},expression:"downloadSharedAs"}}),e._v(" "),a("el-button",{staticClass:"download-shared-pack-button",attrs:{type:"primary"},on:{click:e.downloadFromInstance}},[e._v("\n "+e._s(e.isDesktop?e.$t("emoji.downloadSharedPack"):e.$t("emoji.downloadSharedPackMobile"))+"\n ")])],1)])],1)],1):e._e()])},[],!1,null,null,null));_.options.__file="RemoteEmojiPack.vue";var $=_.exports,P=a("mSNy"),y={components:{LocalEmojiPack:b,RebootButton:a("rIUS").a,RemoteEmojiPack:$},data:function(){return{newPackName:"",activeLocalPack:[],activeRemotePack:[],fullscreenLoading:!1}},computed:{isMobile:function(){return"mobile"===this.$store.state.app.device},isTablet:function(){return"tablet"===this.$store.state.app.device},labelWidth:function(){return this.isMobile?"105px":this.isTablet?"180px":"240px"},localPacks:function(){return this.$store.state.emojiPacks.localPacks},remoteInstanceAddress:{get:function(){return this.$store.state.emojiPacks.remoteInstance},set:function(e){this.$store.dispatch("SetRemoteInstance",e)}},remotePacks:function(){return this.$store.state.emojiPacks.remotePacks}},mounted:function(){this.$store.dispatch("GetNodeInfo"),this.$store.dispatch("NeedReboot"),this.refreshLocalPacks()},methods:{createLocalPack:function(){var e=this;this.$store.dispatch("CreatePack",{name:this.newPackName}).then(function(){e.newPackName="",e.$store.dispatch("SetLocalEmojiPacks"),e.$store.dispatch("ReloadEmoji")})},importFromFS:function(){var e=this;this.$store.dispatch("ImportFromFS").then(function(){e.$store.dispatch("SetLocalEmojiPacks"),e.$store.dispatch("ReloadEmoji")})},sortPack:function(e){var t=Object.keys(e.files).sort(function(e,t){return e.localeCompare(t)}).map(function(t){return[t,e.files[t]]});return n()({},e,{files:t})},refreshLocalPacks:function(){try{this.$store.dispatch("SetLocalEmojiPacks")}catch(e){return}this.$message({type:"success",message:P.a.t("emoji.refreshed")})},refreshRemotePacks:function(){var e=c()(s.a.mark(function e(){return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.fullscreenLoading=!0,e.next=3,this.$store.dispatch("SetRemoteEmojiPacks",{remoteInstance:this.remoteInstanceAddress});case 3:this.fullscreenLoading=!1;case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),reloadEmoji:function(){var e=c()(s.a.mark(function e(){return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,this.$store.dispatch("ReloadEmoji"),e.next=7;break;case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return");case 7:this.$message({type:"success",message:P.a.t("emoji.reloaded")});case 8:case"end":return e.stop()}},e,this,[[0,4]])}));return function(){return e.apply(this,arguments)}}(),setActiveCollapseItems:function(e){var t=Array.isArray(e)?e:[e];this.$store.dispatch("SetActiveCollapseItems",t)}}},w=(a("smuD"),Object(p.a)(y,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"emoji-packs"},[a("div",{staticClass:"emoji-packs-header"},[a("h1",[e._v(e._s(e.$t("emoji.emojiPacks")))]),e._v(" "),a("reboot-button")],1),e._v(" "),a("div",{staticClass:"emoji-header-container"},[a("div",{staticClass:"emoji-packs-header-button-container"},[a("el-button",{staticClass:"reload-emoji-button",attrs:{type:"primary"},on:{click:e.reloadEmoji}},[e._v(e._s(e.$t("emoji.reloadEmoji")))]),e._v(" "),a("el-tooltip",{attrs:{content:e.$t("emoji.importEmojiTooltip"),effects:"dark",placement:"bottom","popper-class":"import-pack-button"}},[a("el-button",{attrs:{type:"primary"},on:{click:e.importFromFS}},[e._v("\n "+e._s(e.$t("emoji.importPacks"))+"\n ")])],1)],1)]),e._v(" "),a("el-divider",{staticClass:"divider"}),e._v(" "),a("el-form",{staticClass:"emoji-packs-form",attrs:{"label-width":e.labelWidth}},[a("el-form-item",{attrs:{label:e.$t("emoji.localPacks")}},[a("el-button",{attrs:{type:"primary"},on:{click:e.refreshLocalPacks}},[e._v(e._s(e.$t("emoji.refreshLocalPacks")))])],1),e._v(" "),a("el-form-item",{attrs:{label:e.$t("emoji.createLocalPack")}},[a("div",{staticClass:"create-pack"},[a("el-input",{attrs:{placeholder:e.$t("users.name")},model:{value:e.newPackName,callback:function(t){e.newPackName=t},expression:"newPackName"}}),e._v(" "),a("el-button",{staticClass:"create-pack-button",attrs:{disabled:""===e.newPackName.trim()},on:{click:e.createLocalPack}},[e._v("\n "+e._s(e.$t("users.create"))+"\n ")])],1)]),e._v(" "),Object.keys(e.localPacks).length>0?a("el-form-item",{attrs:{label:e.$t("emoji.packs")}},e._l(e.localPacks,function(t,o){return a("el-collapse",{key:o,model:{value:e.activeLocalPack,callback:function(t){e.activeLocalPack=t},expression:"activeLocalPack"}},[a("local-emoji-pack",{attrs:{name:o,pack:e.sortPack(t),host:e.$store.getters.authHost,"is-local":!0}})],1)}),1):e._e(),e._v(" "),a("el-divider",{staticClass:"divider"}),e._v(" "),a("el-form-item",{attrs:{label:e.$t("emoji.remotePacks")}},[a("div",{staticClass:"create-pack"},[a("el-input",{attrs:{placeholder:e.$t("emoji.remoteInstanceAddress")},model:{value:e.remoteInstanceAddress,callback:function(t){e.remoteInstanceAddress=t},expression:"remoteInstanceAddress"}}),e._v(" "),a("el-button",{directives:[{name:"loading",rawName:"v-loading.fullscreen.lock",value:e.fullscreenLoading,expression:"fullscreenLoading",modifiers:{fullscreen:!0,lock:!0}}],staticClass:"create-pack-button",attrs:{disabled:""===e.remoteInstanceAddress.trim()},on:{click:e.refreshRemotePacks}},[e._v("\n "+e._s(e.$t("emoji.refreshRemote"))+"\n ")])],1)]),e._v(" "),Object.keys(e.remotePacks).length>0?a("el-form-item",{attrs:{label:e.$t("emoji.packs")}},e._l(e.remotePacks,function(t,o){return a("el-collapse",{key:o,on:{change:e.setActiveCollapseItems},model:{value:e.activeRemotePack,callback:function(t){e.activeRemotePack=t},expression:"activeRemotePack"}},[a("remote-emoji-pack",{attrs:{name:o,pack:e.sortPack(t),host:e.$store.getters.authHost,"is-local":!1}})],1)}),1):e._e()],1)],1)},[],!1,null,null,null));w.options.__file="index.vue";t.default=w.exports},"4ySm":function(e,t,a){"use strict";var o=a("n6gr");a.n(o).a},"6lYW":function(e,t,a){},HBNe:function(e,t,a){},IVv3:function(e,t,a){"use strict";var o=a("6lYW");a.n(o).a},LE4i:function(e,t,a){"use strict";var o=a("HBNe");a.n(o).a},QZC8:function(e,t,a){},Zd0x:function(e,t,a){"use strict";var o=a("eDOw");a.n(o).a},eDOw:function(e,t,a){},n6gr:function(e,t,a){},smuD:function(e,t,a){"use strict";var o=a("QZC8");a.n(o).a}}]);
+//# sourceMappingURL=chunk-c5f4.304479e7.js.map
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-c5f4.304479e7.js.map b/priv/static/adminfe/static/js/chunk-c5f4.304479e7.js.map
new file mode 100644
index 000000000..2ab89731d
--- /dev/null
+++ b/priv/static/adminfe/static/js/chunk-c5f4.304479e7.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///./src/views/emojiPacks/index.vue?f3a6","webpack:///./src/views/emojiPacks/components/SingleEmojiEditor.vue?5a7e","webpack:///src/views/emojiPacks/components/SingleEmojiEditor.vue","webpack:///./src/views/emojiPacks/components/SingleEmojiEditor.vue","webpack:///./src/views/emojiPacks/components/SingleEmojiEditor.vue?9e34","webpack:///./src/views/emojiPacks/components/NewEmojiUploader.vue?1c09","webpack:///src/views/emojiPacks/components/NewEmojiUploader.vue","webpack:///./src/views/emojiPacks/components/NewEmojiUploader.vue","webpack:///./src/views/emojiPacks/components/NewEmojiUploader.vue?e7aa","webpack:///./src/views/emojiPacks/components/LocalEmojiPack.vue?88cd","webpack:///src/views/emojiPacks/components/LocalEmojiPack.vue","webpack:///./src/views/emojiPacks/components/LocalEmojiPack.vue","webpack:///./src/views/emojiPacks/components/LocalEmojiPack.vue?a6c1","webpack:///./src/views/emojiPacks/components/RemoteEmojiPack.vue?4c9f","webpack:///src/views/emojiPacks/components/RemoteEmojiPack.vue","webpack:///./src/views/emojiPacks/components/RemoteEmojiPack.vue","webpack:///./src/views/emojiPacks/components/RemoteEmojiPack.vue?d192","webpack:///./src/views/emojiPacks/index.vue?a332","webpack:///src/views/emojiPacks/index.vue","webpack:///./src/views/emojiPacks/index.vue","webpack:///./src/views/emojiPacks/components/SingleEmojiEditor.vue?bc44","webpack:///./src/views/emojiPacks/components/NewEmojiUploader.vue?d98f","webpack:///./src/views/emojiPacks/components/LocalEmojiPack.vue?2a38","webpack:///./src/views/emojiPacks/components/RemoteEmojiPack.vue?118a","webpack:///./src/views/emojiPacks/index.vue?7b86"],"names":["components_SingleEmojiEditorvue_type_script_lang_js_","props","host","type","String","required","packName","shortcode","file","isLocal","Boolean","data","newShortcode","newFile","copyToLocalPackName","copyPopoverVisible","copyToShortcode","copyToFilename","computed","emojiName","get","this","set","val","emojiFile","isDesktop","$store","state","app","device","isMobile","localPacks","emojiPacks","remoteInstance","URL","methods","update","_update","asyncToGenerator_default","regenerator_default","a","mark","_callee","wrap","_context","prev","next","dispatch","newFilename","force","t0","abrupt","stop","apply","arguments","remove","_this","$confirm","confirmButtonText","cancelButtonText","then","copyToLocal","addressOfEmojiInPack","trim","filename","e","copyToLocalVisible","component","Object","componentNormalizer","_vm","_h","$createElement","_c","_self","class","staticClass","attrs","src","_v","placeholder","$t","model","value","callback","$$v","expression","on","click","_s","_e","placement","popper-class","_l","_pack","name","key","label","disabled","slot","options","__file","SingleEmojiEditor","components_NewEmojiUploadervue_type_script_lang_js_","imageUploadURL","customFileName","uploadEmoji","_uploadEmoji","_ref","_x","NewEmojiUploader_component","label-position","label-width","size","http-request","multiple","show-file-list","action","components_LocalEmojiPackvue_type_script_lang_js_","components","NewEmojiUploader","pack","showPackContent","isTablet","labelWidth","share","homepage","description","license","fallbackSrc","deletePack","catch","savePackMetadata","LocalEmojiPack_component","title","href","underline","target","pack-name","files","length","ref","is-local","LocalEmojiPack","components_RemoteEmojiPackvue_type_script_lang_js_","downloadSharedAs","loadRemotePack","activeCollapseItems","includes","remoteInstanceAddress","downloadFromInstance","instanceAddress","as","RemoteEmojiPack_component","RemoteEmojiPack","views_emojiPacksvue_type_script_lang_js_","RebootButton","newPackName","activeLocalPack","activeRemotePack","fullscreenLoading","instance","remotePacks","mounted","refreshLocalPacks","createLocalPack","importFromFS","_this2","sortPack","orderedFiles","keys","sort","b","localeCompare","map","objectSpread_default","$message","message","lang","t","refreshRemotePacks","_refreshRemotePacks","reloadEmoji","_reloadEmoji","_callee2","_context2","setActiveCollapseItems","activeItems","items","Array","isArray","emojiPacks_component","content","effects","getters","authHost","directives","rawName","modifiers","fullscreen","lock","change","__webpack_exports__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_SingleEmojiEditor_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","n","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_NewEmojiUploader_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_LocalEmojiPack_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_RemoteEmojiPack_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__"],"mappings":"+GAAA,+ECA4NA,GCgD5NC,OACAC,MACAC,KAAAC,OACAC,UAAA,GAEAC,UACAH,KAAAC,OACAC,UAAA,GAEAE,WACAJ,KAAAC,OACAC,UAAA,GAEAG,MACAL,KAAAC,OACAC,UAAA,GAEAI,SACAN,KAAAO,QACAL,UAAA,IAGAM,KAvBA,WAwBA,OACAC,aAAA,KACAC,QAAA,KACAC,oBAAA,KACAC,oBAAA,EACAC,gBAAA,GACAC,eAAA,KAGAC,UACAC,WACAC,IADA,WAGA,cAAAC,KAAAT,aAAAS,KAAAT,aAAAS,KAAAd,WAEAe,IALA,SAKAC,GAAAF,KAAAT,aAAAW,IAEAC,WACAJ,IADA,WAGA,cAAAC,KAAAR,QAAAQ,KAAAR,QAAAQ,KAAAb,MAEAc,IALA,SAKAC,GAAAF,KAAAR,QAAAU,IAEAE,UAfA,WAgBA,kBAAAJ,KAAAK,OAAAC,MAAAC,IAAAC,QAEAC,SAlBA,WAmBA,iBAAAT,KAAAK,OAAAC,MAAAC,IAAAC,QAEAE,WArBA,WAsBA,OAAAV,KAAAK,OAAAC,MAAAK,WAAAD,YAEAE,eAxBA,WAyBA,WAAAC,IAAAb,KAAAK,OAAAC,MAAAK,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D,EAAA1B,GAA8C,OAAAtB,EAAA,eAAyBuB,IAAAD,EAAAR,IAAakH,OAAAnI,EAAAoH,wBAAoCxG,OAAQC,MAAAb,EAAA,iBAAAc,SAAA,SAAAC,GAAsDf,EAAAyF,iBAAA1E,GAAyBC,WAAA,sBAAgCb,EAAA,qBAA0BI,OAAOkB,OAAA0B,KAAAnD,EAAAkG,SAAA/C,GAAAvH,KAAAoE,EAAA5C,OAAAwK,QAAAC,SAAArD,YAAA,MAA2F,KAAM,GAAAxE,EAAAoB,MAAA,YmBY71G,EACA,KACA,KACA,OAIAqG,EAAS3F,QAAAC,OAAA,YACMqG,EAAA,QAAAX,+CCpBf,IAAAY,EAAAC,EAAA,QAAAA,EAAAC,EAAAF,GAAqf,qFCArf,IAAAG,EAAAF,EAAA,QAAAA,EAAAC,EAAAC,GAAof,qCCApf,IAAAC,EAAAH,EAAA,QAAAA,EAAAC,EAAAE,GAAkf,4DCAlf,IAAAC,EAAAJ,EAAA,QAAAA,EAAAC,EAAAG,GAAmf,mFCAnf,IAAAC,EAAAL,EAAA,QAAAA,EAAAC,EAAAI,GAAud","file":"static/js/chunk-c5f4.304479e7.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"emoji-packs\"},[_c('div',{staticClass:\"emoji-packs-header\"},[_c('h1',[_vm._v(_vm._s(_vm.$t('emoji.emojiPacks')))]),_vm._v(\" \"),_c('reboot-button')],1),_vm._v(\" \"),_c('div',{staticClass:\"emoji-header-container\"},[_c('div',{staticClass:\"emoji-packs-header-button-container\"},[_c('el-button',{staticClass:\"reload-emoji-button\",attrs:{\"type\":\"primary\"},on:{\"click\":_vm.reloadEmoji}},[_vm._v(_vm._s(_vm.$t('emoji.reloadEmoji')))]),_vm._v(\" \"),_c('el-tooltip',{attrs:{\"content\":_vm.$t('emoji.importEmojiTooltip'),\"effects\":\"dark\",\"placement\":\"bottom\",\"popper-class\":\"import-pack-button\"}},[_c('el-button',{attrs:{\"type\":\"primary\"},on:{\"click\":_vm.importFromFS}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('emoji.importPacks'))+\"\\n \")])],1)],1)]),_vm._v(\" \"),_c('el-divider',{staticClass:\"divider\"}),_vm._v(\" \"),_c('el-form',{staticClass:\"emoji-packs-form\",attrs:{\"label-width\":_vm.labelWidth}},[_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.localPacks')}},[_c('el-button',{attrs:{\"type\":\"primary\"},on:{\"click\":_vm.refreshLocalPacks}},[_vm._v(_vm._s(_vm.$t('emoji.refreshLocalPacks')))])],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.createLocalPack')}},[_c('div',{staticClass:\"create-pack\"},[_c('el-input',{attrs:{\"placeholder\":_vm.$t('users.name')},model:{value:(_vm.newPackName),callback:function ($$v) {_vm.newPackName=$$v},expression:\"newPackName\"}}),_vm._v(\" \"),_c('el-button',{staticClass:\"create-pack-button\",attrs:{\"disabled\":_vm.newPackName.trim() === ''},on:{\"click\":_vm.createLocalPack}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.create'))+\"\\n \")])],1)]),_vm._v(\" \"),(Object.keys(_vm.localPacks).length > 0)?_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.packs')}},_vm._l((_vm.localPacks),function(pack,name){return _c('el-collapse',{key:name,model:{value:(_vm.activeLocalPack),callback:function ($$v) {_vm.activeLocalPack=$$v},expression:\"activeLocalPack\"}},[_c('local-emoji-pack',{attrs:{\"name\":name,\"pack\":_vm.sortPack(pack),\"host\":_vm.$store.getters.authHost,\"is-local\":true}})],1)}),1):_vm._e(),_vm._v(\" \"),_c('el-divider',{staticClass:\"divider\"}),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.remotePacks')}},[_c('div',{staticClass:\"create-pack\"},[_c('el-input',{attrs:{\"placeholder\":_vm.$t('emoji.remoteInstanceAddress')},model:{value:(_vm.remoteInstanceAddress),callback:function ($$v) {_vm.remoteInstanceAddress=$$v},expression:\"remoteInstanceAddress\"}}),_vm._v(\" \"),_c('el-button',{directives:[{name:\"loading\",rawName:\"v-loading.fullscreen.lock\",value:(_vm.fullscreenLoading),expression:\"fullscreenLoading\",modifiers:{\"fullscreen\":true,\"lock\":true}}],staticClass:\"create-pack-button\",attrs:{\"disabled\":_vm.remoteInstanceAddress.trim() === ''},on:{\"click\":_vm.refreshRemotePacks}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('emoji.refreshRemote'))+\"\\n \")])],1)]),_vm._v(\" \"),(Object.keys(_vm.remotePacks).length > 0)?_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.packs')}},_vm._l((_vm.remotePacks),function(pack,name){return _c('el-collapse',{key:name,on:{\"change\":_vm.setActiveCollapseItems},model:{value:(_vm.activeRemotePack),callback:function ($$v) {_vm.activeRemotePack=$$v},expression:\"activeRemotePack\"}},[_c('remote-emoji-pack',{attrs:{\"name\":name,\"pack\":_vm.sortPack(pack),\"host\":_vm.$store.getters.authHost,\"is-local\":false}})],1)}),1):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SingleEmojiEditor.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SingleEmojiEditor.vue?vue&type=script&lang=js&\"","
\n \n
\n
\n
\n \n \n {{ $t('emoji.update') }}\n {{ $t('emoji.remove') }}\n
\n \n\n
\n
\n
\n \n \n {{ $t('emoji.selectLocalPack') }}
\n \n \n \n {{ $t('emoji.specifyShortcode') }}
\n \n {{ $t('emoji.specifyFilename') }}
\n \n {{ $t('emoji.copy') }}\n {{ $t('emoji.copyToLocalPack') }}\n \n \n
\n\n\n\n\n\n","import { render, staticRenderFns } from \"./SingleEmojiEditor.vue?vue&type=template&id=5d2cbcfa&\"\nimport script from \"./SingleEmojiEditor.vue?vue&type=script&lang=js&\"\nexport * from \"./SingleEmojiEditor.vue?vue&type=script&lang=js&\"\nimport style0 from \"./SingleEmojiEditor.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"SingleEmojiEditor.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.isLocal)?_c('div',{class:_vm.isMobile ? 'emoji-container-flex' : 'emoji-container-grid'},[_c('img',{staticClass:\"emoji-preview-img\",attrs:{\"src\":_vm.addressOfEmojiInPack(_vm.host, _vm.packName, _vm.file)}}),_vm._v(\" \"),_c('el-input',{staticClass:\"emoji-info\",attrs:{\"placeholder\":_vm.$t('emoji.shortcode')},model:{value:(_vm.emojiName),callback:function ($$v) {_vm.emojiName=$$v},expression:\"emojiName\"}}),_vm._v(\" \"),_c('el-input',{staticClass:\"emoji-info\",attrs:{\"placeholder\":_vm.$t('emoji.file')},model:{value:(_vm.emojiFile),callback:function ($$v) {_vm.emojiFile=$$v},expression:\"emojiFile\"}}),_vm._v(\" \"),_c('div',{staticClass:\"emoji-buttons\"},[_c('el-button',{attrs:{\"type\":\"primary\"},on:{\"click\":_vm.update}},[_vm._v(_vm._s(_vm.$t('emoji.update')))]),_vm._v(\" \"),_c('el-button',{staticClass:\"remove-emoji-button\",on:{\"click\":_vm.remove}},[_vm._v(_vm._s(_vm.$t('emoji.remove')))])],1)],1):_vm._e(),_vm._v(\" \"),(!_vm.isLocal)?_c('div',{class:_vm.isMobile ? 'emoji-container-flex' : 'remote-emoji-container-grid'},[_c('img',{staticClass:\"emoji-preview-img\",attrs:{\"src\":_vm.addressOfEmojiInPack(_vm.remoteInstance, _vm.packName, _vm.file)}}),_vm._v(\" \"),_c('el-input',{staticClass:\"emoji-info\",attrs:{\"value\":_vm.emojiName,\"placeholder\":_vm.$t('emoji.shortcode')}}),_vm._v(\" \"),_c('el-input',{staticClass:\"emoji-info\",attrs:{\"value\":_vm.emojiFile,\"placeholder\":_vm.$t('emoji.file')}}),_vm._v(\" \"),_c('el-popover',{staticClass:\"copy-pack-container\",attrs:{\"placement\":\"left-start\",\"popper-class\":\"copy-popover\"},model:{value:(_vm.copyPopoverVisible),callback:function ($$v) {_vm.copyPopoverVisible=$$v},expression:\"copyPopoverVisible\"}},[_c('p',[_vm._v(_vm._s(_vm.$t('emoji.selectLocalPack')))]),_vm._v(\" \"),_c('el-select',{staticClass:\"copy-pack-select\",attrs:{\"placeholder\":_vm.$t('emoji.localPack')},model:{value:(_vm.copyToLocalPackName),callback:function ($$v) {_vm.copyToLocalPackName=$$v},expression:\"copyToLocalPackName\"}},_vm._l((_vm.localPacks),function(_pack,name){return _c('el-option',{key:name,attrs:{\"label\":name,\"value\":name}})}),1),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('emoji.specifyShortcode')))]),_vm._v(\" \"),_c('el-input',{attrs:{\"placeholder\":_vm.$t('emoji.leaveEmptyShortcode')},model:{value:(_vm.copyToShortcode),callback:function ($$v) {_vm.copyToShortcode=$$v},expression:\"copyToShortcode\"}}),_vm._v(\" \"),_c('p',[_vm._v(_vm._s(_vm.$t('emoji.specifyFilename')))]),_vm._v(\" \"),_c('el-input',{attrs:{\"placeholder\":_vm.$t('emoji.leaveEmptyFilename')},model:{value:(_vm.copyToFilename),callback:function ($$v) {_vm.copyToFilename=$$v},expression:\"copyToFilename\"}}),_vm._v(\" \"),_c('el-button',{staticClass:\"copy-to-local-pack-button\",attrs:{\"disabled\":!_vm.copyToLocalPackName,\"type\":\"primary\"},on:{\"click\":_vm.copyToLocal}},[_vm._v(_vm._s(_vm.$t('emoji.copy')))]),_vm._v(\" \"),_c('el-button',{staticClass:\"emoji-button\",attrs:{\"slot\":\"reference\",\"type\":\"primary\"},slot:\"reference\"},[_vm._v(_vm._s(_vm.$t('emoji.copyToLocalPack')))])],1)],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewEmojiUploader.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewEmojiUploader.vue?vue&type=script&lang=js&\"","
\n \n \n \n \n \n \n \n \n \n \n {{ $t('emoji.upload') }}\n
\n \n
or
\n
\n {{ $t('emoji.clickToUpload') }}\n \n
\n \n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./NewEmojiUploader.vue?vue&type=template&id=403a380a&\"\nimport script from \"./NewEmojiUploader.vue?vue&type=script&lang=js&\"\nexport * from \"./NewEmojiUploader.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NewEmojiUploader.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"NewEmojiUploader.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-form',{staticClass:\"new-emoji-uploader-form\",attrs:{\"label-position\":_vm.isMobile ? 'top' : 'left',\"label-width\":\"130px\",\"size\":\"small\"}},[_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.shortcode')}},[_c('el-input',{attrs:{\"placeholder\":_vm.$t('emoji.optional')},model:{value:(_vm.shortcode),callback:function ($$v) {_vm.shortcode=$$v},expression:\"shortcode\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.customFilename')}},[_c('el-input',{attrs:{\"placeholder\":_vm.$t('emoji.optional')},model:{value:(_vm.customFileName),callback:function ($$v) {_vm.customFileName=$$v},expression:\"customFileName\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.uploadFile')}},[_c('div',{staticClass:\"upload-file-url\"},[_c('el-input',{attrs:{\"placeholder\":_vm.$t('emoji.url')},model:{value:(_vm.imageUploadURL),callback:function ($$v) {_vm.imageUploadURL=$$v},expression:\"imageUploadURL\"}}),_vm._v(\" \"),_c('el-button',{staticClass:\"upload-button\",attrs:{\"type\":\"primary\"},on:{\"click\":_vm.uploadEmoji}},[_vm._v(_vm._s(_vm.$t('emoji.upload')))])],1),_vm._v(\" \"),_c('div',{staticClass:\"upload-container\"},[_c('p',{staticClass:\"text\"},[_vm._v(\"or\")]),_vm._v(\" \"),_c('el-upload',{attrs:{\"http-request\":_vm.uploadEmoji,\"multiple\":false,\"show-file-list\":false,\"action\":\"add\"}},[_c('el-button',{attrs:{\"type\":\"primary\"}},[_vm._v(_vm._s(_vm.$t('emoji.clickToUpload')))])],1)],1)])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LocalEmojiPack.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LocalEmojiPack.vue?vue&type=script&lang=js&\"","
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{ pack.pack[\"fallback-src-sha256\"] }}\n \n \n \n \n \n \n \n 0\" :title=\" $t('emoji.manageEmoji')\" name=\"manageEmoji\" class=\"no-background\">\n \n \n \n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./LocalEmojiPack.vue?vue&type=template&id=1f26166f&\"\nimport script from \"./LocalEmojiPack.vue?vue&type=script&lang=js&\"\nexport * from \"./LocalEmojiPack.vue?vue&type=script&lang=js&\"\nimport style0 from \"./LocalEmojiPack.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"LocalEmojiPack.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-collapse-item',{staticClass:\"has-background\",attrs:{\"title\":_vm.name,\"name\":_vm.name}},[_c('el-form',{staticClass:\"emoji-pack-metadata\",attrs:{\"label-width\":_vm.labelWidth,\"label-position\":\"left\",\"size\":\"small\"}},[_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.sharePack')}},[_c('el-switch',{model:{value:(_vm.share),callback:function ($$v) {_vm.share=$$v},expression:\"share\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.homepage')}},[_c('el-input',{model:{value:(_vm.homepage),callback:function ($$v) {_vm.homepage=$$v},expression:\"homepage\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.description')}},[_c('el-input',{attrs:{\"type\":\"textarea\"},model:{value:(_vm.description),callback:function ($$v) {_vm.description=$$v},expression:\"description\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.license')}},[_c('el-input',{model:{value:(_vm.license),callback:function ($$v) {_vm.license=$$v},expression:\"license\"}})],1),_vm._v(\" \"),_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.fallbackSrc')}},[_c('el-input',{model:{value:(_vm.fallbackSrc),callback:function ($$v) {_vm.fallbackSrc=$$v},expression:\"fallbackSrc\"}})],1),_vm._v(\" \"),(_vm.fallbackSrc && _vm.fallbackSrc.trim() !== '')?_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.fallbackSrcSha')}},[_vm._v(\"\\n \"+_vm._s(_vm.pack.pack[\"fallback-src-sha256\"])+\"\\n \")]):_vm._e()],1),_vm._v(\" \"),_c('div',{staticClass:\"pack-button-container\"},[_c('div',{staticClass:\"save-pack-button-container\"},[_c('el-button',{staticClass:\"save-pack-button\",attrs:{\"type\":\"primary\"},on:{\"click\":_vm.savePackMetadata}},[_vm._v(_vm._s(_vm.$t('emoji.saveMetadata')))]),_vm._v(\" \"),_c('el-button',{staticClass:\"delete-pack-button\",on:{\"click\":_vm.deletePack}},[_vm._v(_vm._s(_vm.$t('emoji.deletePack')))])],1),_vm._v(\" \"),_c('div',{staticClass:\"download-pack-button-container\"},[(_vm.pack.pack['can-download'])?_c('el-link',{attrs:{\"href\":(\"//\" + _vm.host + \"/api/pleroma/emoji/packs/\" + _vm.name + \"/download_shared\"),\"underline\":false,\"type\":\"primary\",\"target\":\"_blank\"}},[_c('el-button',{staticClass:\"download-archive\"},[_vm._v(_vm._s(_vm.$t('emoji.downloadPackArchive')))])],1):_vm._e()],1)]),_vm._v(\" \"),_c('el-collapse',{staticClass:\"contents-collapse\",model:{value:(_vm.showPackContent),callback:function ($$v) {_vm.showPackContent=$$v},expression:\"showPackContent\"}},[(_vm.isLocal)?_c('el-collapse-item',{staticClass:\"no-background\",attrs:{\"title\":_vm.$t('emoji.addNewEmoji'),\"name\":\"addEmoji\"}},[_c('new-emoji-uploader',{attrs:{\"pack-name\":_vm.name}})],1):_vm._e(),_vm._v(\" \"),(_vm.pack.files.length > 0)?_c('el-collapse-item',{staticClass:\"no-background\",attrs:{\"title\":_vm.$t('emoji.manageEmoji'),\"name\":\"manageEmoji\"}},_vm._l((_vm.pack.files),function(ref){\nvar shortcode = ref[0];\nvar file = ref[1];\nreturn _c('single-emoji-editor',{key:shortcode,attrs:{\"host\":_vm.host,\"pack-name\":_vm.name,\"shortcode\":shortcode,\"file\":file,\"is-local\":_vm.isLocal}})}),1):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./RemoteEmojiPack.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./RemoteEmojiPack.vue?vue&type=script&lang=js&\"","
\n \n \n
\n \n \n \n \n {{ homepage }}\n \n \n {{ description }}\n \n \n {{ license }}\n \n \n {{ fallbackSrc }}\n \n \n {{ pack.pack[\"fallback-src-sha256\"] }}\n \n \n \n {{ $t('emoji.downloadPackArchive') }}\n \n \n \n
\n 0\" :title=\" $t('emoji.manageEmoji')\" name=\"manageEmoji\" class=\"no-background\">\n \n \n \n \n {{ $t('emoji.thisWillDownload') }} \"{{ name }}\" {{ $t('emoji.downloadToCurrentInstance') }}\n \"{{ downloadSharedAs.trim() === '' ? name : downloadSharedAs }}\" ({{ $t('emoji.canBeChanged') }}).\n {{ $t('emoji.willBeUsable') }}.\n
\n \n \n \n {{ isDesktop ? $t('emoji.downloadSharedPack') : $t('emoji.downloadSharedPackMobile') }}\n \n
\n \n \n
\n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./RemoteEmojiPack.vue?vue&type=template&id=6ff625b1&\"\nimport script from \"./RemoteEmojiPack.vue?vue&type=script&lang=js&\"\nexport * from \"./RemoteEmojiPack.vue?vue&type=script&lang=js&\"\nimport style0 from \"./RemoteEmojiPack.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"RemoteEmojiPack.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-collapse-item',{staticClass:\"has-background\",attrs:{\"title\":_vm.name,\"name\":_vm.name}},[(_vm.loadRemotePack)?_c('div',[_c('el-form',{staticClass:\"emoji-pack-metadata remote-pack-metadata\",attrs:{\"label-width\":_vm.labelWidth,\"label-position\":\"left\",\"size\":\"small\"}},[_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.sharePack')}},[_c('el-switch',{attrs:{\"disabled\":\"\"},model:{value:(_vm.share),callback:function ($$v) {_vm.share=$$v},expression:\"share\"}})],1),_vm._v(\" \"),(_vm.homepage)?_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.homepage')}},[_c('span',[_vm._v(_vm._s(_vm.homepage))])]):_vm._e(),_vm._v(\" \"),(_vm.description)?_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.description')}},[_c('span',[_vm._v(_vm._s(_vm.description))])]):_vm._e(),_vm._v(\" \"),(_vm.license)?_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.license')}},[_c('span',[_vm._v(_vm._s(_vm.license))])]):_vm._e(),_vm._v(\" \"),(_vm.fallbackSrc)?_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.fallbackSrc')}},[_c('span',[_vm._v(_vm._s(_vm.fallbackSrc))])]):_vm._e(),_vm._v(\" \"),(_vm.fallbackSrc && _vm.fallbackSrc.trim() !== '')?_c('el-form-item',{attrs:{\"label\":_vm.$t('emoji.fallbackSrcSha')}},[_vm._v(\"\\n \"+_vm._s(_vm.pack.pack[\"fallback-src-sha256\"])+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('el-form-item',[(_vm.pack.pack['can-download'])?_c('el-link',{attrs:{\"href\":_vm.pack.pack['fallback-src'],\"underline\":false,\"type\":\"primary\",\"target\":\"_blank\"}},[_c('el-button',{staticClass:\"download-archive\"},[_vm._v(_vm._s(_vm.$t('emoji.downloadPackArchive')))])],1):_vm._e()],1)],1),_vm._v(\" \"),_c('el-collapse',{staticClass:\"contents-collapse\",model:{value:(_vm.showPackContent),callback:function ($$v) {_vm.showPackContent=$$v},expression:\"showPackContent\"}},[(_vm.pack.files.length > 0)?_c('el-collapse-item',{staticClass:\"no-background\",attrs:{\"title\":_vm.$t('emoji.manageEmoji'),\"name\":\"manageEmoji\"}},_vm._l((_vm.pack.files),function(ref){\nvar shortcode = ref[0];\nvar file = ref[1];\nreturn _c('single-emoji-editor',{key:shortcode,attrs:{\"host\":_vm.host,\"pack-name\":_vm.name,\"shortcode\":shortcode,\"file\":file,\"is-local\":_vm.isLocal}})}),1):_vm._e(),_vm._v(\" \"),_c('el-collapse-item',{staticClass:\"no-background\",attrs:{\"title\":_vm.$t('emoji.downloadPack'),\"name\":\"downloadPack\"}},[_c('p',[_vm._v(\"\\n \"+_vm._s(_vm.$t('emoji.thisWillDownload'))+\" \\\"\"+_vm._s(_vm.name)+\"\\\" \"+_vm._s(_vm.$t('emoji.downloadToCurrentInstance'))+\"\\n \\\"\"+_vm._s(_vm.downloadSharedAs.trim() === '' ? _vm.name : _vm.downloadSharedAs)+\"\\\" (\"+_vm._s(_vm.$t('emoji.canBeChanged'))+\").\\n \"+_vm._s(_vm.$t('emoji.willBeUsable'))+\".\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"download-shared-pack\"},[_c('el-input',{attrs:{\"placeholder\":_vm.$t('emoji.downloadAsOptional')},model:{value:(_vm.downloadSharedAs),callback:function ($$v) {_vm.downloadSharedAs=$$v},expression:\"downloadSharedAs\"}}),_vm._v(\" \"),_c('el-button',{staticClass:\"download-shared-pack-button\",attrs:{\"type\":\"primary\"},on:{\"click\":_vm.downloadFromInstance}},[_vm._v(\"\\n \"+_vm._s(_vm.isDesktop ? _vm.$t('emoji.downloadSharedPack') : _vm.$t('emoji.downloadSharedPackMobile'))+\"\\n \")])],1)])],1)],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","
\n \n \n \n
\n \n \n {{ $t('emoji.refreshLocalPacks') }}\n \n \n \n \n \n {{ $t('users.create') }}\n \n
\n \n 0\" :label=\"$t('emoji.packs')\">\n \n \n \n \n \n \n \n \n \n {{ $t('emoji.refreshRemote') }}\n \n
\n \n 0\" :label=\"$t('emoji.packs')\">\n \n \n \n \n \n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=631f1c16&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SingleEmojiEditor.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SingleEmojiEditor.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewEmojiUploader.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewEmojiUploader.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LocalEmojiPack.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LocalEmojiPack.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./RemoteEmojiPack.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./RemoteEmojiPack.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\""],"sourceRoot":""}
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-commons.5a106955.js b/priv/static/adminfe/static/js/chunk-commons.5a106955.js
new file mode 100644
index 000000000..a6cf2ce52
--- /dev/null
+++ b/priv/static/adminfe/static/js/chunk-commons.5a106955.js
@@ -0,0 +1,2 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-commons"],{Kw8l:function(t,s,e){"use strict";var a=e("cRgN");e.n(a).a},cRgN:function(t,s,e){},ot3S:function(t,s,e){"use strict";var a=e("wd/R"),n=e.n(a),i={name:"Status",props:{account:{type:Object,required:!1,default:function(){return{}}},fetchStatusesByInstance:{type:Boolean,required:!1,default:!1},showCheckbox:{type:Boolean,required:!0,default:!1},status:{type:Object,required:!0},page:{type:Number,required:!1,default:0},userId:{type:String,required:!1,default:""},godmode:{type:Boolean,required:!1,default:!1}},data:function(){return{showHiddenStatus:!1}},methods:{capitalizeFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},changeStatus:function(t,s,e){this.$store.dispatch("ChangeStatusScope",{statusId:t,isSensitive:s,visibility:e,reportCurrentPage:this.page,userId:this.userId,godmode:this.godmode,fetchStatusesByInstance:this.fetchStatusesByInstance})},deleteStatus:function(t){var s=this;this.$confirm("Are you sure you want to delete this status?","Warning",{confirmButtonText:"OK",cancelButtonText:"Cancel",type:"warning"}).then(function(){s.$store.dispatch("DeleteStatus",{statusId:t,reportCurrentPage:s.page,userId:s.userId,godmode:s.godmode,fetchStatusesByInstance:s.fetchStatusesByInstance}),s.$message({type:"success",message:"Delete completed"})}).catch(function(){s.$message({type:"info",message:"Delete canceled"})})},handleStatusSelection:function(t){this.$emit("status-selection",t)},handleRouteChange:function(){this.$router.push({name:"StatusShow",params:{id:this.status.id}})},optionPercent:function(t,s){var e=t.options.reduce(function(t,s){return t+s.votes_count},0);return 0===e?0:+(s.votes_count/e*100).toFixed(1)},parseTimestamp:function(t){return n()(t).format("YYYY-MM-DD HH:mm")},propertyExists:function(t,s,e){return e?t[s]&&t[e]:t[s]}}},o=(e("Kw8l"),e("KHd+")),r=Object(o.a)(i,function(){var t=this,s=t.$createElement,e=t._self._c||s;return t.status.deleted?e("el-card",{staticClass:"status-card"},[e("div",{attrs:{slot:"header"},slot:"header"},[e("div",{staticClass:"status-header"},[e("div",{staticClass:"status-account-container"},[e("div",{staticClass:"status-account"},[e("h4",{staticClass:"status-deleted"},[t._v(t._s(t.$t("reports.statusDeleted")))])])])])]),t._v(" "),e("div",{staticClass:"status-body"},[t.status.content?e("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}):e("span",{staticClass:"status-without-content"},[t._v("no content")])]),t._v(" "),e("div",{staticClass:"status-footer"},[t.status.created_at?e("span",{staticClass:"status-created-at"},[t._v(t._s(t.parseTimestamp(t.status.created_at)))]):t._e(),t._v(" "),t.status.url?e("a",{staticClass:"account",attrs:{href:t.status.url,target:"_blank"},on:{click:function(t){t.stopPropagation()}}},[t._v("\n Open status in instance\n "),e("i",{staticClass:"el-icon-top-right"})]):t._e()])]):e("el-card",{staticClass:"status-card",nativeOn:{click:function(s){return t.handleRouteChange()}}},[e("div",{attrs:{slot:"header"},slot:"header"},[e("div",{staticClass:"status-header"},[e("div",{staticClass:"status-account-container"},[e("div",{staticClass:"status-account"},[t.showCheckbox?e("el-checkbox",{staticClass:"status-checkbox",on:{change:function(s){return t.handleStatusSelection(t.account)}}}):t._e(),t._v(" "),t.propertyExists(t.account,"id")?e("router-link",{staticClass:"router-link",attrs:{to:{name:"UsersShow",params:{id:t.account.id}}},nativeOn:{click:function(t){t.stopPropagation()}}},[e("div",{staticClass:"status-card-header"},[t.propertyExists(t.account,"avatar")?e("img",{staticClass:"status-avatar-img",attrs:{src:t.account.avatar}}):t._e(),t._v(" "),t.propertyExists(t.account,"nickname")?e("span",{staticClass:"status-account-name"},[t._v(t._s(t.account.nickname))]):e("span",[t.propertyExists(t.account,"nickname")?e("span",{staticClass:"status-account-name"},[t._v("\n "+t._s(t.account.nickname)+"\n ")]):e("span",{staticClass:"status-account-name deactivated"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")])])])]):t._e()],1)]),t._v(" "),e("div",{staticClass:"status-actions"},[e("div",{staticClass:"status-tags"},[t.status.sensitive?e("el-tag",{attrs:{type:"warning",size:"large"}},[t._v(t._s(t.$t("reports.sensitive")))]):t._e(),t._v(" "),e("el-tag",{attrs:{size:"large"}},[t._v(t._s(t.capitalizeFirstLetter(t.status.visibility)))])],1),t._v(" "),e("el-dropdown",{attrs:{trigger:"click"},nativeOn:{click:function(t){t.stopPropagation()}}},[e("el-button",{staticClass:"status-actions-button",attrs:{plain:"",size:"small",icon:"el-icon-edit"}},[t._v("\n "+t._s(t.$t("reports.changeScope"))),e("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t.status.sensitive?t._e():e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,!0,t.status.visibility)}}},[t._v("\n "+t._s(t.$t("reports.addSensitive"))+"\n ")]),t._v(" "),t.status.sensitive?e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,!1,t.status.visibility)}}},[t._v("\n "+t._s(t.$t("reports.removeSensitive"))+"\n ")]):t._e(),t._v(" "),"public"!==t.status.visibility?e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,t.status.sensitive,"public")}}},[t._v("\n "+t._s(t.$t("reports.public"))+"\n ")]):t._e(),t._v(" "),"private"!==t.status.visibility?e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,t.status.sensitive,"private")}}},[t._v("\n "+t._s(t.$t("reports.private"))+"\n ")]):t._e(),t._v(" "),"unlisted"!==t.status.visibility?e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,t.status.sensitive,"unlisted")}}},[t._v("\n "+t._s(t.$t("reports.unlisted"))+"\n ")]):t._e(),t._v(" "),e("el-dropdown-item",{nativeOn:{click:function(s){return t.deleteStatus(t.status.id)}}},[t._v("\n "+t._s(t.$t("reports.deleteStatus"))+"\n ")])],1)],1)],1)])]),t._v(" "),e("div",{staticClass:"status-body"},[t.status.spoiler_text?e("div",[e("strong",[t._v(t._s(t.status.spoiler_text))]),t._v(" "),t.showHiddenStatus?t._e():e("el-button",{staticClass:"show-more-button",attrs:{size:"mini"},on:{click:function(s){t.showHiddenStatus=!0}}},[t._v("Show more")]),t._v(" "),t.showHiddenStatus?e("el-button",{staticClass:"show-more-button",attrs:{size:"mini"},on:{click:function(s){t.showHiddenStatus=!1}}},[t._v("Show less")]):t._e(),t._v(" "),t.showHiddenStatus?e("div",[e("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}),t._v(" "),t.status.poll?e("div",{staticClass:"poll"},[e("ul",t._l(t.status.poll.options,function(s,a){return e("li",{key:a},[t._v("\n "+t._s(s.title)+"\n "),e("el-progress",{attrs:{percentage:t.optionPercent(t.status.poll,s)}})],1)}),0)]):t._e(),t._v(" "),t._l(t.status.media_attachments,function(t,s){return e("div",{key:s,staticClass:"image"},[e("img",{attrs:{src:t.preview_url}})])})],2):t._e()],1):t._e(),t._v(" "),t.status.spoiler_text?t._e():e("div",[e("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}),t._v(" "),t.status.poll?e("div",{staticClass:"poll"},[e("ul",t._l(t.status.poll.options,function(s,a){return e("li",{key:a},[t._v("\n "+t._s(s.title)+"\n "),e("el-progress",{attrs:{percentage:t.optionPercent(t.status.poll,s)}})],1)}),0)]):t._e(),t._v(" "),t._l(t.status.media_attachments,function(t,s){return e("div",{key:s,staticClass:"image"},[e("img",{attrs:{src:t.preview_url}})])})],2),t._v(" "),e("div",{staticClass:"status-footer"},[e("span",{staticClass:"status-created-at"},[t._v(t._s(t.parseTimestamp(t.status.created_at)))]),t._v(" "),t.status.url?e("a",{staticClass:"account",attrs:{href:t.status.url,target:"_blank"},on:{click:function(t){t.stopPropagation()}}},[t._v("\n "+t._s(t.$t("statuses.openStatusInInstance"))+"\n "),e("i",{staticClass:"el-icon-top-right"})]):t._e()])])])},[],!1,null,null,null);r.options.__file="index.vue";s.a=r.exports},rIUS:function(t,s,e){"use strict";var a=e("o0o1"),n=e.n(a),i=e("yXPU"),o=e.n(i),r=e("mSNy"),c={name:"RebootButton",computed:{needReboot:function(){return this.$store.state.app.needReboot}},methods:{restartApp:function(){var t=o()(n.a.mark(function t(){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.$store.dispatch("RestartApplication");case 3:t.next=8;break;case 5:return t.prev=5,t.t0=t.catch(0),t.abrupt("return");case 8:this.$message({type:"success",message:r.a.t("settings.restartSuccess")});case 9:case"end":return t.stop()}},t,this,[[0,5]])}));return function(){return t.apply(this,arguments)}}()}},u=e("KHd+"),l=Object(u.a)(c,function(){var t=this.$createElement,s=this._self._c||t;return this.needReboot?s("el-tooltip",{attrs:{content:this.$t("settings.restartApp"),placement:"bottom-end"}},[s("el-button",{staticClass:"reboot-button",attrs:{type:"warning"},on:{click:this.restartApp}},[s("span",[s("i",{staticClass:"el-icon-refresh"}),this._v("\n "+this._s(this.$t("settings.instanceReboot"))+"\n ")])])],1):this._e()},[],!1,null,null,null);l.options.__file="index.vue";s.a=l.exports}}]);
+//# sourceMappingURL=chunk-commons.5a106955.js.map
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-commons.5a106955.js.map b/priv/static/adminfe/static/js/chunk-commons.5a106955.js.map
new file mode 100644
index 000000000..d924490e5
--- /dev/null
+++ b/priv/static/adminfe/static/js/chunk-commons.5a106955.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///./src/components/Status/index.vue?aecc","webpack:///./src/components/Status/index.vue?b843","webpack:///./src/components/Status/index.vue?6071","webpack:///src/components/Status/index.vue","webpack:///./src/components/Status/index.vue","webpack:///./src/components/RebootButton/index.vue?8db4","webpack:///./src/components/RebootButton/index.vue?2f45","webpack:///src/components/RebootButton/index.vue","webpack:///./src/components/RebootButton/index.vue"],"names":["_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","n","components_Statusvue_type_script_lang_js_","name","props","account","type","Object","required","default","fetchStatusesByInstance","Boolean","showCheckbox","status","page","Number","userId","String","godmode","data","showHiddenStatus","methods","capitalizeFirstLetter","str","charAt","toUpperCase","slice","changeStatus","statusId","isSensitive","visibility","this","$store","dispatch","reportCurrentPage","deleteStatus","_this","$confirm","confirmButtonText","cancelButtonText","then","$message","message","catch","handleStatusSelection","$emit","handleRouteChange","$router","push","params","id","optionPercent","poll","pollOption","allVotes","options","reduce","acc","option","votes_count","toFixed","parseTimestamp","timestamp","moment_default","format","propertyExists","property","_secondProperty","component","componentNormalizer","_vm","_h","$createElement","_c","_self","deleted","staticClass","attrs","slot","_v","_s","$t","domProps","innerHTML","content","created_at","_e","href","url","target","on","click","$event","stopPropagation","nativeOn","change","to","src","avatar","nickname","size","trigger","plain","icon","sensitive","spoiler_text","_l","index","key","title","percentage","attachment","preview_url","__file","__webpack_exports__","components_RebootButtonvue_type_script_lang_js_","computed","needReboot","state","app","restartApp","_restartApp","asyncToGenerator_default","regenerator_default","a","mark","_callee","wrap","_context","prev","next","t0","abrupt","lang","t","stop","apply","arguments","placement"],"mappings":"yGAAA,IAAAA,EAAAC,EAAA,QAAAA,EAAAC,EAAAF,GAAud,4DCAvd,yBCA0MG,GC4I1MC,KAAA,SACAC,OACAC,SACAC,KAAAC,OACAC,UAAA,EACAC,QAAA,sBAEAC,yBACAJ,KAAAK,QACAH,UAAA,EACAC,SAAA,GAEAG,cACAN,KAAAK,QACAH,UAAA,EACAC,SAAA,GAEAI,QACAP,KAAAC,OACAC,UAAA,GAEAM,MACAR,KAAAS,OACAP,UAAA,EACAC,QAAA,GAEAO,QACAV,KAAAW,OACAT,UAAA,EACAC,QAAA,IAE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kD,GAAA,uBAAAyD,UAAA,gBAAkEjE,EAAA,aAAkBG,YAAA,gBAAAC,OAAmCvE,KAAA,WAAiBoF,IAAKC,MAA5P5D,KAA4PyF,cAAwB/C,EAAA,QAAAA,EAAA,KAAqBG,YAAA,oBAAzS7C,KAAuUgD,GAAA,WAAvUhD,KAAuUiD,GAAvUjD,KAAuUkD,GAAA,8CAAvUlD,KAAuUuD,UGWjW,EACA,KACA,KACA,MAIAlB,EAAAb,QAAA0D,OAAA,YACeC,EAAA,EAAA9C","file":"static/js/chunk-commons.5a106955.js","sourcesContent":["import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.status.deleted)?_c('el-card',{staticClass:\"status-card\",nativeOn:{\"click\":function($event){return _vm.handleRouteChange()}}},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('div',{staticClass:\"status-header\"},[_c('div',{staticClass:\"status-account-container\"},[_c('div',{staticClass:\"status-account\"},[(_vm.showCheckbox)?_c('el-checkbox',{staticClass:\"status-checkbox\",on:{\"change\":function($event){return _vm.handleStatusSelection(_vm.account)}}}):_vm._e(),_vm._v(\" \"),(_vm.propertyExists(_vm.account, 'id'))?_c('router-link',{staticClass:\"router-link\",attrs:{\"to\":{ name: 'UsersShow', params: { id: _vm.account.id }}},nativeOn:{\"click\":function($event){$event.stopPropagation();}}},[_c('div',{staticClass:\"status-card-header\"},[(_vm.propertyExists(_vm.account, 'avatar'))?_c('img',{staticClass:\"status-avatar-img\",attrs:{\"src\":_vm.account.avatar}}):_vm._e(),_vm._v(\" \"),(_vm.propertyExists(_vm.account, 'nickname'))?_c('span',{staticClass:\"status-account-name\"},[_vm._v(_vm._s(_vm.account.nickname))]):_c('span',[(_vm.propertyExists(_vm.account, 'nickname'))?_c('span',{staticClass:\"status-account-name\"},[_vm._v(\"\\n \"+_vm._s(_vm.account.nickname)+\"\\n \")]):_c('span',{staticClass:\"status-account-name deactivated\"},[_vm._v(\"(\"+_vm._s(_vm.$t('users.invalidNickname'))+\")\")])])])]):_vm._e()],1)]),_vm._v(\" \"),_c('div',{staticClass:\"status-actions\"},[_c('div',{staticClass:\"status-tags\"},[(_vm.status.sensitive)?_c('el-tag',{attrs:{\"type\":\"warning\",\"size\":\"large\"}},[_vm._v(_vm._s(_vm.$t('reports.sensitive')))]):_vm._e(),_vm._v(\" \"),_c('el-tag',{attrs:{\"size\":\"large\"}},[_vm._v(_vm._s(_vm.capitalizeFirstLetter(_vm.status.visibility)))])],1),_vm._v(\" \"),_c('el-dropdown',{attrs:{\"trigger\":\"click\"},nativeOn:{\"click\":function($event){$event.stopPropagation();}}},[_c('el-button',{staticClass:\"status-actions-button\",attrs:{\"plain\":\"\",\"size\":\"small\",\"icon\":\"el-icon-edit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.changeScope'))),_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"})]),_vm._v(\" \"),_c('el-dropdown-menu',{attrs:{\"slot\":\"dropdown\"},slot:\"dropdown\"},[(!_vm.status.sensitive)?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, true, _vm.status.visibility)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.addSensitive'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.sensitive)?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, false, _vm.status.visibility)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.removeSensitive'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'public')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'public')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.public'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'private')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'private')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.private'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'unlisted')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'unlisted')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.unlisted'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.deleteStatus(_vm.status.id)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.deleteStatus'))+\"\\n \")])],1)],1)],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"status-body\"},[(_vm.status.spoiler_text)?_c('div',[_c('strong',[_vm._v(_vm._s(_vm.status.spoiler_text))]),_vm._v(\" \"),(!_vm.showHiddenStatus)?_c('el-button',{staticClass:\"show-more-button\",attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.showHiddenStatus = true}}},[_vm._v(\"Show more\")]):_vm._e(),_vm._v(\" \"),(_vm.showHiddenStatus)?_c('el-button',{staticClass:\"show-more-button\",attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.showHiddenStatus = false}}},[_vm._v(\"Show less\")]):_vm._e(),_vm._v(\" \"),(_vm.showHiddenStatus)?_c('div',[_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}),_vm._v(\" \"),(_vm.status.poll)?_c('div',{staticClass:\"poll\"},[_c('ul',_vm._l((_vm.status.poll.options),function(option,index){return _c('li',{key:index},[_vm._v(\"\\n \"+_vm._s(option.title)+\"\\n \"),_c('el-progress',{attrs:{\"percentage\":_vm.optionPercent(_vm.status.poll, option)}})],1)}),0)]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.status.media_attachments),function(attachment,index){return _c('div',{key:index,staticClass:\"image\"},[_c('img',{attrs:{\"src\":attachment.preview_url}})])})],2):_vm._e()],1):_vm._e(),_vm._v(\" \"),(!_vm.status.spoiler_text)?_c('div',[_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}),_vm._v(\" \"),(_vm.status.poll)?_c('div',{staticClass:\"poll\"},[_c('ul',_vm._l((_vm.status.poll.options),function(option,index){return _c('li',{key:index},[_vm._v(\"\\n \"+_vm._s(option.title)+\"\\n \"),_c('el-progress',{attrs:{\"percentage\":_vm.optionPercent(_vm.status.poll, option)}})],1)}),0)]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.status.media_attachments),function(attachment,index){return _c('div',{key:index,staticClass:\"image\"},[_c('img',{attrs:{\"src\":attachment.preview_url}})])})],2):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"status-footer\"},[_c('span',{staticClass:\"status-created-at\"},[_vm._v(_vm._s(_vm.parseTimestamp(_vm.status.created_at)))]),_vm._v(\" \"),(_vm.status.url)?_c('a',{staticClass:\"account\",attrs:{\"href\":_vm.status.url,\"target\":\"_blank\"},on:{\"click\":function($event){$event.stopPropagation();}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('statuses.openStatusInInstance'))+\"\\n \"),_c('i',{staticClass:\"el-icon-top-right\"})]):_vm._e()])])]):_c('el-card',{staticClass:\"status-card\"},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('div',{staticClass:\"status-header\"},[_c('div',{staticClass:\"status-account-container\"},[_c('div',{staticClass:\"status-account\"},[_c('h4',{staticClass:\"status-deleted\"},[_vm._v(_vm._s(_vm.$t('reports.statusDeleted')))])])])])]),_vm._v(\" \"),_c('div',{staticClass:\"status-body\"},[(_vm.status.content)?_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}):_c('span',{staticClass:\"status-without-content\"},[_vm._v(\"no content\")])]),_vm._v(\" \"),_c('div',{staticClass:\"status-footer\"},[(_vm.status.created_at)?_c('span',{staticClass:\"status-created-at\"},[_vm._v(_vm._s(_vm.parseTimestamp(_vm.status.created_at)))]):_vm._e(),_vm._v(\" \"),(_vm.status.url)?_c('a',{staticClass:\"account\",attrs:{\"href\":_vm.status.url,\"target\":\"_blank\"},on:{\"click\":function($event){$event.stopPropagation();}}},[_vm._v(\"\\n Open status in instance\\n \"),_c('i',{staticClass:\"el-icon-top-right\"})]):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","
\n \n \n \n
\n \n
\n
{{ status.spoiler_text }}\n
Show more\n
Show less\n
\n
\n \n
\n - \n {{ option.title }}\n \n
\n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n - \n {{ option.title }}\n \n
\n
\n
\n \n
\n
\n \n \n
\n \n \n \n \n
\n \n \n no content\n
\n \n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=69419e6d&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.needReboot)?_c('el-tooltip',{attrs:{\"content\":_vm.$t('settings.restartApp'),\"placement\":\"bottom-end\"}},[_c('el-button',{staticClass:\"reboot-button\",attrs:{\"type\":\"warning\"},on:{\"click\":_vm.restartApp}},[_c('span',[_c('i',{staticClass:\"el-icon-refresh\"}),_vm._v(\"\\n \"+_vm._s(_vm.$t('settings.instanceReboot'))+\"\\n \")])])],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","
\n \n \n \n \n {{ $t('settings.instanceReboot') }}\n \n \n \n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=53cfaf1d&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports"],"sourceRoot":""}
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-d38a.a851004a.js b/priv/static/adminfe/static/js/chunk-d38a.a851004a.js
deleted file mode 100644
index c302af310..000000000
--- a/priv/static/adminfe/static/js/chunk-d38a.a851004a.js
+++ /dev/null
@@ -1,2 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-d38a"],{"53Av":function(e,t,s){"use strict";var r=s("lOBV");s.n(r).a},"6eCR":function(e,t,s){"use strict";var r=s("Jdpf");s.n(r).a},"9/5/":function(e,t,s){(function(t){var s="Expected a function",r=NaN,n="[object Symbol]",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt,l="object"==typeof t&&t&&t.Object===Object&&t,d="object"==typeof self&&self&&self.Object===Object&&self,p=l||d||Function("return this")(),v=Object.prototype.toString,f=Math.max,m=Math.min,h=function(){return p.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&v.call(e)==n}(e))return r;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var s=a.test(e);return s||c.test(e)?u(e.slice(2),s?2:8):o.test(e)?r:+e}e.exports=function(e,t,r){var n,i,o,a,c,u,l=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new TypeError(s);function w(t){var s=n,r=i;return n=i=void 0,l=t,a=e.apply(r,s)}function $(e){var s=e-u;return void 0===u||s>=t||s<0||p&&e-l>=o}function b(){var e=h();if($(e))return k(e);c=setTimeout(b,function(e){var s=t-(e-u);return p?m(s,o-(e-l)):s}(e))}function k(e){return c=void 0,v&&n?w(e):(n=i=void 0,a)}function y(){var e=h(),s=$(e);if(n=arguments,i=this,u=e,s){if(void 0===c)return function(e){return l=e,c=setTimeout(b,t),d?w(e):a}(u);if(p)return c=setTimeout(b,t),w(u)}return void 0===c&&(c=setTimeout(b,t)),a}return t=_(t)||0,g(r)&&(d=!!r.leading,o=(p="maxWait"in r)?f(_(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),y.cancel=function(){void 0!==c&&clearTimeout(c),l=0,n=u=i=c=void 0},y.flush=function(){return void 0===c?a:k(h())},y}}).call(this,s("yLpj"))},DPTh:function(e,t,s){"use strict";var r=s("vg5t");s.n(r).a},H08Y:function(e,t,s){"use strict";var r=s("zhkl");s.n(r).a},Jdpf:function(e,t,s){},RGjw:function(e,t,s){"use strict";s.r(t);var r=s("o0o1"),n=s.n(r),i=s("yXPU"),o=s.n(i),a=s("9/5/"),c=s.n(a),u=s("ZhIB"),l=s.n(u),d=s("lSNA"),p=s.n(d),v=s("MVZn"),f=s.n(v),m={data:function(){return{value:[]}},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device}},methods:{removeOppositeFilters:function(){var e=Object.keys(this.$store.state.users.filters).length,t=this.$data.value.slice(),s=t.indexOf("local"),r=t.indexOf("external"),n=t.indexOf("active"),i=t.indexOf("deactivated");if(t.length===e)return[];if(s>-1&&r>-1){var o=s>r?r:s;t.splice(o,1)}else if(n>-1&&i>-1){var a=n>i?i:n;t.splice(a,1)}return t},toggleFilters:function(){this.$data.value=this.removeOppositeFilters();var e=this.$data.value.reduce(function(e,t){return f()({},e,p()({},t,!0))},{});this.$store.dispatch("ToggleUsersFilter",e)}}},h=(s("H08Y"),s("KHd+")),g=Object(h.a)(m,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-select",{staticClass:"select-field",attrs:{clearable:e.isDesktop,placeholder:e.$t("usersFilter.inputPlaceholder"),multiple:""},on:{change:e.toggleFilters},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[s("el-option-group",{attrs:{label:e.$t("usersFilter.byUserType")}},[s("el-option",{attrs:{value:"local"}},[e._v(e._s(e.$t("usersFilter.local")))]),e._v(" "),s("el-option",{attrs:{value:"external"}},[e._v(e._s(e.$t("usersFilter.external")))])],1),e._v(" "),s("el-option-group",{attrs:{label:e.$t("usersFilter.byStatus")}},[s("el-option",{attrs:{value:"active"}},[e._v(e._s(e.$t("usersFilter.active")))]),e._v(" "),s("el-option",{attrs:{value:"deactivated"}},[e._v(e._s(e.$t("usersFilter.deactivated")))])],1)],1)},[],!1,null,"4bc96860",null);g.options.__file="UsersFilter.vue";var _=g.exports,w=s("i7Kn"),$={name:"NewAccountDialog",props:{dialogFormVisible:{type:Boolean,default:function(){return!1}}},data:function(){return{newUserForm:{nickname:"",email:"",password:""},rules:{nickname:[{validator:this.validateUsername,trigger:"blur"}],email:[{validator:this.validateEmail,trigger:"blur"}],password:[{validator:this.validatePassword,trigger:"blur"}]}}},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device},isVisible:{get:function(){return this.$props.dialogFormVisible},set:function(){this.closeDialogWindow()}},getLabelWidth:function(){return this.isDesktop?"120px":"85px"}},methods:{closeDialogWindow:function(){this.$emit("closeWindow")},resetForm:function(){var e=this;this.$nextTick(function(){e.$refs.newUserForm.resetFields()})},submitForm:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return t.$message({type:"error",message:t.$t("users.submitFormError")}),!1;t.$emit("createNewAccount",t.$data.newUserForm)})},validateEmail:function(e,t,s){return""===t?s(new Error(this.$t("users.emptyEmailError"))):this.validEmail(t)?s():s(new Error(this.$t("users.invalidEmailError")))},validatePassword:function(e,t,s){return""===t?s(new Error(this.$t("users.emptyPasswordError"))):s()},validateUsername:function(e,t,s){return""===t?s(new Error(this.$t("users.emptyNicknameError"))):this.validNickname(t)?s():s(new Error(this.$t("users.invalidNicknameError")))},validEmail:function(e){return/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)},validNickname:function(e){return/^[a-zA-Z\d]+$/.test(e)}}},b=(s("DPTh"),Object(h.a)($,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dialog",{attrs:{visible:e.isVisible,"show-close":!1,title:e.$t("users.createAccount"),"custom-class":"create-user-dialog"},on:{"update:visible":function(t){e.isVisible=t},open:e.resetForm}},[s("el-form",{ref:"newUserForm",attrs:{model:e.newUserForm,rules:e.rules,"label-width":e.getLabelWidth,"status-icon":""}},[s("el-form-item",{staticClass:"create-account-form-item",attrs:{label:e.$t("users.username"),prop:"nickname"}},[s("el-input",{attrs:{name:"nickname",autofocus:""},model:{value:e.newUserForm.nickname,callback:function(t){e.$set(e.newUserForm,"nickname",t)},expression:"newUserForm.nickname"}})],1),e._v(" "),s("el-form-item",{staticClass:"create-account-form-item",attrs:{label:e.$t("users.email"),prop:"email"}},[s("el-input",{attrs:{name:"email",type:"email"},model:{value:e.newUserForm.email,callback:function(t){e.$set(e.newUserForm,"email",t)},expression:"newUserForm.email"}})],1),e._v(" "),s("el-form-item",{staticClass:"create-account-form-item-without-margin",attrs:{label:e.$t("users.password"),prop:"password"}},[s("el-input",{attrs:{type:"password",name:"password",autocomplete:"off"},model:{value:e.newUserForm.password,callback:function(t){e.$set(e.newUserForm,"password",t)},expression:"newUserForm.password"}})],1)],1),e._v(" "),s("span",{attrs:{slot:"footer"},slot:"footer"},[s("el-button",{on:{click:e.closeDialogWindow}},[e._v(e._s(e.$t("users.cancel")))]),e._v(" "),s("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.submitForm("newUserForm")}}},[e._v(e._s(e.$t("users.create")))])],1)],1)},[],!1,null,null,null));b.options.__file="NewAccountDialog.vue";var k=b.exports,y=s("tPM3"),D=s("rIUS"),C={name:"Users",components:{NewAccountDialog:k,ModerationDropdown:y.a,MultipleUsersMenu:w.a,RebootButton:D.a,UsersFilter:_},data:function(){return{search:"",selectedUsers:[],createAccountDialogOpen:!1,resetPasswordDialogOpen:!1}},computed:{loading:function(){return this.$store.state.users.loading},normalizedUsersCount:function(){return l()(this.$store.state.users.totalUsersCount).format("0a")},users:function(){return this.$store.state.users.fetchedUsers},usersCount:function(){return this.$store.state.users.totalUsersCount},pageSize:function(){return this.$store.state.users.pageSize},passwordResetLink:function(){return this.$store.state.users.passwordResetToken.link},passwordResetToken:function(){return this.$store.state.users.passwordResetToken.token},currentPage:function(){return this.$store.state.users.currentPage},isDesktop:function(){return"desktop"===this.$store.state.app.device},isMobile:function(){return"mobile"===this.$store.state.app.device},width:function(){return!!this.isMobile&&55}},created:function(){var e=this;this.handleDebounceSearchInput=c()(function(t){e.$store.dispatch("SearchUsers",{query:t,page:1})},500)},mounted:function(){this.$store.dispatch("NeedReboot"),this.$store.dispatch("FetchUsers",{page:1})},methods:{activationIcon:function(e){return e?"el-icon-error":"el-icon-success"},clearSelection:function(){this.$refs.usersTable.clearSelection()},closeResetPasswordDialog:function(){this.resetPasswordDialogOpen=!1,this.$store.dispatch("RemovePasswordToken")},createNewAccount:function(){var e=o()(n.a.mark(function e(t){return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.$store.dispatch("CreateNewAccount",t);case 2:this.createAccountDialogOpen=!1;case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),getFirstLetter:function(e){return e.charAt(0).toUpperCase()},handlePageChange:function(e){var t=this.$store.state.users.searchQuery;""===t?this.$store.dispatch("FetchUsers",{page:e}):this.$store.dispatch("SearchUsers",{query:t,page:e})},handleSelectionChange:function(e){this.$data.selectedUsers=e},openResetPasswordDialog:function(){this.resetPasswordDialogOpen=!0},showDeactivatedButton:function(e){return this.$store.state.user.id!==e}}},A=(s("6eCR"),Object(h.a)(C,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"users-container"},[s("div",{staticClass:"users-header-container"},[s("h1",[e._v("\n "+e._s(e.$t("users.users"))+"\n "),s("span",{staticClass:"user-count"},[e._v("("+e._s(e.normalizedUsersCount)+")")])]),e._v(" "),s("reboot-button")],1),e._v(" "),s("div",{staticClass:"filter-container"},[s("users-filter"),e._v(" "),s("el-input",{staticClass:"search",attrs:{placeholder:e.$t("users.search"),"prefix-icon":"el-icon-search"},on:{input:e.handleDebounceSearchInput},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}})],1),e._v(" "),s("div",{staticClass:"actions-container"},[s("el-button",{staticClass:"actions-button",on:{click:function(t){e.createAccountDialogOpen=!0}}},[s("span",{staticClass:"create-account"},[s("i",{staticClass:"el-icon-plus"}),e._v("\n "+e._s(e.$t("users.createAccount"))+"\n ")])]),e._v(" "),s("multiple-users-menu",{attrs:{"selected-users":e.selectedUsers},on:{"apply-action":e.clearSelection}})],1),e._v(" "),s("new-account-dialog",{attrs:{"dialog-form-visible":e.createAccountDialogOpen},on:{createNewAccount:e.createNewAccount,closeWindow:function(t){e.createAccountDialogOpen=!1}}}),e._v(" "),s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"usersTable",staticStyle:{width:"100%"},attrs:{data:e.users,"row-key":"id"},on:{"selection-change":e.handleSelectionChange}},[e.isDesktop?s("el-table-column",{attrs:{type:"selection","reserve-selection":"",width:"44",align:"center"}}):e._e(),e._v(" "),s("el-table-column",{attrs:{"min-width":e.width,label:e.$t("users.id"),prop:"id"}}),e._v(" "),s("el-table-column",{attrs:{label:e.$t("users.name"),prop:"nickname"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("router-link",{attrs:{to:{name:"UsersShow",params:{id:t.row.id}}}},[e._v(e._s(t.row.nickname))]),e._v(" "),e.isDesktop?s("el-tag",{attrs:{type:"info",size:"mini"}},[s("span",[e._v(e._s(t.row.local?e.$t("users.local"):e.$t("users.external")))])]):e._e()]}}])}),e._v(" "),s("el-table-column",{attrs:{"min-width":e.width,label:e.$t("users.status")},scopedSlots:e._u([{key:"default",fn:function(t){return[s("el-tag",{attrs:{type:t.row.deactivated?"danger":"success"}},[e.isDesktop?s("span",[e._v(e._s(t.row.deactivated?e.$t("users.deactivated"):e.$t("users.active")))]):s("i",{class:e.activationIcon(t.row.deactivated)})]),e._v(" "),t.row.roles.admin?s("el-tag",[s("span",[e._v(e._s(e.isDesktop?e.$t("users.admin"):e.getFirstLetter(e.$t("users.admin"))))])]):e._e(),e._v(" "),t.row.roles.moderator?s("el-tag",[s("span",[e._v(e._s(e.isDesktop?e.$t("users.moderator"):e.getFirstLetter(e.$t("users.moderator"))))])]):e._e(),e._v(" "),s("el-tooltip",{attrs:{content:e.$t("users.unconfirmedEmail"),effect:"dark"}},[t.row.confirmation_pending?s("el-tag",{attrs:{type:"info"}},[e._v("\n "+e._s(e.isDesktop?e.$t("users.unconfirmed"):e.getFirstLetter(e.$t("users.unconfirmed")))+"\n ")]):e._e()],1)]}}])}),e._v(" "),s("el-table-column",{attrs:{label:e.$t("users.actions"),fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("moderation-dropdown",{attrs:{user:t.row,page:"users"},on:{"open-reset-token-dialog":e.openResetPasswordDialog}})]}}])})],1),e._v(" "),s("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{visible:e.resetPasswordDialogOpen,title:e.$t("users.passwordResetTokenCreated"),"custom-class":"password-reset-token-dialog"},on:{"update:visible":function(t){e.resetPasswordDialogOpen=t},close:e.closeResetPasswordDialog}},[s("div",[s("p",{staticClass:"password-reset-token"},[e._v("Password reset token was generated: "+e._s(e.passwordResetToken))]),e._v(" "),s("p",[e._v("You can also use this link to reset password:\n "),s("a",{staticClass:"reset-password-link",attrs:{href:e.passwordResetLink,target:"_blank"}},[e._v(e._s(e.passwordResetLink))])])])]),e._v(" "),e.loading?e._e():s("div",{staticClass:"pagination"},[s("el-pagination",{attrs:{total:e.usersCount,"current-page":e.currentPage,"page-size":e.pageSize,background:"",layout:"prev, pager, next"},on:{"current-change":e.handlePageChange}})],1)],1)},[],!1,null,null,null));A.options.__file="index.vue";t.default=A.exports},lOBV:function(e,t,s){},tPM3:function(e,t,s){"use strict";var r={name:"ModerationDropdown",props:{user:{type:Object,default:function(){return{}}},page:{type:String,default:"users"}},computed:{isDesktop:function(){return"desktop"===this.$store.state.app.device}},methods:{getPasswordResetToken:function(e){this.$emit("open-reset-token-dialog"),this.$store.dispatch("GetPasswordResetToken",e)},handleConfirmationResend:function(e){this.$store.dispatch("ResendConfirmationEmail",[e])},handleDeletion:function(e){this.$store.dispatch("DeleteUsers",{users:[e],_userId:e.id})},handleEmailConfirmation:function(e){this.$store.dispatch("ConfirmUsersEmail",{users:[e],_userId:e.id})},requirePasswordReset:function(e){this.$store.state.user.nodeInfo.metadata.mailerEnabled?this.$store.dispatch("RequirePasswordReset",[e]):this.$alert(this.$t("users.mailerMustBeEnabled"),"Error",{type:"error"})},showAdminAction:function(e){var t=e.local,s=e.id;return t&&this.showDeactivatedButton(s)},showDeactivatedButton:function(e){return this.$store.state.user.id!==e},toggleActivation:function(e){e.deactivated?this.$store.dispatch("ActivateUsers",{users:[e],_userId:e.id}):this.$store.dispatch("DeactivateUsers",{users:[e],_userId:e.id})},toggleTag:function(e,t){e.tags.includes(t)?this.$store.dispatch("RemoveTag",{users:[e],tag:t,_userId:e.id}):this.$store.dispatch("AddTag",{users:[e],tag:t,_userId:e.id})},toggleUserRight:function(e,t){e.roles[t]?this.$store.dispatch("DeleteRight",{users:[e],right:t,_userId:e.id}):this.$store.dispatch("AddRight",{users:[e],right:t,_userId:e.id})}}},n=(s("53Av"),s("KHd+")),i=Object(n.a)(r,function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dropdown",{attrs:{"hide-on-click":!1,size:"small",trigger:"click"}},[s("div",["users"===e.page?s("span",{staticClass:"el-dropdown-link"},[e._v("\n "+e._s(e.$t("users.moderation"))+"\n "),e.isDesktop?s("i",{staticClass:"el-icon-arrow-down el-icon--right"}):e._e()]):e._e(),e._v(" "),"userPage"===e.page?s("el-button",{staticClass:"moderate-user-button"},[s("span",{staticClass:"moderate-user-button-container"},[s("span",[s("i",{staticClass:"el-icon-edit"}),e._v("\n "+e._s(e.$t("users.moderateUser"))+"\n ")]),e._v(" "),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})])]):e._e()],1),e._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e.showAdminAction(e.user)?s("el-dropdown-item",{nativeOn:{click:function(t){return e.toggleUserRight(e.user,"admin")}}},[e._v("\n "+e._s(e.user.roles.admin?e.$t("users.revokeAdmin"):e.$t("users.grantAdmin"))+"\n ")]):e._e(),e._v(" "),e.showAdminAction(e.user)?s("el-dropdown-item",{nativeOn:{click:function(t){return e.toggleUserRight(e.user,"moderator")}}},[e._v("\n "+e._s(e.user.roles.moderator?e.$t("users.revokeModerator"):e.$t("users.grantModerator"))+"\n ")]):e._e(),e._v(" "),e.showDeactivatedButton(e.user.id)?s("el-dropdown-item",{attrs:{divided:e.showAdminAction(e.user)},nativeOn:{click:function(t){return e.toggleActivation(e.user)}}},[e._v("\n "+e._s(e.user.deactivated?e.$t("users.activateAccount"):e.$t("users.deactivateAccount"))+"\n ")]):e._e(),e._v(" "),e.showDeactivatedButton(e.user.id)?s("el-dropdown-item",{nativeOn:{click:function(t){return e.handleDeletion(e.user)}}},[e._v("\n "+e._s(e.$t("users.deleteAccount"))+"\n ")]):e._e(),e._v(" "),e.user.local&&e.user.confirmation_pending?s("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.handleEmailConfirmation(e.user)}}},[e._v("\n "+e._s(e.$t("users.confirmAccount"))+"\n ")]):e._e(),e._v(" "),e.user.local&&e.user.confirmation_pending?s("el-dropdown-item",{nativeOn:{click:function(t){return e.handleConfirmationResend(e.user)}}},[e._v("\n "+e._s(e.$t("users.resendConfirmation"))+"\n ")]):e._e(),e._v(" "),s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("force_nsfw")},attrs:{divided:e.showAdminAction(e.user)},nativeOn:{click:function(t){return e.toggleTag(e.user,"force_nsfw")}}},[e._v("\n "+e._s(e.$t("users.forceNsfw"))+"\n "),e.user.tags.includes("force_nsfw")?s("i",{staticClass:"el-icon-check"}):e._e()]),e._v(" "),s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("strip_media")},nativeOn:{click:function(t){return e.toggleTag(e.user,"strip_media")}}},[e._v("\n "+e._s(e.$t("users.stripMedia"))+"\n "),e.user.tags.includes("strip_media")?s("i",{staticClass:"el-icon-check"}):e._e()]),e._v(" "),s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("force_unlisted")},nativeOn:{click:function(t){return e.toggleTag(e.user,"force_unlisted")}}},[e._v("\n "+e._s(e.$t("users.forceUnlisted"))+"\n "),e.user.tags.includes("force_unlisted")?s("i",{staticClass:"el-icon-check"}):e._e()]),e._v(" "),s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("sandbox")},nativeOn:{click:function(t){return e.toggleTag(e.user,"sandbox")}}},[e._v("\n "+e._s(e.$t("users.sandbox"))+"\n "),e.user.tags.includes("sandbox")?s("i",{staticClass:"el-icon-check"}):e._e()]),e._v(" "),e.user.local?s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("disable_remote_subscription")},nativeOn:{click:function(t){return e.toggleTag(e.user,"disable_remote_subscription")}}},[e._v("\n "+e._s(e.$t("users.disableRemoteSubscription"))+"\n "),e.user.tags.includes("disable_remote_subscription")?s("i",{staticClass:"el-icon-check"}):e._e()]):e._e(),e._v(" "),e.user.local?s("el-dropdown-item",{class:{"active-tag":e.user.tags.includes("disable_any_subscription")},nativeOn:{click:function(t){return e.toggleTag(e.user,"disable_any_subscription")}}},[e._v("\n "+e._s(e.$t("users.disableAnySubscription"))+"\n "),e.user.tags.includes("disable_any_subscription")?s("i",{staticClass:"el-icon-check"}):e._e()]):e._e(),e._v(" "),e.user.local?s("el-dropdown-item",{attrs:{divided:""},nativeOn:{click:function(t){return e.getPasswordResetToken(e.user.nickname)}}},[e._v("\n "+e._s(e.$t("users.getPasswordResetToken"))+"\n ")]):e._e(),e._v(" "),e.user.local?s("el-dropdown-item",{nativeOn:{click:function(t){return e.requirePasswordReset(e.user)}}},[e._v("\n "+e._s(e.$t("users.requirePasswordReset"))+"\n ")]):e._e()],1)],1)},[],!1,null,null,null);i.options.__file="ModerationDropdown.vue";t.a=i.exports},vg5t:function(e,t,s){},zhkl:function(e,t,s){}}]);
-//# sourceMappingURL=chunk-d38a.a851004a.js.map
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-d38a.a851004a.js.map b/priv/static/adminfe/static/js/chunk-d38a.a851004a.js.map
deleted file mode 100644
index 6779f6dc1..000000000
--- a/priv/static/adminfe/static/js/chunk-d38a.a851004a.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///./src/views/users/components/ModerationDropdown.vue?e3f0","webpack:///./src/views/users/index.vue?1afe","webpack:///./node_modules/lodash.debounce/index.js","webpack:///./src/views/users/components/NewAccountDialog.vue?d353","webpack:///./src/views/users/components/UsersFilter.vue?b48f","webpack:///./src/views/users/index.vue?6efb","webpack:///./src/views/users/components/UsersFilter.vue?6a82","webpack:///src/views/users/components/UsersFilter.vue","webpack:///./src/views/users/components/UsersFilter.vue","webpack:///./src/views/users/components/UsersFilter.vue?6235","webpack:///./src/views/users/components/NewAccountDialog.vue?9018","webpack:///src/views/users/components/NewAccountDialog.vue","webpack:///./src/views/users/components/NewAccountDialog.vue","webpack:///./src/views/users/components/NewAccountDialog.vue?43a7","webpack:///./src/views/users/index.vue?0a29","webpack:///src/views/users/index.vue","webpack:///./src/views/users/index.vue","webpack:///./src/views/users/components/ModerationDropdown.vue?f4d5","webpack:///./src/views/users/components/ModerationDropdown.vue?676e","webpack:///src/views/users/components/ModerationDropdown.vue","webpack:///./src/views/users/components/ModerationDropdown.vue"],"names":["_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_ModerationDropdown_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","n","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","global","FUNC_ERROR_TEXT","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","Object","freeSelf","self","root","Function","objectToString","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","isObject","value","type","toNumber","isObjectLike","call","isSymbol","other","valueOf","replace","isBinary","test","slice","module","exports","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","remainingWait","debounced","isInvoking","arguments","this","leadingEdge","cancel","clearTimeout","flush","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_NewAccountDialog_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_UsersFilter_vue_vue_type_style_index_0_id_4bc96860_rel_stylesheet_2Fscss_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__","components_UsersFiltervue_type_script_lang_js_","data","computed","isDesktop","$store","state","app","device","methods","removeOppositeFilters","filtersQuantity","keys","users","filters","length","currentFilters","$data","indexOfLocal","indexOf","indexOfExternal","indexOfActive","indexOfDeactivated","filterToRemove","splice","_filterToRemove","toggleFilters","reduce","acc","filter","objectSpread_default","defineProperty_default","dispatch","component","componentNormalizer","_vm","_h","$createElement","_c","_self","staticClass","attrs","clearable","placeholder","$t","multiple","on","change","model","callback","$$v","expression","label","_v","_s","__file","UsersFilter","components_NewAccountDialogvue_type_script_lang_js_","name","props","dialogFormVisible","Boolean","default","newUserForm","nickname","email","password","rules","validator","validateUsername","trigger","validateEmail","validatePassword","isVisible","get","$props","set","closeDialogWindow","getLabelWidth","$emit","resetForm","_this","$nextTick","$refs","resetFields","submitForm","formName","_this2","validate","valid","$message","message","rule","Error","validEmail","validNickname","NewAccountDialog_component","visible","show-close","title","custom-class","update:visible","$event","open","ref","label-width","status-icon","prop","autofocus","$set","autocomplete","slot","click","NewAccountDialog","views_usersvue_type_script_lang_js_","components","ModerationDropdown","MultipleUsersMenu","RebootButton","search","selectedUsers","createAccountDialogOpen","resetPasswordDialogOpen","loading","normalizedUsersCount","numeral_default","totalUsersCount","format","fetchedUsers","usersCount","pageSize","passwordResetLink","passwordResetToken","link","token","currentPage","isMobile","width","created","handleDebounceSearchInput","lodash_debounce_default","query","page","mounted","activationIcon","status","clearSelection","usersTable","closeResetPasswordDialog","createNewAccount","_createNewAccount","asyncToGenerator_default","regenerator_default","a","mark","_callee","accountData","wrap","_context","prev","next","stop","_x","getFirstLetter","str","charAt","toUpperCase","handlePageChange","searchQuery","handleSelectionChange","openResetPasswordDialog","showDeactivatedButton","id","user","users_component","prefix-icon","input","selected-users","apply-action","dialog-form-visible","closeWindow","directives","rawName","staticStyle","row-key","selection-change","reserve-selection","align","_e","min-width","scopedSlots","_u","key","fn","scope","to","params","row","size","local","deactivated","class","roles","content","effect","fixed","open-reset-token-dialog","close","href","target","total","current-page","page-size","background","layout","current-change","__webpack_exports__","components_ModerationDropdownvue_type_script_lang_js_","String","getPasswordResetToken","handleConfirmationResend","handleDeletion","_userId","handleEmailConfirmation","requirePasswordReset","nodeInfo","metadata","mailerEnabled","$alert","showAdminAction","_ref","toggleActivation","toggleTag","tag","tags","includes","toggleUserRight","right","hide-on-click","nativeOn","admin","moderator","divided","confirmation_pending","active-tag"],"mappings":"wGAAA,IAAAA,EAAAC,EAAA,QAAAA,EAAAC,EAAAF,GAAsf,uCCAtf,IAAAG,EAAAF,EAAA,QAAAA,EAAAC,EAAAC,GAAud,2BCAvd,SAAAC,GAUA,IAAAC,EAAA,sBAGAC,EAAA,IAGAC,EAAA,kBAGAC,EAAA,aAGAC,EAAA,qBAGAC,EAAA,aAGAC,EAAA,cAGAC,EAAAC,SAGAC,EAAA,iBAAAV,QAAAW,iBAAAX,EAGAY,EAAA,iBAAAC,iBAAAF,iBAAAE,KAGAC,EAAAJ,GAAAE,GAAAG,SAAA,cAAAA,GAUAC,EAPAL,OAAAM,UAOAC,SAGAC,EAAAC,KAAAC,IACAC,EAAAF,KAAAG,IAkBAC,EAAA,WACA,OAAAV,EAAAW,KAAAD,OA4MA,SAAAE,EAAAC,GACA,IAAAC,SAAAD,EACA,QAAAA,IAAA,UAAAC,GAAA,YAAAA,GA4EA,SAAAC,EAAAF,GACA,oBAAAA,EACA,OAAAA,EAEA,GAhCA,SAAAA,GACA,uBAAAA,GAtBA,SAAAA,GACA,QAAAA,GAAA,iBAAAA,EAsBAG,CAAAH,IAAAX,EAAAe,KAAAJ,IAAAxB,EA8BA6B,CAAAL,GACA,OAAAzB,EAEA,GAAAwB,EAAAC,GAAA,CACA,IAAAM,EAAA,mBAAAN,EAAAO,QAAAP,EAAAO,UAAAP,EACAA,EAAAD,EAAAO,KAAA,GAAAA,EAEA,oBAAAN,EACA,WAA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OAAA,yBACeiK,EAAA,EAAAvL","file":"static/js/chunk-d38a.a851004a.js","sourcesContent":["import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModerationDropdown.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModerationDropdown.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","/**\n * lodash (Custom Build)
\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors
\n * Released under MIT license
\n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewAccountDialog.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewAccountDialog.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UsersFilter.vue?vue&type=style&index=0&id=4bc96860&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UsersFilter.vue?vue&type=style&index=0&id=4bc96860&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"users-container\"},[_c('div',{staticClass:\"users-header-container\"},[_c('h1',[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.users'))+\"\\n \"),_c('span',{staticClass:\"user-count\"},[_vm._v(\"(\"+_vm._s(_vm.normalizedUsersCount)+\")\")])]),_vm._v(\" \"),_c('reboot-button')],1),_vm._v(\" \"),_c('div',{staticClass:\"filter-container\"},[_c('users-filter'),_vm._v(\" \"),_c('el-input',{staticClass:\"search\",attrs:{\"placeholder\":_vm.$t('users.search'),\"prefix-icon\":\"el-icon-search\"},on:{\"input\":_vm.handleDebounceSearchInput},model:{value:(_vm.search),callback:function ($$v) {_vm.search=$$v},expression:\"search\"}})],1),_vm._v(\" \"),_c('div',{staticClass:\"actions-container\"},[_c('el-button',{staticClass:\"actions-button\",on:{\"click\":function($event){_vm.createAccountDialogOpen = true}}},[_c('span',{staticClass:\"create-account\"},[_c('i',{staticClass:\"el-icon-plus\"}),_vm._v(\"\\n \"+_vm._s(_vm.$t('users.createAccount'))+\"\\n \")])]),_vm._v(\" \"),_c('multiple-users-menu',{attrs:{\"selected-users\":_vm.selectedUsers},on:{\"apply-action\":_vm.clearSelection}})],1),_vm._v(\" \"),_c('new-account-dialog',{attrs:{\"dialog-form-visible\":_vm.createAccountDialogOpen},on:{\"createNewAccount\":_vm.createNewAccount,\"closeWindow\":function($event){_vm.createAccountDialogOpen = false}}}),_vm._v(\" \"),_c('el-table',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.loading),expression:\"loading\"}],ref:\"usersTable\",staticStyle:{\"width\":\"100%\"},attrs:{\"data\":_vm.users,\"row-key\":\"id\"},on:{\"selection-change\":_vm.handleSelectionChange}},[(_vm.isDesktop)?_c('el-table-column',{attrs:{\"type\":\"selection\",\"reserve-selection\":\"\",\"width\":\"44\",\"align\":\"center\"}}):_vm._e(),_vm._v(\" \"),_c('el-table-column',{attrs:{\"min-width\":_vm.width,\"label\":_vm.$t('users.id'),\"prop\":\"id\"}}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":_vm.$t('users.name'),\"prop\":\"nickname\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_c('router-link',{attrs:{\"to\":{ name: 'UsersShow', params: { id: scope.row.id }}}},[_vm._v(_vm._s(scope.row.nickname))]),_vm._v(\" \"),(_vm.isDesktop)?_c('el-tag',{attrs:{\"type\":\"info\",\"size\":\"mini\"}},[_c('span',[_vm._v(_vm._s(scope.row.local ? _vm.$t('users.local') : _vm.$t('users.external')))])]):_vm._e()]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"min-width\":_vm.width,\"label\":_vm.$t('users.status')},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_c('el-tag',{attrs:{\"type\":scope.row.deactivated ? 'danger' : 'success'}},[(_vm.isDesktop)?_c('span',[_vm._v(_vm._s(scope.row.deactivated ? _vm.$t('users.deactivated') : _vm.$t('users.active')))]):_c('i',{class:_vm.activationIcon(scope.row.deactivated)})]),_vm._v(\" \"),(scope.row.roles.admin)?_c('el-tag',[_c('span',[_vm._v(_vm._s(_vm.isDesktop ? _vm.$t('users.admin') : _vm.getFirstLetter(_vm.$t('users.admin'))))])]):_vm._e(),_vm._v(\" \"),(scope.row.roles.moderator)?_c('el-tag',[_c('span',[_vm._v(_vm._s(_vm.isDesktop ? _vm.$t('users.moderator') : _vm.getFirstLetter(_vm.$t('users.moderator'))))])]):_vm._e(),_vm._v(\" \"),_c('el-tooltip',{attrs:{\"content\":_vm.$t('users.unconfirmedEmail'),\"effect\":\"dark\"}},[(scope.row.confirmation_pending)?_c('el-tag',{attrs:{\"type\":\"info\"}},[_vm._v(\"\\n \"+_vm._s(_vm.isDesktop ? _vm.$t('users.unconfirmed') : _vm.getFirstLetter(_vm.$t('users.unconfirmed')))+\"\\n \")]):_vm._e()],1)]}}])}),_vm._v(\" \"),_c('el-table-column',{attrs:{\"label\":_vm.$t('users.actions'),\"fixed\":\"right\"},scopedSlots:_vm._u([{key:\"default\",fn:function(scope){return [_c('moderation-dropdown',{attrs:{\"user\":scope.row,\"page\":'users'},on:{\"open-reset-token-dialog\":_vm.openResetPasswordDialog}})]}}])})],1),_vm._v(\" \"),_c('el-dialog',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.loading),expression:\"loading\"}],attrs:{\"visible\":_vm.resetPasswordDialogOpen,\"title\":_vm.$t('users.passwordResetTokenCreated'),\"custom-class\":\"password-reset-token-dialog\"},on:{\"update:visible\":function($event){_vm.resetPasswordDialogOpen=$event},\"close\":_vm.closeResetPasswordDialog}},[_c('div',[_c('p',{staticClass:\"password-reset-token\"},[_vm._v(\"Password reset token was generated: \"+_vm._s(_vm.passwordResetToken))]),_vm._v(\" \"),_c('p',[_vm._v(\"You can also use this link to reset password:\\n \"),_c('a',{staticClass:\"reset-password-link\",attrs:{\"href\":_vm.passwordResetLink,\"target\":\"_blank\"}},[_vm._v(_vm._s(_vm.passwordResetLink))])])])]),_vm._v(\" \"),(!_vm.loading)?_c('div',{staticClass:\"pagination\"},[_c('el-pagination',{attrs:{\"total\":_vm.usersCount,\"current-page\":_vm.currentPage,\"page-size\":_vm.pageSize,\"background\":\"\",\"layout\":\"prev, pager, next\"},on:{\"current-change\":_vm.handlePageChange}})],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UsersFilter.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UsersFilter.vue?vue&type=script&lang=js&\"","\n \n \n {{ $t('usersFilter.local') }}\n {{ $t('usersFilter.external') }}\n \n \n {{ $t('usersFilter.active') }}\n {{ $t('usersFilter.deactivated') }}\n \n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./UsersFilter.vue?vue&type=template&id=4bc96860&scoped=true&\"\nimport script from \"./UsersFilter.vue?vue&type=script&lang=js&\"\nexport * from \"./UsersFilter.vue?vue&type=script&lang=js&\"\nimport style0 from \"./UsersFilter.vue?vue&type=style&index=0&id=4bc96860&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"4bc96860\",\n null\n \n)\n\ncomponent.options.__file = \"UsersFilter.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-select',{staticClass:\"select-field\",attrs:{\"clearable\":_vm.isDesktop,\"placeholder\":_vm.$t('usersFilter.inputPlaceholder'),\"multiple\":\"\"},on:{\"change\":_vm.toggleFilters},model:{value:(_vm.value),callback:function ($$v) {_vm.value=$$v},expression:\"value\"}},[_c('el-option-group',{attrs:{\"label\":_vm.$t('usersFilter.byUserType')}},[_c('el-option',{attrs:{\"value\":\"local\"}},[_vm._v(_vm._s(_vm.$t('usersFilter.local')))]),_vm._v(\" \"),_c('el-option',{attrs:{\"value\":\"external\"}},[_vm._v(_vm._s(_vm.$t('usersFilter.external')))])],1),_vm._v(\" \"),_c('el-option-group',{attrs:{\"label\":_vm.$t('usersFilter.byStatus')}},[_c('el-option',{attrs:{\"value\":\"active\"}},[_vm._v(_vm._s(_vm.$t('usersFilter.active')))]),_vm._v(\" \"),_c('el-option',{attrs:{\"value\":\"deactivated\"}},[_vm._v(_vm._s(_vm.$t('usersFilter.deactivated')))])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewAccountDialog.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NewAccountDialog.vue?vue&type=script&lang=js&\"","\n \n \n \n \n \n \n \n \n \n \n \n \n \n {{ $t('users.cancel') }}\n {{ $t('users.create') }}\n \n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./NewAccountDialog.vue?vue&type=template&id=c89e4c22&\"\nimport script from \"./NewAccountDialog.vue?vue&type=script&lang=js&\"\nexport * from \"./NewAccountDialog.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NewAccountDialog.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"NewAccountDialog.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{attrs:{\"visible\":_vm.isVisible,\"show-close\":false,\"title\":_vm.$t('users.createAccount'),\"custom-class\":\"create-user-dialog\"},on:{\"update:visible\":function($event){_vm.isVisible=$event},\"open\":_vm.resetForm}},[_c('el-form',{ref:\"newUserForm\",attrs:{\"model\":_vm.newUserForm,\"rules\":_vm.rules,\"label-width\":_vm.getLabelWidth,\"status-icon\":\"\"}},[_c('el-form-item',{staticClass:\"create-account-form-item\",attrs:{\"label\":_vm.$t('users.username'),\"prop\":\"nickname\"}},[_c('el-input',{attrs:{\"name\":\"nickname\",\"autofocus\":\"\"},model:{value:(_vm.newUserForm.nickname),callback:function ($$v) {_vm.$set(_vm.newUserForm, \"nickname\", $$v)},expression:\"newUserForm.nickname\"}})],1),_vm._v(\" \"),_c('el-form-item',{staticClass:\"create-account-form-item\",attrs:{\"label\":_vm.$t('users.email'),\"prop\":\"email\"}},[_c('el-input',{attrs:{\"name\":\"email\",\"type\":\"email\"},model:{value:(_vm.newUserForm.email),callback:function ($$v) {_vm.$set(_vm.newUserForm, \"email\", $$v)},expression:\"newUserForm.email\"}})],1),_vm._v(\" \"),_c('el-form-item',{staticClass:\"create-account-form-item-without-margin\",attrs:{\"label\":_vm.$t('users.password'),\"prop\":\"password\"}},[_c('el-input',{attrs:{\"type\":\"password\",\"name\":\"password\",\"autocomplete\":\"off\"},model:{value:(_vm.newUserForm.password),callback:function ($$v) {_vm.$set(_vm.newUserForm, \"password\", $$v)},expression:\"newUserForm.password\"}})],1)],1),_vm._v(\" \"),_c('span',{attrs:{\"slot\":\"footer\"},slot:\"footer\"},[_c('el-button',{on:{\"click\":_vm.closeDialogWindow}},[_vm._v(_vm._s(_vm.$t('users.cancel')))]),_vm._v(\" \"),_c('el-button',{attrs:{\"type\":\"primary\"},on:{\"click\":function($event){return _vm.submitForm('newUserForm')}}},[_vm._v(_vm._s(_vm.$t('users.create')))])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","\n \n \n
\n \n \n
\n
\n \n \n \n {{ $t('users.createAccount') }}\n \n \n \n
\n
\n
\n \n \n \n \n {{ scope.row.nickname }}\n \n {{ scope.row.local ? $t('users.local') : $t('users.external') }}\n \n \n \n \n \n \n {{ scope.row.deactivated ? $t('users.deactivated') : $t('users.active') }}\n \n \n \n {{ isDesktop ? $t('users.admin') : getFirstLetter($t('users.admin')) }}\n \n \n {{ isDesktop ? $t('users.moderator') : getFirstLetter($t('users.moderator')) }}\n \n \n \n {{ isDesktop ? $t('users.unconfirmed') : getFirstLetter($t('users.unconfirmed')) }}\n \n \n \n \n \n \n \n \n \n \n
\n \n
Password reset token was generated: {{ passwordResetToken }}
\n
You can also use this link to reset password:\n {{ passwordResetLink }}\n
\n
\n \n \n
\n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=5a7e4206&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dropdown',{attrs:{\"hide-on-click\":false,\"size\":\"small\",\"trigger\":\"click\"}},[_c('div',[(_vm.page === 'users')?_c('span',{staticClass:\"el-dropdown-link\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.moderation'))+\"\\n \"),(_vm.isDesktop)?_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"}):_vm._e()]):_vm._e(),_vm._v(\" \"),(_vm.page === 'userPage')?_c('el-button',{staticClass:\"moderate-user-button\"},[_c('span',{staticClass:\"moderate-user-button-container\"},[_c('span',[_c('i',{staticClass:\"el-icon-edit\"}),_vm._v(\"\\n \"+_vm._s(_vm.$t('users.moderateUser'))+\"\\n \")]),_vm._v(\" \"),_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"})])]):_vm._e()],1),_vm._v(\" \"),_c('el-dropdown-menu',{attrs:{\"slot\":\"dropdown\"},slot:\"dropdown\"},[(_vm.showAdminAction(_vm.user))?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.toggleUserRight(_vm.user, 'admin')}}},[_vm._v(\"\\n \"+_vm._s(_vm.user.roles.admin ? _vm.$t('users.revokeAdmin') : _vm.$t('users.grantAdmin'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.showAdminAction(_vm.user))?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.toggleUserRight(_vm.user, 'moderator')}}},[_vm._v(\"\\n \"+_vm._s(_vm.user.roles.moderator ? _vm.$t('users.revokeModerator') : _vm.$t('users.grantModerator'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.showDeactivatedButton(_vm.user.id))?_c('el-dropdown-item',{attrs:{\"divided\":_vm.showAdminAction(_vm.user)},nativeOn:{\"click\":function($event){return _vm.toggleActivation(_vm.user)}}},[_vm._v(\"\\n \"+_vm._s(_vm.user.deactivated ? _vm.$t('users.activateAccount') : _vm.$t('users.deactivateAccount'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.showDeactivatedButton(_vm.user.id))?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.handleDeletion(_vm.user)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.deleteAccount'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.user.local && _vm.user.confirmation_pending)?_c('el-dropdown-item',{attrs:{\"divided\":\"\"},nativeOn:{\"click\":function($event){return _vm.handleEmailConfirmation(_vm.user)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.confirmAccount'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.user.local && _vm.user.confirmation_pending)?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.handleConfirmationResend(_vm.user)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.resendConfirmation'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.user.tags.includes('force_nsfw') },attrs:{\"divided\":_vm.showAdminAction(_vm.user)},nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.user, 'force_nsfw')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.forceNsfw'))+\"\\n \"),(_vm.user.tags.includes('force_nsfw'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.user.tags.includes('strip_media') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.user, 'strip_media')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.stripMedia'))+\"\\n \"),(_vm.user.tags.includes('strip_media'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.user.tags.includes('force_unlisted') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.user, 'force_unlisted')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.forceUnlisted'))+\"\\n \"),(_vm.user.tags.includes('force_unlisted'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.user.tags.includes('sandbox') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.user, 'sandbox')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.sandbox'))+\"\\n \"),(_vm.user.tags.includes('sandbox'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),(_vm.user.local)?_c('el-dropdown-item',{class:{ 'active-tag': _vm.user.tags.includes('disable_remote_subscription') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.user, 'disable_remote_subscription')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.disableRemoteSubscription'))+\"\\n \"),(_vm.user.tags.includes('disable_remote_subscription'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]):_vm._e(),_vm._v(\" \"),(_vm.user.local)?_c('el-dropdown-item',{class:{ 'active-tag': _vm.user.tags.includes('disable_any_subscription') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.user, 'disable_any_subscription')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.disableAnySubscription'))+\"\\n \"),(_vm.user.tags.includes('disable_any_subscription'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]):_vm._e(),_vm._v(\" \"),(_vm.user.local)?_c('el-dropdown-item',{attrs:{\"divided\":\"\"},nativeOn:{\"click\":function($event){return _vm.getPasswordResetToken(_vm.user.nickname)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.getPasswordResetToken'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.user.local)?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.requirePasswordReset(_vm.user)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.requirePasswordReset'))+\"\\n \")]):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModerationDropdown.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModerationDropdown.vue?vue&type=script&lang=js&\"","\n \n \n \n {{ $t('users.moderation') }}\n \n \n \n \n \n \n {{ $t('users.moderateUser') }}\n \n \n \n \n
\n \n \n {{ user.roles.admin ? $t('users.revokeAdmin') : $t('users.grantAdmin') }}\n \n \n {{ user.roles.moderator ? $t('users.revokeModerator') : $t('users.grantModerator') }}\n \n \n {{ user.deactivated ? $t('users.activateAccount') : $t('users.deactivateAccount') }}\n \n \n {{ $t('users.deleteAccount') }}\n \n \n {{ $t('users.confirmAccount') }}\n \n \n {{ $t('users.resendConfirmation') }}\n \n \n {{ $t('users.forceNsfw') }}\n \n \n \n {{ $t('users.stripMedia') }}\n \n \n \n {{ $t('users.forceUnlisted') }}\n \n \n \n {{ $t('users.sandbox') }}\n \n \n \n {{ $t('users.disableRemoteSubscription') }}\n \n \n \n {{ $t('users.disableAnySubscription') }}\n \n \n \n {{ $t('users.getPasswordResetToken') }}\n \n \n {{ $t('users.requirePasswordReset') }}\n \n \n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./ModerationDropdown.vue?vue&type=template&id=4841469c&\"\nimport script from \"./ModerationDropdown.vue?vue&type=script&lang=js&\"\nexport * from \"./ModerationDropdown.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ModerationDropdown.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"ModerationDropdown.vue\"\nexport default component.exports"],"sourceRoot":""}
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-e404.554bc2e3.js b/priv/static/adminfe/static/js/chunk-e404.554bc2e3.js
new file mode 100644
index 000000000..769e9f4f9
--- /dev/null
+++ b/priv/static/adminfe/static/js/chunk-e404.554bc2e3.js
@@ -0,0 +1,2 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-e404"],{"07OA":function(t,e,s){"use strict";var a=s("51EY");s.n(a).a},"51EY":function(t,e,s){},"8rU9":function(t,e,s){},Eg1M:function(t,e,s){"use strict";var a=s("8rU9");s.n(a).a},"G/Mk":function(t,e,s){"use strict";var a=s("xdcp");s.n(a).a},Lbbz:function(t,e,s){"use strict";var a=s("Sxb/");s.n(a).a},RnhZ:function(t,e,s){var a={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-SG":"zavE","./en-SG.js":"zavE","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function n(t){var e=r(t);return s(e)}function r(t){if(!s.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}n.keys=function(){return Object.keys(a)},n.resolve=r,t.exports=n,n.id="RnhZ"},"Sxb/":function(t,e,s){},cEOe:function(t,e,s){"use strict";s.r(e);var a=s("ZhIB"),n=s.n(a),r=s("wd/R"),o=s.n(r),i={name:"NoteCard",props:{report:{type:Object,required:!0},note:{type:Object,required:!0}},methods:{handleNoteDeletion:function(t,e){var s=this;this.$confirm("Are you sure you want to delete this note?","Warning",{confirmButtonText:"OK",cancelButtonText:"Cancel",type:"warning"}).then(function(){s.$store.dispatch("DeleteReportNote",{noteID:t,reportID:e}),s.$message({type:"success",message:"Delete completed"})}).catch(function(){s.$message({type:"info",message:"Delete canceled"})})},parseTimestamp:function(t){return o()(t).format("YYYY-MM-DD HH:mm")},propertyExists:function(t,e){return t[e]}}},c=(s("G/Mk"),s("KHd+")),l=Object(c.a)(i,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-card",{staticClass:"note-card"},[s("div",{attrs:{slot:"header"},slot:"header"},[s("div",{staticClass:"note-header"},[t.propertyExists(t.note.user,"id")?s("router-link",{staticClass:"router-link",attrs:{to:{name:"UsersShow",params:{id:t.note.user.id}}}},[s("div",{staticClass:"note-actor"},[t.propertyExists(t.note.user,"avatar")?s("img",{staticClass:"note-avatar-img",attrs:{src:t.note.user.avatar,alt:"avatar"}}):t._e(),t._v(" "),t.propertyExists(t.note.user,"nickname")?s("span",{staticClass:"note-actor-name"},[t._v(t._s(t.note.user.nickname))]):s("span",{staticClass:"note-actor-name deactivated"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")])])]):t._e(),t._v(" "),s("el-button",{attrs:{size:"mini"},nativeOn:{click:function(e){return t.handleNoteDeletion(t.note.id,t.report.id)}}},[t._v("\n "+t._s(t.$t("reports.deleteNote"))+"\n ")])],1)]),t._v(" "),s("div",{staticClass:"note-body"},[s("span",{staticClass:"note-content",domProps:{innerHTML:t._s(t.note.content)}}),t._v("\n "+t._s(t.parseTimestamp(t.note.created_at))+"\n ")])])},[],!1,null,null,null);l.options.__file="NoteCard.vue";var u=l.exports,d=s("ot3S"),p={name:"ModerateUserDropdown",props:{account:{type:Object,required:!0}},computed:{tags:function(){return this.account.tags||[]}},methods:{handleDeactivation:function(t){var e=t.nickname;this.$store.dispatch("ToggleUserActivation",e)},handleDeletion:function(t){this.$store.dispatch("DeleteUser",t)},showDeactivatedButton:function(t){return this.$store.state.user.id!==t},toggleTag:function(t,e){t.tags.includes(e)?this.$store.dispatch("RemoveTag",{users:[t],tag:e}):this.$store.dispatch("AddTag",{users:[t],tag:e})}}},v=Object(c.a)(p,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-dropdown",{attrs:{trigger:"click"}},[s("el-button",{attrs:{disabled:!t.account.id,plain:"",size:"small",icon:"el-icon-files"}},[t._v(t._s(t.$t("reports.moderateUser"))+"\n "),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t.showDeactivatedButton(t.account)?s("el-dropdown-item",{nativeOn:{click:function(e){return t.handleDeactivation(t.account)}}},[t._v("\n "+t._s(t.account.deactivated?t.$t("users.activateAccount"):t.$t("users.deactivateAccount"))+"\n ")]):t._e(),t._v(" "),t.showDeactivatedButton(t.account.id)?s("el-dropdown-item",{nativeOn:{click:function(e){return t.handleDeletion(t.account.id)}}},[t._v("\n "+t._s(t.$t("users.deleteAccount"))+"\n ")]):t._e(),t._v(" "),s("el-dropdown-item",{class:{"active-tag":t.tags.includes("force_nsfw")},attrs:{divided:!0},nativeOn:{click:function(e){return t.toggleTag(t.account,"force_nsfw")}}},[t._v("\n "+t._s(t.$t("users.forceNsfw"))+"\n "),t.tags.includes("force_nsfw")?s("i",{staticClass:"el-icon-check"}):t._e()]),t._v(" "),s("el-dropdown-item",{class:{"active-tag":t.tags.includes("strip_media")},nativeOn:{click:function(e){return t.toggleTag(t.account,"strip_media")}}},[t._v("\n "+t._s(t.$t("users.stripMedia"))+"\n "),t.tags.includes("strip_media")?s("i",{staticClass:"el-icon-check"}):t._e()]),t._v(" "),s("el-dropdown-item",{class:{"active-tag":t.tags.includes("force_unlisted")},nativeOn:{click:function(e){return t.toggleTag(t.account,"force_unlisted")}}},[t._v("\n "+t._s(t.$t("users.forceUnlisted"))+"\n "),t.tags.includes("force_unlisted")?s("i",{staticClass:"el-icon-check"}):t._e()]),t._v(" "),s("el-dropdown-item",{class:{"active-tag":t.tags.includes("sandbox")},nativeOn:{click:function(e){return t.toggleTag(t.account,"sandbox")}}},[t._v("\n "+t._s(t.$t("users.sandbox"))+"\n "),t.tags.includes("sandbox")?s("i",{staticClass:"el-icon-check"}):t._e()]),t._v(" "),t.account.local?s("el-dropdown-item",{class:{"active-tag":t.tags.includes("disable_remote_subscription")},nativeOn:{click:function(e){return t.toggleTag(t.account,"disable_remote_subscription")}}},[t._v("\n "+t._s(t.$t("users.disableRemoteSubscription"))+"\n "),t.tags.includes("disable_remote_subscription")?s("i",{staticClass:"el-icon-check"}):t._e()]):t._e(),t._v(" "),t.account.local?s("el-dropdown-item",{class:{"active-tag":t.tags.includes("disable_any_subscription")},nativeOn:{click:function(e){return t.toggleTag(t.account,"disable_any_subscription")}}},[t._v("\n "+t._s(t.$t("users.disableAnySubscription"))+"\n "),t.tags.includes("disable_any_subscription")?s("i",{staticClass:"el-icon-check"}):t._e()]):t._e()],1)],1)},[],!1,null,null,null);v.options.__file="ModerateUserDropdown.vue";var _=v.exports,h={name:"Report",components:{Status:d.a,ModerateUserDropdown:_,NoteCard:u},props:{reports:{type:Array,required:!0}},data:function(){return{notes:{}}},computed:{loading:function(){return this.$store.state.reports.loading},pageSize:function(){return this.$store.state.reports.pageSize},totalReportsCount:function(){return this.$store.state.reports.totalReportsCount},currentPage:function(){return this.$store.state.reports.currentPage}},methods:{changeReportState:function(t,e){this.$store.dispatch("ChangeReportState",[{state:t,id:e}])},capitalizeFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},getStateType:function(t){switch(t){case"closed":return"info";case"resolved":return"success";default:return"primary"}},getStatusesTitle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return"Reported statuses: ".concat(t.length," item(s)")},getNotesTitle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return"Notes: ".concat(t.length," item(s)")},handleNewNote:function(t){this.$store.dispatch("CreateReportNote",{content:this.notes[t],reportID:t}),this.notes[t]=""},handlePageChange:function(t){this.$store.dispatch("FetchReports",t)},parseTimestamp:function(t){return o()(t).format("L HH:mm")},propertyExists:function(t,e,s){return s?t[e]&&t[s]:t[e]},showStatuses:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).length>0}}},m=(s("07OA"),Object(c.a)(h,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("el-timeline",{staticClass:"reports-timeline"},t._l(t.reports,function(e){return s("el-timeline-item",{key:e.id,staticClass:"timeline-item-container",attrs:{timestamp:t.parseTimestamp(e.created_at),placement:"top"}},[s("el-card",{staticClass:"report"},[s("div",{staticClass:"report-header-container"},[s("div",{staticClass:"title-container"},[t.propertyExists(e.account,"nickname")?s("h3",{staticClass:"report-title"},[t._v(t._s(t.$t("reports.reportOn"))+" "+t._s(e.account.nickname))]):s("h3",{staticClass:"report-title"},[t._v(t._s(t.$t("reports.report")))]),t._v(" "),t.propertyExists(e.account,"id")?s("h5",{staticClass:"id"},[t._v(t._s(t.$t("reports.id"))+": "+t._s(e.id))]):t._e()]),t._v(" "),s("div",[s("el-tag",{staticClass:"report-tag",attrs:{type:t.getStateType(e.state),size:"large"}},[t._v(t._s(t.capitalizeFirstLetter(e.state)))]),t._v(" "),s("el-dropdown",{attrs:{trigger:"click"}},[s("el-button",{staticClass:"report-actions-button",attrs:{plain:"",size:"small",icon:"el-icon-edit"}},[t._v(t._s(t.$t("reports.changeState"))),s("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},["resolved"!==e.state?s("el-dropdown-item",{nativeOn:{click:function(s){return t.changeReportState("resolved",e.id)}}},[t._v(t._s(t.$t("reports.resolve")))]):t._e(),t._v(" "),"open"!==e.state?s("el-dropdown-item",{nativeOn:{click:function(s){return t.changeReportState("open",e.id)}}},[t._v(t._s(t.$t("reports.reopen")))]):t._e(),t._v(" "),"closed"!==e.state?s("el-dropdown-item",{nativeOn:{click:function(s){return t.changeReportState("closed",e.id)}}},[t._v(t._s(t.$t("reports.close")))]):t._e()],1)],1),t._v(" "),t.propertyExists(e.account,"nickname")?s("moderate-user-dropdown",{attrs:{account:e.account}}):t._e()],1)]),t._v(" "),s("el-divider",{staticClass:"divider"}),t._v(" "),s("div",{staticClass:"report-account-container"},[s("span",{staticClass:"report-row-key"},[t._v(t._s(t.$t("reports.account"))+":")]),t._v(" "),s("div",{staticClass:"report-account"},[t.propertyExists(e.account,"id")?s("router-link",{staticClass:"router-link",attrs:{to:{name:"UsersShow",params:{id:e.account.id}}}},[t.propertyExists(e.account,"avatar")?s("img",{staticClass:"avatar-img",attrs:{src:e.account.avatar,alt:"avatar"}}):t._e(),t._v(" "),t.propertyExists(e.account,"nickname")?s("span",{staticClass:"report-account-name"},[t._v(t._s(e.account.nickname))]):s("span",{staticClass:"report-account-name deactivated"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")])]):s("span",{staticClass:"report-account-name deactivated"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")]),t._v(" "),t.propertyExists(e.account,"url")?s("a",{staticClass:"account",attrs:{href:e.account.url,target:"_blank"}},[t._v("\n "+t._s(t.$t("userProfile.openAccountInInstance"))+"\n "),s("i",{staticClass:"el-icon-top-right"})]):t._e()],1)]),t._v(" "),e.content&&e.content.length>0?s("div",[s("el-divider",{staticClass:"divider"}),t._v(" "),s("span",{staticClass:"report-row-key"},[t._v(t._s(t.$t("reports.content"))+":\n "),s("span",[t._v(t._s(e.content))])])],1):t._e(),t._v(" "),s("el-divider",{staticClass:"divider"}),t._v(" "),s("div",{staticClass:"report-account-container",style:t.showStatuses(e.statuses)?"":"margin-bottom:15px"},[s("span",{staticClass:"report-row-key"},[t._v(t._s(t.$t("reports.actor"))+":")]),t._v(" "),s("div",{staticClass:"report-account"},[t.propertyExists(e.actor,"id")?s("router-link",{staticClass:"router-link",attrs:{to:{name:"UsersShow",params:{id:e.actor.id}}}},[t.propertyExists(e.actor,"avatar")?s("img",{staticClass:"avatar-img",attrs:{src:e.actor.avatar,alt:"avatar"}}):t._e(),t._v(" "),t.propertyExists(e.actor,"nickname")?s("span",{staticClass:"report-account-name"},[t._v(t._s(e.actor.nickname))]):s("span",{staticClass:"report-account-name deactivated"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")])]):s("span",{staticClass:"report-account-name deactivated"},[t._v("("+t._s(t.$t("users.invalidNickname"))+")")]),t._v(" "),t.propertyExists(e.actor,"url")?s("a",{staticClass:"account",attrs:{href:e.actor.url,target:"_blank"}},[t._v("\n "+t._s(t.$t("userProfile.openAccountInInstance"))+"\n "),s("i",{staticClass:"el-icon-top-right"})]):t._e()],1)]),t._v(" "),t.showStatuses(e.statuses)?s("div",{staticClass:"reported-statuses"},[s("el-collapse",[s("el-collapse-item",{attrs:{title:t.getStatusesTitle(e.statuses)}},t._l(e.statuses,function(a){return s("div",{key:a.id},[s("status",{attrs:{status:a,account:a.account.nickname?a.account:e.account,"show-checkbox":!1,page:t.currentPage}})],1)}),0)],1)],1):t._e(),t._v(" "),s("div",{staticClass:"report-notes"},[s("el-collapse",[s("el-collapse-item",{attrs:{title:t.getNotesTitle(e.notes)}},t._l(e.notes,function(t,a){return s("note-card",{key:a,attrs:{note:t,report:e}})}),1)],1),t._v(" "),s("div",{staticClass:"report-note-form"},[s("el-input",{attrs:{placeholder:t.$t("reports.leaveNote"),type:"textarea",rows:"2"},model:{value:t.notes[e.id],callback:function(s){t.$set(t.notes,e.id,s)},expression:"notes[report.id]"}}),t._v(" "),s("div",{staticClass:"report-post-note"},[s("el-button",{on:{click:function(s){return t.handleNewNote(e.id)}}},[t._v(t._s(t.$t("reports.postNote")))])],1)],1)],1)],1)],1)}),1),t._v(" "),t.loading?t._e():s("div",{staticClass:"reports-pagination"},[s("el-pagination",{attrs:{total:t.totalReportsCount,"current-page":t.currentPage,"page-size":t.pageSize,background:"",layout:"prev, pager, next"},on:{"current-change":t.handlePageChange}})],1)],1)},[],!1,null,null,null));m.options.__file="Report.vue";var g=m.exports,j=s("mSNy"),f={data:function(){return{filter:"open",options:[{value:"open",label:j.a.t("reportsFilter.open")},{value:"closed",label:j.a.t("reportsFilter.closed")},{value:"resolved",label:j.a.t("reportsFilter.resolved")}]}},created:function(){this.$store.dispatch("SetFilter",this.$data.filter)},methods:{toggleFilters:function(){this.$store.dispatch("SetFilter",this.$data.filter),this.$store.dispatch("ClearFetchedReports"),this.$store.dispatch("FetchReports",1)}}},k=(s("Eg1M"),Object(c.a)(f,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-select",{staticClass:"select-field",attrs:{placeholder:t.$t("reportsFilter.inputPlaceholder"),clearable:"","value-key":"value"},on:{change:t.toggleFilters},model:{value:t.filter,callback:function(e){t.filter=e},expression:"filter"}},t._l(t.options,function(e){return s("el-option",{key:e.value,attrs:{label:e.label,value:e.value}},[t._v(t._s(e.label))])}),1)},[],!1,null,"ecc36f5a",null));k.options.__file="ReportsFilter.vue";var b=k.exports,C={components:{RebootButton:s("rIUS").a,Report:g,ReportsFilter:b},computed:{loading:function(){return this.$store.state.reports.loading},normalizedReportsCount:function(){return n()(this.$store.state.reports.totalReportsCount).format("0a")},reports:function(){return this.$store.state.reports.fetchedReports}},mounted:function(){this.$store.dispatch("GetNodeInfo"),this.$store.dispatch("NeedReboot"),this.$store.dispatch("FetchReports",1)}},y=(s("Lbbz"),Object(c.a)(C,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"reports-container"},[s("div",{staticClass:"reports-header-container"},[s("h1",[t._v("\n "+t._s(t.$t("reports.reports"))+"\n "),s("span",{staticClass:"report-count"},[t._v("("+t._s(t.normalizedReportsCount)+")")])]),t._v(" "),s("reboot-button")],1),t._v(" "),s("div",{staticClass:"reports-filter-container"},[s("reports-filter")],1),t._v(" "),s("div",{staticClass:"block"},[s("report",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{reports:t.reports}}),t._v(" "),0===t.reports.length?s("div",{staticClass:"no-reports-message"},[s("p",[t._v("There are no reports to display")])]):t._e()],1)])},[],!1,null,"fa601560",null));y.options.__file="index.vue";e.default=y.exports},xdcp:function(t,e,s){}}]);
+//# sourceMappingURL=chunk-e404.554bc2e3.js.map
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-e404.554bc2e3.js.map b/priv/static/adminfe/static/js/chunk-e404.554bc2e3.js.map
new file mode 100644
index 000000000..e8214adbb
--- /dev/null
+++ b/priv/static/adminfe/static/js/chunk-e404.554bc2e3.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///./src/views/reports/components/Report.vue?ad5f","webpack:///./src/views/reports/components/ReportsFilter.vue?a490","webpack:///./src/views/reports/components/NoteCard.vue?b93a","webpack:///./src/views/reports/index.vue?cda2","webpack:///./node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./src/views/reports/index.vue?43f7","webpack:///./src/views/reports/components/NoteCard.vue?6205","webpack:///src/views/reports/components/NoteCard.vue","webpack:///./src/views/reports/components/NoteCard.vue","webpack:///./src/views/reports/components/NoteCard.vue?6977","webpack:///./src/views/reports/components/ModerateUserDropdown.vue?6745","webpack:///src/views/reports/components/ModerateUserDropdown.vue","webpack:///./src/views/reports/components/ModerateUserDropdown.vue","webpack:///./src/views/reports/components/ModerateUserDropdown.vue?65ad","webpack:///./src/views/reports/components/Report.vue?a764","webpack:///src/views/reports/components/Report.vue","webpack:///./src/views/reports/components/Report.vue","webpack:///./src/views/reports/components/Report.vue?9727","webpack:///./src/views/reports/components/ReportsFilter.vue?e3b7","webpack:///src/views/reports/components/ReportsFilter.vue","webpack:///./src/views/reports/components/ReportsFilter.vue","webpack:///./src/views/reports/components/ReportsFilter.vue?f6ad","webpack:///./src/views/reports/index.vue?3bcc","webpack:///src/views/reports/index.vue","webpack:///./src/views/reports/index.vue"],"names":["_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_Report_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","n","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_ReportsFilter_vue_vue_type_style_index_0_id_ecc36f5a_rel_stylesheet_2Fscss_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_NoteCard_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_fa601560_rel_stylesheet_2Fscss_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__","map","./af","./af.js","./ar","./ar-dz","./ar-dz.js","./ar-kw","./ar-kw.js","./ar-ly","./ar-ly.js","./ar-ma","./ar-ma.js","./ar-sa","./ar-sa.js","./ar-tn","./ar-tn.js","./ar.js","./az","./az.js","./be","./be.js","./bg","./bg.js","./bm","./bm.js","./bn","./bn.js","./bo","./bo.js","./br","./br.js","./bs","./bs.js","./ca","./ca.js","./cs","./cs.js","./cv","./cv.js","./cy","./cy.js","./da","./da.js","./de","./de-at","./de-at.js","./de-ch","./de-ch.js","./de.js","./dv","./dv.js","./el","./el.js","./en-SG","./en-SG.js","./en-au","./en-au.js","./en-ca","./en-ca.js","./en-gb","./en-gb.js","./en-ie","./en-ie.js","./en-il","./en-il.js","./en-nz","./en-nz.js","./eo","./eo.js","./es","./es-do","./es-do.js","./es-us","./es-us.js","./es.js","./et","./et.js","./eu","./eu.js","./fa","./fa.js","./fi","./fi.js","./fo","./fo.js","./fr","./fr-ca","./fr-ca.js","./fr-ch","./fr-ch.js","./fr.js","./fy","./fy.js","./ga","./ga.js","./gd","./gd.js","./gl","./gl.js","./gom-latn","./gom-latn.js","./gu","./gu.js","./he","./he.js","./hi","./hi.js","./hr","./hr.js","./hu","./hu.js","./hy-am","./hy-am.js","./id","./id.js","./is","./is.js","./it","./it-ch","./it-ch.js","./it.js","./ja","./ja.js","./jv","./jv.js","./ka","./ka.js","./kk","./kk.js","./km","./km.js","./kn","./kn.js","./ko","./ko.js","./ku","./ku.js","./ky","./ky.js","./lb","./lb.js","./lo","./lo.js","./lt","./lt.js","./lv","./lv.js","./me","./me.js","./mi","./mi.js","./mk","./mk.js","./ml","./ml.js","./mn","./mn.js","./mr","./mr.js","./ms","./ms-my","./ms-my.js","./ms.js","./mt","./mt.js","./my","./my.js","./nb","./nb.js","./ne","./ne.js","./nl","./nl-be","./nl-be.js","./nl.js","./nn","./nn.js","./pa-in","./pa-in.js","./pl","./pl.js","./pt","./pt-br","./pt-br.js","./pt.js","./ro","./ro.js","./ru","./ru.js","./sd","./sd.js","./se","./se.js","./si","./si.js","./sk","./sk.js","./sl","./sl.js","./sq","./sq.js","./sr","./sr-cyrl","./sr-cyrl.js","./sr.js","./ss","./ss.js","./sv","./sv.js","./sw","./sw.js","./ta","./ta.js","./te","./te.js","./tet","./tet.js","./tg","./tg.js","./th","./th.js","./tl-ph","./tl-ph.js","./tlh","./tlh.js","./tr","./tr.js","./tzl","./tzl.js","./tzm","./tzm-latn","./tzm-latn.js","./tzm.js","./ug-cn","./ug-cn.js","./uk","./uk.js","./ur","./ur.js","./uz","./uz-latn","./uz-latn.js","./uz.js","./vi","./vi.js","./x-pseudo","./x-pseudo.js","./yo","./yo.js","./zh-cn","./zh-cn.js","./zh-hk","./zh-hk.js","./zh-tw","./zh-tw.js","webpackContext","req","id","webpackContextResolve","o","e","Error","code","keys","Object","resolve","module","exports","components_NoteCardvue_type_script_lang_js_","name","props","report","type","required","note","methods","handleNoteDeletion","noteID","reportID","_this","this","$confirm","confirmButtonText","cancelButtonText","then","$store","dispatch","$message","message","catch","parseTimestamp","timestamp","moment_default","format","propertyExists","account","property","component","componentNormalizer","_vm","_h","$createElement","_c","_self","staticClass","attrs","slot","user","to","params","src","avatar","alt","_e","_v","_s","nickname","$t","size","nativeOn","click","$event","domProps","innerHTML","content","created_at","options","__file","NoteCard","components_ModerateUserDropdownvue_type_script_lang_js_","computed","tags","handleDeactivation","_ref","handleDeletion","showDeactivatedButton","state","toggleTag","tag","includes","users","ModerateUserDropdown_component","trigger","disabled","plain","icon","deactivated","class","active-tag","divided","ModerateUserDropdown","components_Reportvue_type_script_lang_js_","components","Status","reports","Array","data","notes","loading","pageSize","totalReportsCount","currentPage","changeReportState","capitalizeFirstLetter","str","charAt","toUpperCase","slice","getStateType","getStatusesTitle","statuses","arguments","length","undefined","concat","getNotesTitle","handleNewNote","handlePageChange","page","_secondProperty","showStatuses","Report_component","_l","key","placement","href","url","target","style","actor","title","status","show-checkbox","index","placeholder","rows","model","value","callback","$$v","$set","expression","on","total","current-page","page-size","background","layout","current-change","Report","components_ReportsFiltervue_type_script_lang_js_","filter","label","lang","t","created","$data","toggleFilters","ReportsFilter_component","clearable","value-key","change","item","ReportsFilter","views_reportsvue_type_script_lang_js_","RebootButton","normalizedReportsCount","numeral_default","fetchedReports","mounted","reports_component","directives","rawName","__webpack_exports__"],"mappings":"wGAAA,IAAAA,EAAAC,EAAA,QAAAA,EAAAC,EAAAF,GAA0e,uFCA1e,IAAAG,EAAAF,EAAA,QAAAA,EAAAC,EAAAC,GAAygB,uCCAzgB,IAAAC,EAAAH,EAAA,QAAAA,EAAAC,EAAAE,GAA4e,qCCA5e,IAAAC,EAAAJ,EAAA,QAAAA,EAAAC,EAAAG,GAA+e,wBCA/e,IAAAC,GACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAA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BAAAH,EAAAe,GAAA,KAAAZ,EAAA,OAAmHE,YAAA,6BAAuCF,EAAA,sBAAAH,EAAAe,GAAA,KAAAZ,EAAA,OAAiDE,YAAA,UAAoBF,EAAA,UAAeiI,aAAalK,KAAA,UAAAmK,QAAA,YAAAnC,MAAAlG,EAAA,QAAAsG,WAAA,YAA4EhG,OAASiD,QAAAvD,EAAAuD,WAAuBvD,EAAAe,GAAA,SAAAf,EAAAuD,QAAAkB,OAAAtE,EAAA,OAAmDE,YAAA,uBAAiCF,EAAA,KAAAH,EAAAe,GAAA,uCAAAf,EAAAc,MAAA,UmBYzuB,EACA,KACA,WACA,OAIAqH,EAASxG,QAAAC,OAAA,YACM0G,EAAA,QAAAH","file":"static/js/chunk-e404.554bc2e3.js","sourcesContent":["import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Report.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Report.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportsFilter.vue?vue&type=style&index=0&id=ecc36f5a&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportsFilter.vue?vue&type=style&index=0&id=ecc36f5a&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NoteCard.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../../node_modules/css-loader/index.js??ref--11-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NoteCard.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=fa601560&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=fa601560&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"","var map = {\n\t\"./af\": \"K/tc\",\n\t\"./af.js\": \"K/tc\",\n\t\"./ar\": \"jnO4\",\n\t\"./ar-dz\": \"o1bE\",\n\t\"./ar-dz.js\": \"o1bE\",\n\t\"./ar-kw\": \"Qj4J\",\n\t\"./ar-kw.js\": \"Qj4J\",\n\t\"./ar-ly\": \"HP3h\",\n\t\"./ar-ly.js\": \"HP3h\",\n\t\"./ar-ma\": \"CoRJ\",\n\t\"./ar-ma.js\": \"CoRJ\",\n\t\"./ar-sa\": \"gjCT\",\n\t\"./ar-sa.js\": \"gjCT\",\n\t\"./ar-tn\": \"bYM6\",\n\t\"./ar-tn.js\": \"bYM6\",\n\t\"./ar.js\": \"jnO4\",\n\t\"./az\": \"SFxW\",\n\t\"./az.js\": \"SFxW\",\n\t\"./be\": \"H8ED\",\n\t\"./be.js\": \"H8ED\",\n\t\"./bg\": \"hKrs\",\n\t\"./bg.js\": \"hKrs\",\n\t\"./bm\": \"p/rL\",\n\t\"./bm.js\": \"p/rL\",\n\t\"./bn\": \"kEOa\",\n\t\"./bn.js\": \"kEOa\",\n\t\"./bo\": \"0mo+\",\n\t\"./bo.js\": \"0mo+\",\n\t\"./br\": \"aIdf\",\n\t\"./br.js\": \"aIdf\",\n\t\"./bs\": \"JVSJ\",\n\t\"./bs.js\": \"JVSJ\",\n\t\"./ca\": \"1xZ4\",\n\t\"./ca.js\": \"1xZ4\",\n\t\"./cs\": \"PA2r\",\n\t\"./cs.js\": \"PA2r\",\n\t\"./cv\": \"A+xa\",\n\t\"./cv.js\": \"A+xa\",\n\t\"./cy\": \"l5ep\",\n\t\"./cy.js\": \"l5ep\",\n\t\"./da\": \"DxQv\",\n\t\"./da.js\": \"DxQv\",\n\t\"./de\": \"tGlX\",\n\t\"./de-at\": \"s+uk\",\n\t\"./de-at.js\": \"s+uk\",\n\t\"./de-ch\": \"u3GI\",\n\t\"./de-ch.js\": \"u3GI\",\n\t\"./de.js\": \"tGlX\",\n\t\"./dv\": \"WYrj\",\n\t\"./dv.js\": \"WYrj\",\n\t\"./el\": \"jUeY\",\n\t\"./el.js\": \"jUeY\",\n\t\"./en-SG\": \"zavE\",\n\t\"./en-SG.js\": \"zavE\",\n\t\"./en-au\": \"Dmvi\",\n\t\"./en-au.js\": \"Dmvi\",\n\t\"./en-ca\": \"OIYi\",\n\t\"./en-ca.js\": \"OIYi\",\n\t\"./en-gb\": \"Oaa7\",\n\t\"./en-gb.js\": \"Oaa7\",\n\t\"./en-ie\": \"4dOw\",\n\t\"./en-ie.js\": \"4dOw\",\n\t\"./en-il\": \"czMo\",\n\t\"./en-il.js\": \"czMo\",\n\t\"./en-nz\": \"b1Dy\",\n\t\"./en-nz.js\": \"b1Dy\",\n\t\"./eo\": \"Zduo\",\n\t\"./eo.js\": \"Zduo\",\n\t\"./es\": \"iYuL\",\n\t\"./es-do\": \"CjzT\",\n\t\"./es-do.js\": \"CjzT\",\n\t\"./es-us\": \"Vclq\",\n\t\"./es-us.js\": \"Vclq\",\n\t\"./es.js\": \"iYuL\",\n\t\"./et\": \"7BjC\",\n\t\"./et.js\": \"7BjC\",\n\t\"./eu\": \"D/JM\",\n\t\"./eu.js\": \"D/JM\",\n\t\"./fa\": \"jfSC\",\n\t\"./fa.js\": \"jfSC\",\n\t\"./fi\": \"gekB\",\n\t\"./fi.js\": \"gekB\",\n\t\"./fo\": \"ByF4\",\n\t\"./fo.js\": \"ByF4\",\n\t\"./fr\": \"nyYc\",\n\t\"./fr-ca\": \"2fjn\",\n\t\"./fr-ca.js\": \"2fjn\",\n\t\"./fr-ch\": \"Dkky\",\n\t\"./fr-ch.js\": \"Dkky\",\n\t\"./fr.js\": \"nyYc\",\n\t\"./fy\": \"cRix\",\n\t\"./fy.js\": \"cRix\",\n\t\"./ga\": \"USCx\",\n\t\"./ga.js\": \"USCx\",\n\t\"./gd\": \"9rRi\",\n\t\"./gd.js\": \"9rRi\",\n\t\"./gl\": \"iEDd\",\n\t\"./gl.js\": \"iEDd\",\n\t\"./gom-latn\": \"DKr+\",\n\t\"./gom-latn.js\": \"DKr+\",\n\t\"./gu\": \"4MV3\",\n\t\"./gu.js\": \"4MV3\",\n\t\"./he\": \"x6pH\",\n\t\"./he.js\": \"x6pH\",\n\t\"./hi\": \"3E1r\",\n\t\"./hi.js\": \"3E1r\",\n\t\"./hr\": \"S6ln\",\n\t\"./hr.js\": \"S6ln\",\n\t\"./hu\": \"WxRl\",\n\t\"./hu.js\": \"WxRl\",\n\t\"./hy-am\": \"1rYy\",\n\t\"./hy-am.js\": \"1rYy\",\n\t\"./id\": \"UDhR\",\n\t\"./id.js\": \"UDhR\",\n\t\"./is\": \"BVg3\",\n\t\"./is.js\": \"BVg3\",\n\t\"./it\": \"bpih\",\n\t\"./it-ch\": \"bxKX\",\n\t\"./it-ch.js\": \"bxKX\",\n\t\"./it.js\": \"bpih\",\n\t\"./ja\": \"B55N\",\n\t\"./ja.js\": \"B55N\",\n\t\"./jv\": \"tUCv\",\n\t\"./jv.js\": \"tUCv\",\n\t\"./ka\": \"IBtZ\",\n\t\"./ka.js\": \"IBtZ\",\n\t\"./kk\": \"bXm7\",\n\t\"./kk.js\": \"bXm7\",\n\t\"./km\": \"6B0Y\",\n\t\"./km.js\": \"6B0Y\",\n\t\"./kn\": \"PpIw\",\n\t\"./kn.js\": \"PpIw\",\n\t\"./ko\": \"Ivi+\",\n\t\"./ko.js\": \"Ivi+\",\n\t\"./ku\": \"JCF/\",\n\t\"./ku.js\": \"JCF/\",\n\t\"./ky\": \"lgnt\",\n\t\"./ky.js\": \"lgnt\",\n\t\"./lb\": \"RAwQ\",\n\t\"./lb.js\": \"RAwQ\",\n\t\"./lo\": \"sp3z\",\n\t\"./lo.js\": \"sp3z\",\n\t\"./lt\": \"JvlW\",\n\t\"./lt.js\": \"JvlW\",\n\t\"./lv\": \"uXwI\",\n\t\"./lv.js\": \"uXwI\",\n\t\"./me\": \"KTz0\",\n\t\"./me.js\": \"KTz0\",\n\t\"./mi\": \"aIsn\",\n\t\"./mi.js\": \"aIsn\",\n\t\"./mk\": \"aQkU\",\n\t\"./mk.js\": \"aQkU\",\n\t\"./ml\": \"AvvY\",\n\t\"./ml.js\": \"AvvY\",\n\t\"./mn\": \"lYtQ\",\n\t\"./mn.js\": \"lYtQ\",\n\t\"./mr\": \"Ob0Z\",\n\t\"./mr.js\": \"Ob0Z\",\n\t\"./ms\": \"6+QB\",\n\t\"./ms-my\": \"ZAMP\",\n\t\"./ms-my.js\": \"ZAMP\",\n\t\"./ms.js\": \"6+QB\",\n\t\"./mt\": \"G0Uy\",\n\t\"./mt.js\": \"G0Uy\",\n\t\"./my\": \"honF\",\n\t\"./my.js\": \"honF\",\n\t\"./nb\": \"bOMt\",\n\t\"./nb.js\": \"bOMt\",\n\t\"./ne\": \"OjkT\",\n\t\"./ne.js\": \"OjkT\",\n\t\"./nl\": \"+s0g\",\n\t\"./nl-be\": \"2ykv\",\n\t\"./nl-be.js\": \"2ykv\",\n\t\"./nl.js\": \"+s0g\",\n\t\"./nn\": \"uEye\",\n\t\"./nn.js\": \"uEye\",\n\t\"./pa-in\": \"8/+R\",\n\t\"./pa-in.js\": \"8/+R\",\n\t\"./pl\": \"jVdC\",\n\t\"./pl.js\": \"jVdC\",\n\t\"./pt\": \"8mBD\",\n\t\"./pt-br\": \"0tRk\",\n\t\"./pt-br.js\": \"0tRk\",\n\t\"./pt.js\": \"8mBD\",\n\t\"./ro\": \"lyxo\",\n\t\"./ro.js\": \"lyxo\",\n\t\"./ru\": \"lXzo\",\n\t\"./ru.js\": \"lXzo\",\n\t\"./sd\": \"Z4QM\",\n\t\"./sd.js\": \"Z4QM\",\n\t\"./se\": \"//9w\",\n\t\"./se.js\": \"//9w\",\n\t\"./si\": \"7aV9\",\n\t\"./si.js\": \"7aV9\",\n\t\"./sk\": \"e+ae\",\n\t\"./sk.js\": \"e+ae\",\n\t\"./sl\": \"gVVK\",\n\t\"./sl.js\": \"gVVK\",\n\t\"./sq\": \"yPMs\",\n\t\"./sq.js\": \"yPMs\",\n\t\"./sr\": \"zx6S\",\n\t\"./sr-cyrl\": \"E+lV\",\n\t\"./sr-cyrl.js\": \"E+lV\",\n\t\"./sr.js\": \"zx6S\",\n\t\"./ss\": \"Ur1D\",\n\t\"./ss.js\": \"Ur1D\",\n\t\"./sv\": \"X709\",\n\t\"./sv.js\": \"X709\",\n\t\"./sw\": \"dNwA\",\n\t\"./sw.js\": \"dNwA\",\n\t\"./ta\": \"PeUW\",\n\t\"./ta.js\": \"PeUW\",\n\t\"./te\": \"XLvN\",\n\t\"./te.js\": \"XLvN\",\n\t\"./tet\": \"V2x9\",\n\t\"./tet.js\": \"V2x9\",\n\t\"./tg\": \"Oxv6\",\n\t\"./tg.js\": \"Oxv6\",\n\t\"./th\": \"EOgW\",\n\t\"./th.js\": \"EOgW\",\n\t\"./tl-ph\": \"Dzi0\",\n\t\"./tl-ph.js\": \"Dzi0\",\n\t\"./tlh\": \"z3Vd\",\n\t\"./tlh.js\": \"z3Vd\",\n\t\"./tr\": \"DoHr\",\n\t\"./tr.js\": \"DoHr\",\n\t\"./tzl\": \"z1FC\",\n\t\"./tzl.js\": \"z1FC\",\n\t\"./tzm\": \"wQk9\",\n\t\"./tzm-latn\": \"tT3J\",\n\t\"./tzm-latn.js\": \"tT3J\",\n\t\"./tzm.js\": \"wQk9\",\n\t\"./ug-cn\": \"YRex\",\n\t\"./ug-cn.js\": \"YRex\",\n\t\"./uk\": \"raLr\",\n\t\"./uk.js\": \"raLr\",\n\t\"./ur\": \"UpQW\",\n\t\"./ur.js\": \"UpQW\",\n\t\"./uz\": \"Loxo\",\n\t\"./uz-latn\": \"AQ68\",\n\t\"./uz-latn.js\": \"AQ68\",\n\t\"./uz.js\": \"Loxo\",\n\t\"./vi\": \"KSF8\",\n\t\"./vi.js\": \"KSF8\",\n\t\"./x-pseudo\": \"/X5v\",\n\t\"./x-pseudo.js\": \"/X5v\",\n\t\"./yo\": \"fzPg\",\n\t\"./yo.js\": \"fzPg\",\n\t\"./zh-cn\": \"XDpg\",\n\t\"./zh-cn.js\": \"XDpg\",\n\t\"./zh-hk\": \"SatO\",\n\t\"./zh-hk.js\": \"SatO\",\n\t\"./zh-tw\": \"kOpN\",\n\t\"./zh-tw.js\": \"kOpN\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"RnhZ\";","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"reports-container\"},[_c('div',{staticClass:\"reports-header-container\"},[_c('h1',[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.reports'))+\"\\n \"),_c('span',{staticClass:\"report-count\"},[_vm._v(\"(\"+_vm._s(_vm.normalizedReportsCount)+\")\")])]),_vm._v(\" \"),_c('reboot-button')],1),_vm._v(\" \"),_c('div',{staticClass:\"reports-filter-container\"},[_c('reports-filter')],1),_vm._v(\" \"),_c('div',{staticClass:\"block\"},[_c('report',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.loading),expression:\"loading\"}],attrs:{\"reports\":_vm.reports}}),_vm._v(\" \"),(_vm.reports.length === 0)?_c('div',{staticClass:\"no-reports-message\"},[_c('p',[_vm._v(\"There are no reports to display\")])]):_vm._e()],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NoteCard.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./NoteCard.vue?vue&type=script&lang=js&\"","\n \n \n \n
\n \n \n {{ parseTimestamp(note.created_at) }}\n
\n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./NoteCard.vue?vue&type=template&id=030edbfd&\"\nimport script from \"./NoteCard.vue?vue&type=script&lang=js&\"\nexport * from \"./NoteCard.vue?vue&type=script&lang=js&\"\nimport style0 from \"./NoteCard.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"NoteCard.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-card',{staticClass:\"note-card\"},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('div',{staticClass:\"note-header\"},[(_vm.propertyExists(_vm.note.user, 'id'))?_c('router-link',{staticClass:\"router-link\",attrs:{\"to\":{ name: 'UsersShow', params: { id: _vm.note.user.id }}}},[_c('div',{staticClass:\"note-actor\"},[(_vm.propertyExists(_vm.note.user, 'avatar'))?_c('img',{staticClass:\"note-avatar-img\",attrs:{\"src\":_vm.note.user.avatar,\"alt\":\"avatar\"}}):_vm._e(),_vm._v(\" \"),(_vm.propertyExists(_vm.note.user, 'nickname'))?_c('span',{staticClass:\"note-actor-name\"},[_vm._v(_vm._s(_vm.note.user.nickname))]):_c('span',{staticClass:\"note-actor-name deactivated\"},[_vm._v(\"(\"+_vm._s(_vm.$t('users.invalidNickname'))+\")\")])])]):_vm._e(),_vm._v(\" \"),_c('el-button',{attrs:{\"size\":\"mini\"},nativeOn:{\"click\":function($event){return _vm.handleNoteDeletion(_vm.note.id, _vm.report.id)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.deleteNote'))+\"\\n \")])],1)]),_vm._v(\" \"),_c('div',{staticClass:\"note-body\"},[_c('span',{staticClass:\"note-content\",domProps:{\"innerHTML\":_vm._s(_vm.note.content)}}),_vm._v(\"\\n \"+_vm._s(_vm.parseTimestamp(_vm.note.created_at))+\"\\n \")])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModerateUserDropdown.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModerateUserDropdown.vue?vue&type=script&lang=js&\"","\n \n {{ $t('reports.moderateUser') }}\n \n \n \n \n {{ account.deactivated ? $t('users.activateAccount') : $t('users.deactivateAccount') }}\n \n \n {{ $t('users.deleteAccount') }}\n \n \n {{ $t('users.forceNsfw') }}\n \n \n \n {{ $t('users.stripMedia') }}\n \n \n \n {{ $t('users.forceUnlisted') }}\n \n \n \n {{ $t('users.sandbox') }}\n \n \n \n {{ $t('users.disableRemoteSubscription') }}\n \n \n \n {{ $t('users.disableAnySubscription') }}\n \n \n \n \n\n\n\n","import { render, staticRenderFns } from \"./ModerateUserDropdown.vue?vue&type=template&id=bcf0134c&\"\nimport script from \"./ModerateUserDropdown.vue?vue&type=script&lang=js&\"\nexport * from \"./ModerateUserDropdown.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"ModerateUserDropdown.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dropdown',{attrs:{\"trigger\":\"click\"}},[_c('el-button',{attrs:{\"disabled\":!_vm.account.id,\"plain\":\"\",\"size\":\"small\",\"icon\":\"el-icon-files\"}},[_vm._v(_vm._s(_vm.$t('reports.moderateUser'))+\"\\n \"),_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"})]),_vm._v(\" \"),_c('el-dropdown-menu',{attrs:{\"slot\":\"dropdown\"},slot:\"dropdown\"},[(_vm.showDeactivatedButton(_vm.account))?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.handleDeactivation(_vm.account)}}},[_vm._v(\"\\n \"+_vm._s(_vm.account.deactivated ? _vm.$t('users.activateAccount') : _vm.$t('users.deactivateAccount'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.showDeactivatedButton(_vm.account.id))?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.handleDeletion(_vm.account.id)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.deleteAccount'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('force_nsfw') },attrs:{\"divided\":true},nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'force_nsfw')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.forceNsfw'))+\"\\n \"),(_vm.tags.includes('force_nsfw'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('strip_media') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'strip_media')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.stripMedia'))+\"\\n \"),(_vm.tags.includes('strip_media'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('force_unlisted') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'force_unlisted')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.forceUnlisted'))+\"\\n \"),(_vm.tags.includes('force_unlisted'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('sandbox') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'sandbox')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.sandbox'))+\"\\n \"),(_vm.tags.includes('sandbox'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]),_vm._v(\" \"),(_vm.account.local)?_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('disable_remote_subscription') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'disable_remote_subscription')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.disableRemoteSubscription'))+\"\\n \"),(_vm.tags.includes('disable_remote_subscription'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]):_vm._e(),_vm._v(\" \"),(_vm.account.local)?_c('el-dropdown-item',{class:{ 'active-tag': _vm.tags.includes('disable_any_subscription') },nativeOn:{\"click\":function($event){return _vm.toggleTag(_vm.account, 'disable_any_subscription')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('users.disableAnySubscription'))+\"\\n \"),(_vm.tags.includes('disable_any_subscription'))?_c('i',{staticClass:\"el-icon-check\"}):_vm._e()]):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Report.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Report.vue?vue&type=script&lang=js&\"","\n \n
\n \n \n \n \n \n
{{ $t('reports.account') }}:\n
\n
\n 0\">\n \n {{ $t('reports.content') }}:\n {{ report.content }}\n \n
\n \n \n
{{ $t('reports.actor') }}:\n
\n
\n \n \n \n \n \n \n
\n\n\n\n\n\n","import { render, staticRenderFns } from \"./Report.vue?vue&type=template&id=14ff42ce&\"\nimport script from \"./Report.vue?vue&type=script&lang=js&\"\nexport * from \"./Report.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Report.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"Report.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('el-timeline',{staticClass:\"reports-timeline\"},_vm._l((_vm.reports),function(report){return _c('el-timeline-item',{key:report.id,staticClass:\"timeline-item-container\",attrs:{\"timestamp\":_vm.parseTimestamp(report.created_at),\"placement\":\"top\"}},[_c('el-card',{staticClass:\"report\"},[_c('div',{staticClass:\"report-header-container\"},[_c('div',{staticClass:\"title-container\"},[(_vm.propertyExists(report.account, 'nickname'))?_c('h3',{staticClass:\"report-title\"},[_vm._v(_vm._s(_vm.$t('reports.reportOn'))+\" \"+_vm._s(report.account.nickname))]):_c('h3',{staticClass:\"report-title\"},[_vm._v(_vm._s(_vm.$t('reports.report')))]),_vm._v(\" \"),(_vm.propertyExists(report.account, 'id'))?_c('h5',{staticClass:\"id\"},[_vm._v(_vm._s(_vm.$t('reports.id'))+\": \"+_vm._s(report.id))]):_vm._e()]),_vm._v(\" \"),_c('div',[_c('el-tag',{staticClass:\"report-tag\",attrs:{\"type\":_vm.getStateType(report.state),\"size\":\"large\"}},[_vm._v(_vm._s(_vm.capitalizeFirstLetter(report.state)))]),_vm._v(\" \"),_c('el-dropdown',{attrs:{\"trigger\":\"click\"}},[_c('el-button',{staticClass:\"report-actions-button\",attrs:{\"plain\":\"\",\"size\":\"small\",\"icon\":\"el-icon-edit\"}},[_vm._v(_vm._s(_vm.$t('reports.changeState'))),_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"})]),_vm._v(\" \"),_c('el-dropdown-menu',{attrs:{\"slot\":\"dropdown\"},slot:\"dropdown\"},[(report.state !== 'resolved')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeReportState('resolved', report.id)}}},[_vm._v(_vm._s(_vm.$t('reports.resolve')))]):_vm._e(),_vm._v(\" \"),(report.state !== 'open')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeReportState('open', report.id)}}},[_vm._v(_vm._s(_vm.$t('reports.reopen')))]):_vm._e(),_vm._v(\" \"),(report.state !== 'closed')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeReportState('closed', report.id)}}},[_vm._v(_vm._s(_vm.$t('reports.close')))]):_vm._e()],1)],1),_vm._v(\" \"),(_vm.propertyExists(report.account, 'nickname'))?_c('moderate-user-dropdown',{attrs:{\"account\":report.account}}):_vm._e()],1)]),_vm._v(\" \"),_c('el-divider',{staticClass:\"divider\"}),_vm._v(\" \"),_c('div',{staticClass:\"report-account-container\"},[_c('span',{staticClass:\"report-row-key\"},[_vm._v(_vm._s(_vm.$t('reports.account'))+\":\")]),_vm._v(\" \"),_c('div',{staticClass:\"report-account\"},[(_vm.propertyExists(report.account, 'id'))?_c('router-link',{staticClass:\"router-link\",attrs:{\"to\":{ name: 'UsersShow', params: { id: report.account.id }}}},[(_vm.propertyExists(report.account, 'avatar'))?_c('img',{staticClass:\"avatar-img\",attrs:{\"src\":report.account.avatar,\"alt\":\"avatar\"}}):_vm._e(),_vm._v(\" \"),(_vm.propertyExists(report.account, 'nickname'))?_c('span',{staticClass:\"report-account-name\"},[_vm._v(_vm._s(report.account.nickname))]):_c('span',{staticClass:\"report-account-name deactivated\"},[_vm._v(\"(\"+_vm._s(_vm.$t('users.invalidNickname'))+\")\")])]):_c('span',{staticClass:\"report-account-name deactivated\"},[_vm._v(\"(\"+_vm._s(_vm.$t('users.invalidNickname'))+\")\")]),_vm._v(\" \"),(_vm.propertyExists(report.account, 'url'))?_c('a',{staticClass:\"account\",attrs:{\"href\":report.account.url,\"target\":\"_blank\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('userProfile.openAccountInInstance'))+\"\\n \"),_c('i',{staticClass:\"el-icon-top-right\"})]):_vm._e()],1)]),_vm._v(\" \"),(report.content && report.content.length > 0)?_c('div',[_c('el-divider',{staticClass:\"divider\"}),_vm._v(\" \"),_c('span',{staticClass:\"report-row-key\"},[_vm._v(_vm._s(_vm.$t('reports.content'))+\":\\n \"),_c('span',[_vm._v(_vm._s(report.content))])])],1):_vm._e(),_vm._v(\" \"),_c('el-divider',{staticClass:\"divider\"}),_vm._v(\" \"),_c('div',{staticClass:\"report-account-container\",style:(_vm.showStatuses(report.statuses) ? '' : 'margin-bottom:15px')},[_c('span',{staticClass:\"report-row-key\"},[_vm._v(_vm._s(_vm.$t('reports.actor'))+\":\")]),_vm._v(\" \"),_c('div',{staticClass:\"report-account\"},[(_vm.propertyExists(report.actor, 'id'))?_c('router-link',{staticClass:\"router-link\",attrs:{\"to\":{ name: 'UsersShow', params: { id: report.actor.id }}}},[(_vm.propertyExists(report.actor, 'avatar'))?_c('img',{staticClass:\"avatar-img\",attrs:{\"src\":report.actor.avatar,\"alt\":\"avatar\"}}):_vm._e(),_vm._v(\" \"),(_vm.propertyExists(report.actor, 'nickname'))?_c('span',{staticClass:\"report-account-name\"},[_vm._v(_vm._s(report.actor.nickname))]):_c('span',{staticClass:\"report-account-name deactivated\"},[_vm._v(\"(\"+_vm._s(_vm.$t('users.invalidNickname'))+\")\")])]):_c('span',{staticClass:\"report-account-name deactivated\"},[_vm._v(\"(\"+_vm._s(_vm.$t('users.invalidNickname'))+\")\")]),_vm._v(\" \"),(_vm.propertyExists(report.actor, 'url'))?_c('a',{staticClass:\"account\",attrs:{\"href\":report.actor.url,\"target\":\"_blank\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('userProfile.openAccountInInstance'))+\"\\n \"),_c('i',{staticClass:\"el-icon-top-right\"})]):_vm._e()],1)]),_vm._v(\" \"),(_vm.showStatuses(report.statuses))?_c('div',{staticClass:\"reported-statuses\"},[_c('el-collapse',[_c('el-collapse-item',{attrs:{\"title\":_vm.getStatusesTitle(report.statuses)}},_vm._l((report.statuses),function(status){return _c('div',{key:status.id},[_c('status',{attrs:{\"status\":status,\"account\":status.account.nickname ? status.account : report.account,\"show-checkbox\":false,\"page\":_vm.currentPage}})],1)}),0)],1)],1):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"report-notes\"},[_c('el-collapse',[_c('el-collapse-item',{attrs:{\"title\":_vm.getNotesTitle(report.notes)}},_vm._l((report.notes),function(note,index){return _c('note-card',{key:index,attrs:{\"note\":note,\"report\":report}})}),1)],1),_vm._v(\" \"),_c('div',{staticClass:\"report-note-form\"},[_c('el-input',{attrs:{\"placeholder\":_vm.$t('reports.leaveNote'),\"type\":\"textarea\",\"rows\":\"2\"},model:{value:(_vm.notes[report.id]),callback:function ($$v) {_vm.$set(_vm.notes, report.id, $$v)},expression:\"notes[report.id]\"}}),_vm._v(\" \"),_c('div',{staticClass:\"report-post-note\"},[_c('el-button',{on:{\"click\":function($event){return _vm.handleNewNote(report.id)}}},[_vm._v(_vm._s(_vm.$t('reports.postNote')))])],1)],1)],1)],1)],1)}),1),_vm._v(\" \"),(!_vm.loading)?_c('div',{staticClass:\"reports-pagination\"},[_c('el-pagination',{attrs:{\"total\":_vm.totalReportsCount,\"current-page\":_vm.currentPage,\"page-size\":_vm.pageSize,\"background\":\"\",\"layout\":\"prev, pager, next\"},on:{\"current-change\":_vm.handlePageChange}})],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportsFilter.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportsFilter.vue?vue&type=script&lang=js&\"","\n \n {{ item.label }}\n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./ReportsFilter.vue?vue&type=template&id=ecc36f5a&scoped=true&\"\nimport script from \"./ReportsFilter.vue?vue&type=script&lang=js&\"\nexport * from \"./ReportsFilter.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ReportsFilter.vue?vue&type=style&index=0&id=ecc36f5a&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"ecc36f5a\",\n null\n \n)\n\ncomponent.options.__file = \"ReportsFilter.vue\"\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-select',{staticClass:\"select-field\",attrs:{\"placeholder\":_vm.$t('reportsFilter.inputPlaceholder'),\"clearable\":\"\",\"value-key\":\"value\"},on:{\"change\":_vm.toggleFilters},model:{value:(_vm.filter),callback:function ($$v) {_vm.filter=$$v},expression:\"filter\"}},_vm._l((_vm.options),function(item){return _c('el-option',{key:item.value,attrs:{\"label\":item.label,\"value\":item.value}},[_vm._v(_vm._s(item.label))])}),1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","\n \n \n
\n \n
\n
\n
\n \n
There are no reports to display
\n
\n \n
\n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=fa601560&scoped=true&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&id=fa601560&rel=stylesheet%2Fscss&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"fa601560\",\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports"],"sourceRoot":""}
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-e458.bb460d81.js b/priv/static/adminfe/static/js/chunk-e458.bb460d81.js
deleted file mode 100644
index a08717166..000000000
--- a/priv/static/adminfe/static/js/chunk-e458.bb460d81.js
+++ /dev/null
@@ -1,2 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-e458"],{FtQ1:function(t,s,e){"use strict";e.r(s);var a=e("RIqP"),n=e.n(a),i=e("i7Kn"),o=e("ot3S"),r=e("rIUS"),c=e("ZhIB"),u=e.n(c),l={name:"Statuses",components:{MultipleUsersMenu:i.a,RebootButton:r.a,Status:o.a},data:function(){return{selectedUsers:[]}},computed:{allLoaded:function(){return this.$store.state.status.statusesByInstance.allLoaded},buttonLoading:function(){return this.$store.state.status.statusesByInstance.buttonLoading},currentInstance:function(){return this.selectedInstance===this.$store.state.user.authHost},instances:function(){return[this.$store.state.user.authHost].concat(n()(this.$store.state.peers.fetchedPeers))},isDesktop:function(){return"desktop"===this.$store.state.app.device},isMobile:function(){return"mobile"===this.$store.state.app.device},isTablet:function(){return"tablet"===this.$store.state.app.device},loadingPeers:function(){return this.$store.state.peers.loading},page:function(){return this.$store.state.status.statusesByInstance.page},pageSize:function(){return this.$store.state.status.statusesByInstance.pageSize},selectedInstance:{get:function(){return this.$store.state.status.statusesByInstance.selectedInstance},set:function(t){this.$store.dispatch("HandleFilterChange",t)}},showLocal:{get:function(){return this.$store.state.status.statusesByInstance.showLocal},set:function(t){this.$store.dispatch("HandleLocalCheckboxChange",t)}},showPrivate:{get:function(){return this.$store.state.status.statusesByInstance.showPrivate},set:function(t){this.$store.dispatch("HandleGodmodeCheckboxChange",t)}},statuses:function(){return this.$store.state.status.fetchedStatuses},statusVisibility:function(){return this.$store.state.status.statusVisibility}},mounted:function(){this.$store.dispatch("GetNodeInfo"),this.$store.dispatch("NeedReboot"),this.$store.dispatch("FetchPeers"),this.$store.dispatch("FetchStatusesCount")},destroyed:function(){this.clearSelection(),this.$store.dispatch("ClearState")},methods:{clearSelection:function(){this.selectedUsers=[]},handleFilterChange:function(){this.$store.dispatch("HandlePageChange",1),this.$store.dispatch("FetchStatusesByInstance")},handleLoadMore:function(){this.$store.dispatch("HandlePageChange",this.page+1),this.$store.dispatch("FetchStatusesPageByInstance")},handleStatusSelection:function(t){void 0===this.selectedUsers.find(function(s){return t.id===s.id})&&(this.selectedUsers=[].concat(n()(this.selectedUsers),[t]))},normalizedCount:function(t){return u()(t).format("0a")}}},d=(e("QOJ7"),e("KHd+")),h=Object(d.a)(l,function(){var t=this,s=t.$createElement,e=t._self._c||s;return t.loadingPeers?t._e():e("div",{staticClass:"statuses-container"},[e("div",{staticClass:"statuses-header"},[e("h1",[t._v("\n "+t._s(t.$t("statuses.statuses"))+"\n ")]),t._v(" "),e("reboot-button")],1),t._v(" "),e("div",{staticClass:"statuses-header-container"},[e("el-button-group",[e("el-button",{staticClass:"direct-button",attrs:{plain:""}},[t._v("\n "+t._s(t.$t("statuses.direct"))+": "+t._s(t.normalizedCount(t.statusVisibility.direct))+"\n ")]),t._v(" "),e("el-button",{staticClass:"private-button",attrs:{plain:""}},[t._v("\n "+t._s(t.$t("statuses.private"))+": "+t._s(t.normalizedCount(t.statusVisibility.private))+"\n ")]),t._v(" "),e("el-button",{staticClass:"public-button",attrs:{plain:""}},[t._v("\n "+t._s(t.$t("statuses.public"))+": "+t._s(t.normalizedCount(t.statusVisibility.public))+"\n ")]),t._v(" "),e("el-button",{staticClass:"unlisted-button",attrs:{plain:""}},[t._v("\n "+t._s(t.$t("statuses.unlisted"))+": "+t._s(t.normalizedCount(t.statusVisibility.unlisted))+"\n ")])],1)],1),t._v(" "),e("div",{staticClass:"filter-container"},[e("el-select",{staticClass:"select-instance",attrs:{placeholder:t.$t("statuses.instanceFilter"),"no-data-text":t.$t("statuses.noInstances"),filterable:"",clearable:""},on:{change:t.handleFilterChange},model:{value:t.selectedInstance,callback:function(s){t.selectedInstance=s},expression:"selectedInstance"}},t._l(t.instances,function(t,s){return e("el-option",{key:s,attrs:{label:t,value:t}})}),1),t._v(" "),e("multiple-users-menu",{attrs:{"selected-users":t.selectedUsers},on:{"apply-action":t.clearSelection}})],1),t._v(" "),t.currentInstance?e("div",{staticClass:"checkbox-container"},[e("el-checkbox",{staticClass:"show-private-statuses",model:{value:t.showLocal,callback:function(s){t.showLocal=s},expression:"showLocal"}},[t._v("\n "+t._s(t.$t("statuses.onlyLocalStatuses"))+"\n ")]),t._v(" "),e("el-checkbox",{staticClass:"show-private-statuses",model:{value:t.showPrivate,callback:function(s){t.showPrivate=s},expression:"showPrivate"}},[t._v("\n "+t._s(t.$t("statuses.showPrivateStatuses"))+"\n ")])],1):t._e(),t._v(" "),0===t.statuses.length?e("p",{staticClass:"no-statuses"},[t._v(t._s(t.$t("userProfile.noStatuses")))]):t._e(),t._v(" "),t._l(t.statuses,function(s){return e("div",{key:s.id,staticClass:"status-container"},[e("status",{attrs:{status:s,account:s.account,"show-checkbox":t.isDesktop,"fetch-statuses-by-instance":!0},on:{"status-selection":t.handleStatusSelection}})],1)}),t._v(" "),t.statuses.length>0?e("div",{staticClass:"statuses-pagination"},[t.allLoaded?e("el-button",{attrs:{icon:"el-icon-check",circle:""}}):e("el-button",{attrs:{loading:t.buttonLoading},on:{click:t.handleLoadMore}},[t._v(t._s(t.$t("statuses.loadMore")))])],1):t._e()],2)},[],!1,null,null,null);h.options.__file="index.vue";s.default=h.exports},KmHg:function(t,s,e){},Kw8l:function(t,s,e){"use strict";var a=e("cRgN");e.n(a).a},QOJ7:function(t,s,e){"use strict";var a=e("KmHg");e.n(a).a},RnhZ:function(t,s,e){var a={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-SG":"zavE","./en-SG.js":"zavE","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function n(t){var s=i(t);return e(s)}function i(t){if(!e.o(a,t)){var s=new Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}return a[t]}n.keys=function(){return Object.keys(a)},n.resolve=i,t.exports=n,n.id="RnhZ"},cRgN:function(t,s,e){},ot3S:function(t,s,e){"use strict";var a=e("wd/R"),n=e.n(a),i={name:"Status",props:{account:{type:Object,required:!1,default:function(){return{}}},fetchStatusesByInstance:{type:Boolean,required:!1,default:!1},showCheckbox:{type:Boolean,required:!0,default:!1},status:{type:Object,required:!0},page:{type:Number,required:!1,default:0},userId:{type:String,required:!1,default:""},godmode:{type:Boolean,required:!1,default:!1}},data:function(){return{showHiddenStatus:!1}},methods:{capitalizeFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)},changeStatus:function(t,s,e){this.$store.dispatch("ChangeStatusScope",{statusId:t,isSensitive:s,visibility:e,reportCurrentPage:this.page,userId:this.userId,godmode:this.godmode,fetchStatusesByInstance:this.fetchStatusesByInstance})},deleteStatus:function(t){var s=this;this.$confirm("Are you sure you want to delete this status?","Warning",{confirmButtonText:"OK",cancelButtonText:"Cancel",type:"warning"}).then(function(){s.$store.dispatch("DeleteStatus",{statusId:t,reportCurrentPage:s.page,userId:s.userId,godmode:s.godmode,fetchStatusesByInstance:s.fetchStatusesByInstance}),s.$message({type:"success",message:"Delete completed"})}).catch(function(){s.$message({type:"info",message:"Delete canceled"})})},optionPercent:function(t,s){var e=t.options.reduce(function(t,s){return t+s.votes_count},0);return 0===e?0:+(s.votes_count/e*100).toFixed(1)},parseTimestamp:function(t){return n()(t).format("YYYY-MM-DD HH:mm")},handleStatusSelection:function(t){this.$emit("status-selection",t)}}},o=(e("Kw8l"),e("KHd+")),r=Object(o.a)(i,function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[t.status.deleted?e("el-card",{staticClass:"status-card"},[e("div",{attrs:{slot:"header"},slot:"header"},[e("div",{staticClass:"status-header"},[e("div",{staticClass:"status-account-container"},[e("div",{staticClass:"status-account"},[e("h4",{staticClass:"status-deleted"},[t._v(t._s(t.$t("reports.statusDeleted")))])])])])]),t._v(" "),e("div",{staticClass:"status-body"},[t.status.content?e("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}):e("span",{staticClass:"status-without-content"},[t._v("no content")])]),t._v(" "),t.status.created_at?e("a",{staticClass:"account",attrs:{href:t.status.url,target:"_blank"}},[t._v("\n "+t._s(t.parseTimestamp(t.status.created_at))+"\n ")]):t._e()]):e("el-card",{staticClass:"status-card"},[e("div",{attrs:{slot:"header"},slot:"header"},[e("div",{staticClass:"status-header"},[e("div",{staticClass:"status-account-container"},[e("div",{staticClass:"status-account"},[t.showCheckbox?e("el-checkbox",{staticClass:"status-checkbox",on:{change:function(s){return t.handleStatusSelection(t.account)}}}):t._e(),t._v(" "),e("img",{staticClass:"status-avatar-img",attrs:{src:t.account.avatar}}),t._v(" "),t.account.deactivated?e("span",[e("h3",{staticClass:"status-account-name"},[t._v(t._s(t.account.display_name))]),t._v(" "),e("h3",{staticClass:"status-account-name deactivated"},[t._v(" (deactivated)")])]):e("a",{staticClass:"account",attrs:{href:t.account.url,target:"_blank"}},[e("h3",{staticClass:"status-account-name"},[t._v(t._s(t.account.display_name))])])],1)]),t._v(" "),e("div",{staticClass:"status-actions"},[t.status.sensitive?e("el-tag",{attrs:{type:"warning",size:"large"}},[t._v(t._s(t.$t("reports.sensitive")))]):t._e(),t._v(" "),e("el-tag",{attrs:{size:"large"}},[t._v(t._s(t.capitalizeFirstLetter(t.status.visibility)))]),t._v(" "),e("el-dropdown",{attrs:{trigger:"click"}},[e("el-button",{staticClass:"status-actions-button",attrs:{plain:"",size:"small",icon:"el-icon-edit"}},[t._v("\n "+t._s(t.$t("reports.changeScope"))),e("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t.status.sensitive?t._e():e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,!0,t.status.visibility)}}},[t._v("\n "+t._s(t.$t("reports.addSensitive"))+"\n ")]),t._v(" "),t.status.sensitive?e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,!1,t.status.visibility)}}},[t._v("\n "+t._s(t.$t("reports.removeSensitive"))+"\n ")]):t._e(),t._v(" "),"public"!==t.status.visibility?e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,t.status.sensitive,"public")}}},[t._v("\n "+t._s(t.$t("reports.public"))+"\n ")]):t._e(),t._v(" "),"private"!==t.status.visibility?e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,t.status.sensitive,"private")}}},[t._v("\n "+t._s(t.$t("reports.private"))+"\n ")]):t._e(),t._v(" "),"unlisted"!==t.status.visibility?e("el-dropdown-item",{nativeOn:{click:function(s){return t.changeStatus(t.status.id,t.status.sensitive,"unlisted")}}},[t._v("\n "+t._s(t.$t("reports.unlisted"))+"\n ")]):t._e(),t._v(" "),e("el-dropdown-item",{nativeOn:{click:function(s){return t.deleteStatus(t.status.id)}}},[t._v("\n "+t._s(t.$t("reports.deleteStatus"))+"\n ")])],1)],1)],1)])]),t._v(" "),e("div",{staticClass:"status-body"},[t.status.spoiler_text?e("div",[e("strong",[t._v(t._s(t.status.spoiler_text))]),t._v(" "),t.showHiddenStatus?t._e():e("el-button",{staticClass:"show-more-button",attrs:{size:"mini"},on:{click:function(s){t.showHiddenStatus=!0}}},[t._v("Show more")]),t._v(" "),t.showHiddenStatus?e("el-button",{staticClass:"show-more-button",attrs:{size:"mini"},on:{click:function(s){t.showHiddenStatus=!1}}},[t._v("Show less")]):t._e(),t._v(" "),t.showHiddenStatus?e("div",[e("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}),t._v(" "),t.status.poll?e("div",{staticClass:"poll"},[e("ul",t._l(t.status.poll.options,function(s,a){return e("li",{key:a},[t._v("\n "+t._s(s.title)+"\n "),e("el-progress",{attrs:{percentage:t.optionPercent(t.status.poll,s)}})],1)}),0)]):t._e(),t._v(" "),t._l(t.status.media_attachments,function(t,s){return e("div",{key:s,staticClass:"image"},[e("img",{attrs:{src:t.preview_url}})])})],2):t._e()],1):t._e(),t._v(" "),t.status.spoiler_text?t._e():e("div",[e("span",{staticClass:"status-content",domProps:{innerHTML:t._s(t.status.content)}}),t._v(" "),t.status.poll?e("div",{staticClass:"poll"},[e("ul",t._l(t.status.poll.options,function(s,a){return e("li",{key:a},[t._v("\n "+t._s(s.title)+"\n "),e("el-progress",{attrs:{percentage:t.optionPercent(t.status.poll,s)}})],1)}),0)]):t._e(),t._v(" "),t._l(t.status.media_attachments,function(t,s){return e("div",{key:s,staticClass:"image"},[e("img",{attrs:{src:t.preview_url}})])})],2),t._v(" "),e("a",{staticClass:"account",attrs:{href:t.status.url,target:"_blank"}},[t._v("\n "+t._s(t.parseTimestamp(t.status.created_at))+"\n ")])])])],1)},[],!1,null,null,null);r.options.__file="index.vue";s.a=r.exports}}]);
-//# sourceMappingURL=chunk-e458.bb460d81.js.map
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/chunk-e458.bb460d81.js.map b/priv/static/adminfe/static/js/chunk-e458.bb460d81.js.map
deleted file mode 100644
index 89f05fb99..000000000
--- a/priv/static/adminfe/static/js/chunk-e458.bb460d81.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///./src/views/statuses/index.vue?ffa7","webpack:///./src/views/statuses/index.vue?1423","webpack:///src/views/statuses/index.vue","webpack:///./src/views/statuses/index.vue","webpack:///./src/components/Status/index.vue?aecc","webpack:///./src/views/statuses/index.vue?f25c","webpack:///./node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./src/components/Status/index.vue?f9b2","webpack:///./src/components/Status/index.vue?6071","webpack:///src/components/Status/index.vue","webpack:///./src/components/Status/index.vue"],"names":["views_statusesvue_type_script_lang_js_","name","components","MultipleUsersMenu","RebootButton","Status","data","selectedUsers","computed","allLoaded","this","$store","state","status","statusesByInstance","buttonLoading","currentInstance","selectedInstance","user","authHost","instances","concat","toConsumableArray_default","peers","fetchedPeers","isDesktop","app","device","isMobile","isTablet","loadingPeers","loading","page","pageSize","get","set","instance","dispatch","showLocal","value","showPrivate","statuses","fetchedStatuses","statusVisibility","mounted","destroyed","clearSelection","methods","handleFilterChange","handleLoadMore","handleStatusSelection","undefined","find","selectedUser","id","normalizedCount","count","numeral_default","format","component","Object","componentNormalizer","_vm","_h","$createElement","_c","_self","_e","staticClass","_v","_s","$t","attrs","plain","direct","private","public","unlisted","placeholder","no-data-text","filterable","clearable","on","change","model","callback","$$v","expression","_l","index","key","label","selected-users","apply-action","length","account","show-checkbox","fetch-statuses-by-instance","status-selection","icon","circle","click","options","__file","__webpack_exports__","_node_modules_mini_css_extract_plugin_dist_loader_js_node_modules_css_loader_index_js_ref_11_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_lib_index_js_ref_11_2_node_modules_sass_loader_lib_loader_js_ref_11_3_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_rel_stylesheet_2Fscss_lang_scss___WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","n","map","./af","./af.js","./ar","./ar-dz","./ar-dz.js","./ar-kw","./ar-kw.js","./ar-ly","./ar-ly.js","./ar-ma","./ar-ma.js","./ar-sa","./ar-sa.js","./ar-tn","./ar-tn.js","./ar.js","./az","./az.js","./be","./be.js","./bg","./bg.js","./bm","./bm.js","./bn","./bn.js","./bo","./bo.js","./br","./br.js","./bs","./bs.js","./ca","./ca.js","./cs","./cs.js","./cv","./cv.js","./cy","./cy.js","./da","./da.js","./de","./de-at","./de-at.js","./de-ch","./de-ch.js","./de.js","./dv","./dv.js","./el","./el.js","./en-SG","./en-SG.js","./en-au","./en-au.js","./en-ca","./en-ca.js","./en-gb","./en-gb.js","./en-ie","./en-ie.js","./en-il","./en-il.js","./en-nz","./en-nz.js","./eo","./eo.js","./es","./es-do","./es-do.js","./es-us","./es-us.js","./es.js","./et","./et.js","./eu","./eu.js","./fa","./fa.js","./fi","./fi.js","./fo","./fo.js","./fr","./fr-ca","./fr-ca.js","./fr-ch","./fr-ch.js","./fr.js","./fy","./fy.js","./ga","./ga.js","./gd","./gd.js","./gl","./gl.js","./gom-latn","./gom-latn.js","./gu","./gu.js","./he","./he.js","./hi","./hi.js","./hr","./hr.js","./hu","./hu.js","./hy-am","./hy-am.js","./id","./id.js","./is","./is.js","./it","./it-ch","./it-ch.js","./it.js","./ja","./ja.js","./jv","./jv.js","./ka","./ka.js","./kk","./kk.js","./km","./km.js","./kn","./kn.js","./ko","./ko.js","./ku","./ku.js","./ky","./ky.js","./lb","./lb.js","./lo","./lo.js","./lt","./lt.js","./lv","./lv.js","./me","./me.js","./mi","./mi.js","./mk","./mk.js","./ml","./ml.js","./mn","./mn.js","./mr","./mr.js","./ms","./ms-my","./ms-my.js","./ms.js","./mt","./mt.js","./my","./my.js","./nb","./nb.js","./ne","./ne.js","./nl","./nl-be","./nl-be.js","./nl.js","./nn","./nn.js","./pa-in","./pa-in.js","./pl","./pl.js","./pt","./pt-br","./pt-br.js","./pt.js","./ro","./ro.js","./ru","./ru.js","./sd","./sd.js","./se","./se.js","./si","./si.js","./sk","./sk.js","./sl","./sl.js","./sq","./sq.js","./sr","./sr-cyrl","./sr-cyrl.js","./sr.js","./ss","./ss.js","./sv","./sv.js","./sw","./sw.js","./ta","./ta.js","./te","./te.js","./tet","./tet.js","./tg","./tg.js","./th","./th.js","./tl-ph","./tl-ph.js","./tlh","./tlh.js","./tr","./tr.js","./tzl","./tzl.js","./tzm","./tzm-latn","./tzm-latn.js","./tzm.js","./ug-cn","./ug-cn.js","./uk","./uk.js","./ur","./ur.js","./uz","./uz-latn","./uz-latn.js","./uz.js","./vi","./vi.js","./x-pseudo","./x-pseudo.js","./yo","./yo.js","./zh-cn","./zh-cn.js","./zh-hk","./zh-hk.js","./zh-tw","./zh-tw.js","webpackContext","req","webpackContextResolve","o","e","Error","code","keys","resolve","module","exports","components_Statusvue_type_script_lang_js_","props","type","required","default","fetchStatusesByInstance","Boolean","showCheckbox","Number","userId","String","godmode","showHiddenStatus","capitalizeFirstLetter","str","charAt","toUpperCase","slice","changeStatus","statusId","isSensitive","visibility","reportCurrentPage","deleteStatus","_this","$confirm","confirmButtonText","cancelButtonText","then","$message","message","catch","optionPercent","poll","pollOption","allVotes","reduce","acc","option","votes_count","toFixed","parseTimestamp","timestamp","moment_default","$emit","deleted","slot","domProps","innerHTML","content","href","url","target","created_at","$event","src","avatar","deactivated","display_name","size","trigger","sensitive","nativeOn","spoiler_text","title","percentage","attachment","preview_url"],"mappings":"6GAAA,kFCA0MA,GC0E1MC,KAAA,WACAC,YACAC,oBAAA,EACAC,eAAA,EACAC,SAAA,GAEAC,KAPA,WAQA,OACAC,mBAGAC,UACAC,UADA,WAEA,OAAAC,KAAAC,OAAAC,MAAAC,OAAAC,mBAAAL,WAEAM,cAJA,WAKA,OAAAL,KAAAC,OAAAC,MAAAC,OAAAC,mBAAAC,eAEAC,gBAPA,WAQA,OAAAN,KAAAO,mBAAAP,KAAAC,OAAAC,MAAAM,KAAAC,UAEAC,UAVA,WAWA,OAAAV,KAAAC,OAAAC,MAAAM,KAAAC,UAAAE,OAAAC,IAAAZ,KAAAC,OAAAC,MAAAW,MAAAC,gBAEAC,UAbA,WAcA,kBAAAf,KAAAC,OAAAC,MAAAc,IAAAC,QAEAC,SAhBA,WAiBA,iBAAAlB,KAAAC,OAAAC,MAAAc,IAAAC,QAEAE,SAnBA,WAoBA,iBAAAnB,KAAAC,OAAAC,MAAAc,IAAAC,QAEAG,aAtBA,WAuBA,OAAApB,KAAAC,OAAAC,MAAAW,MAAAQ,SAEAC,KAzBA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OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,UAAA,OACAC,aAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,YAAA,OACAC,eAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,QAAA,OACAC,WAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,UAAA,OACAC,aAAA,OACAC,QAAA,OACAC,WAAA,OACAC,OAAA,OACAC,UAAA,OACAC,QAAA,OACAC,WAAA,OACAC,QAAA,OACAC,aAAA,OACAC,gBAAA,OACAC,WAAA,OACAC,UAAA,OACAC,aAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,OAAA,OACAC,YAAA,OACAC,eAAA,OACAC,UAAA,OACAC,OAAA,OACAC,UAAA,OACAC,aAAA,OACAC,gBAAA,OACAC,OAAA,OACAC,UAAA,OACAC,UAAA,OACAC,aAAA,OACAC,UAAA,OAC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,YAAA,UAAAI,OAA6BgW,KAAA1W,EAAAjD,OAAA4Z,IAAAC,OAAA,YAAyC5W,EAAAO,GAAA,aAAAP,EAAAQ,GAAAR,EAAAiW,eAAAjW,EAAAjD,OAAA8Z,aAAA,mBAA4vB,QGYj1L,EACA,KACA,KACA,MAIAhX,EAAA2C,QAAAC,OAAA,YACeC,EAAA,EAAA7C","file":"static/js/chunk-e458.bb460d81.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.loadingPeers)?_c('div',{staticClass:\"statuses-container\"},[_c('div',{staticClass:\"statuses-header\"},[_c('h1',[_vm._v(\"\\n \"+_vm._s(_vm.$t('statuses.statuses'))+\"\\n \")]),_vm._v(\" \"),_c('reboot-button')],1),_vm._v(\" \"),_c('div',{staticClass:\"statuses-header-container\"},[_c('el-button-group',[_c('el-button',{staticClass:\"direct-button\",attrs:{\"plain\":\"\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('statuses.direct'))+\": \"+_vm._s(_vm.normalizedCount(_vm.statusVisibility.direct))+\"\\n \")]),_vm._v(\" \"),_c('el-button',{staticClass:\"private-button\",attrs:{\"plain\":\"\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('statuses.private'))+\": \"+_vm._s(_vm.normalizedCount(_vm.statusVisibility.private))+\"\\n \")]),_vm._v(\" \"),_c('el-button',{staticClass:\"public-button\",attrs:{\"plain\":\"\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('statuses.public'))+\": \"+_vm._s(_vm.normalizedCount(_vm.statusVisibility.public))+\"\\n \")]),_vm._v(\" \"),_c('el-button',{staticClass:\"unlisted-button\",attrs:{\"plain\":\"\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('statuses.unlisted'))+\": \"+_vm._s(_vm.normalizedCount(_vm.statusVisibility.unlisted))+\"\\n \")])],1)],1),_vm._v(\" \"),_c('div',{staticClass:\"filter-container\"},[_c('el-select',{staticClass:\"select-instance\",attrs:{\"placeholder\":_vm.$t('statuses.instanceFilter'),\"no-data-text\":_vm.$t('statuses.noInstances'),\"filterable\":\"\",\"clearable\":\"\"},on:{\"change\":_vm.handleFilterChange},model:{value:(_vm.selectedInstance),callback:function ($$v) {_vm.selectedInstance=$$v},expression:\"selectedInstance\"}},_vm._l((_vm.instances),function(instance,index){return _c('el-option',{key:index,attrs:{\"label\":instance,\"value\":instance}})}),1),_vm._v(\" \"),_c('multiple-users-menu',{attrs:{\"selected-users\":_vm.selectedUsers},on:{\"apply-action\":_vm.clearSelection}})],1),_vm._v(\" \"),(_vm.currentInstance)?_c('div',{staticClass:\"checkbox-container\"},[_c('el-checkbox',{staticClass:\"show-private-statuses\",model:{value:(_vm.showLocal),callback:function ($$v) {_vm.showLocal=$$v},expression:\"showLocal\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('statuses.onlyLocalStatuses'))+\"\\n \")]),_vm._v(\" \"),_c('el-checkbox',{staticClass:\"show-private-statuses\",model:{value:(_vm.showPrivate),callback:function ($$v) {_vm.showPrivate=$$v},expression:\"showPrivate\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('statuses.showPrivateStatuses'))+\"\\n \")])],1):_vm._e(),_vm._v(\" \"),(_vm.statuses.length === 0)?_c('p',{staticClass:\"no-statuses\"},[_vm._v(_vm._s(_vm.$t('userProfile.noStatuses')))]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.statuses),function(status){return _c('div',{key:status.id,staticClass:\"status-container\"},[_c('status',{attrs:{\"status\":status,\"account\":status.account,\"show-checkbox\":_vm.isDesktop,\"fetch-statuses-by-instance\":true},on:{\"status-selection\":_vm.handleStatusSelection}})],1)}),_vm._v(\" \"),(_vm.statuses.length > 0)?_c('div',{staticClass:\"statuses-pagination\"},[(!_vm.allLoaded)?_c('el-button',{attrs:{\"loading\":_vm.buttonLoading},on:{\"click\":_vm.handleLoadMore}},[_vm._v(_vm._s(_vm.$t('statuses.loadMore')))]):_c('el-button',{attrs:{\"icon\":\"el-icon-check\",\"circle\":\"\"}})],1):_vm._e()],2):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","\n \n \n \n
\n \n \n \n \n
\n
\n \n {{ $t('statuses.onlyLocalStatuses') }}\n \n \n {{ $t('statuses.showPrivateStatuses') }}\n \n
\n
{{ $t('userProfile.noStatuses') }}
\n
\n \n
\n
0\" class=\"statuses-pagination\">\n {{ $t('statuses.loadMore') }}\n \n
\n
\n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=4ee51084&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js!../../../node_modules/css-loader/index.js??ref--11-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/lib/index.js??ref--11-2!../../../node_modules/sass-loader/lib/loader.js??ref--11-3!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"","var map = {\n\t\"./af\": \"K/tc\",\n\t\"./af.js\": \"K/tc\",\n\t\"./ar\": \"jnO4\",\n\t\"./ar-dz\": \"o1bE\",\n\t\"./ar-dz.js\": \"o1bE\",\n\t\"./ar-kw\": \"Qj4J\",\n\t\"./ar-kw.js\": \"Qj4J\",\n\t\"./ar-ly\": \"HP3h\",\n\t\"./ar-ly.js\": \"HP3h\",\n\t\"./ar-ma\": \"CoRJ\",\n\t\"./ar-ma.js\": \"CoRJ\",\n\t\"./ar-sa\": \"gjCT\",\n\t\"./ar-sa.js\": \"gjCT\",\n\t\"./ar-tn\": \"bYM6\",\n\t\"./ar-tn.js\": \"bYM6\",\n\t\"./ar.js\": \"jnO4\",\n\t\"./az\": \"SFxW\",\n\t\"./az.js\": \"SFxW\",\n\t\"./be\": \"H8ED\",\n\t\"./be.js\": \"H8ED\",\n\t\"./bg\": \"hKrs\",\n\t\"./bg.js\": \"hKrs\",\n\t\"./bm\": \"p/rL\",\n\t\"./bm.js\": \"p/rL\",\n\t\"./bn\": \"kEOa\",\n\t\"./bn.js\": \"kEOa\",\n\t\"./bo\": \"0mo+\",\n\t\"./bo.js\": \"0mo+\",\n\t\"./br\": \"aIdf\",\n\t\"./br.js\": \"aIdf\",\n\t\"./bs\": \"JVSJ\",\n\t\"./bs.js\": \"JVSJ\",\n\t\"./ca\": \"1xZ4\",\n\t\"./ca.js\": \"1xZ4\",\n\t\"./cs\": \"PA2r\",\n\t\"./cs.js\": \"PA2r\",\n\t\"./cv\": \"A+xa\",\n\t\"./cv.js\": \"A+xa\",\n\t\"./cy\": \"l5ep\",\n\t\"./cy.js\": \"l5ep\",\n\t\"./da\": \"DxQv\",\n\t\"./da.js\": \"DxQv\",\n\t\"./de\": \"tGlX\",\n\t\"./de-at\": \"s+uk\",\n\t\"./de-at.js\": \"s+uk\",\n\t\"./de-ch\": \"u3GI\",\n\t\"./de-ch.js\": \"u3GI\",\n\t\"./de.js\": \"tGlX\",\n\t\"./dv\": \"WYrj\",\n\t\"./dv.js\": \"WYrj\",\n\t\"./el\": \"jUeY\",\n\t\"./el.js\": \"jUeY\",\n\t\"./en-SG\": \"zavE\",\n\t\"./en-SG.js\": \"zavE\",\n\t\"./en-au\": \"Dmvi\",\n\t\"./en-au.js\": \"Dmvi\",\n\t\"./en-ca\": \"OIYi\",\n\t\"./en-ca.js\": \"OIYi\",\n\t\"./en-gb\": \"Oaa7\",\n\t\"./en-gb.js\": \"Oaa7\",\n\t\"./en-ie\": \"4dOw\",\n\t\"./en-ie.js\": \"4dOw\",\n\t\"./en-il\": \"czMo\",\n\t\"./en-il.js\": \"czMo\",\n\t\"./en-nz\": \"b1Dy\",\n\t\"./en-nz.js\": \"b1Dy\",\n\t\"./eo\": \"Zduo\",\n\t\"./eo.js\": \"Zduo\",\n\t\"./es\": \"iYuL\",\n\t\"./es-do\": \"CjzT\",\n\t\"./es-do.js\": \"CjzT\",\n\t\"./es-us\": \"Vclq\",\n\t\"./es-us.js\": \"Vclq\",\n\t\"./es.js\": \"iYuL\",\n\t\"./et\": \"7BjC\",\n\t\"./et.js\": \"7BjC\",\n\t\"./eu\": \"D/JM\",\n\t\"./eu.js\": \"D/JM\",\n\t\"./fa\": \"jfSC\",\n\t\"./fa.js\": \"jfSC\",\n\t\"./fi\": \"gekB\",\n\t\"./fi.js\": \"gekB\",\n\t\"./fo\": \"ByF4\",\n\t\"./fo.js\": \"ByF4\",\n\t\"./fr\": \"nyYc\",\n\t\"./fr-ca\": \"2fjn\",\n\t\"./fr-ca.js\": \"2fjn\",\n\t\"./fr-ch\": \"Dkky\",\n\t\"./fr-ch.js\": \"Dkky\",\n\t\"./fr.js\": \"nyYc\",\n\t\"./fy\": \"cRix\",\n\t\"./fy.js\": \"cRix\",\n\t\"./ga\": \"USCx\",\n\t\"./ga.js\": \"USCx\",\n\t\"./gd\": \"9rRi\",\n\t\"./gd.js\": \"9rRi\",\n\t\"./gl\": \"iEDd\",\n\t\"./gl.js\": \"iEDd\",\n\t\"./gom-latn\": \"DKr+\",\n\t\"./gom-latn.js\": \"DKr+\",\n\t\"./gu\": \"4MV3\",\n\t\"./gu.js\": \"4MV3\",\n\t\"./he\": \"x6pH\",\n\t\"./he.js\": \"x6pH\",\n\t\"./hi\": \"3E1r\",\n\t\"./hi.js\": \"3E1r\",\n\t\"./hr\": \"S6ln\",\n\t\"./hr.js\": \"S6ln\",\n\t\"./hu\": \"WxRl\",\n\t\"./hu.js\": \"WxRl\",\n\t\"./hy-am\": \"1rYy\",\n\t\"./hy-am.js\": \"1rYy\",\n\t\"./id\": \"UDhR\",\n\t\"./id.js\": \"UDhR\",\n\t\"./is\": \"BVg3\",\n\t\"./is.js\": \"BVg3\",\n\t\"./it\": \"bpih\",\n\t\"./it-ch\": \"bxKX\",\n\t\"./it-ch.js\": \"bxKX\",\n\t\"./it.js\": \"bpih\",\n\t\"./ja\": \"B55N\",\n\t\"./ja.js\": \"B55N\",\n\t\"./jv\": \"tUCv\",\n\t\"./jv.js\": \"tUCv\",\n\t\"./ka\": \"IBtZ\",\n\t\"./ka.js\": \"IBtZ\",\n\t\"./kk\": \"bXm7\",\n\t\"./kk.js\": \"bXm7\",\n\t\"./km\": \"6B0Y\",\n\t\"./km.js\": \"6B0Y\",\n\t\"./kn\": \"PpIw\",\n\t\"./kn.js\": \"PpIw\",\n\t\"./ko\": \"Ivi+\",\n\t\"./ko.js\": \"Ivi+\",\n\t\"./ku\": \"JCF/\",\n\t\"./ku.js\": \"JCF/\",\n\t\"./ky\": \"lgnt\",\n\t\"./ky.js\": \"lgnt\",\n\t\"./lb\": \"RAwQ\",\n\t\"./lb.js\": \"RAwQ\",\n\t\"./lo\": \"sp3z\",\n\t\"./lo.js\": \"sp3z\",\n\t\"./lt\": \"JvlW\",\n\t\"./lt.js\": \"JvlW\",\n\t\"./lv\": \"uXwI\",\n\t\"./lv.js\": \"uXwI\",\n\t\"./me\": \"KTz0\",\n\t\"./me.js\": \"KTz0\",\n\t\"./mi\": \"aIsn\",\n\t\"./mi.js\": \"aIsn\",\n\t\"./mk\": \"aQkU\",\n\t\"./mk.js\": \"aQkU\",\n\t\"./ml\": \"AvvY\",\n\t\"./ml.js\": \"AvvY\",\n\t\"./mn\": \"lYtQ\",\n\t\"./mn.js\": \"lYtQ\",\n\t\"./mr\": \"Ob0Z\",\n\t\"./mr.js\": \"Ob0Z\",\n\t\"./ms\": \"6+QB\",\n\t\"./ms-my\": \"ZAMP\",\n\t\"./ms-my.js\": \"ZAMP\",\n\t\"./ms.js\": \"6+QB\",\n\t\"./mt\": \"G0Uy\",\n\t\"./mt.js\": \"G0Uy\",\n\t\"./my\": \"honF\",\n\t\"./my.js\": \"honF\",\n\t\"./nb\": \"bOMt\",\n\t\"./nb.js\": \"bOMt\",\n\t\"./ne\": \"OjkT\",\n\t\"./ne.js\": \"OjkT\",\n\t\"./nl\": \"+s0g\",\n\t\"./nl-be\": \"2ykv\",\n\t\"./nl-be.js\": \"2ykv\",\n\t\"./nl.js\": \"+s0g\",\n\t\"./nn\": \"uEye\",\n\t\"./nn.js\": \"uEye\",\n\t\"./pa-in\": \"8/+R\",\n\t\"./pa-in.js\": \"8/+R\",\n\t\"./pl\": \"jVdC\",\n\t\"./pl.js\": \"jVdC\",\n\t\"./pt\": \"8mBD\",\n\t\"./pt-br\": \"0tRk\",\n\t\"./pt-br.js\": \"0tRk\",\n\t\"./pt.js\": \"8mBD\",\n\t\"./ro\": \"lyxo\",\n\t\"./ro.js\": \"lyxo\",\n\t\"./ru\": \"lXzo\",\n\t\"./ru.js\": \"lXzo\",\n\t\"./sd\": \"Z4QM\",\n\t\"./sd.js\": \"Z4QM\",\n\t\"./se\": \"//9w\",\n\t\"./se.js\": \"//9w\",\n\t\"./si\": \"7aV9\",\n\t\"./si.js\": \"7aV9\",\n\t\"./sk\": \"e+ae\",\n\t\"./sk.js\": \"e+ae\",\n\t\"./sl\": \"gVVK\",\n\t\"./sl.js\": \"gVVK\",\n\t\"./sq\": \"yPMs\",\n\t\"./sq.js\": \"yPMs\",\n\t\"./sr\": \"zx6S\",\n\t\"./sr-cyrl\": \"E+lV\",\n\t\"./sr-cyrl.js\": \"E+lV\",\n\t\"./sr.js\": \"zx6S\",\n\t\"./ss\": \"Ur1D\",\n\t\"./ss.js\": \"Ur1D\",\n\t\"./sv\": \"X709\",\n\t\"./sv.js\": \"X709\",\n\t\"./sw\": \"dNwA\",\n\t\"./sw.js\": \"dNwA\",\n\t\"./ta\": \"PeUW\",\n\t\"./ta.js\": \"PeUW\",\n\t\"./te\": \"XLvN\",\n\t\"./te.js\": \"XLvN\",\n\t\"./tet\": \"V2x9\",\n\t\"./tet.js\": \"V2x9\",\n\t\"./tg\": \"Oxv6\",\n\t\"./tg.js\": \"Oxv6\",\n\t\"./th\": \"EOgW\",\n\t\"./th.js\": \"EOgW\",\n\t\"./tl-ph\": \"Dzi0\",\n\t\"./tl-ph.js\": \"Dzi0\",\n\t\"./tlh\": \"z3Vd\",\n\t\"./tlh.js\": \"z3Vd\",\n\t\"./tr\": \"DoHr\",\n\t\"./tr.js\": \"DoHr\",\n\t\"./tzl\": \"z1FC\",\n\t\"./tzl.js\": \"z1FC\",\n\t\"./tzm\": \"wQk9\",\n\t\"./tzm-latn\": \"tT3J\",\n\t\"./tzm-latn.js\": \"tT3J\",\n\t\"./tzm.js\": \"wQk9\",\n\t\"./ug-cn\": \"YRex\",\n\t\"./ug-cn.js\": \"YRex\",\n\t\"./uk\": \"raLr\",\n\t\"./uk.js\": \"raLr\",\n\t\"./ur\": \"UpQW\",\n\t\"./ur.js\": \"UpQW\",\n\t\"./uz\": \"Loxo\",\n\t\"./uz-latn\": \"AQ68\",\n\t\"./uz-latn.js\": \"AQ68\",\n\t\"./uz.js\": \"Loxo\",\n\t\"./vi\": \"KSF8\",\n\t\"./vi.js\": \"KSF8\",\n\t\"./x-pseudo\": \"/X5v\",\n\t\"./x-pseudo.js\": \"/X5v\",\n\t\"./yo\": \"fzPg\",\n\t\"./yo.js\": \"fzPg\",\n\t\"./zh-cn\": \"XDpg\",\n\t\"./zh-cn.js\": \"XDpg\",\n\t\"./zh-hk\": \"SatO\",\n\t\"./zh-hk.js\": \"SatO\",\n\t\"./zh-tw\": \"kOpN\",\n\t\"./zh-tw.js\": \"kOpN\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"RnhZ\";","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(!_vm.status.deleted)?_c('el-card',{staticClass:\"status-card\"},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('div',{staticClass:\"status-header\"},[_c('div',{staticClass:\"status-account-container\"},[_c('div',{staticClass:\"status-account\"},[(_vm.showCheckbox)?_c('el-checkbox',{staticClass:\"status-checkbox\",on:{\"change\":function($event){return _vm.handleStatusSelection(_vm.account)}}}):_vm._e(),_vm._v(\" \"),_c('img',{staticClass:\"status-avatar-img\",attrs:{\"src\":_vm.account.avatar}}),_vm._v(\" \"),(!_vm.account.deactivated)?_c('a',{staticClass:\"account\",attrs:{\"href\":_vm.account.url,\"target\":\"_blank\"}},[_c('h3',{staticClass:\"status-account-name\"},[_vm._v(_vm._s(_vm.account.display_name))])]):_c('span',[_c('h3',{staticClass:\"status-account-name\"},[_vm._v(_vm._s(_vm.account.display_name))]),_vm._v(\" \"),_c('h3',{staticClass:\"status-account-name deactivated\"},[_vm._v(\" (deactivated)\")])])],1)]),_vm._v(\" \"),_c('div',{staticClass:\"status-actions\"},[(_vm.status.sensitive)?_c('el-tag',{attrs:{\"type\":\"warning\",\"size\":\"large\"}},[_vm._v(_vm._s(_vm.$t('reports.sensitive')))]):_vm._e(),_vm._v(\" \"),_c('el-tag',{attrs:{\"size\":\"large\"}},[_vm._v(_vm._s(_vm.capitalizeFirstLetter(_vm.status.visibility)))]),_vm._v(\" \"),_c('el-dropdown',{attrs:{\"trigger\":\"click\"}},[_c('el-button',{staticClass:\"status-actions-button\",attrs:{\"plain\":\"\",\"size\":\"small\",\"icon\":\"el-icon-edit\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.changeScope'))),_c('i',{staticClass:\"el-icon-arrow-down el-icon--right\"})]),_vm._v(\" \"),_c('el-dropdown-menu',{attrs:{\"slot\":\"dropdown\"},slot:\"dropdown\"},[(!_vm.status.sensitive)?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, true, _vm.status.visibility)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.addSensitive'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.sensitive)?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, false, _vm.status.visibility)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.removeSensitive'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'public')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'public')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.public'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'private')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'private')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.private'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(_vm.status.visibility !== 'unlisted')?_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.changeStatus(_vm.status.id, _vm.status.sensitive, 'unlisted')}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.unlisted'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),_c('el-dropdown-item',{nativeOn:{\"click\":function($event){return _vm.deleteStatus(_vm.status.id)}}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('reports.deleteStatus'))+\"\\n \")])],1)],1)],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"status-body\"},[(_vm.status.spoiler_text)?_c('div',[_c('strong',[_vm._v(_vm._s(_vm.status.spoiler_text))]),_vm._v(\" \"),(!_vm.showHiddenStatus)?_c('el-button',{staticClass:\"show-more-button\",attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.showHiddenStatus = true}}},[_vm._v(\"Show more\")]):_vm._e(),_vm._v(\" \"),(_vm.showHiddenStatus)?_c('el-button',{staticClass:\"show-more-button\",attrs:{\"size\":\"mini\"},on:{\"click\":function($event){_vm.showHiddenStatus = false}}},[_vm._v(\"Show less\")]):_vm._e(),_vm._v(\" \"),(_vm.showHiddenStatus)?_c('div',[_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}),_vm._v(\" \"),(_vm.status.poll)?_c('div',{staticClass:\"poll\"},[_c('ul',_vm._l((_vm.status.poll.options),function(option,index){return _c('li',{key:index},[_vm._v(\"\\n \"+_vm._s(option.title)+\"\\n \"),_c('el-progress',{attrs:{\"percentage\":_vm.optionPercent(_vm.status.poll, option)}})],1)}),0)]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.status.media_attachments),function(attachment,index){return _c('div',{key:index,staticClass:\"image\"},[_c('img',{attrs:{\"src\":attachment.preview_url}})])})],2):_vm._e()],1):_vm._e(),_vm._v(\" \"),(!_vm.status.spoiler_text)?_c('div',[_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}),_vm._v(\" \"),(_vm.status.poll)?_c('div',{staticClass:\"poll\"},[_c('ul',_vm._l((_vm.status.poll.options),function(option,index){return _c('li',{key:index},[_vm._v(\"\\n \"+_vm._s(option.title)+\"\\n \"),_c('el-progress',{attrs:{\"percentage\":_vm.optionPercent(_vm.status.poll, option)}})],1)}),0)]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.status.media_attachments),function(attachment,index){return _c('div',{key:index,staticClass:\"image\"},[_c('img',{attrs:{\"src\":attachment.preview_url}})])})],2):_vm._e(),_vm._v(\" \"),_c('a',{staticClass:\"account\",attrs:{\"href\":_vm.status.url,\"target\":\"_blank\"}},[_vm._v(\"\\n \"+_vm._s(_vm.parseTimestamp(_vm.status.created_at))+\"\\n \")])])]):_c('el-card',{staticClass:\"status-card\"},[_c('div',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('div',{staticClass:\"status-header\"},[_c('div',{staticClass:\"status-account-container\"},[_c('div',{staticClass:\"status-account\"},[_c('h4',{staticClass:\"status-deleted\"},[_vm._v(_vm._s(_vm.$t('reports.statusDeleted')))])])])])]),_vm._v(\" \"),_c('div',{staticClass:\"status-body\"},[(_vm.status.content)?_c('span',{staticClass:\"status-content\",domProps:{\"innerHTML\":_vm._s(_vm.status.content)}}):_c('span',{staticClass:\"status-without-content\"},[_vm._v(\"no content\")])]),_vm._v(\" \"),(_vm.status.created_at)?_c('a',{staticClass:\"account\",attrs:{\"href\":_vm.status.url,\"target\":\"_blank\"}},[_vm._v(\"\\n \"+_vm._s(_vm.parseTimestamp(_vm.status.created_at))+\"\\n \")]):_vm._e()])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js?cacheDirectory!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js&\"","\n \n\n\n\n\n\n","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0fdc1bba&\"\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&rel=stylesheet%2Fscss&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\ncomponent.options.__file = \"index.vue\"\nexport default component.exports"],"sourceRoot":""}
\ No newline at end of file
diff --git a/priv/static/adminfe/static/js/runtime.5bae86dc.js b/priv/static/adminfe/static/js/runtime.5bae86dc.js
new file mode 100644
index 000000000..e5fb1554b
--- /dev/null
+++ b/priv/static/adminfe/static/js/runtime.5bae86dc.js
@@ -0,0 +1,2 @@
+!function(e){function n(n){for(var t,r,a=n[0],f=n[1],h=n[2],i=0,l=[];i
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.ApplicationRequirementsTest do
+ use Pleroma.DataCase
+ import ExUnit.CaptureLog
+ import Mock
+
+ alias Pleroma.Repo
+
+ describe "check_rum!" do
+ setup_with_mocks([
+ {Pleroma.ApplicationRequirements, [:passthrough],
+ [check_migrations_applied!: fn _ -> :ok end]}
+ ]) do
+ :ok
+ end
+
+ setup do: clear_config([:database, :rum_enabled])
+
+ test "raises if rum is enabled and detects unapplied rum migrations" do
+ Pleroma.Config.put([:database, :rum_enabled], true)
+
+ with_mocks([{Repo, [:passthrough], [exists?: fn _, _ -> false end]}]) do
+ assert_raise Pleroma.ApplicationRequirements.VerifyError,
+ "Unapplied RUM Migrations detected",
+ fn ->
+ capture_log(&Pleroma.ApplicationRequirements.verify!/0)
+ end
+ end
+ end
+
+ test "raises if rum is disabled and detects rum migrations" do
+ Pleroma.Config.put([:database, :rum_enabled], false)
+
+ with_mocks([{Repo, [:passthrough], [exists?: fn _, _ -> true end]}]) do
+ assert_raise Pleroma.ApplicationRequirements.VerifyError,
+ "RUM Migrations detected",
+ fn ->
+ capture_log(&Pleroma.ApplicationRequirements.verify!/0)
+ end
+ end
+ end
+
+ test "doesn't do anything if rum enabled and applied migrations" do
+ Pleroma.Config.put([:database, :rum_enabled], true)
+
+ with_mocks([{Repo, [:passthrough], [exists?: fn _, _ -> true end]}]) do
+ assert Pleroma.ApplicationRequirements.verify!() == :ok
+ end
+ end
+
+ test "doesn't do anything if rum disabled" do
+ Pleroma.Config.put([:database, :rum_enabled], false)
+
+ with_mocks([{Repo, [:passthrough], [exists?: fn _, _ -> false end]}]) do
+ assert Pleroma.ApplicationRequirements.verify!() == :ok
+ end
+ end
+ end
+
+ describe "check_migrations_applied!" do
+ setup_with_mocks([
+ {Ecto.Migrator, [],
+ [
+ with_repo: fn repo, fun -> passthrough([repo, fun]) end,
+ migrations: fn Repo ->
+ [
+ {:up, 20_191_128_153_944, "fix_missing_following_count"},
+ {:up, 20_191_203_043_610, "create_report_notes"},
+ {:down, 20_191_220_174_645, "add_scopes_to_pleroma_feo_auth_records"}
+ ]
+ end
+ ]}
+ ]) do
+ :ok
+ end
+
+ setup do: clear_config([:i_am_aware_this_may_cause_data_loss, :disable_migration_check])
+
+ test "raises if it detects unapplied migrations" do
+ assert_raise Pleroma.ApplicationRequirements.VerifyError,
+ "Unapplied Migrations detected",
+ fn ->
+ capture_log(&Pleroma.ApplicationRequirements.verify!/0)
+ end
+ end
+
+ test "doesn't do anything if disabled" do
+ Pleroma.Config.put([:i_am_aware_this_may_cause_data_loss, :disable_migration_check], true)
+
+ assert :ok == Pleroma.ApplicationRequirements.verify!()
+ end
+ end
+end
diff --git a/test/chat/message_reference_test.exs b/test/chat/message_reference_test.exs
new file mode 100644
index 000000000..aaa7c1ad4
--- /dev/null
+++ b/test/chat/message_reference_test.exs
@@ -0,0 +1,29 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Chat.MessageReferenceTest do
+ use Pleroma.DataCase, async: true
+
+ alias Pleroma.Chat
+ alias Pleroma.Chat.MessageReference
+ alias Pleroma.Web.CommonAPI
+
+ import Pleroma.Factory
+
+ describe "messages" do
+ test "it returns the last message in a chat" do
+ user = insert(:user)
+ recipient = insert(:user)
+
+ {:ok, _message_1} = CommonAPI.post_chat_message(user, recipient, "hey")
+ {:ok, _message_2} = CommonAPI.post_chat_message(recipient, user, "ho")
+
+ {:ok, chat} = Chat.get_or_create(user.id, recipient.ap_id)
+
+ message = MessageReference.last_message_for_chat(chat)
+
+ assert message.object.data["content"] == "ho"
+ end
+ end
+end
diff --git a/test/chat_test.exs b/test/chat_test.exs
new file mode 100644
index 000000000..332f2180a
--- /dev/null
+++ b/test/chat_test.exs
@@ -0,0 +1,61 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.ChatTest do
+ use Pleroma.DataCase, async: true
+
+ alias Pleroma.Chat
+
+ import Pleroma.Factory
+
+ describe "creation and getting" do
+ test "it only works if the recipient is a valid user (for now)" do
+ user = insert(:user)
+
+ assert {:error, _chat} = Chat.bump_or_create(user.id, "http://some/nonexisting/account")
+ assert {:error, _chat} = Chat.get_or_create(user.id, "http://some/nonexisting/account")
+ end
+
+ test "it creates a chat for a user and recipient" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, chat} = Chat.bump_or_create(user.id, other_user.ap_id)
+
+ assert chat.id
+ end
+
+ test "it returns and bumps a chat for a user and recipient if it already exists" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, chat} = Chat.bump_or_create(user.id, other_user.ap_id)
+ {:ok, chat_two} = Chat.bump_or_create(user.id, other_user.ap_id)
+
+ assert chat.id == chat_two.id
+ end
+
+ test "it returns a chat for a user and recipient if it already exists" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
+ {:ok, chat_two} = Chat.get_or_create(user.id, other_user.ap_id)
+
+ assert chat.id == chat_two.id
+ end
+
+ test "a returning chat will have an updated `update_at` field" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, chat} = Chat.bump_or_create(user.id, other_user.ap_id)
+ :timer.sleep(1500)
+ {:ok, chat_two} = Chat.bump_or_create(user.id, other_user.ap_id)
+
+ assert chat.id == chat_two.id
+ assert chat.updated_at != chat_two.updated_at
+ end
+ end
+end
diff --git a/test/config/config_db_test.exs b/test/config/config_db_test.exs
index 336de7359..3895e2cda 100644
--- a/test/config/config_db_test.exs
+++ b/test/config/config_db_test.exs
@@ -7,40 +7,28 @@ defmodule Pleroma.ConfigDBTest do
import Pleroma.Factory
alias Pleroma.ConfigDB
- test "get_by_key/1" do
+ test "get_by_params/1" do
config = insert(:config)
insert(:config)
assert config == ConfigDB.get_by_params(%{group: config.group, key: config.key})
end
- test "create/1" do
- {:ok, config} = ConfigDB.create(%{group: ":pleroma", key: ":some_key", value: "some_value"})
- assert config == ConfigDB.get_by_params(%{group: ":pleroma", key: ":some_key"})
- end
-
- test "update/1" do
- config = insert(:config)
- {:ok, updated} = ConfigDB.update(config, %{value: "some_value"})
- loaded = ConfigDB.get_by_params(%{group: config.group, key: config.key})
- assert loaded == updated
- end
-
test "get_all_as_keyword/0" do
saved = insert(:config)
- insert(:config, group: ":quack", key: ":level", value: ConfigDB.to_binary(:info))
- insert(:config, group: ":quack", key: ":meta", value: ConfigDB.to_binary([:none]))
+ insert(:config, group: ":quack", key: ":level", value: :info)
+ insert(:config, group: ":quack", key: ":meta", value: [:none])
insert(:config,
group: ":quack",
key: ":webhook_url",
- value: ConfigDB.to_binary("https://hooks.slack.com/services/KEY/some_val")
+ value: "https://hooks.slack.com/services/KEY/some_val"
)
config = ConfigDB.get_all_as_keyword()
assert config[:pleroma] == [
- {ConfigDB.from_string(saved.key), ConfigDB.from_binary(saved.value)}
+ {saved.key, saved.value}
]
assert config[:quack][:level] == :info
@@ -51,11 +39,11 @@ test "get_all_as_keyword/0" do
describe "update_or_create/1" do
test "common" do
config = insert(:config)
- key2 = "another_key"
+ key2 = :another_key
params = [
- %{group: "pleroma", key: key2, value: "another_value"},
- %{group: config.group, key: config.key, value: "new_value"}
+ %{group: :pleroma, key: key2, value: "another_value"},
+ %{group: :pleroma, key: config.key, value: [a: 1, b: 2, c: "new_value"]}
]
assert Repo.all(ConfigDB) |> length() == 1
@@ -65,16 +53,16 @@ test "common" do
assert Repo.all(ConfigDB) |> length() == 2
config1 = ConfigDB.get_by_params(%{group: config.group, key: config.key})
- config2 = ConfigDB.get_by_params(%{group: "pleroma", key: key2})
+ config2 = ConfigDB.get_by_params(%{group: :pleroma, key: key2})
- assert config1.value == ConfigDB.transform("new_value")
- assert config2.value == ConfigDB.transform("another_value")
+ assert config1.value == [a: 1, b: 2, c: "new_value"]
+ assert config2.value == "another_value"
end
test "partial update" do
- config = insert(:config, value: ConfigDB.to_binary(key1: "val1", key2: :val2))
+ config = insert(:config, value: [key1: "val1", key2: :val2])
- {:ok, _config} =
+ {:ok, config} =
ConfigDB.update_or_create(%{
group: config.group,
key: config.key,
@@ -83,15 +71,14 @@ test "partial update" do
updated = ConfigDB.get_by_params(%{group: config.group, key: config.key})
- value = ConfigDB.from_binary(updated.value)
- assert length(value) == 3
- assert value[:key1] == :val1
- assert value[:key2] == :val2
- assert value[:key3] == :val3
+ assert config.value == updated.value
+ assert updated.value[:key1] == :val1
+ assert updated.value[:key2] == :val2
+ assert updated.value[:key3] == :val3
end
test "deep merge" do
- config = insert(:config, value: ConfigDB.to_binary(key1: "val1", key2: [k1: :v1, k2: "v2"]))
+ config = insert(:config, value: [key1: "val1", key2: [k1: :v1, k2: "v2"]])
{:ok, config} =
ConfigDB.update_or_create(%{
@@ -103,18 +90,15 @@ test "deep merge" do
updated = ConfigDB.get_by_params(%{group: config.group, key: config.key})
assert config.value == updated.value
-
- value = ConfigDB.from_binary(updated.value)
- assert value[:key1] == :val1
- assert value[:key2] == [k1: :v1, k2: :v2, k3: :v3]
- assert value[:key3] == :val3
+ assert updated.value[:key1] == :val1
+ assert updated.value[:key2] == [k1: :v1, k2: :v2, k3: :v3]
+ assert updated.value[:key3] == :val3
end
test "only full update for some keys" do
- config1 = insert(:config, key: ":ecto_repos", value: ConfigDB.to_binary(repo: Pleroma.Repo))
+ config1 = insert(:config, key: :ecto_repos, value: [repo: Pleroma.Repo])
- config2 =
- insert(:config, group: ":cors_plug", key: ":max_age", value: ConfigDB.to_binary(18))
+ config2 = insert(:config, group: :cors_plug, key: :max_age, value: 18)
{:ok, _config} =
ConfigDB.update_or_create(%{
@@ -133,8 +117,8 @@ test "only full update for some keys" do
updated1 = ConfigDB.get_by_params(%{group: config1.group, key: config1.key})
updated2 = ConfigDB.get_by_params(%{group: config2.group, key: config2.key})
- assert ConfigDB.from_binary(updated1.value) == [another_repo: [Pleroma.Repo]]
- assert ConfigDB.from_binary(updated2.value) == 777
+ assert updated1.value == [another_repo: [Pleroma.Repo]]
+ assert updated2.value == 777
end
test "full update if value is not keyword" do
@@ -142,7 +126,7 @@ test "full update if value is not keyword" do
insert(:config,
group: ":tesla",
key: ":adapter",
- value: ConfigDB.to_binary(Tesla.Adapter.Hackney)
+ value: Tesla.Adapter.Hackney
)
{:ok, _config} =
@@ -154,20 +138,20 @@ test "full update if value is not keyword" do
updated = ConfigDB.get_by_params(%{group: config.group, key: config.key})
- assert ConfigDB.from_binary(updated.value) == Tesla.Adapter.Httpc
+ assert updated.value == Tesla.Adapter.Httpc
end
test "only full update for some subkeys" do
config1 =
insert(:config,
key: ":emoji",
- value: ConfigDB.to_binary(groups: [a: 1, b: 2], key: [a: 1])
+ value: [groups: [a: 1, b: 2], key: [a: 1]]
)
config2 =
insert(:config,
key: ":assets",
- value: ConfigDB.to_binary(mascots: [a: 1, b: 2], key: [a: 1])
+ value: [mascots: [a: 1, b: 2], key: [a: 1]]
)
{:ok, _config} =
@@ -187,8 +171,8 @@ test "only full update for some subkeys" do
updated1 = ConfigDB.get_by_params(%{group: config1.group, key: config1.key})
updated2 = ConfigDB.get_by_params(%{group: config2.group, key: config2.key})
- assert ConfigDB.from_binary(updated1.value) == [groups: [c: 3, d: 4], key: [a: 1, b: 2]]
- assert ConfigDB.from_binary(updated2.value) == [mascots: [c: 3, d: 4], key: [a: 1, b: 2]]
+ assert updated1.value == [groups: [c: 3, d: 4], key: [a: 1, b: 2]]
+ assert updated2.value == [mascots: [c: 3, d: 4], key: [a: 1, b: 2]]
end
end
@@ -206,14 +190,14 @@ test "full delete" do
end
test "partial subkeys delete" do
- config = insert(:config, value: ConfigDB.to_binary(groups: [a: 1, b: 2], key: [a: 1]))
+ config = insert(:config, value: [groups: [a: 1, b: 2], key: [a: 1]])
{:ok, deleted} =
ConfigDB.delete(%{group: config.group, key: config.key, subkeys: [":groups"]})
assert Ecto.get_meta(deleted, :state) == :loaded
- assert deleted.value == ConfigDB.to_binary(key: [a: 1])
+ assert deleted.value == [key: [a: 1]]
updated = ConfigDB.get_by_params(%{group: config.group, key: config.key})
@@ -221,7 +205,7 @@ test "partial subkeys delete" do
end
test "full delete if remaining value after subkeys deletion is empty list" do
- config = insert(:config, value: ConfigDB.to_binary(groups: [a: 1, b: 2]))
+ config = insert(:config, value: [groups: [a: 1, b: 2]])
{:ok, deleted} =
ConfigDB.delete(%{group: config.group, key: config.key, subkeys: [":groups"]})
@@ -232,234 +216,159 @@ test "full delete if remaining value after subkeys deletion is empty list" do
end
end
- describe "transform/1" do
+ describe "to_elixir_types/1" do
test "string" do
- binary = ConfigDB.transform("value as string")
- assert binary == :erlang.term_to_binary("value as string")
- assert ConfigDB.from_binary(binary) == "value as string"
+ assert ConfigDB.to_elixir_types("value as string") == "value as string"
end
test "boolean" do
- binary = ConfigDB.transform(false)
- assert binary == :erlang.term_to_binary(false)
- assert ConfigDB.from_binary(binary) == false
+ assert ConfigDB.to_elixir_types(false) == false
end
test "nil" do
- binary = ConfigDB.transform(nil)
- assert binary == :erlang.term_to_binary(nil)
- assert ConfigDB.from_binary(binary) == nil
+ assert ConfigDB.to_elixir_types(nil) == nil
end
test "integer" do
- binary = ConfigDB.transform(150)
- assert binary == :erlang.term_to_binary(150)
- assert ConfigDB.from_binary(binary) == 150
+ assert ConfigDB.to_elixir_types(150) == 150
end
test "atom" do
- binary = ConfigDB.transform(":atom")
- assert binary == :erlang.term_to_binary(:atom)
- assert ConfigDB.from_binary(binary) == :atom
+ assert ConfigDB.to_elixir_types(":atom") == :atom
end
test "ssl options" do
- binary = ConfigDB.transform([":tlsv1", ":tlsv1.1", ":tlsv1.2"])
- assert binary == :erlang.term_to_binary([:tlsv1, :"tlsv1.1", :"tlsv1.2"])
- assert ConfigDB.from_binary(binary) == [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
+ assert ConfigDB.to_elixir_types([":tlsv1", ":tlsv1.1", ":tlsv1.2"]) == [
+ :tlsv1,
+ :"tlsv1.1",
+ :"tlsv1.2"
+ ]
end
test "pleroma module" do
- binary = ConfigDB.transform("Pleroma.Bookmark")
- assert binary == :erlang.term_to_binary(Pleroma.Bookmark)
- assert ConfigDB.from_binary(binary) == Pleroma.Bookmark
+ assert ConfigDB.to_elixir_types("Pleroma.Bookmark") == Pleroma.Bookmark
end
test "pleroma string" do
- binary = ConfigDB.transform("Pleroma")
- assert binary == :erlang.term_to_binary("Pleroma")
- assert ConfigDB.from_binary(binary) == "Pleroma"
+ assert ConfigDB.to_elixir_types("Pleroma") == "Pleroma"
end
test "phoenix module" do
- binary = ConfigDB.transform("Phoenix.Socket.V1.JSONSerializer")
- assert binary == :erlang.term_to_binary(Phoenix.Socket.V1.JSONSerializer)
- assert ConfigDB.from_binary(binary) == Phoenix.Socket.V1.JSONSerializer
+ assert ConfigDB.to_elixir_types("Phoenix.Socket.V1.JSONSerializer") ==
+ Phoenix.Socket.V1.JSONSerializer
end
test "tesla module" do
- binary = ConfigDB.transform("Tesla.Adapter.Hackney")
- assert binary == :erlang.term_to_binary(Tesla.Adapter.Hackney)
- assert ConfigDB.from_binary(binary) == Tesla.Adapter.Hackney
+ assert ConfigDB.to_elixir_types("Tesla.Adapter.Hackney") == Tesla.Adapter.Hackney
end
test "ExSyslogger module" do
- binary = ConfigDB.transform("ExSyslogger")
- assert binary == :erlang.term_to_binary(ExSyslogger)
- assert ConfigDB.from_binary(binary) == ExSyslogger
+ assert ConfigDB.to_elixir_types("ExSyslogger") == ExSyslogger
end
test "Quack.Logger module" do
- binary = ConfigDB.transform("Quack.Logger")
- assert binary == :erlang.term_to_binary(Quack.Logger)
- assert ConfigDB.from_binary(binary) == Quack.Logger
+ assert ConfigDB.to_elixir_types("Quack.Logger") == Quack.Logger
end
test "Swoosh.Adapters modules" do
- binary = ConfigDB.transform("Swoosh.Adapters.SMTP")
- assert binary == :erlang.term_to_binary(Swoosh.Adapters.SMTP)
- assert ConfigDB.from_binary(binary) == Swoosh.Adapters.SMTP
- binary = ConfigDB.transform("Swoosh.Adapters.AmazonSES")
- assert binary == :erlang.term_to_binary(Swoosh.Adapters.AmazonSES)
- assert ConfigDB.from_binary(binary) == Swoosh.Adapters.AmazonSES
+ assert ConfigDB.to_elixir_types("Swoosh.Adapters.SMTP") == Swoosh.Adapters.SMTP
+ assert ConfigDB.to_elixir_types("Swoosh.Adapters.AmazonSES") == Swoosh.Adapters.AmazonSES
end
test "sigil" do
- binary = ConfigDB.transform("~r[comp[lL][aA][iI][nN]er]")
- assert binary == :erlang.term_to_binary(~r/comp[lL][aA][iI][nN]er/)
- assert ConfigDB.from_binary(binary) == ~r/comp[lL][aA][iI][nN]er/
+ assert ConfigDB.to_elixir_types("~r[comp[lL][aA][iI][nN]er]") == ~r/comp[lL][aA][iI][nN]er/
end
test "link sigil" do
- binary = ConfigDB.transform("~r/https:\/\/example.com/")
- assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/)
- assert ConfigDB.from_binary(binary) == ~r/https:\/\/example.com/
+ assert ConfigDB.to_elixir_types("~r/https:\/\/example.com/") == ~r/https:\/\/example.com/
end
test "link sigil with um modifiers" do
- binary = ConfigDB.transform("~r/https:\/\/example.com/um")
- assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/um)
- assert ConfigDB.from_binary(binary) == ~r/https:\/\/example.com/um
+ assert ConfigDB.to_elixir_types("~r/https:\/\/example.com/um") ==
+ ~r/https:\/\/example.com/um
end
test "link sigil with i modifier" do
- binary = ConfigDB.transform("~r/https:\/\/example.com/i")
- assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/i)
- assert ConfigDB.from_binary(binary) == ~r/https:\/\/example.com/i
+ assert ConfigDB.to_elixir_types("~r/https:\/\/example.com/i") == ~r/https:\/\/example.com/i
end
test "link sigil with s modifier" do
- binary = ConfigDB.transform("~r/https:\/\/example.com/s")
- assert binary == :erlang.term_to_binary(~r/https:\/\/example.com/s)
- assert ConfigDB.from_binary(binary) == ~r/https:\/\/example.com/s
+ assert ConfigDB.to_elixir_types("~r/https:\/\/example.com/s") == ~r/https:\/\/example.com/s
end
test "raise if valid delimiter not found" do
assert_raise ArgumentError, "valid delimiter for Regex expression not found", fn ->
- ConfigDB.transform("~r/https://[]{}<>\"'()|example.com/s")
+ ConfigDB.to_elixir_types("~r/https://[]{}<>\"'()|example.com/s")
end
end
test "2 child tuple" do
- binary = ConfigDB.transform(%{"tuple" => ["v1", ":v2"]})
- assert binary == :erlang.term_to_binary({"v1", :v2})
- assert ConfigDB.from_binary(binary) == {"v1", :v2}
+ assert ConfigDB.to_elixir_types(%{"tuple" => ["v1", ":v2"]}) == {"v1", :v2}
end
test "proxy tuple with localhost" do
- binary =
- ConfigDB.transform(%{
- "tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]
- })
-
- assert binary == :erlang.term_to_binary({:proxy_url, {:socks5, :localhost, 1234}})
- assert ConfigDB.from_binary(binary) == {:proxy_url, {:socks5, :localhost, 1234}}
+ assert ConfigDB.to_elixir_types(%{
+ "tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]
+ }) == {:proxy_url, {:socks5, :localhost, 1234}}
end
test "proxy tuple with domain" do
- binary =
- ConfigDB.transform(%{
- "tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]
- })
-
- assert binary == :erlang.term_to_binary({:proxy_url, {:socks5, 'domain.com', 1234}})
- assert ConfigDB.from_binary(binary) == {:proxy_url, {:socks5, 'domain.com', 1234}}
+ assert ConfigDB.to_elixir_types(%{
+ "tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]
+ }) == {:proxy_url, {:socks5, 'domain.com', 1234}}
end
test "proxy tuple with ip" do
- binary =
- ConfigDB.transform(%{
- "tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]
- })
-
- assert binary == :erlang.term_to_binary({:proxy_url, {:socks5, {127, 0, 0, 1}, 1234}})
- assert ConfigDB.from_binary(binary) == {:proxy_url, {:socks5, {127, 0, 0, 1}, 1234}}
+ assert ConfigDB.to_elixir_types(%{
+ "tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]
+ }) == {:proxy_url, {:socks5, {127, 0, 0, 1}, 1234}}
end
test "tuple with n childs" do
- binary =
- ConfigDB.transform(%{
- "tuple" => [
- "v1",
- ":v2",
- "Pleroma.Bookmark",
- 150,
- false,
- "Phoenix.Socket.V1.JSONSerializer"
- ]
- })
-
- assert binary ==
- :erlang.term_to_binary(
- {"v1", :v2, Pleroma.Bookmark, 150, false, Phoenix.Socket.V1.JSONSerializer}
- )
-
- assert ConfigDB.from_binary(binary) ==
- {"v1", :v2, Pleroma.Bookmark, 150, false, Phoenix.Socket.V1.JSONSerializer}
+ assert ConfigDB.to_elixir_types(%{
+ "tuple" => [
+ "v1",
+ ":v2",
+ "Pleroma.Bookmark",
+ 150,
+ false,
+ "Phoenix.Socket.V1.JSONSerializer"
+ ]
+ }) == {"v1", :v2, Pleroma.Bookmark, 150, false, Phoenix.Socket.V1.JSONSerializer}
end
test "map with string key" do
- binary = ConfigDB.transform(%{"key" => "value"})
- assert binary == :erlang.term_to_binary(%{"key" => "value"})
- assert ConfigDB.from_binary(binary) == %{"key" => "value"}
+ assert ConfigDB.to_elixir_types(%{"key" => "value"}) == %{"key" => "value"}
end
test "map with atom key" do
- binary = ConfigDB.transform(%{":key" => "value"})
- assert binary == :erlang.term_to_binary(%{key: "value"})
- assert ConfigDB.from_binary(binary) == %{key: "value"}
+ assert ConfigDB.to_elixir_types(%{":key" => "value"}) == %{key: "value"}
end
test "list of strings" do
- binary = ConfigDB.transform(["v1", "v2", "v3"])
- assert binary == :erlang.term_to_binary(["v1", "v2", "v3"])
- assert ConfigDB.from_binary(binary) == ["v1", "v2", "v3"]
+ assert ConfigDB.to_elixir_types(["v1", "v2", "v3"]) == ["v1", "v2", "v3"]
end
test "list of modules" do
- binary = ConfigDB.transform(["Pleroma.Repo", "Pleroma.Activity"])
- assert binary == :erlang.term_to_binary([Pleroma.Repo, Pleroma.Activity])
- assert ConfigDB.from_binary(binary) == [Pleroma.Repo, Pleroma.Activity]
+ assert ConfigDB.to_elixir_types(["Pleroma.Repo", "Pleroma.Activity"]) == [
+ Pleroma.Repo,
+ Pleroma.Activity
+ ]
end
test "list of atoms" do
- binary = ConfigDB.transform([":v1", ":v2", ":v3"])
- assert binary == :erlang.term_to_binary([:v1, :v2, :v3])
- assert ConfigDB.from_binary(binary) == [:v1, :v2, :v3]
+ assert ConfigDB.to_elixir_types([":v1", ":v2", ":v3"]) == [:v1, :v2, :v3]
end
test "list of mixed values" do
- binary =
- ConfigDB.transform([
- "v1",
- ":v2",
- "Pleroma.Repo",
- "Phoenix.Socket.V1.JSONSerializer",
- 15,
- false
- ])
-
- assert binary ==
- :erlang.term_to_binary([
- "v1",
- :v2,
- Pleroma.Repo,
- Phoenix.Socket.V1.JSONSerializer,
- 15,
- false
- ])
-
- assert ConfigDB.from_binary(binary) == [
+ assert ConfigDB.to_elixir_types([
+ "v1",
+ ":v2",
+ "Pleroma.Repo",
+ "Phoenix.Socket.V1.JSONSerializer",
+ 15,
+ false
+ ]) == [
"v1",
:v2,
Pleroma.Repo,
@@ -470,40 +379,17 @@ test "list of mixed values" do
end
test "simple keyword" do
- binary = ConfigDB.transform([%{"tuple" => [":key", "value"]}])
- assert binary == :erlang.term_to_binary([{:key, "value"}])
- assert ConfigDB.from_binary(binary) == [{:key, "value"}]
- assert ConfigDB.from_binary(binary) == [key: "value"]
- end
-
- test "keyword with partial_chain key" do
- binary =
- ConfigDB.transform([%{"tuple" => [":partial_chain", "&:hackney_connect.partial_chain/1"]}])
-
- assert binary == :erlang.term_to_binary(partial_chain: &:hackney_connect.partial_chain/1)
- assert ConfigDB.from_binary(binary) == [partial_chain: &:hackney_connect.partial_chain/1]
+ assert ConfigDB.to_elixir_types([%{"tuple" => [":key", "value"]}]) == [key: "value"]
end
test "keyword" do
- binary =
- ConfigDB.transform([
- %{"tuple" => [":types", "Pleroma.PostgresTypes"]},
- %{"tuple" => [":telemetry_event", ["Pleroma.Repo.Instrumenter"]]},
- %{"tuple" => [":migration_lock", nil]},
- %{"tuple" => [":key1", 150]},
- %{"tuple" => [":key2", "string"]}
- ])
-
- assert binary ==
- :erlang.term_to_binary(
- types: Pleroma.PostgresTypes,
- telemetry_event: [Pleroma.Repo.Instrumenter],
- migration_lock: nil,
- key1: 150,
- key2: "string"
- )
-
- assert ConfigDB.from_binary(binary) == [
+ assert ConfigDB.to_elixir_types([
+ %{"tuple" => [":types", "Pleroma.PostgresTypes"]},
+ %{"tuple" => [":telemetry_event", ["Pleroma.Repo.Instrumenter"]]},
+ %{"tuple" => [":migration_lock", nil]},
+ %{"tuple" => [":key1", 150]},
+ %{"tuple" => [":key2", "string"]}
+ ]) == [
types: Pleroma.PostgresTypes,
telemetry_event: [Pleroma.Repo.Instrumenter],
migration_lock: nil,
@@ -512,86 +398,60 @@ test "keyword" do
]
end
- test "complex keyword with nested mixed childs" do
- binary =
- ConfigDB.transform([
- %{"tuple" => [":uploader", "Pleroma.Uploaders.Local"]},
- %{"tuple" => [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
- %{"tuple" => [":link_name", true]},
- %{"tuple" => [":proxy_remote", false]},
- %{"tuple" => [":common_map", %{":key" => "value"}]},
- %{
- "tuple" => [
- ":proxy_opts",
- [
- %{"tuple" => [":redirect_on_failure", false]},
- %{"tuple" => [":max_body_length", 1_048_576]},
- %{
- "tuple" => [
- ":http",
- [%{"tuple" => [":follow_redirect", true]}, %{"tuple" => [":pool", ":upload"]}]
- ]
- }
- ]
- ]
- }
- ])
+ test "trandformed keyword" do
+ assert ConfigDB.to_elixir_types(a: 1, b: 2, c: "string") == [a: 1, b: 2, c: "string"]
+ end
- assert binary ==
- :erlang.term_to_binary(
- uploader: Pleroma.Uploaders.Local,
- filters: [Pleroma.Upload.Filter.Dedupe],
- link_name: true,
- proxy_remote: false,
- common_map: %{key: "value"},
- proxy_opts: [
- redirect_on_failure: false,
- max_body_length: 1_048_576,
- http: [
- follow_redirect: true,
- pool: :upload
+ test "complex keyword with nested mixed childs" do
+ assert ConfigDB.to_elixir_types([
+ %{"tuple" => [":uploader", "Pleroma.Uploaders.Local"]},
+ %{"tuple" => [":filters", ["Pleroma.Upload.Filter.Dedupe"]]},
+ %{"tuple" => [":link_name", true]},
+ %{"tuple" => [":proxy_remote", false]},
+ %{"tuple" => [":common_map", %{":key" => "value"}]},
+ %{
+ "tuple" => [
+ ":proxy_opts",
+ [
+ %{"tuple" => [":redirect_on_failure", false]},
+ %{"tuple" => [":max_body_length", 1_048_576]},
+ %{
+ "tuple" => [
+ ":http",
+ [
+ %{"tuple" => [":follow_redirect", true]},
+ %{"tuple" => [":pool", ":upload"]}
+ ]
+ ]
+ }
]
]
- )
-
- assert ConfigDB.from_binary(binary) ==
- [
- uploader: Pleroma.Uploaders.Local,
- filters: [Pleroma.Upload.Filter.Dedupe],
- link_name: true,
- proxy_remote: false,
- common_map: %{key: "value"},
- proxy_opts: [
- redirect_on_failure: false,
- max_body_length: 1_048_576,
- http: [
- follow_redirect: true,
- pool: :upload
- ]
+ }
+ ]) == [
+ uploader: Pleroma.Uploaders.Local,
+ filters: [Pleroma.Upload.Filter.Dedupe],
+ link_name: true,
+ proxy_remote: false,
+ common_map: %{key: "value"},
+ proxy_opts: [
+ redirect_on_failure: false,
+ max_body_length: 1_048_576,
+ http: [
+ follow_redirect: true,
+ pool: :upload
]
]
+ ]
end
test "common keyword" do
- binary =
- ConfigDB.transform([
- %{"tuple" => [":level", ":warn"]},
- %{"tuple" => [":meta", [":all"]]},
- %{"tuple" => [":path", ""]},
- %{"tuple" => [":val", nil]},
- %{"tuple" => [":webhook_url", "https://hooks.slack.com/services/YOUR-KEY-HERE"]}
- ])
-
- assert binary ==
- :erlang.term_to_binary(
- level: :warn,
- meta: [:all],
- path: "",
- val: nil,
- webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
- )
-
- assert ConfigDB.from_binary(binary) == [
+ assert ConfigDB.to_elixir_types([
+ %{"tuple" => [":level", ":warn"]},
+ %{"tuple" => [":meta", [":all"]]},
+ %{"tuple" => [":path", ""]},
+ %{"tuple" => [":val", nil]},
+ %{"tuple" => [":webhook_url", "https://hooks.slack.com/services/YOUR-KEY-HERE"]}
+ ]) == [
level: :warn,
meta: [:all],
path: "",
@@ -601,98 +461,73 @@ test "common keyword" do
end
test "complex keyword with sigil" do
- binary =
- ConfigDB.transform([
- %{"tuple" => [":federated_timeline_removal", []]},
- %{"tuple" => [":reject", ["~r/comp[lL][aA][iI][nN]er/"]]},
- %{"tuple" => [":replace", []]}
- ])
-
- assert binary ==
- :erlang.term_to_binary(
- federated_timeline_removal: [],
- reject: [~r/comp[lL][aA][iI][nN]er/],
- replace: []
- )
-
- assert ConfigDB.from_binary(binary) ==
- [federated_timeline_removal: [], reject: [~r/comp[lL][aA][iI][nN]er/], replace: []]
+ assert ConfigDB.to_elixir_types([
+ %{"tuple" => [":federated_timeline_removal", []]},
+ %{"tuple" => [":reject", ["~r/comp[lL][aA][iI][nN]er/"]]},
+ %{"tuple" => [":replace", []]}
+ ]) == [
+ federated_timeline_removal: [],
+ reject: [~r/comp[lL][aA][iI][nN]er/],
+ replace: []
+ ]
end
test "complex keyword with tuples with more than 2 values" do
- binary =
- ConfigDB.transform([
- %{
- "tuple" => [
- ":http",
- [
- %{
- "tuple" => [
- ":key1",
- [
- %{
- "tuple" => [
- ":_",
- [
- %{
- "tuple" => [
- "/api/v1/streaming",
- "Pleroma.Web.MastodonAPI.WebsocketHandler",
- []
- ]
- },
- %{
- "tuple" => [
- "/websocket",
- "Phoenix.Endpoint.CowboyWebSocket",
- %{
- "tuple" => [
- "Phoenix.Transports.WebSocket",
- %{
- "tuple" => [
- "Pleroma.Web.Endpoint",
- "Pleroma.Web.UserSocket",
- []
- ]
- }
- ]
- }
- ]
- },
- %{
- "tuple" => [
- ":_",
- "Phoenix.Endpoint.Cowboy2Handler",
- %{"tuple" => ["Pleroma.Web.Endpoint", []]}
- ]
- }
- ]
- ]
- }
- ]
- ]
- }
- ]
- ]
- }
- ])
-
- assert binary ==
- :erlang.term_to_binary(
- http: [
- key1: [
- _: [
- {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
- {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
- {Phoenix.Transports.WebSocket,
- {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, []}}},
- {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
- ]
+ assert ConfigDB.to_elixir_types([
+ %{
+ "tuple" => [
+ ":http",
+ [
+ %{
+ "tuple" => [
+ ":key1",
+ [
+ %{
+ "tuple" => [
+ ":_",
+ [
+ %{
+ "tuple" => [
+ "/api/v1/streaming",
+ "Pleroma.Web.MastodonAPI.WebsocketHandler",
+ []
+ ]
+ },
+ %{
+ "tuple" => [
+ "/websocket",
+ "Phoenix.Endpoint.CowboyWebSocket",
+ %{
+ "tuple" => [
+ "Phoenix.Transports.WebSocket",
+ %{
+ "tuple" => [
+ "Pleroma.Web.Endpoint",
+ "Pleroma.Web.UserSocket",
+ []
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ %{
+ "tuple" => [
+ ":_",
+ "Phoenix.Endpoint.Cowboy2Handler",
+ %{"tuple" => ["Pleroma.Web.Endpoint", []]}
+ ]
+ }
+ ]
+ ]
+ }
+ ]
+ ]
+ }
]
]
- )
-
- assert ConfigDB.from_binary(binary) == [
+ }
+ ]) == [
http: [
key1: [
{:_,
diff --git a/test/config/deprecation_warnings_test.exs b/test/config/deprecation_warnings_test.exs
new file mode 100644
index 000000000..548ee87b0
--- /dev/null
+++ b/test/config/deprecation_warnings_test.exs
@@ -0,0 +1,57 @@
+defmodule Pleroma.Config.DeprecationWarningsTest do
+ use ExUnit.Case, async: true
+ use Pleroma.Tests.Helpers
+
+ import ExUnit.CaptureLog
+
+ test "check_old_mrf_config/0" do
+ clear_config([:instance, :rewrite_policy], Pleroma.Web.ActivityPub.MRF.NoOpPolicy)
+ clear_config([:instance, :mrf_transparency], true)
+ clear_config([:instance, :mrf_transparency_exclusions], [])
+
+ assert capture_log(fn -> Pleroma.Config.DeprecationWarnings.check_old_mrf_config() end) =~
+ """
+ !!!DEPRECATION WARNING!!!
+ Your config is using old namespaces for MRF configuration. They should work for now, but you are advised to change to new namespaces to prevent possible issues later:
+
+ * `config :pleroma, :instance, rewrite_policy` is now `config :pleroma, :mrf, policies`
+ * `config :pleroma, :instance, mrf_transparency` is now `config :pleroma, :mrf, transparency`
+ * `config :pleroma, :instance, mrf_transparency_exclusions` is now `config :pleroma, :mrf, transparency_exclusions`
+ """
+ end
+
+ test "move_namespace_and_warn/2" do
+ old_group1 = [:group, :key]
+ old_group2 = [:group, :key2]
+ old_group3 = [:group, :key3]
+
+ new_group1 = [:another_group, :key4]
+ new_group2 = [:another_group, :key5]
+ new_group3 = [:another_group, :key6]
+
+ clear_config(old_group1, 1)
+ clear_config(old_group2, 2)
+ clear_config(old_group3, 3)
+
+ clear_config(new_group1)
+ clear_config(new_group2)
+ clear_config(new_group3)
+
+ config_map = [
+ {old_group1, new_group1, "\n error :key"},
+ {old_group2, new_group2, "\n error :key2"},
+ {old_group3, new_group3, "\n error :key3"}
+ ]
+
+ assert capture_log(fn ->
+ Pleroma.Config.DeprecationWarnings.move_namespace_and_warn(
+ config_map,
+ "Warning preface"
+ )
+ end) =~ "Warning preface\n error :key\n error :key2\n error :key3"
+
+ assert Pleroma.Config.get(new_group1) == 1
+ assert Pleroma.Config.get(new_group2) == 2
+ assert Pleroma.Config.get(new_group3) == 3
+ end
+end
diff --git a/test/config/transfer_task_test.exs b/test/config/transfer_task_test.exs
index 473899d1d..f53829e09 100644
--- a/test/config/transfer_task_test.exs
+++ b/test/config/transfer_task_test.exs
@@ -6,9 +6,9 @@ defmodule Pleroma.Config.TransferTaskTest do
use Pleroma.DataCase
import ExUnit.CaptureLog
+ import Pleroma.Factory
alias Pleroma.Config.TransferTask
- alias Pleroma.ConfigDB
setup do: clear_config(:configurable_from_database, true)
@@ -19,31 +19,11 @@ test "transfer config values from db to env" do
refute Application.get_env(:postgrex, :test_key)
initial = Application.get_env(:logger, :level)
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":test_key",
- value: [live: 2, com: 3]
- })
-
- ConfigDB.create(%{
- group: ":idna",
- key: ":test_key",
- value: [live: 15, com: 35]
- })
-
- ConfigDB.create(%{
- group: ":quack",
- key: ":test_key",
- value: [:test_value1, :test_value2]
- })
-
- ConfigDB.create(%{
- group: ":postgrex",
- key: ":test_key",
- value: :value
- })
-
- ConfigDB.create(%{group: ":logger", key: ":level", value: :debug})
+ insert(:config, key: :test_key, value: [live: 2, com: 3])
+ insert(:config, group: :idna, key: :test_key, value: [live: 15, com: 35])
+ insert(:config, group: :quack, key: :test_key, value: [:test_value1, :test_value2])
+ insert(:config, group: :postgrex, key: :test_key, value: :value)
+ insert(:config, group: :logger, key: :level, value: :debug)
TransferTask.start_link([])
@@ -66,17 +46,8 @@ test "transfer config values for 1 group and some keys" do
level = Application.get_env(:quack, :level)
meta = Application.get_env(:quack, :meta)
- ConfigDB.create(%{
- group: ":quack",
- key: ":level",
- value: :info
- })
-
- ConfigDB.create(%{
- group: ":quack",
- key: ":meta",
- value: [:none]
- })
+ insert(:config, group: :quack, key: :level, value: :info)
+ insert(:config, group: :quack, key: :meta, value: [:none])
TransferTask.start_link([])
@@ -95,17 +66,8 @@ test "transfer config values with full subkey update" do
clear_config(:emoji)
clear_config(:assets)
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":emoji",
- value: [groups: [a: 1, b: 2]]
- })
-
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":assets",
- value: [mascots: [a: 1, b: 2]]
- })
+ insert(:config, key: :emoji, value: [groups: [a: 1, b: 2]])
+ insert(:config, key: :assets, value: [mascots: [a: 1, b: 2]])
TransferTask.start_link([])
@@ -122,12 +84,7 @@ test "transfer config values with full subkey update" do
test "don't restart if no reboot time settings were changed" do
clear_config(:emoji)
-
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":emoji",
- value: [groups: [a: 1, b: 2]]
- })
+ insert(:config, key: :emoji, value: [groups: [a: 1, b: 2]])
refute String.contains?(
capture_log(fn -> TransferTask.start_link([]) end),
@@ -137,25 +94,13 @@ test "don't restart if no reboot time settings were changed" do
test "on reboot time key" do
clear_config(:chat)
-
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":chat",
- value: [enabled: false]
- })
-
+ insert(:config, key: :chat, value: [enabled: false])
assert capture_log(fn -> TransferTask.start_link([]) end) =~ "pleroma restarted"
end
test "on reboot time subkey" do
clear_config(Pleroma.Captcha)
-
- ConfigDB.create(%{
- group: ":pleroma",
- key: "Pleroma.Captcha",
- value: [seconds_valid: 60]
- })
-
+ insert(:config, key: Pleroma.Captcha, value: [seconds_valid: 60])
assert capture_log(fn -> TransferTask.start_link([]) end) =~ "pleroma restarted"
end
@@ -163,17 +108,8 @@ test "don't restart pleroma on reboot time key and subkey if there is false flag
clear_config(:chat)
clear_config(Pleroma.Captcha)
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":chat",
- value: [enabled: false]
- })
-
- ConfigDB.create(%{
- group: ":pleroma",
- key: "Pleroma.Captcha",
- value: [seconds_valid: 60]
- })
+ insert(:config, key: :chat, value: [enabled: false])
+ insert(:config, key: Pleroma.Captcha, value: [seconds_valid: 60])
refute String.contains?(
capture_log(fn -> TransferTask.load_and_update_env([], false) end),
diff --git a/test/fixtures/config/temp.secret.exs b/test/fixtures/config/temp.secret.exs
index dc950ca30..fa8c7c7e8 100644
--- a/test/fixtures/config/temp.secret.exs
+++ b/test/fixtures/config/temp.secret.exs
@@ -9,3 +9,5 @@
config :pleroma, Pleroma.Repo, pool: Ecto.Adapters.SQL.Sandbox
config :postgrex, :json_library, Poison
+
+config :pleroma, :database, rum_enabled: true
diff --git a/test/fixtures/create-chat-message.json b/test/fixtures/create-chat-message.json
new file mode 100644
index 000000000..9c23a1c9b
--- /dev/null
+++ b/test/fixtures/create-chat-message.json
@@ -0,0 +1,31 @@
+{
+ "actor": "http://2hu.gensokyo/users/raymoo",
+ "id": "http://2hu.gensokyo/objects/1",
+ "object": {
+ "attributedTo": "http://2hu.gensokyo/users/raymoo",
+ "content": "You expected a cute girl? Too bad. ",
+ "id": "http://2hu.gensokyo/objects/2",
+ "published": "2020-02-12T14:08:20Z",
+ "to": [
+ "http://2hu.gensokyo/users/marisa"
+ ],
+ "tag": [
+ {
+ "icon": {
+ "type": "Image",
+ "url": "http://2hu.gensokyo/emoji/Firefox.gif"
+ },
+ "id": "http://2hu.gensokyo/emoji/Firefox.gif",
+ "name": ":firefox:",
+ "type": "Emoji",
+ "updated": "1970-01-01T00:00:00Z"
+ }
+ ],
+ "type": "ChatMessage"
+ },
+ "published": "2018-02-12T14:08:20Z",
+ "to": [
+ "http://2hu.gensokyo/users/marisa"
+ ],
+ "type": "Create"
+}
diff --git a/test/fixtures/preload_static/instance/panel.html b/test/fixtures/preload_static/instance/panel.html
new file mode 100644
index 000000000..fc58e4e93
--- /dev/null
+++ b/test/fixtures/preload_static/instance/panel.html
@@ -0,0 +1 @@
+HEY!
diff --git a/test/html_test.exs b/test/html_test.exs
index 0a4b4ebbc..f8907c8b4 100644
--- a/test/html_test.exs
+++ b/test/html_test.exs
@@ -237,5 +237,19 @@ test "does not crash when there is an HTML entity in a link" do
assert {:ok, nil} = HTML.extract_first_external_url(object, object.data["content"])
end
+
+ test "skips attachment links" do
+ user = insert(:user)
+
+ {:ok, activity} =
+ CommonAPI.post(user, %{
+ status:
+ "image.png"
+ })
+
+ object = Object.normalize(activity)
+
+ assert {:ok, nil} = HTML.extract_first_external_url(object, object.data["content"])
+ end
end
end
diff --git a/test/http/adapter_helper/hackney_test.exs b/test/http/adapter_helper/hackney_test.exs
index 3f7e708e0..f2361ff0b 100644
--- a/test/http/adapter_helper/hackney_test.exs
+++ b/test/http/adapter_helper/hackney_test.exs
@@ -31,17 +31,5 @@ test "respect connection opts and no proxy", %{uri: uri} do
assert opts[:b] == 1
refute Keyword.has_key?(opts, :proxy)
end
-
- test "add opts for https" do
- uri = URI.parse("https://domain.com")
-
- opts = Hackney.options(uri)
-
- assert opts[:ssl_options] == [
- partial_chain: &:hackney_connect.partial_chain/1,
- versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"],
- server_name_indication: 'domain.com'
- ]
- end
end
end
diff --git a/test/http/ex_aws_test.exs b/test/http/ex_aws_test.exs
new file mode 100644
index 000000000..d0b00ca26
--- /dev/null
+++ b/test/http/ex_aws_test.exs
@@ -0,0 +1,54 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.HTTP.ExAwsTest do
+ use ExUnit.Case
+
+ import Tesla.Mock
+ alias Pleroma.HTTP
+
+ @url "https://s3.amazonaws.com/test_bucket/test_image.jpg"
+
+ setup do
+ mock(fn
+ %{method: :get, url: @url, headers: [{"x-amz-bucket-region", "us-east-1"}]} ->
+ %Tesla.Env{
+ status: 200,
+ body: "image-content",
+ headers: [{"x-amz-bucket-region", "us-east-1"}]
+ }
+
+ %{method: :post, url: @url, body: "image-content-2"} ->
+ %Tesla.Env{status: 200, body: "image-content-2"}
+ end)
+
+ :ok
+ end
+
+ describe "request" do
+ test "get" do
+ assert HTTP.ExAws.request(:get, @url, "", [{"x-amz-bucket-region", "us-east-1"}]) == {
+ :ok,
+ %{
+ body: "image-content",
+ headers: [{"x-amz-bucket-region", "us-east-1"}],
+ status_code: 200
+ }
+ }
+ end
+
+ test "post" do
+ assert HTTP.ExAws.request(:post, @url, "image-content-2", [
+ {"x-amz-bucket-region", "us-east-1"}
+ ]) == {
+ :ok,
+ %{
+ body: "image-content-2",
+ headers: [],
+ status_code: 200
+ }
+ }
+ end
+ end
+end
diff --git a/test/http/tzdata_test.exs b/test/http/tzdata_test.exs
new file mode 100644
index 000000000..3e605d33b
--- /dev/null
+++ b/test/http/tzdata_test.exs
@@ -0,0 +1,35 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.HTTP.TzdataTest do
+ use ExUnit.Case
+
+ import Tesla.Mock
+ alias Pleroma.HTTP
+ @url "https://data.iana.org/time-zones/tzdata-latest.tar.gz"
+
+ setup do
+ mock(fn
+ %{method: :head, url: @url} ->
+ %Tesla.Env{status: 200, body: ""}
+
+ %{method: :get, url: @url} ->
+ %Tesla.Env{status: 200, body: "hello"}
+ end)
+
+ :ok
+ end
+
+ describe "head/1" do
+ test "returns successfully result" do
+ assert HTTP.Tzdata.head(@url, [], []) == {:ok, {200, []}}
+ end
+ end
+
+ describe "get/1" do
+ test "returns successfully result" do
+ assert HTTP.Tzdata.get(@url, [], []) == {:ok, {200, [], "hello"}}
+ end
+ end
+end
diff --git a/test/http_test.exs b/test/http_test.exs
index 618485b55..d394bb942 100644
--- a/test/http_test.exs
+++ b/test/http_test.exs
@@ -17,6 +17,9 @@ defmodule Pleroma.HTTPTest do
} ->
json(%{"my" => "data"})
+ %{method: :head, url: "http://example.com/hello"} ->
+ %Tesla.Env{status: 200, body: ""}
+
%{method: :get, url: "http://example.com/hello"} ->
%Tesla.Env{status: 200, body: "hello"}
@@ -27,6 +30,12 @@ defmodule Pleroma.HTTPTest do
:ok
end
+ describe "head/1" do
+ test "returns successfully result" do
+ assert HTTP.head("http://example.com/hello") == {:ok, %Tesla.Env{status: 200, body: ""}}
+ end
+ end
+
describe "get/1" do
test "returns successfully result" do
assert HTTP.get("http://example.com/hello") == {
diff --git a/test/instance_static/emoji/test_pack/blank2.png b/test/instance_static/emoji/test_pack/blank2.png
new file mode 100644
index 000000000..8f50fa023
Binary files /dev/null and b/test/instance_static/emoji/test_pack/blank2.png differ
diff --git a/test/instance_static/emoji/test_pack/pack.json b/test/instance_static/emoji/test_pack/pack.json
index 481891b08..5b33fbb32 100644
--- a/test/instance_static/emoji/test_pack/pack.json
+++ b/test/instance_static/emoji/test_pack/pack.json
@@ -1,6 +1,7 @@
{
"files": {
- "blank": "blank.png"
+ "blank": "blank.png",
+ "blank2": "blank2.png"
},
"pack": {
"description": "Test description",
diff --git a/test/instance_static/emoji/test_pack_nonshared/nonshared.zip b/test/instance_static/emoji/test_pack_nonshared/nonshared.zip
index 148446c64..59bff37f0 100644
Binary files a/test/instance_static/emoji/test_pack_nonshared/nonshared.zip and b/test/instance_static/emoji/test_pack_nonshared/nonshared.zip differ
diff --git a/test/instance_static/emoji/test_pack_nonshared/pack.json b/test/instance_static/emoji/test_pack_nonshared/pack.json
index 93d643a5f..09f6274d1 100644
--- a/test/instance_static/emoji/test_pack_nonshared/pack.json
+++ b/test/instance_static/emoji/test_pack_nonshared/pack.json
@@ -4,7 +4,7 @@
"homepage": "https://pleroma.social",
"description": "Test description",
"fallback-src": "https://nonshared-pack",
- "fallback-src-sha256": "74409E2674DAA06C072729C6C8426C4CB3B7E0B85ED77792DB7A436E11D76DAF",
+ "fallback-src-sha256": "1967BB4E42BCC34BCC12D57BE7811D3B7BE52F965BCE45C87BD377B9499CE11D",
"share-files": false
},
"files": {
diff --git a/test/migration_helper/notification_backfill_test.exs b/test/migration_helper/notification_backfill_test.exs
new file mode 100644
index 000000000..2a62a2b00
--- /dev/null
+++ b/test/migration_helper/notification_backfill_test.exs
@@ -0,0 +1,56 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.MigrationHelper.NotificationBackfillTest do
+ use Pleroma.DataCase
+
+ alias Pleroma.Activity
+ alias Pleroma.MigrationHelper.NotificationBackfill
+ alias Pleroma.Notification
+ alias Pleroma.Repo
+ alias Pleroma.Web.CommonAPI
+
+ import Pleroma.Factory
+
+ describe "fill_in_notification_types" do
+ test "it fills in missing notification types" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, post} = CommonAPI.post(user, %{status: "yeah, @#{other_user.nickname}"})
+ {:ok, chat} = CommonAPI.post_chat_message(user, other_user, "yo")
+ {:ok, react} = CommonAPI.react_with_emoji(post.id, other_user, "☕")
+ {:ok, like} = CommonAPI.favorite(other_user, post.id)
+ {:ok, react_2} = CommonAPI.react_with_emoji(post.id, other_user, "☕")
+
+ data =
+ react_2.data
+ |> Map.put("type", "EmojiReaction")
+
+ {:ok, react_2} =
+ react_2
+ |> Activity.change(%{data: data})
+ |> Repo.update()
+
+ assert {5, nil} = Repo.update_all(Notification, set: [type: nil])
+
+ NotificationBackfill.fill_in_notification_types()
+
+ assert %{type: "mention"} =
+ Repo.get_by(Notification, user_id: other_user.id, activity_id: post.id)
+
+ assert %{type: "favourite"} =
+ Repo.get_by(Notification, user_id: user.id, activity_id: like.id)
+
+ assert %{type: "pleroma:emoji_reaction"} =
+ Repo.get_by(Notification, user_id: user.id, activity_id: react.id)
+
+ assert %{type: "pleroma:emoji_reaction"} =
+ Repo.get_by(Notification, user_id: user.id, activity_id: react_2.id)
+
+ assert %{type: "pleroma:chat_mention"} =
+ Repo.get_by(Notification, user_id: other_user.id, activity_id: chat.id)
+ end
+ end
+end
diff --git a/test/notification_test.exs b/test/notification_test.exs
index 37c255fee..6add3f7eb 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -10,6 +10,7 @@ defmodule Pleroma.NotificationTest do
alias Pleroma.FollowingRelationship
alias Pleroma.Notification
+ alias Pleroma.Repo
alias Pleroma.Tests.ObanHelpers
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
@@ -21,6 +22,16 @@ defmodule Pleroma.NotificationTest do
alias Pleroma.Web.Streamer
describe "create_notifications" do
+ test "never returns nil" do
+ user = insert(:user)
+ other_user = insert(:user, %{invisible: true})
+
+ {:ok, activity} = CommonAPI.post(user, %{status: "yeah"})
+ {:ok, activity} = CommonAPI.react_with_emoji(activity.id, other_user, "☕")
+
+ refute {:ok, [nil]} == Notification.create_notifications(activity)
+ end
+
test "creates a notification for an emoji reaction" do
user = insert(:user)
other_user = insert(:user)
@@ -31,6 +42,7 @@ test "creates a notification for an emoji reaction" do
{:ok, [notification]} = Notification.create_notifications(activity)
assert notification.user_id == user.id
+ assert notification.type == "pleroma:emoji_reaction"
end
test "notifies someone when they are directly addressed" do
@@ -48,6 +60,7 @@ test "notifies someone when they are directly addressed" do
notified_ids = Enum.sort([notification.user_id, other_notification.user_id])
assert notified_ids == [other_user.id, third_user.id]
assert notification.activity_id == activity.id
+ assert notification.type == "mention"
assert other_notification.activity_id == activity.id
assert [%Pleroma.Marker{unread_count: 2}] =
@@ -303,6 +316,14 @@ test "it doesn't create subscription notifications if the recipient cannot see t
assert {:ok, []} == Notification.create_notifications(status)
end
+
+ test "it disables notifications from people who are invisible" do
+ author = insert(:user, invisible: true)
+ user = insert(:user)
+
+ {:ok, status} = CommonAPI.post(author, %{status: "hey @#{user.nickname}"})
+ refute Notification.create_notification(status, user)
+ end
end
describe "follow / follow_request notifications" do
@@ -335,9 +356,12 @@ test "it creates `follow_request` notification for pending Follow activity" do
# After request is accepted, the same notification is rendered with type "follow":
assert {:ok, _} = CommonAPI.accept_follow_request(user, followed_user)
- notification_id = notification.id
- assert [%{id: ^notification_id}] = Notification.for_user(followed_user)
- assert %{type: "follow"} = NotificationView.render("show.json", render_opts)
+ notification =
+ Repo.get(Notification, notification.id)
+ |> Repo.preload(:activity)
+
+ assert %{type: "follow"} =
+ NotificationView.render("show.json", notification: notification, for: followed_user)
end
test "it doesn't create a notification for follow-unfollow-follow chains" do
diff --git a/test/pagination_test.exs b/test/pagination_test.exs
index d5b1b782d..9165427ae 100644
--- a/test/pagination_test.exs
+++ b/test/pagination_test.exs
@@ -21,7 +21,7 @@ test "paginates by min_id", %{notes: notes} do
id = Enum.at(notes, 2).id |> Integer.to_string()
%{total: total, items: paginated} =
- Pagination.fetch_paginated(Object, %{"min_id" => id, "total" => true})
+ Pagination.fetch_paginated(Object, %{min_id: id, total: true})
assert length(paginated) == 2
assert total == 5
@@ -31,7 +31,7 @@ test "paginates by since_id", %{notes: notes} do
id = Enum.at(notes, 2).id |> Integer.to_string()
%{total: total, items: paginated} =
- Pagination.fetch_paginated(Object, %{"since_id" => id, "total" => true})
+ Pagination.fetch_paginated(Object, %{since_id: id, total: true})
assert length(paginated) == 2
assert total == 5
@@ -41,7 +41,7 @@ test "paginates by max_id", %{notes: notes} do
id = Enum.at(notes, 1).id |> Integer.to_string()
%{total: total, items: paginated} =
- Pagination.fetch_paginated(Object, %{"max_id" => id, "total" => true})
+ Pagination.fetch_paginated(Object, %{max_id: id, total: true})
assert length(paginated) == 1
assert total == 5
@@ -50,7 +50,7 @@ test "paginates by max_id", %{notes: notes} do
test "paginates by min_id & limit", %{notes: notes} do
id = Enum.at(notes, 2).id |> Integer.to_string()
- paginated = Pagination.fetch_paginated(Object, %{"min_id" => id, "limit" => 1})
+ paginated = Pagination.fetch_paginated(Object, %{min_id: id, limit: 1})
assert length(paginated) == 1
end
@@ -64,13 +64,13 @@ test "paginates by min_id & limit", %{notes: notes} do
end
test "paginates by limit" do
- paginated = Pagination.fetch_paginated(Object, %{"limit" => 2}, :offset)
+ paginated = Pagination.fetch_paginated(Object, %{limit: 2}, :offset)
assert length(paginated) == 2
end
test "paginates by limit & offset" do
- paginated = Pagination.fetch_paginated(Object, %{"limit" => 2, "offset" => 4}, :offset)
+ paginated = Pagination.fetch_paginated(Object, %{limit: 2, offset: 4}, :offset)
assert length(paginated) == 1
end
diff --git a/test/plugs/instance_static_test.exs b/test/plugs/instance_static_test.exs
index b8f070d6a..be2613ad0 100644
--- a/test/plugs/instance_static_test.exs
+++ b/test/plugs/instance_static_test.exs
@@ -16,7 +16,7 @@ defmodule Pleroma.Web.RuntimeStaticPlugTest do
test "overrides index" do
bundled_index = get(build_conn(), "/")
- assert html_response(bundled_index, 200) == File.read!("priv/static/index.html")
+ refute html_response(bundled_index, 200) == "hello world"
File.write!(@dir <> "/index.html", "hello world")
diff --git a/test/repo_test.exs b/test/repo_test.exs
index daffc6542..92e827c95 100644
--- a/test/repo_test.exs
+++ b/test/repo_test.exs
@@ -4,9 +4,7 @@
defmodule Pleroma.RepoTest do
use Pleroma.DataCase
- import ExUnit.CaptureLog
import Pleroma.Factory
- import Mock
alias Pleroma.User
@@ -49,36 +47,4 @@ test "return error if has not assoc " do
assert Repo.get_assoc(token, :user) == {:error, :not_found}
end
end
-
- describe "check_migrations_applied!" do
- setup_with_mocks([
- {Ecto.Migrator, [],
- [
- with_repo: fn repo, fun -> passthrough([repo, fun]) end,
- migrations: fn Pleroma.Repo ->
- [
- {:up, 20_191_128_153_944, "fix_missing_following_count"},
- {:up, 20_191_203_043_610, "create_report_notes"},
- {:down, 20_191_220_174_645, "add_scopes_to_pleroma_feo_auth_records"}
- ]
- end
- ]}
- ]) do
- :ok
- end
-
- setup do: clear_config([:i_am_aware_this_may_cause_data_loss, :disable_migration_check])
-
- test "raises if it detects unapplied migrations" do
- assert_raise Pleroma.Repo.UnappliedMigrationsError, fn ->
- capture_log(&Repo.check_migrations_applied!/0)
- end
- end
-
- test "doesn't do anything if disabled" do
- Pleroma.Config.put([:i_am_aware_this_may_cause_data_loss, :disable_migration_check], true)
-
- assert :ok == Repo.check_migrations_applied!()
- end
- end
end
diff --git a/test/stats_test.exs b/test/stats_test.exs
index 4b76e2e78..f09d8d31a 100644
--- a/test/stats_test.exs
+++ b/test/stats_test.exs
@@ -17,10 +17,11 @@ test "it ignores internal users" do
end
end
- describe "status visibility count" do
+ describe "status visibility sum count" do
test "on new status" do
+ instance2 = "instance2.tld"
user = insert(:user)
- other_user = insert(:user)
+ other_user = insert(:user, %{ap_id: "https://#{instance2}/@actor"})
CommonAPI.post(user, %{visibility: "public", status: "hey"})
@@ -45,24 +46,24 @@ test "on new status" do
})
end)
- assert %{direct: 3, private: 4, public: 1, unlisted: 2} =
+ assert %{"direct" => 3, "private" => 4, "public" => 1, "unlisted" => 2} =
Pleroma.Stats.get_status_visibility_count()
end
test "on status delete" do
user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{visibility: "public", status: "hey"})
- assert %{public: 1} = Pleroma.Stats.get_status_visibility_count()
+ assert %{"public" => 1} = Pleroma.Stats.get_status_visibility_count()
CommonAPI.delete(activity.id, user)
- assert %{public: 0} = Pleroma.Stats.get_status_visibility_count()
+ assert %{"public" => 0} = Pleroma.Stats.get_status_visibility_count()
end
test "on status visibility update" do
user = insert(:user)
{:ok, activity} = CommonAPI.post(user, %{visibility: "public", status: "hey"})
- assert %{public: 1, private: 0} = Pleroma.Stats.get_status_visibility_count()
+ assert %{"public" => 1, "private" => 0} = Pleroma.Stats.get_status_visibility_count()
{:ok, _} = CommonAPI.update_activity_scope(activity.id, %{visibility: "private"})
- assert %{public: 0, private: 1} = Pleroma.Stats.get_status_visibility_count()
+ assert %{"public" => 0, "private" => 1} = Pleroma.Stats.get_status_visibility_count()
end
test "doesn't count unrelated activities" do
@@ -73,8 +74,46 @@ test "doesn't count unrelated activities" do
CommonAPI.favorite(other_user, activity.id)
CommonAPI.repeat(activity.id, other_user)
- assert %{direct: 0, private: 0, public: 1, unlisted: 0} =
+ assert %{"direct" => 0, "private" => 0, "public" => 1, "unlisted" => 0} =
Pleroma.Stats.get_status_visibility_count()
end
end
+
+ describe "status visibility by instance count" do
+ test "single instance" do
+ local_instance = Pleroma.Web.Endpoint.url() |> String.split("//") |> Enum.at(1)
+ instance2 = "instance2.tld"
+ user1 = insert(:user)
+ user2 = insert(:user, %{ap_id: "https://#{instance2}/@actor"})
+
+ CommonAPI.post(user1, %{visibility: "public", status: "hey"})
+
+ Enum.each(1..5, fn _ ->
+ CommonAPI.post(user1, %{
+ visibility: "unlisted",
+ status: "hey"
+ })
+ end)
+
+ Enum.each(1..10, fn _ ->
+ CommonAPI.post(user1, %{
+ visibility: "direct",
+ status: "hey @#{user2.nickname}"
+ })
+ end)
+
+ Enum.each(1..20, fn _ ->
+ CommonAPI.post(user2, %{
+ visibility: "private",
+ status: "hey"
+ })
+ end)
+
+ assert %{"direct" => 10, "private" => 0, "public" => 1, "unlisted" => 5} =
+ Pleroma.Stats.get_status_visibility_count(local_instance)
+
+ assert %{"direct" => 0, "private" => 20, "public" => 0, "unlisted" => 0} =
+ Pleroma.Stats.get_status_visibility_count(instance2)
+ end
+ end
end
diff --git a/test/support/factory.ex b/test/support/factory.ex
index 6e3676aca..6e22b66a4 100644
--- a/test/support/factory.ex
+++ b/test/support/factory.ex
@@ -42,7 +42,8 @@ def user_factory do
user
| ap_id: User.ap_id(user),
follower_address: User.ap_followers(user),
- following_address: User.ap_following(user)
+ following_address: User.ap_following(user),
+ raw_bio: user.bio
}
end
@@ -396,24 +397,17 @@ def registration_factory do
}
end
- def config_factory do
+ def config_factory(attrs \\ %{}) do
%Pleroma.ConfigDB{
- key:
- sequence(:key, fn key ->
- # Atom dynamic registration hack in tests
- "some_key_#{key}"
- |> String.to_atom()
- |> inspect()
- end),
- group: ":pleroma",
+ key: sequence(:key, &String.to_atom("some_key_#{&1}")),
+ group: :pleroma,
value:
sequence(
:value,
- fn key ->
- :erlang.term_to_binary(%{another_key: "#{key}somevalue", another: "#{key}somevalue"})
- end
+ &%{another_key: "#{&1}somevalue", another: "#{&1}somevalue"}
)
}
+ |> merge_attributes(attrs)
end
def marker_factory do
diff --git a/test/tasks/config_test.exs b/test/tasks/config_test.exs
index 04bc947a9..71f36c0e3 100644
--- a/test/tasks/config_test.exs
+++ b/test/tasks/config_test.exs
@@ -5,6 +5,8 @@
defmodule Mix.Tasks.Pleroma.ConfigTest do
use Pleroma.DataCase
+ import Pleroma.Factory
+
alias Pleroma.ConfigDB
alias Pleroma.Repo
@@ -48,25 +50,21 @@ test "filtered settings are migrated to db" do
config3 = ConfigDB.get_by_params(%{group: ":quack", key: ":level"})
refute ConfigDB.get_by_params(%{group: ":pleroma", key: "Pleroma.Repo"})
refute ConfigDB.get_by_params(%{group: ":postgrex", key: ":json_library"})
+ refute ConfigDB.get_by_params(%{group: ":pleroma", key: ":database"})
- assert ConfigDB.from_binary(config1.value) == [key: "value", key2: [Repo]]
- assert ConfigDB.from_binary(config2.value) == [key: "value2", key2: ["Activity"]]
- assert ConfigDB.from_binary(config3.value) == :info
+ assert config1.value == [key: "value", key2: [Repo]]
+ assert config2.value == [key: "value2", key2: ["Activity"]]
+ assert config3.value == :info
end
test "config table is truncated before migration" do
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":first_setting",
- value: [key: "value", key2: ["Activity"]]
- })
-
+ insert(:config, key: :first_setting, value: [key: "value", key2: ["Activity"]])
assert Repo.aggregate(ConfigDB, :count, :id) == 1
Mix.Tasks.Pleroma.Config.migrate_to_db("test/fixtures/config/temp.secret.exs")
config = ConfigDB.get_by_params(%{group: ":pleroma", key: ":first_setting"})
- assert ConfigDB.from_binary(config.value) == [key: "value", key2: [Repo]]
+ assert config.value == [key: "value", key2: [Repo]]
end
end
@@ -82,19 +80,9 @@ test "config table is truncated before migration" do
end
test "settings are migrated to file and deleted from db", %{temp_file: temp_file} do
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":setting_first",
- value: [key: "value", key2: ["Activity"]]
- })
-
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":setting_second",
- value: [key: "value2", key2: [Repo]]
- })
-
- ConfigDB.create(%{group: ":quack", key: ":level", value: :info})
+ insert(:config, key: :setting_first, value: [key: "value", key2: ["Activity"]])
+ insert(:config, key: :setting_second, value: [key: "value2", key2: [Repo]])
+ insert(:config, group: :quack, key: :level, value: :info)
Mix.Tasks.Pleroma.Config.run(["migrate_from_db", "--env", "temp", "-d"])
@@ -107,9 +95,8 @@ test "settings are migrated to file and deleted from db", %{temp_file: temp_file
end
test "load a settings with large values and pass to file", %{temp_file: temp_file} do
- ConfigDB.create(%{
- group: ":pleroma",
- key: ":instance",
+ insert(:config,
+ key: :instance,
value: [
name: "Pleroma",
email: "example@example.com",
@@ -134,14 +121,11 @@ test "load a settings with large values and pass to file", %{temp_file: temp_fil
federation_reachability_timeout_days: 7,
federation_publisher_modules: [Pleroma.Web.ActivityPub.Publisher],
allow_relay: true,
- rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
public: true,
quarantined_instances: [],
managed_config: true,
static_dir: "instance/static/",
allowed_post_formats: ["text/plain", "text/html", "text/markdown", "text/bbcode"],
- mrf_transparency: true,
- mrf_transparency_exclusions: [],
autofollowed_nicknames: [],
max_pinned_statuses: 1,
attachment_links: false,
@@ -163,7 +147,6 @@ test "load a settings with large values and pass to file", %{temp_file: temp_fil
extended_nickname_format: true,
multi_factor_authentication: [
totp: [
- # digits 6 or 8
digits: 6,
period: 30
],
@@ -173,7 +156,7 @@ test "load a settings with large values and pass to file", %{temp_file: temp_fil
]
]
]
- })
+ )
Mix.Tasks.Pleroma.Config.run(["migrate_from_db", "--env", "temp", "-d"])
@@ -189,7 +172,7 @@ test "load a settings with large values and pass to file", %{temp_file: temp_fil
end
assert file ==
- "#{header}\n\nconfig :pleroma, :instance,\n name: \"Pleroma\",\n email: \"example@example.com\",\n notify_email: \"noreply@example.com\",\n description: \"A Pleroma instance, an alternative fediverse server\",\n limit: 5000,\n chat_limit: 5000,\n remote_limit: 100_000,\n upload_limit: 16_000_000,\n avatar_upload_limit: 2_000_000,\n background_upload_limit: 4_000_000,\n banner_upload_limit: 4_000_000,\n poll_limits: %{\n max_expiration: 31_536_000,\n max_option_chars: 200,\n max_options: 20,\n min_expiration: 0\n },\n registrations_open: true,\n federating: true,\n federation_incoming_replies_max_depth: 100,\n federation_reachability_timeout_days: 7,\n federation_publisher_modules: [Pleroma.Web.ActivityPub.Publisher],\n allow_relay: true,\n rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,\n public: true,\n quarantined_instances: [],\n managed_config: true,\n static_dir: \"instance/static/\",\n allowed_post_formats: [\"text/plain\", \"text/html\", \"text/markdown\", \"text/bbcode\"],\n mrf_transparency: true,\n mrf_transparency_exclusions: [],\n autofollowed_nicknames: [],\n max_pinned_statuses: 1,\n attachment_links: false,\n welcome_user_nickname: nil,\n welcome_message: nil,\n max_report_comment_size: 1000,\n safe_dm_mentions: false,\n healthcheck: false,\n remote_post_retention_days: 90,\n skip_thread_containment: true,\n limit_to_local_content: :unauthenticated,\n user_bio_length: 5000,\n user_name_length: 100,\n max_account_fields: 10,\n max_remote_account_fields: 20,\n account_field_name_length: 512,\n account_field_value_length: 2048,\n external_user_synchronization: true,\n extended_nickname_format: true,\n multi_factor_authentication: [\n totp: [digits: 6, period: 30],\n backup_codes: [number: 2, length: 6]\n ]\n"
+ "#{header}\n\nconfig :pleroma, :instance,\n name: \"Pleroma\",\n email: \"example@example.com\",\n notify_email: \"noreply@example.com\",\n description: \"A Pleroma instance, an alternative fediverse server\",\n limit: 5000,\n chat_limit: 5000,\n remote_limit: 100_000,\n upload_limit: 16_000_000,\n avatar_upload_limit: 2_000_000,\n background_upload_limit: 4_000_000,\n banner_upload_limit: 4_000_000,\n poll_limits: %{\n max_expiration: 31_536_000,\n max_option_chars: 200,\n max_options: 20,\n min_expiration: 0\n },\n registrations_open: true,\n federating: true,\n federation_incoming_replies_max_depth: 100,\n federation_reachability_timeout_days: 7,\n federation_publisher_modules: [Pleroma.Web.ActivityPub.Publisher],\n allow_relay: true,\n public: true,\n quarantined_instances: [],\n managed_config: true,\n static_dir: \"instance/static/\",\n allowed_post_formats: [\"text/plain\", \"text/html\", \"text/markdown\", \"text/bbcode\"],\n autofollowed_nicknames: [],\n max_pinned_statuses: 1,\n attachment_links: false,\n welcome_user_nickname: nil,\n welcome_message: nil,\n max_report_comment_size: 1000,\n safe_dm_mentions: false,\n healthcheck: false,\n remote_post_retention_days: 90,\n skip_thread_containment: true,\n limit_to_local_content: :unauthenticated,\n user_bio_length: 5000,\n user_name_length: 100,\n max_account_fields: 10,\n max_remote_account_fields: 20,\n account_field_name_length: 512,\n account_field_value_length: 2048,\n external_user_synchronization: true,\n extended_nickname_format: true,\n multi_factor_authentication: [\n totp: [digits: 6, period: 30],\n backup_codes: [number: 2, length: 6]\n ]\n"
end
end
end
diff --git a/test/tasks/refresh_counter_cache_test.exs b/test/tasks/refresh_counter_cache_test.exs
index 851971a77..6a1a9ac17 100644
--- a/test/tasks/refresh_counter_cache_test.exs
+++ b/test/tasks/refresh_counter_cache_test.exs
@@ -37,7 +37,7 @@ test "counts statuses" do
assert capture_io(fn -> Mix.Tasks.Pleroma.RefreshCounterCache.run([]) end) =~ "Done\n"
- assert %{direct: 3, private: 4, public: 1, unlisted: 2} =
+ assert %{"direct" => 3, "private" => 4, "public" => 1, "unlisted" => 2} =
Pleroma.Stats.get_status_visibility_count()
end
end
diff --git a/test/tasks/relay_test.exs b/test/tasks/relay_test.exs
index d3d88467d..a8ba0658d 100644
--- a/test/tasks/relay_test.exs
+++ b/test/tasks/relay_test.exs
@@ -62,10 +62,11 @@ test "relay is unfollowed" do
[undo_activity] =
ActivityPub.fetch_activities([], %{
- "type" => "Undo",
- "actor_id" => follower_id,
- "limit" => 1,
- "skip_preload" => true
+ type: "Undo",
+ actor_id: follower_id,
+ limit: 1,
+ skip_preload: true,
+ invisible_actors: true
})
assert undo_activity.data["type"] == "Undo"
diff --git a/test/tasks/user_test.exs b/test/tasks/user_test.exs
index b55aa1cdb..9220d23fc 100644
--- a/test/tasks/user_test.exs
+++ b/test/tasks/user_test.exs
@@ -4,6 +4,7 @@
defmodule Mix.Tasks.Pleroma.UserTest do
alias Pleroma.Activity
+ alias Pleroma.MFA
alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.Tests.ObanHelpers
@@ -278,6 +279,35 @@ test "no user to reset password" do
end
end
+ describe "running reset_mfa" do
+ test "disables MFA" do
+ user =
+ insert(:user,
+ multi_factor_authentication_settings: %MFA.Settings{
+ enabled: true,
+ totp: %MFA.Settings.TOTP{secret: "xx", confirmed: true}
+ }
+ )
+
+ Mix.Tasks.Pleroma.User.run(["reset_mfa", user.nickname])
+
+ assert_received {:mix_shell, :info, [message]}
+ assert message == "Multi-Factor Authentication disabled for #{user.nickname}"
+
+ assert %{enabled: false, totp: false} ==
+ user.nickname
+ |> User.get_cached_by_nickname()
+ |> MFA.mfa_settings()
+ end
+
+ test "no user to reset MFA" do
+ Mix.Tasks.Pleroma.User.run(["reset_password", "nonexistent"])
+
+ assert_received {:mix_shell, :error, [message]}
+ assert message =~ "No local user"
+ end
+ end
+
describe "running invite" do
test "invite token is generated" do
assert capture_io(fn ->
diff --git a/test/upload/filter/mogrify_test.exs b/test/upload/filter/mogrify_test.exs
index b6a463e8c..62ca30487 100644
--- a/test/upload/filter/mogrify_test.exs
+++ b/test/upload/filter/mogrify_test.exs
@@ -6,21 +6,17 @@ defmodule Pleroma.Upload.Filter.MogrifyTest do
use Pleroma.DataCase
import Mock
- alias Pleroma.Config
- alias Pleroma.Upload
alias Pleroma.Upload.Filter
- setup do: clear_config([Filter.Mogrify, :args])
-
test "apply mogrify filter" do
- Config.put([Filter.Mogrify, :args], [{"tint", "40"}])
+ clear_config(Filter.Mogrify, args: [{"tint", "40"}])
File.cp!(
"test/fixtures/image.jpg",
"test/fixtures/image_tmp.jpg"
)
- upload = %Upload{
+ upload = %Pleroma.Upload{
name: "an… image.jpg",
content_type: "image/jpg",
path: Path.absname("test/fixtures/image_tmp.jpg"),
diff --git a/test/upload_test.exs b/test/upload_test.exs
index 060a940bb..2abf0edec 100644
--- a/test/upload_test.exs
+++ b/test/upload_test.exs
@@ -54,6 +54,7 @@ test "it returns file" do
%{
"name" => "image.jpg",
"type" => "Document",
+ "mediaType" => "image/jpeg",
"url" => [
%{
"href" => "http://localhost:4001/media/post-process-file.jpg",
diff --git a/test/user_test.exs b/test/user_test.exs
index 3556ef1b4..9b66f3f51 100644
--- a/test/user_test.exs
+++ b/test/user_test.exs
@@ -199,6 +199,16 @@ test "doesn't return already accepted or duplicate follow requests" do
assert [^pending_follower] = User.get_follow_requests(locked)
end
+ test "doesn't return follow requests for deactivated accounts" do
+ locked = insert(:user, locked: true)
+ pending_follower = insert(:user, %{deactivated: true})
+
+ CommonAPI.follow(pending_follower, locked)
+
+ assert true == pending_follower.deactivated
+ assert [] = User.get_follow_requests(locked)
+ end
+
test "clears follow requests when requester is blocked" do
followed = insert(:user, locked: true)
follower = insert(:user)
@@ -1122,7 +1132,7 @@ test "hide a user's statuses from timelines and notifications" do
assert [%{activity | thread_muted?: CommonAPI.thread_muted?(user2, activity)}] ==
ActivityPub.fetch_activities([user2.ap_id | User.following(user2)], %{
- "user" => user2
+ user: user2
})
{:ok, _user} = User.deactivate(user)
@@ -1132,7 +1142,7 @@ test "hide a user's statuses from timelines and notifications" do
assert [] ==
ActivityPub.fetch_activities([user2.ap_id | User.following(user2)], %{
- "user" => user2
+ user: user2
})
end
end
@@ -1159,6 +1169,9 @@ test "it deactivates a user, all follow relationships and all activities", %{use
follower = insert(:user)
{:ok, follower} = User.follow(follower, user)
+ locked_user = insert(:user, name: "locked", locked: true)
+ {:ok, _} = User.follow(user, locked_user, :follow_pending)
+
object = insert(:note, user: user)
activity = insert(:note_activity, user: user, note: object)
@@ -1177,6 +1190,8 @@ test "it deactivates a user, all follow relationships and all activities", %{use
refute User.following?(follower, user)
assert %{deactivated: true} = User.get_by_id(user.id)
+ assert [] == User.get_follow_requests(locked_user)
+
user_activities =
user.ap_id
|> Activity.Queries.by_actor()
@@ -1337,11 +1352,11 @@ test "returns false for a non-invisible user" do
end
end
- describe "visible_for?/2" do
+ describe "visible_for/2" do
test "returns true when the account is itself" do
user = insert(:user, local: true)
- assert User.visible_for?(user, user)
+ assert User.visible_for(user, user) == :visible
end
test "returns false when the account is unauthenticated and auth is required" do
@@ -1350,14 +1365,14 @@ test "returns false when the account is unauthenticated and auth is required" do
user = insert(:user, local: true, confirmation_pending: true)
other_user = insert(:user, local: true)
- refute User.visible_for?(user, other_user)
+ refute User.visible_for(user, other_user) == :visible
end
test "returns true when the account is unauthenticated and auth is not required" do
user = insert(:user, local: true, confirmation_pending: true)
other_user = insert(:user, local: true)
- assert User.visible_for?(user, other_user)
+ assert User.visible_for(user, other_user) == :visible
end
test "returns true when the account is unauthenticated and being viewed by a privileged account (auth required)" do
@@ -1366,7 +1381,7 @@ test "returns true when the account is unauthenticated and being viewed by a pri
user = insert(:user, local: true, confirmation_pending: true)
other_user = insert(:user, local: true, is_admin: true)
- assert User.visible_for?(user, other_user)
+ assert User.visible_for(user, other_user) == :visible
end
end
@@ -1802,7 +1817,7 @@ test "avatar fallback" do
user = insert(:user)
assert User.avatar_url(user) =~ "/images/avi.png"
- Pleroma.Config.put([:assets, :default_user_avatar], "avatar.png")
+ clear_config([:assets, :default_user_avatar], "avatar.png")
user = User.get_cached_by_nickname_or_id(user.nickname)
assert User.avatar_url(user) =~ "avatar.png"
diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs
index 24edab41a..e722f7c04 100644
--- a/test/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/web/activity_pub/activity_pub_controller_test.exs
@@ -536,6 +536,7 @@ test "accept follow activity", %{conn: conn} do
assert_receive {:mix_shell, :info, ["relay.mastodon.host"]}
end
+ @tag capture_log: true
test "without valid signature, " <>
"it only accepts Create activities and requires enabled federation",
%{conn: conn} do
@@ -648,11 +649,14 @@ test "it accepts messages with bcc as string instead of array", %{conn: conn, da
test "it accepts announces with to as string instead of array", %{conn: conn} do
user = insert(:user)
+ {:ok, post} = CommonAPI.post(user, %{status: "hey"})
+ announcer = insert(:user, local: false)
+
data = %{
"@context" => "https://www.w3.org/ns/activitystreams",
- "actor" => "http://mastodon.example.org/users/admin",
- "id" => "http://mastodon.example.org/users/admin/statuses/19512778738411822/activity",
- "object" => "https://mastodon.social/users/emelie/statuses/101849165031453009",
+ "actor" => announcer.ap_id,
+ "id" => "#{announcer.ap_id}/statuses/19512778738411822/activity",
+ "object" => post.data["object"],
"to" => "https://www.w3.org/ns/activitystreams#Public",
"cc" => [user.ap_id],
"type" => "Announce"
@@ -804,17 +808,63 @@ test "it requires authentication", %{conn: conn} do
end
describe "GET /users/:nickname/outbox" do
+ test "it paginates correctly", %{conn: conn} do
+ user = insert(:user)
+ conn = assign(conn, :user, user)
+ outbox_endpoint = user.ap_id <> "/outbox"
+
+ _posts =
+ for i <- 0..25 do
+ {:ok, activity} = CommonAPI.post(user, %{status: "post #{i}"})
+ activity
+ end
+
+ result =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get(outbox_endpoint <> "?page=true")
+ |> json_response(200)
+
+ result_ids = Enum.map(result["orderedItems"], fn x -> x["id"] end)
+ assert length(result["orderedItems"]) == 20
+ assert length(result_ids) == 20
+ assert result["next"]
+ assert String.starts_with?(result["next"], outbox_endpoint)
+
+ result_next =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get(result["next"])
+ |> json_response(200)
+
+ result_next_ids = Enum.map(result_next["orderedItems"], fn x -> x["id"] end)
+ assert length(result_next["orderedItems"]) == 6
+ assert length(result_next_ids) == 6
+ refute Enum.find(result_next_ids, fn x -> x in result_ids end)
+ refute Enum.find(result_ids, fn x -> x in result_next_ids end)
+ assert String.starts_with?(result["id"], outbox_endpoint)
+
+ result_next_again =
+ conn
+ |> put_req_header("accept", "application/activity+json")
+ |> get(result_next["id"])
+ |> json_response(200)
+
+ assert result_next == result_next_again
+ end
+
test "it returns 200 even if there're no activities", %{conn: conn} do
user = insert(:user)
+ outbox_endpoint = user.ap_id <> "/outbox"
conn =
conn
|> assign(:user, user)
|> put_req_header("accept", "application/activity+json")
- |> get("/users/#{user.nickname}/outbox")
+ |> get(outbox_endpoint)
result = json_response(conn, 200)
- assert user.ap_id <> "/outbox" == result["id"]
+ assert outbox_endpoint == result["id"]
end
test "it returns a note activity in a collection", %{conn: conn} do
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs
index 3dcb62873..575e0c5db 100644
--- a/test/web/activity_pub/activity_pub_test.exs
+++ b/test/web/activity_pub/activity_pub_test.exs
@@ -82,30 +82,28 @@ test "it restricts by the appropriate visibility" do
{:ok, private_activity} = CommonAPI.post(user, %{status: ".", visibility: "private"})
- activities =
- ActivityPub.fetch_activities([], %{:visibility => "direct", "actor_id" => user.ap_id})
+ activities = ActivityPub.fetch_activities([], %{visibility: "direct", actor_id: user.ap_id})
assert activities == [direct_activity]
activities =
- ActivityPub.fetch_activities([], %{:visibility => "unlisted", "actor_id" => user.ap_id})
+ ActivityPub.fetch_activities([], %{visibility: "unlisted", actor_id: user.ap_id})
assert activities == [unlisted_activity]
activities =
- ActivityPub.fetch_activities([], %{:visibility => "private", "actor_id" => user.ap_id})
+ ActivityPub.fetch_activities([], %{visibility: "private", actor_id: user.ap_id})
assert activities == [private_activity]
- activities =
- ActivityPub.fetch_activities([], %{:visibility => "public", "actor_id" => user.ap_id})
+ activities = ActivityPub.fetch_activities([], %{visibility: "public", actor_id: user.ap_id})
assert activities == [public_activity]
activities =
ActivityPub.fetch_activities([], %{
- :visibility => ~w[private public],
- "actor_id" => user.ap_id
+ visibility: ~w[private public],
+ actor_id: user.ap_id
})
assert activities == [public_activity, private_activity]
@@ -126,8 +124,8 @@ test "it excludes by the appropriate visibility" do
activities =
ActivityPub.fetch_activities([], %{
- "exclude_visibilities" => "direct",
- "actor_id" => user.ap_id
+ exclude_visibilities: "direct",
+ actor_id: user.ap_id
})
assert public_activity in activities
@@ -137,8 +135,8 @@ test "it excludes by the appropriate visibility" do
activities =
ActivityPub.fetch_activities([], %{
- "exclude_visibilities" => "unlisted",
- "actor_id" => user.ap_id
+ exclude_visibilities: "unlisted",
+ actor_id: user.ap_id
})
assert public_activity in activities
@@ -148,8 +146,8 @@ test "it excludes by the appropriate visibility" do
activities =
ActivityPub.fetch_activities([], %{
- "exclude_visibilities" => "private",
- "actor_id" => user.ap_id
+ exclude_visibilities: "private",
+ actor_id: user.ap_id
})
assert public_activity in activities
@@ -159,8 +157,8 @@ test "it excludes by the appropriate visibility" do
activities =
ActivityPub.fetch_activities([], %{
- "exclude_visibilities" => "public",
- "actor_id" => user.ap_id
+ exclude_visibilities: "public",
+ actor_id: user.ap_id
})
refute public_activity in activities
@@ -193,23 +191,22 @@ test "it fetches the appropriate tag-restricted posts" do
{:ok, status_two} = CommonAPI.post(user, %{status: ". #essais"})
{:ok, status_three} = CommonAPI.post(user, %{status: ". #test #reject"})
- fetch_one = ActivityPub.fetch_activities([], %{"type" => "Create", "tag" => "test"})
+ fetch_one = ActivityPub.fetch_activities([], %{type: "Create", tag: "test"})
- fetch_two =
- ActivityPub.fetch_activities([], %{"type" => "Create", "tag" => ["test", "essais"]})
+ fetch_two = ActivityPub.fetch_activities([], %{type: "Create", tag: ["test", "essais"]})
fetch_three =
ActivityPub.fetch_activities([], %{
- "type" => "Create",
- "tag" => ["test", "essais"],
- "tag_reject" => ["reject"]
+ type: "Create",
+ tag: ["test", "essais"],
+ tag_reject: ["reject"]
})
fetch_four =
ActivityPub.fetch_activities([], %{
- "type" => "Create",
- "tag" => ["test"],
- "tag_all" => ["test", "reject"]
+ type: "Create",
+ tag: ["test"],
+ tag_all: ["test", "reject"]
})
assert fetch_one == [status_one, status_three]
@@ -375,7 +372,7 @@ test "can be fetched into a timeline" do
_listen_activity_2 = insert(:listen)
_listen_activity_3 = insert(:listen)
- timeline = ActivityPub.fetch_activities([], %{"type" => ["Listen"]})
+ timeline = ActivityPub.fetch_activities([], %{type: ["Listen"]})
assert length(timeline) == 3
end
@@ -507,7 +504,7 @@ test "retrieves activities that have a given context" do
{:ok, _user_relationship} = User.block(user, %{ap_id: activity_five.data["actor"]})
- activities = ActivityPub.fetch_activities_for_context("2hu", %{"blocking_user" => user})
+ activities = ActivityPub.fetch_activities_for_context("2hu", %{blocking_user: user})
assert activities == [activity_two, activity]
end
end
@@ -520,8 +517,7 @@ test "doesn't return blocked activities" do
booster = insert(:user)
{:ok, _user_relationship} = User.block(user, %{ap_id: activity_one.data["actor"]})
- activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => user, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: user, skip_preload: true})
assert Enum.member?(activities, activity_two)
assert Enum.member?(activities, activity_three)
@@ -529,8 +525,7 @@ test "doesn't return blocked activities" do
{:ok, _user_block} = User.unblock(user, %{ap_id: activity_one.data["actor"]})
- activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => user, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: user, skip_preload: true})
assert Enum.member?(activities, activity_two)
assert Enum.member?(activities, activity_three)
@@ -541,16 +536,14 @@ test "doesn't return blocked activities" do
%Activity{} = boost_activity = Activity.get_create_by_object_ap_id(id)
activity_three = Activity.get_by_id(activity_three.id)
- activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => user, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: user, skip_preload: true})
assert Enum.member?(activities, activity_two)
refute Enum.member?(activities, activity_three)
refute Enum.member?(activities, boost_activity)
assert Enum.member?(activities, activity_one)
- activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => nil, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: nil, skip_preload: true})
assert Enum.member?(activities, activity_two)
assert Enum.member?(activities, activity_three)
@@ -573,7 +566,7 @@ test "doesn't return transitive interactions concerning blocked users" do
{:ok, activity_four} = CommonAPI.post(blockee, %{status: "hey! @#{blocker.nickname}"})
- activities = ActivityPub.fetch_activities([], %{"blocking_user" => blocker})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: blocker})
assert Enum.member?(activities, activity_one)
refute Enum.member?(activities, activity_two)
@@ -581,7 +574,7 @@ test "doesn't return transitive interactions concerning blocked users" do
refute Enum.member?(activities, activity_four)
end
- test "doesn't return announce activities concerning blocked users" do
+ test "doesn't return announce activities with blocked users in 'to'" do
blocker = insert(:user)
blockee = insert(:user)
friend = insert(:user)
@@ -595,7 +588,40 @@ test "doesn't return announce activities concerning blocked users" do
{:ok, activity_three} = CommonAPI.repeat(activity_two.id, friend)
activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => blocker})
+ ActivityPub.fetch_activities([], %{blocking_user: blocker})
+ |> Enum.map(fn act -> act.id end)
+
+ assert Enum.member?(activities, activity_one.id)
+ refute Enum.member?(activities, activity_two.id)
+ refute Enum.member?(activities, activity_three.id)
+ end
+
+ test "doesn't return announce activities with blocked users in 'cc'" do
+ blocker = insert(:user)
+ blockee = insert(:user)
+ friend = insert(:user)
+
+ {:ok, _user_relationship} = User.block(blocker, blockee)
+
+ {:ok, activity_one} = CommonAPI.post(friend, %{status: "hey!"})
+
+ {:ok, activity_two} = CommonAPI.post(blockee, %{status: "hey! @#{friend.nickname}"})
+
+ assert object = Pleroma.Object.normalize(activity_two)
+
+ data = %{
+ "actor" => friend.ap_id,
+ "object" => object.data["id"],
+ "context" => object.data["context"],
+ "type" => "Announce",
+ "to" => ["https://www.w3.org/ns/activitystreams#Public"],
+ "cc" => [blockee.ap_id]
+ }
+
+ assert {:ok, activity_three} = ActivityPub.insert(data)
+
+ activities =
+ ActivityPub.fetch_activities([], %{blocking_user: blocker})
|> Enum.map(fn act -> act.id end)
assert Enum.member?(activities, activity_one.id)
@@ -611,8 +637,7 @@ test "doesn't return activities from blocked domains" do
user = insert(:user)
{:ok, user} = User.block_domain(user, domain)
- activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => user, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: user, skip_preload: true})
refute activity in activities
@@ -620,8 +645,7 @@ test "doesn't return activities from blocked domains" do
ActivityPub.follow(user, followed_user)
{:ok, repeat_activity} = CommonAPI.repeat(activity.id, followed_user)
- activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => user, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: user, skip_preload: true})
refute repeat_activity in activities
end
@@ -641,8 +665,7 @@ test "does return activities from followed users on blocked domains" do
note = insert(:note, %{data: %{"actor" => domain_user.ap_id}})
activity = insert(:note_activity, %{note: note})
- activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => blocker, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: blocker, skip_preload: true})
assert activity in activities
@@ -653,8 +676,7 @@ test "does return activities from followed users on blocked domains" do
bad_activity = insert(:note_activity, %{note: bad_note})
{:ok, repeat_activity} = CommonAPI.repeat(bad_activity.id, domain_user)
- activities =
- ActivityPub.fetch_activities([], %{"blocking_user" => blocker, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{blocking_user: blocker, skip_preload: true})
refute repeat_activity in activities
end
@@ -669,8 +691,7 @@ test "doesn't return muted activities" do
activity_one_actor = User.get_by_ap_id(activity_one.data["actor"])
{:ok, _user_relationships} = User.mute(user, activity_one_actor)
- activities =
- ActivityPub.fetch_activities([], %{"muting_user" => user, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{muting_user: user, skip_preload: true})
assert Enum.member?(activities, activity_two)
assert Enum.member?(activities, activity_three)
@@ -679,9 +700,9 @@ test "doesn't return muted activities" do
# Calling with 'with_muted' will deliver muted activities, too.
activities =
ActivityPub.fetch_activities([], %{
- "muting_user" => user,
- "with_muted" => true,
- "skip_preload" => true
+ muting_user: user,
+ with_muted: true,
+ skip_preload: true
})
assert Enum.member?(activities, activity_two)
@@ -690,8 +711,7 @@ test "doesn't return muted activities" do
{:ok, _user_mute} = User.unmute(user, activity_one_actor)
- activities =
- ActivityPub.fetch_activities([], %{"muting_user" => user, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{muting_user: user, skip_preload: true})
assert Enum.member?(activities, activity_two)
assert Enum.member?(activities, activity_three)
@@ -703,15 +723,14 @@ test "doesn't return muted activities" do
%Activity{} = boost_activity = Activity.get_create_by_object_ap_id(id)
activity_three = Activity.get_by_id(activity_three.id)
- activities =
- ActivityPub.fetch_activities([], %{"muting_user" => user, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{muting_user: user, skip_preload: true})
assert Enum.member?(activities, activity_two)
refute Enum.member?(activities, activity_three)
refute Enum.member?(activities, boost_activity)
assert Enum.member?(activities, activity_one)
- activities = ActivityPub.fetch_activities([], %{"muting_user" => nil, "skip_preload" => true})
+ activities = ActivityPub.fetch_activities([], %{muting_user: nil, skip_preload: true})
assert Enum.member?(activities, activity_two)
assert Enum.member?(activities, activity_three)
@@ -727,7 +746,7 @@ test "doesn't return thread muted activities" do
{:ok, _activity_two} = CommonAPI.add_mute(user, activity_two)
- assert [_activity_one] = ActivityPub.fetch_activities([], %{"muting_user" => user})
+ assert [_activity_one] = ActivityPub.fetch_activities([], %{muting_user: user})
end
test "returns thread muted activities when with_muted is set" do
@@ -739,7 +758,7 @@ test "returns thread muted activities when with_muted is set" do
{:ok, _activity_two} = CommonAPI.add_mute(user, activity_two)
assert [_activity_two, _activity_one] =
- ActivityPub.fetch_activities([], %{"muting_user" => user, "with_muted" => true})
+ ActivityPub.fetch_activities([], %{muting_user: user, with_muted: true})
end
test "does include announces on request" do
@@ -761,7 +780,7 @@ test "excludes reblogs on request" do
{:ok, expected_activity} = ActivityBuilder.insert(%{"type" => "Create"}, %{:user => user})
{:ok, _} = ActivityBuilder.insert(%{"type" => "Announce"}, %{:user => user})
- [activity] = ActivityPub.fetch_user_activities(user, nil, %{"exclude_reblogs" => "true"})
+ [activity] = ActivityPub.fetch_user_activities(user, nil, %{exclude_reblogs: true})
assert activity == expected_activity
end
@@ -804,7 +823,7 @@ test "retrieves ids starting from a since_id" do
expected_activities = ActivityBuilder.insert_list(10)
since_id = List.last(activities).id
- activities = ActivityPub.fetch_public_activities(%{"since_id" => since_id})
+ activities = ActivityPub.fetch_public_activities(%{since_id: since_id})
assert collect_ids(activities) == collect_ids(expected_activities)
assert length(activities) == 10
@@ -819,7 +838,7 @@ test "retrieves ids up to max_id" do
|> ActivityBuilder.insert_list()
|> List.first()
- activities = ActivityPub.fetch_public_activities(%{"max_id" => max_id})
+ activities = ActivityPub.fetch_public_activities(%{max_id: max_id})
assert length(activities) == 20
assert collect_ids(activities) == collect_ids(expected_activities)
@@ -831,8 +850,7 @@ test "paginates via offset/limit" do
later_activities = ActivityBuilder.insert_list(10)
- activities =
- ActivityPub.fetch_public_activities(%{"page" => "2", "page_size" => "20"}, :offset)
+ activities = ActivityPub.fetch_public_activities(%{page: "2", page_size: "20"}, :offset)
assert length(activities) == 20
@@ -848,7 +866,7 @@ test "doesn't return reblogs for users for whom reblogs have been muted" do
{:ok, activity} = CommonAPI.repeat(activity.id, booster)
- activities = ActivityPub.fetch_activities([], %{"muting_user" => user})
+ activities = ActivityPub.fetch_activities([], %{muting_user: user})
refute Enum.any?(activities, fn %{id: id} -> id == activity.id end)
end
@@ -862,7 +880,7 @@ test "returns reblogs for users for whom reblogs have not been muted" do
{:ok, activity} = CommonAPI.repeat(activity.id, booster)
- activities = ActivityPub.fetch_activities([], %{"muting_user" => user})
+ activities = ActivityPub.fetch_activities([], %{muting_user: user})
assert Enum.any?(activities, fn %{id: id} -> id == activity.id end)
end
@@ -974,54 +992,6 @@ test "creates an undo activity for a pending follow request" do
end
end
- describe "blocking" do
- test "reverts block activity on error" do
- [blocker, blocked] = insert_list(2, :user)
-
- with_mock(Utils, [:passthrough], maybe_federate: fn _ -> {:error, :reverted} end) do
- assert {:error, :reverted} = ActivityPub.block(blocker, blocked)
- end
-
- assert Repo.aggregate(Activity, :count, :id) == 0
- assert Repo.aggregate(Object, :count, :id) == 0
- end
-
- test "creates a block activity" do
- clear_config([:instance, :federating], true)
- blocker = insert(:user)
- blocked = insert(:user)
-
- with_mock Pleroma.Web.Federator,
- publish: fn _ -> nil end do
- {:ok, activity} = ActivityPub.block(blocker, blocked)
-
- assert activity.data["type"] == "Block"
- assert activity.data["actor"] == blocker.ap_id
- assert activity.data["object"] == blocked.ap_id
-
- assert called(Pleroma.Web.Federator.publish(activity))
- end
- end
-
- test "works with outgoing blocks disabled, but doesn't federate" do
- clear_config([:instance, :federating], true)
- clear_config([:activitypub, :outgoing_blocks], false)
- blocker = insert(:user)
- blocked = insert(:user)
-
- with_mock Pleroma.Web.Federator,
- publish: fn _ -> nil end do
- {:ok, activity} = ActivityPub.block(blocker, blocked)
-
- assert activity.data["type"] == "Block"
- assert activity.data["actor"] == blocker.ap_id
- assert activity.data["object"] == blocked.ap_id
-
- refute called(Pleroma.Web.Federator.publish(:_))
- end
- end
- end
-
describe "timeline post-processing" do
test "it filters broken threads" do
user1 = insert(:user)
@@ -1066,7 +1036,7 @@ test "it filters broken threads" do
assert length(activities) == 3
activities =
- ActivityPub.fetch_activities([user1.ap_id | User.following(user1)], %{"user" => user1})
+ ActivityPub.fetch_activities([user1.ap_id | User.following(user1)], %{user: user1})
|> Enum.map(fn a -> a.id end)
assert [public_activity.id, private_activity_1.id] == activities
@@ -1074,52 +1044,6 @@ test "it filters broken threads" do
end
end
- describe "update" do
- setup do: clear_config([:instance, :max_pinned_statuses])
-
- test "it creates an update activity with the new user data" do
- user = insert(:user)
- {:ok, user} = User.ensure_keys_present(user)
- user_data = Pleroma.Web.ActivityPub.UserView.render("user.json", %{user: user})
-
- {:ok, update} =
- ActivityPub.update(%{
- actor: user_data["id"],
- to: [user.follower_address],
- cc: [],
- object: user_data
- })
-
- assert update.data["actor"] == user.ap_id
- assert update.data["to"] == [user.follower_address]
- assert embedded_object = update.data["object"]
- assert embedded_object["id"] == user_data["id"]
- assert embedded_object["type"] == user_data["type"]
- end
- end
-
- test "returned pinned statuses" do
- Config.put([:instance, :max_pinned_statuses], 3)
- user = insert(:user)
-
- {:ok, activity_one} = CommonAPI.post(user, %{status: "HI!!!"})
- {:ok, activity_two} = CommonAPI.post(user, %{status: "HI!!!"})
- {:ok, activity_three} = CommonAPI.post(user, %{status: "HI!!!"})
-
- CommonAPI.pin(activity_one.id, user)
- user = refresh_record(user)
-
- CommonAPI.pin(activity_two.id, user)
- user = refresh_record(user)
-
- CommonAPI.pin(activity_three.id, user)
- user = refresh_record(user)
-
- activities = ActivityPub.fetch_user_activities(user, nil, %{"pinned" => "true"})
-
- assert 3 = length(activities)
- end
-
describe "flag/1" do
setup do
reporter = insert(:user)
@@ -1226,7 +1150,7 @@ test "fetch_activities/2 returns activities addressed to a list " do
activity = Repo.preload(activity, :bookmark)
activity = %Activity{activity | thread_muted?: !!activity.thread_muted?}
- assert ActivityPub.fetch_activities([], %{"user" => user}) == [activity]
+ assert ActivityPub.fetch_activities([], %{user: user}) == [activity]
end
def data_uri do
@@ -1400,7 +1324,7 @@ test "returns a favourite activities sorted by adds to favorite" do
assert Enum.map(result, & &1.id) == [a1.id, a5.id, a3.id, a4.id]
- result = ActivityPub.fetch_favourites(user, %{"limit" => 2})
+ result = ActivityPub.fetch_favourites(user, %{limit: 2})
assert Enum.map(result, & &1.id) == [a1.id, a5.id]
end
end
@@ -1470,7 +1394,7 @@ test "doesn't retrieve replies activities with exclude_replies" do
{:ok, _reply} = CommonAPI.post(user, %{status: "yeah", in_reply_to_status_id: activity.id})
- [result] = ActivityPub.fetch_public_activities(%{"exclude_replies" => "true"})
+ [result] = ActivityPub.fetch_public_activities(%{exclude_replies: true})
assert result.id == activity.id
@@ -1483,11 +1407,11 @@ test "doesn't retrieve replies activities with exclude_replies" do
test "public timeline", %{users: %{u1: user}} do
activities_ids =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("local_only", false)
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("reply_filtering_user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:local_only, false)
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:reply_filtering_user, user)
|> ActivityPub.fetch_public_activities()
|> Enum.map(& &1.id)
@@ -1504,12 +1428,12 @@ test "public timeline with reply_visibility `following`", %{
} do
activities_ids =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("local_only", false)
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("reply_visibility", "following")
- |> Map.put("reply_filtering_user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:local_only, false)
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:reply_visibility, "following")
+ |> Map.put(:reply_filtering_user, user)
|> ActivityPub.fetch_public_activities()
|> Enum.map(& &1.id)
@@ -1531,12 +1455,12 @@ test "public timeline with reply_visibility `self`", %{
} do
activities_ids =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("local_only", false)
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("reply_visibility", "self")
- |> Map.put("reply_filtering_user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:local_only, false)
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:reply_visibility, "self")
+ |> Map.put(:reply_filtering_user, user)
|> ActivityPub.fetch_public_activities()
|> Enum.map(& &1.id)
@@ -1555,11 +1479,11 @@ test "home timeline", %{
} do
params =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("user", user)
- |> Map.put("reply_filtering_user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:user, user)
+ |> Map.put(:reply_filtering_user, user)
activities_ids =
ActivityPub.fetch_activities([user.ap_id | User.following(user)], params)
@@ -1593,12 +1517,12 @@ test "home timeline with reply_visibility `following`", %{
} do
params =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("user", user)
- |> Map.put("reply_visibility", "following")
- |> Map.put("reply_filtering_user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:user, user)
+ |> Map.put(:reply_visibility, "following")
+ |> Map.put(:reply_filtering_user, user)
activities_ids =
ActivityPub.fetch_activities([user.ap_id | User.following(user)], params)
@@ -1632,12 +1556,12 @@ test "home timeline with reply_visibility `self`", %{
} do
params =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("user", user)
- |> Map.put("reply_visibility", "self")
- |> Map.put("reply_filtering_user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:user, user)
+ |> Map.put(:reply_visibility, "self")
+ |> Map.put(:reply_filtering_user, user)
activities_ids =
ActivityPub.fetch_activities([user.ap_id | User.following(user)], params)
@@ -1658,6 +1582,40 @@ test "home timeline with reply_visibility `self`", %{
assert Enum.all?(visible_ids, &(&1 in activities_ids))
end
+
+ test "filtering out announces where the user is the actor of the announced message" do
+ user = insert(:user)
+ other_user = insert(:user)
+ third_user = insert(:user)
+ User.follow(user, other_user)
+
+ {:ok, post} = CommonAPI.post(user, %{status: "yo"})
+ {:ok, other_post} = CommonAPI.post(third_user, %{status: "yo"})
+ {:ok, _announce} = CommonAPI.repeat(post.id, other_user)
+ {:ok, _announce} = CommonAPI.repeat(post.id, third_user)
+ {:ok, announce} = CommonAPI.repeat(other_post.id, other_user)
+
+ params = %{
+ type: ["Announce"]
+ }
+
+ results =
+ [user.ap_id | User.following(user)]
+ |> ActivityPub.fetch_activities(params)
+
+ assert length(results) == 3
+
+ params = %{
+ type: ["Announce"],
+ announce_filtering_user: user
+ }
+
+ [result] =
+ [user.ap_id | User.following(user)]
+ |> ActivityPub.fetch_activities(params)
+
+ assert result.id == announce.id
+ end
end
describe "replies filtering with private messages" do
@@ -1666,11 +1624,11 @@ test "home timeline with reply_visibility `self`", %{
test "public timeline", %{users: %{u1: user}} do
activities_ids =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("local_only", false)
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:local_only, false)
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:user, user)
|> ActivityPub.fetch_public_activities()
|> Enum.map(& &1.id)
@@ -1680,13 +1638,13 @@ test "public timeline", %{users: %{u1: user}} do
test "public timeline with default reply_visibility `following`", %{users: %{u1: user}} do
activities_ids =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("local_only", false)
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("reply_visibility", "following")
- |> Map.put("reply_filtering_user", user)
- |> Map.put("user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:local_only, false)
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:reply_visibility, "following")
+ |> Map.put(:reply_filtering_user, user)
+ |> Map.put(:user, user)
|> ActivityPub.fetch_public_activities()
|> Enum.map(& &1.id)
@@ -1696,13 +1654,13 @@ test "public timeline with default reply_visibility `following`", %{users: %{u1:
test "public timeline with default reply_visibility `self`", %{users: %{u1: user}} do
activities_ids =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("local_only", false)
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("reply_visibility", "self")
- |> Map.put("reply_filtering_user", user)
- |> Map.put("user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:local_only, false)
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:reply_visibility, "self")
+ |> Map.put(:reply_filtering_user, user)
+ |> Map.put(:user, user)
|> ActivityPub.fetch_public_activities()
|> Enum.map(& &1.id)
@@ -1712,10 +1670,10 @@ test "public timeline with default reply_visibility `self`", %{users: %{u1: user
test "home timeline", %{users: %{u1: user}} do
params =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:user, user)
activities_ids =
ActivityPub.fetch_activities([user.ap_id | User.following(user)], params)
@@ -1727,12 +1685,12 @@ test "home timeline", %{users: %{u1: user}} do
test "home timeline with default reply_visibility `following`", %{users: %{u1: user}} do
params =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("user", user)
- |> Map.put("reply_visibility", "following")
- |> Map.put("reply_filtering_user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:user, user)
+ |> Map.put(:reply_visibility, "following")
+ |> Map.put(:reply_filtering_user, user)
activities_ids =
ActivityPub.fetch_activities([user.ap_id | User.following(user)], params)
@@ -1751,12 +1709,12 @@ test "home timeline with default reply_visibility `self`", %{
} do
params =
%{}
- |> Map.put("type", ["Create", "Announce"])
- |> Map.put("blocking_user", user)
- |> Map.put("muting_user", user)
- |> Map.put("user", user)
- |> Map.put("reply_visibility", "self")
- |> Map.put("reply_filtering_user", user)
+ |> Map.put(:type, ["Create", "Announce"])
+ |> Map.put(:blocking_user, user)
+ |> Map.put(:muting_user, user)
+ |> Map.put(:user, user)
+ |> Map.put(:reply_visibility, "self")
+ |> Map.put(:reply_filtering_user, user)
activities_ids =
ActivityPub.fetch_activities([user.ap_id | User.following(user)], params)
@@ -2001,4 +1959,20 @@ test "it just returns the input if the user has no following/follower addresses"
end) =~ "Follower/Following counter update for #{user.ap_id} failed"
end
end
+
+ describe "global activity expiration" do
+ setup do: clear_config([:mrf, :policies])
+
+ test "creates an activity expiration for local Create activities" do
+ Pleroma.Config.put(
+ [:mrf, :policies],
+ Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy
+ )
+
+ {:ok, %{id: id_create}} = ActivityBuilder.insert(%{"type" => "Create", "context" => "3hu"})
+ {:ok, _follow} = ActivityBuilder.insert(%{"type" => "Follow", "context" => "3hu"})
+
+ assert [%{activity_id: ^id_create}] = Pleroma.ActivityExpiration |> Repo.all()
+ end
+ end
end
diff --git a/test/web/activity_pub/mrf/activity_expiration_policy_test.exs b/test/web/activity_pub/mrf/activity_expiration_policy_test.exs
new file mode 100644
index 000000000..8babf49e7
--- /dev/null
+++ b/test/web/activity_pub/mrf/activity_expiration_policy_test.exs
@@ -0,0 +1,77 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicyTest do
+ use ExUnit.Case, async: true
+ alias Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy
+
+ @id Pleroma.Web.Endpoint.url() <> "/activities/cofe"
+
+ test "adds `expires_at` property" do
+ assert {:ok, %{"type" => "Create", "expires_at" => expires_at}} =
+ ActivityExpirationPolicy.filter(%{
+ "id" => @id,
+ "type" => "Create",
+ "object" => %{"type" => "Note"}
+ })
+
+ assert Timex.diff(expires_at, NaiveDateTime.utc_now(), :days) == 364
+ end
+
+ test "keeps existing `expires_at` if it less than the config setting" do
+ expires_at = NaiveDateTime.utc_now() |> Timex.shift(days: 1)
+
+ assert {:ok, %{"type" => "Create", "expires_at" => ^expires_at}} =
+ ActivityExpirationPolicy.filter(%{
+ "id" => @id,
+ "type" => "Create",
+ "expires_at" => expires_at,
+ "object" => %{"type" => "Note"}
+ })
+ end
+
+ test "overwrites existing `expires_at` if it greater than the config setting" do
+ too_distant_future = NaiveDateTime.utc_now() |> Timex.shift(years: 2)
+
+ assert {:ok, %{"type" => "Create", "expires_at" => expires_at}} =
+ ActivityExpirationPolicy.filter(%{
+ "id" => @id,
+ "type" => "Create",
+ "expires_at" => too_distant_future,
+ "object" => %{"type" => "Note"}
+ })
+
+ assert Timex.diff(expires_at, NaiveDateTime.utc_now(), :days) == 364
+ end
+
+ test "ignores remote activities" do
+ assert {:ok, activity} =
+ ActivityExpirationPolicy.filter(%{
+ "id" => "https://example.com/123",
+ "type" => "Create",
+ "object" => %{"type" => "Note"}
+ })
+
+ refute Map.has_key?(activity, "expires_at")
+ end
+
+ test "ignores non-Create/Note activities" do
+ assert {:ok, activity} =
+ ActivityExpirationPolicy.filter(%{
+ "id" => "https://example.com/123",
+ "type" => "Follow"
+ })
+
+ refute Map.has_key?(activity, "expires_at")
+
+ assert {:ok, activity} =
+ ActivityExpirationPolicy.filter(%{
+ "id" => "https://example.com/123",
+ "type" => "Create",
+ "object" => %{"type" => "Cofe"}
+ })
+
+ refute Map.has_key?(activity, "expires_at")
+ end
+end
diff --git a/test/web/activity_pub/mrf/anti_link_spam_policy_test.exs b/test/web/activity_pub/mrf/anti_link_spam_policy_test.exs
index 1a13699be..6867c9853 100644
--- a/test/web/activity_pub/mrf/anti_link_spam_policy_test.exs
+++ b/test/web/activity_pub/mrf/anti_link_spam_policy_test.exs
@@ -33,7 +33,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest do
describe "with new user" do
test "it allows posts without links" do
- user = insert(:user)
+ user = insert(:user, local: false)
assert user.note_count == 0
@@ -45,7 +45,7 @@ test "it allows posts without links" do
end
test "it disallows posts with links" do
- user = insert(:user)
+ user = insert(:user, local: false)
assert user.note_count == 0
@@ -55,6 +55,18 @@ test "it disallows posts with links" do
{:reject, _} = AntiLinkSpamPolicy.filter(message)
end
+
+ test "it allows posts with links for local users" do
+ user = insert(:user)
+
+ assert user.note_count == 0
+
+ message =
+ @linkful_message
+ |> Map.put("actor", user.ap_id)
+
+ {:ok, _message} = AntiLinkSpamPolicy.filter(message)
+ end
end
describe "with old user" do
diff --git a/test/web/activity_pub/mrf/hellthread_policy_test.exs b/test/web/activity_pub/mrf/hellthread_policy_test.exs
index 95ef0b168..6e9daa7f9 100644
--- a/test/web/activity_pub/mrf/hellthread_policy_test.exs
+++ b/test/web/activity_pub/mrf/hellthread_policy_test.exs
@@ -8,6 +8,8 @@ defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicyTest do
import Pleroma.Web.ActivityPub.MRF.HellthreadPolicy
+ alias Pleroma.Web.CommonAPI
+
setup do
user = insert(:user)
@@ -20,7 +22,10 @@ defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicyTest do
"https://instance.tld/users/user1",
"https://instance.tld/users/user2",
"https://instance.tld/users/user3"
- ]
+ ],
+ "object" => %{
+ "type" => "Note"
+ }
}
[user: user, message: message]
@@ -28,6 +33,17 @@ defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicyTest do
setup do: clear_config(:mrf_hellthread)
+ test "doesn't die on chat messages" do
+ Pleroma.Config.put([:mrf_hellthread], %{delist_threshold: 2, reject_threshold: 0})
+
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, activity} = CommonAPI.post_chat_message(user, other_user, "moin")
+
+ assert {:ok, _} = filter(activity.data)
+ end
+
describe "reject" do
test "rejects the message if the recipient count is above reject_threshold", %{
message: message
diff --git a/test/web/activity_pub/mrf/mrf_test.exs b/test/web/activity_pub/mrf/mrf_test.exs
index c941066f2..a63b25423 100644
--- a/test/web/activity_pub/mrf/mrf_test.exs
+++ b/test/web/activity_pub/mrf/mrf_test.exs
@@ -60,8 +60,6 @@ test "matches are case-insensitive" do
end
describe "describe/0" do
- setup do: clear_config([:instance, :rewrite_policy])
-
test "it works as expected with noop policy" do
expected = %{
mrf_policies: ["NoOpPolicy"],
@@ -72,7 +70,7 @@ test "it works as expected with noop policy" do
end
test "it works as expected with mock policy" do
- Pleroma.Config.put([:instance, :rewrite_policy], [MRFModuleMock])
+ clear_config([:mrf, :policies], [MRFModuleMock])
expected = %{
mrf_policies: ["MRFModuleMock"],
diff --git a/test/web/activity_pub/mrf/user_allowlist_policy_test.exs b/test/web/activity_pub/mrf/user_allowlist_policy_test.exs
index 724bae058..ba1b69658 100644
--- a/test/web/activity_pub/mrf/user_allowlist_policy_test.exs
+++ b/test/web/activity_pub/mrf/user_allowlist_policy_test.exs
@@ -7,7 +7,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.UserAllowListPolicyTest do
alias Pleroma.Web.ActivityPub.MRF.UserAllowListPolicy
- setup do: clear_config([:mrf_user_allowlist, :localhost])
+ setup do: clear_config(:mrf_user_allowlist)
test "pass filter if allow list is empty" do
actor = insert(:user)
@@ -17,14 +17,14 @@ test "pass filter if allow list is empty" do
test "pass filter if allow list isn't empty and user in allow list" do
actor = insert(:user)
- Pleroma.Config.put([:mrf_user_allowlist, :localhost], [actor.ap_id, "test-ap-id"])
+ Pleroma.Config.put([:mrf_user_allowlist], %{"localhost" => [actor.ap_id, "test-ap-id"]})
message = %{"actor" => actor.ap_id}
assert UserAllowListPolicy.filter(message) == {:ok, message}
end
test "rejected if allow list isn't empty and user not in allow list" do
actor = insert(:user)
- Pleroma.Config.put([:mrf_user_allowlist, :localhost], ["test-ap-id"])
+ Pleroma.Config.put([:mrf_user_allowlist], %{"localhost" => ["test-ap-id"]})
message = %{"actor" => actor.ap_id}
assert UserAllowListPolicy.filter(message) == {:reject, nil}
end
diff --git a/test/web/activity_pub/object_validator_test.exs b/test/web/activity_pub/object_validator_test.exs
index 7953eecf2..f38bf7e08 100644
--- a/test/web/activity_pub/object_validator_test.exs
+++ b/test/web/activity_pub/object_validator_test.exs
@@ -2,14 +2,264 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidatorTest do
use Pleroma.DataCase
alias Pleroma.Object
+ alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.ActivityPub.Builder
alias Pleroma.Web.ActivityPub.ObjectValidator
+ alias Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator
alias Pleroma.Web.ActivityPub.ObjectValidators.LikeValidator
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
+ describe "attachments" do
+ test "works with honkerific attachments" do
+ attachment = %{
+ "mediaType" => "",
+ "name" => "",
+ "summary" => "298p3RG7j27tfsZ9RQ.jpg",
+ "type" => "Document",
+ "url" => "https://honk.tedunangst.com/d/298p3RG7j27tfsZ9RQ.jpg"
+ }
+
+ assert {:ok, attachment} =
+ AttachmentValidator.cast_and_validate(attachment)
+ |> Ecto.Changeset.apply_action(:insert)
+
+ assert attachment.mediaType == "application/octet-stream"
+ end
+
+ test "it turns mastodon attachments into our attachments" do
+ attachment = %{
+ "url" =>
+ "http://mastodon.example.org/system/media_attachments/files/000/000/002/original/334ce029e7bfb920.jpg",
+ "type" => "Document",
+ "name" => nil,
+ "mediaType" => "image/jpeg"
+ }
+
+ {:ok, attachment} =
+ AttachmentValidator.cast_and_validate(attachment)
+ |> Ecto.Changeset.apply_action(:insert)
+
+ assert [
+ %{
+ href:
+ "http://mastodon.example.org/system/media_attachments/files/000/000/002/original/334ce029e7bfb920.jpg",
+ type: "Link",
+ mediaType: "image/jpeg"
+ }
+ ] = attachment.url
+
+ assert attachment.mediaType == "image/jpeg"
+ end
+
+ test "it handles our own uploads" do
+ user = insert(:user)
+
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image.jpg"),
+ filename: "an_image.jpg"
+ }
+
+ {:ok, attachment} = ActivityPub.upload(file, actor: user.ap_id)
+
+ {:ok, attachment} =
+ attachment.data
+ |> AttachmentValidator.cast_and_validate()
+ |> Ecto.Changeset.apply_action(:insert)
+
+ assert attachment.mediaType == "image/jpeg"
+ end
+ end
+
+ describe "chat message create activities" do
+ test "it is invalid if the object already exists" do
+ user = insert(:user)
+ recipient = insert(:user)
+ {:ok, activity} = CommonAPI.post_chat_message(user, recipient, "hey")
+ object = Object.normalize(activity, false)
+
+ {:ok, create_data, _} = Builder.create(user, object.data, [recipient.ap_id])
+
+ {:error, cng} = ObjectValidator.validate(create_data, [])
+
+ assert {:object, {"The object to create already exists", []}} in cng.errors
+ end
+
+ test "it is invalid if the object data has a different `to` or `actor` field" do
+ user = insert(:user)
+ recipient = insert(:user)
+ {:ok, object_data, _} = Builder.chat_message(recipient, user.ap_id, "Hey")
+
+ {:ok, create_data, _} = Builder.create(user, object_data, [recipient.ap_id])
+
+ {:error, cng} = ObjectValidator.validate(create_data, [])
+
+ assert {:to, {"Recipients don't match with object recipients", []}} in cng.errors
+ assert {:actor, {"Actor doesn't match with object actor", []}} in cng.errors
+ end
+ end
+
+ describe "chat messages" do
+ setup do
+ clear_config([:instance, :remote_limit])
+ user = insert(:user)
+ recipient = insert(:user, local: false)
+
+ {:ok, valid_chat_message, _} = Builder.chat_message(user, recipient.ap_id, "hey :firefox:")
+
+ %{user: user, recipient: recipient, valid_chat_message: valid_chat_message}
+ end
+
+ test "let's through some basic html", %{user: user, recipient: recipient} do
+ {:ok, valid_chat_message, _} =
+ Builder.chat_message(
+ user,
+ recipient.ap_id,
+ "hey example "
+ )
+
+ assert {:ok, object, _meta} = ObjectValidator.validate(valid_chat_message, [])
+
+ assert object["content"] ==
+ "hey example alert('uguu')"
+ end
+
+ test "validates for a basic object we build", %{valid_chat_message: valid_chat_message} do
+ assert {:ok, object, _meta} = ObjectValidator.validate(valid_chat_message, [])
+
+ assert Map.put(valid_chat_message, "attachment", nil) == object
+ end
+
+ test "validates for a basic object with an attachment", %{
+ valid_chat_message: valid_chat_message,
+ user: user
+ } do
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image.jpg"),
+ filename: "an_image.jpg"
+ }
+
+ {:ok, attachment} = ActivityPub.upload(file, actor: user.ap_id)
+
+ valid_chat_message =
+ valid_chat_message
+ |> Map.put("attachment", attachment.data)
+
+ assert {:ok, object, _meta} = ObjectValidator.validate(valid_chat_message, [])
+
+ assert object["attachment"]
+ end
+
+ test "validates for a basic object with an attachment in an array", %{
+ valid_chat_message: valid_chat_message,
+ user: user
+ } do
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image.jpg"),
+ filename: "an_image.jpg"
+ }
+
+ {:ok, attachment} = ActivityPub.upload(file, actor: user.ap_id)
+
+ valid_chat_message =
+ valid_chat_message
+ |> Map.put("attachment", [attachment.data])
+
+ assert {:ok, object, _meta} = ObjectValidator.validate(valid_chat_message, [])
+
+ assert object["attachment"]
+ end
+
+ test "validates for a basic object with an attachment but without content", %{
+ valid_chat_message: valid_chat_message,
+ user: user
+ } do
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image.jpg"),
+ filename: "an_image.jpg"
+ }
+
+ {:ok, attachment} = ActivityPub.upload(file, actor: user.ap_id)
+
+ valid_chat_message =
+ valid_chat_message
+ |> Map.put("attachment", attachment.data)
+ |> Map.delete("content")
+
+ assert {:ok, object, _meta} = ObjectValidator.validate(valid_chat_message, [])
+
+ assert object["attachment"]
+ end
+
+ test "does not validate if the message has no content", %{
+ valid_chat_message: valid_chat_message
+ } do
+ contentless =
+ valid_chat_message
+ |> Map.delete("content")
+
+ refute match?({:ok, _object, _meta}, ObjectValidator.validate(contentless, []))
+ end
+
+ test "does not validate if the message is longer than the remote_limit", %{
+ valid_chat_message: valid_chat_message
+ } do
+ Pleroma.Config.put([:instance, :remote_limit], 2)
+ refute match?({:ok, _object, _meta}, ObjectValidator.validate(valid_chat_message, []))
+ end
+
+ test "does not validate if the recipient is blocking the actor", %{
+ valid_chat_message: valid_chat_message,
+ user: user,
+ recipient: recipient
+ } do
+ Pleroma.User.block(recipient, user)
+ refute match?({:ok, _object, _meta}, ObjectValidator.validate(valid_chat_message, []))
+ end
+
+ test "does not validate if the actor or the recipient is not in our system", %{
+ valid_chat_message: valid_chat_message
+ } do
+ chat_message =
+ valid_chat_message
+ |> Map.put("actor", "https://raymoo.com/raymoo")
+
+ {:error, _} = ObjectValidator.validate(chat_message, [])
+
+ chat_message =
+ valid_chat_message
+ |> Map.put("to", ["https://raymoo.com/raymoo"])
+
+ {:error, _} = ObjectValidator.validate(chat_message, [])
+ end
+
+ test "does not validate for a message with multiple recipients", %{
+ valid_chat_message: valid_chat_message,
+ user: user,
+ recipient: recipient
+ } do
+ chat_message =
+ valid_chat_message
+ |> Map.put("to", [user.ap_id, recipient.ap_id])
+
+ assert {:error, _} = ObjectValidator.validate(chat_message, [])
+ end
+
+ test "does not validate if it doesn't concern local users" do
+ user = insert(:user, local: false)
+ recipient = insert(:user, local: false)
+
+ {:ok, valid_chat_message, _} = Builder.chat_message(user, recipient.ap_id, "hey")
+ assert {:error, _} = ObjectValidator.validate(valid_chat_message, [])
+ end
+ end
+
describe "EmojiReacts" do
setup do
user = insert(:user)
@@ -372,4 +622,63 @@ test "returns an error if the actor can't announce the object", %{
assert {:actor, {"can not announce this object publicly", []}} in cng.errors
end
end
+
+ describe "updates" do
+ setup do
+ user = insert(:user)
+
+ object = %{
+ "id" => user.ap_id,
+ "name" => "A new name",
+ "summary" => "A new bio"
+ }
+
+ {:ok, valid_update, []} = Builder.update(user, object)
+
+ %{user: user, valid_update: valid_update}
+ end
+
+ test "validates a basic object", %{valid_update: valid_update} do
+ assert {:ok, _update, []} = ObjectValidator.validate(valid_update, [])
+ end
+
+ test "returns an error if the object can't be updated by the actor", %{
+ valid_update: valid_update
+ } do
+ other_user = insert(:user)
+
+ update =
+ valid_update
+ |> Map.put("actor", other_user.ap_id)
+
+ assert {:error, _cng} = ObjectValidator.validate(update, [])
+ end
+ end
+
+ describe "blocks" do
+ setup do
+ user = insert(:user, local: false)
+ blocked = insert(:user)
+
+ {:ok, valid_block, []} = Builder.block(user, blocked)
+
+ %{user: user, valid_block: valid_block}
+ end
+
+ test "validates a basic object", %{
+ valid_block: valid_block
+ } do
+ assert {:ok, _block, []} = ObjectValidator.validate(valid_block, [])
+ end
+
+ test "returns an error if we don't know the blocked user", %{
+ valid_block: valid_block
+ } do
+ block =
+ valid_block
+ |> Map.put("object", "https://gensokyo.2hu/users/raymoo")
+
+ assert {:error, _cng} = ObjectValidator.validate(block, [])
+ end
+ end
end
diff --git a/test/web/activity_pub/object_validators/types/date_time_test.exs b/test/web/activity_pub/object_validators/types/date_time_test.exs
index 3e17a9497..43be8e936 100644
--- a/test/web/activity_pub/object_validators/types/date_time_test.exs
+++ b/test/web/activity_pub/object_validators/types/date_time_test.exs
@@ -1,5 +1,5 @@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.Types.DateTimeTest do
- alias Pleroma.Web.ActivityPub.ObjectValidators.Types.DateTime
+ alias Pleroma.EctoType.ActivityPub.ObjectValidators.DateTime
use Pleroma.DataCase
test "it validates an xsd:Datetime" do
diff --git a/test/web/activity_pub/object_validators/types/object_id_test.exs b/test/web/activity_pub/object_validators/types/object_id_test.exs
index 834213182..e0ab76379 100644
--- a/test/web/activity_pub/object_validators/types/object_id_test.exs
+++ b/test/web/activity_pub/object_validators/types/object_id_test.exs
@@ -1,5 +1,9 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.ObjectValidators.Types.ObjectIDTest do
- alias Pleroma.Web.ActivityPub.ObjectValidators.Types.ObjectID
+ alias Pleroma.EctoType.ActivityPub.ObjectValidators.ObjectID
use Pleroma.DataCase
@uris [
diff --git a/test/web/activity_pub/object_validators/types/recipients_test.exs b/test/web/activity_pub/object_validators/types/recipients_test.exs
index f278f039b..053916bdd 100644
--- a/test/web/activity_pub/object_validators/types/recipients_test.exs
+++ b/test/web/activity_pub/object_validators/types/recipients_test.exs
@@ -1,5 +1,5 @@
defmodule Pleroma.Web.ObjectValidators.Types.RecipientsTest do
- alias Pleroma.Web.ActivityPub.ObjectValidators.Types.Recipients
+ alias Pleroma.EctoType.ActivityPub.ObjectValidators.Recipients
use Pleroma.DataCase
test "it asserts that all elements of the list are object ids" do
diff --git a/test/web/activity_pub/object_validators/types/safe_text_test.exs b/test/web/activity_pub/object_validators/types/safe_text_test.exs
new file mode 100644
index 000000000..9c08606f6
--- /dev/null
+++ b/test/web/activity_pub/object_validators/types/safe_text_test.exs
@@ -0,0 +1,30 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ActivityPub.ObjectValidators.Types.SafeTextTest do
+ use Pleroma.DataCase
+
+ alias Pleroma.EctoType.ActivityPub.ObjectValidators.SafeText
+
+ test "it lets normal text go through" do
+ text = "hey how are you"
+ assert {:ok, text} == SafeText.cast(text)
+ end
+
+ test "it removes html tags from text" do
+ text = "hey look xss "
+ assert {:ok, "hey look xss alert('foo')"} == SafeText.cast(text)
+ end
+
+ test "it keeps basic html tags" do
+ text = "hey look xss "
+
+ assert {:ok, "hey look xss alert('foo')"} ==
+ SafeText.cast(text)
+ end
+
+ test "errors for non-text" do
+ assert :error == SafeText.cast(1)
+ end
+end
diff --git a/test/web/activity_pub/pipeline_test.exs b/test/web/activity_pub/pipeline_test.exs
index 26557720b..8deb64501 100644
--- a/test/web/activity_pub/pipeline_test.exs
+++ b/test/web/activity_pub/pipeline_test.exs
@@ -33,7 +33,10 @@ test "it goes through validation, filtering, persisting, side effects and federa
{
Pleroma.Web.ActivityPub.SideEffects,
[],
- [handle: fn o, m -> {:ok, o, m} end]
+ [
+ handle: fn o, m -> {:ok, o, m} end,
+ handle_after_transaction: fn m -> m end
+ ]
},
{
Pleroma.Web.Federator,
@@ -71,7 +74,7 @@ test "it goes through validation, filtering, persisting, side effects without fe
{
Pleroma.Web.ActivityPub.SideEffects,
[],
- [handle: fn o, m -> {:ok, o, m} end]
+ [handle: fn o, m -> {:ok, o, m} end, handle_after_transaction: fn m -> m end]
},
{
Pleroma.Web.Federator,
@@ -110,7 +113,7 @@ test "it goes through validation, filtering, persisting, side effects without fe
{
Pleroma.Web.ActivityPub.SideEffects,
[],
- [handle: fn o, m -> {:ok, o, m} end]
+ [handle: fn o, m -> {:ok, o, m} end, handle_after_transaction: fn m -> m end]
},
{
Pleroma.Web.Federator,
diff --git a/test/web/activity_pub/side_effects_test.exs b/test/web/activity_pub/side_effects_test.exs
index a80104ea7..af27c34b4 100644
--- a/test/web/activity_pub/side_effects_test.exs
+++ b/test/web/activity_pub/side_effects_test.exs
@@ -7,6 +7,8 @@ defmodule Pleroma.Web.ActivityPub.SideEffectsTest do
use Pleroma.DataCase
alias Pleroma.Activity
+ alias Pleroma.Chat
+ alias Pleroma.Chat.MessageReference
alias Pleroma.Notification
alias Pleroma.Object
alias Pleroma.Repo
@@ -20,6 +22,114 @@ defmodule Pleroma.Web.ActivityPub.SideEffectsTest do
import Pleroma.Factory
import Mock
+ describe "handle_after_transaction" do
+ test "it streams out notifications and streams" do
+ author = insert(:user, local: true)
+ recipient = insert(:user, local: true)
+
+ {:ok, chat_message_data, _meta} = Builder.chat_message(author, recipient.ap_id, "hey")
+
+ {:ok, create_activity_data, _meta} =
+ Builder.create(author, chat_message_data["id"], [recipient.ap_id])
+
+ {:ok, create_activity, _meta} = ActivityPub.persist(create_activity_data, local: false)
+
+ {:ok, _create_activity, meta} =
+ SideEffects.handle(create_activity, local: false, object_data: chat_message_data)
+
+ assert [notification] = meta[:notifications]
+
+ with_mocks([
+ {
+ Pleroma.Web.Streamer,
+ [],
+ [
+ stream: fn _, _ -> nil end
+ ]
+ },
+ {
+ Pleroma.Web.Push,
+ [],
+ [
+ send: fn _ -> nil end
+ ]
+ }
+ ]) do
+ SideEffects.handle_after_transaction(meta)
+
+ assert called(Pleroma.Web.Streamer.stream(["user", "user:notification"], notification))
+ assert called(Pleroma.Web.Streamer.stream(["user", "user:pleroma_chat"], :_))
+ assert called(Pleroma.Web.Push.send(notification))
+ end
+ end
+ end
+
+ describe "blocking users" do
+ setup do
+ user = insert(:user)
+ blocked = insert(:user)
+ User.follow(blocked, user)
+ User.follow(user, blocked)
+
+ {:ok, block_data, []} = Builder.block(user, blocked)
+ {:ok, block, _meta} = ActivityPub.persist(block_data, local: true)
+
+ %{user: user, blocked: blocked, block: block}
+ end
+
+ test "it unfollows and blocks", %{user: user, blocked: blocked, block: block} do
+ assert User.following?(user, blocked)
+ assert User.following?(blocked, user)
+
+ {:ok, _, _} = SideEffects.handle(block)
+
+ refute User.following?(user, blocked)
+ refute User.following?(blocked, user)
+ assert User.blocks?(user, blocked)
+ end
+
+ test "it blocks but does not unfollow if the relevant setting is set", %{
+ user: user,
+ blocked: blocked,
+ block: block
+ } do
+ clear_config([:activitypub, :unfollow_blocked], false)
+ assert User.following?(user, blocked)
+ assert User.following?(blocked, user)
+
+ {:ok, _, _} = SideEffects.handle(block)
+
+ refute User.following?(user, blocked)
+ assert User.following?(blocked, user)
+ assert User.blocks?(user, blocked)
+ end
+ end
+
+ describe "update users" do
+ setup do
+ user = insert(:user)
+ {:ok, update_data, []} = Builder.update(user, %{"id" => user.ap_id, "name" => "new name!"})
+ {:ok, update, _meta} = ActivityPub.persist(update_data, local: true)
+
+ %{user: user, update_data: update_data, update: update}
+ end
+
+ test "it updates the user", %{user: user, update: update} do
+ {:ok, _, _} = SideEffects.handle(update)
+ user = User.get_by_id(user.id)
+ assert user.name == "new name!"
+ end
+
+ test "it uses a given changeset to update", %{user: user, update: update} do
+ changeset = Ecto.Changeset.change(user, %{default_scope: "direct"})
+
+ assert user.default_scope == "public"
+ {:ok, _, _} = SideEffects.handle(update, user_update_changeset: changeset)
+ user = User.get_by_id(user.id)
+ assert user.default_scope == "direct"
+ end
+ end
+
describe "delete objects" do
setup do
user = insert(:user)
@@ -173,8 +283,7 @@ test "when activation is required", %{delete: delete, user: user} do
{:ok, like} = CommonAPI.favorite(user, post.id)
{:ok, reaction} = CommonAPI.react_with_emoji(post.id, user, "👍")
{:ok, announce} = CommonAPI.repeat(post.id, user)
- {:ok, block} = ActivityPub.block(user, poster)
- User.block(user, poster)
+ {:ok, block} = CommonAPI.block(user, poster)
{:ok, undo_data, _meta} = Builder.undo(user, like)
{:ok, like_undo, _meta} = ActivityPub.persist(undo_data, local: true)
@@ -290,6 +399,147 @@ test "creates a notification", %{like: like, poster: poster} do
end
end
+ describe "creation of ChatMessages" do
+ test "notifies the recipient" do
+ author = insert(:user, local: false)
+ recipient = insert(:user, local: true)
+
+ {:ok, chat_message_data, _meta} = Builder.chat_message(author, recipient.ap_id, "hey")
+
+ {:ok, create_activity_data, _meta} =
+ Builder.create(author, chat_message_data["id"], [recipient.ap_id])
+
+ {:ok, create_activity, _meta} = ActivityPub.persist(create_activity_data, local: false)
+
+ {:ok, _create_activity, _meta} =
+ SideEffects.handle(create_activity, local: false, object_data: chat_message_data)
+
+ assert Repo.get_by(Notification, user_id: recipient.id, activity_id: create_activity.id)
+ end
+
+ test "it streams the created ChatMessage" do
+ author = insert(:user, local: true)
+ recipient = insert(:user, local: true)
+
+ {:ok, chat_message_data, _meta} = Builder.chat_message(author, recipient.ap_id, "hey")
+
+ {:ok, create_activity_data, _meta} =
+ Builder.create(author, chat_message_data["id"], [recipient.ap_id])
+
+ {:ok, create_activity, _meta} = ActivityPub.persist(create_activity_data, local: false)
+
+ {:ok, _create_activity, meta} =
+ SideEffects.handle(create_activity, local: false, object_data: chat_message_data)
+
+ assert [_, _] = meta[:streamables]
+ end
+
+ test "it creates a Chat and MessageReferences for the local users and bumps the unread count, except for the author" do
+ author = insert(:user, local: true)
+ recipient = insert(:user, local: true)
+
+ {:ok, chat_message_data, _meta} = Builder.chat_message(author, recipient.ap_id, "hey")
+
+ {:ok, create_activity_data, _meta} =
+ Builder.create(author, chat_message_data["id"], [recipient.ap_id])
+
+ {:ok, create_activity, _meta} = ActivityPub.persist(create_activity_data, local: false)
+
+ with_mocks([
+ {
+ Pleroma.Web.Streamer,
+ [],
+ [
+ stream: fn _, _ -> nil end
+ ]
+ },
+ {
+ Pleroma.Web.Push,
+ [],
+ [
+ send: fn _ -> nil end
+ ]
+ }
+ ]) do
+ {:ok, _create_activity, meta} =
+ SideEffects.handle(create_activity, local: false, object_data: chat_message_data)
+
+ # The notification gets created
+ assert [notification] = meta[:notifications]
+ assert notification.activity_id == create_activity.id
+
+ # But it is not sent out
+ refute called(Pleroma.Web.Streamer.stream(["user", "user:notification"], notification))
+ refute called(Pleroma.Web.Push.send(notification))
+
+ # Same for the user chat stream
+ assert [{topics, _}, _] = meta[:streamables]
+ assert topics == ["user", "user:pleroma_chat"]
+ refute called(Pleroma.Web.Streamer.stream(["user", "user:pleroma_chat"], :_))
+
+ chat = Chat.get(author.id, recipient.ap_id)
+
+ [cm_ref] = MessageReference.for_chat_query(chat) |> Repo.all()
+
+ assert cm_ref.object.data["content"] == "hey"
+ assert cm_ref.unread == false
+
+ chat = Chat.get(recipient.id, author.ap_id)
+
+ [cm_ref] = MessageReference.for_chat_query(chat) |> Repo.all()
+
+ assert cm_ref.object.data["content"] == "hey"
+ assert cm_ref.unread == true
+ end
+ end
+
+ test "it creates a Chat for the local users and bumps the unread count" do
+ author = insert(:user, local: false)
+ recipient = insert(:user, local: true)
+
+ {:ok, chat_message_data, _meta} = Builder.chat_message(author, recipient.ap_id, "hey")
+
+ {:ok, create_activity_data, _meta} =
+ Builder.create(author, chat_message_data["id"], [recipient.ap_id])
+
+ {:ok, create_activity, _meta} = ActivityPub.persist(create_activity_data, local: false)
+
+ {:ok, _create_activity, _meta} =
+ SideEffects.handle(create_activity, local: false, object_data: chat_message_data)
+
+ # An object is created
+ assert Object.get_by_ap_id(chat_message_data["id"])
+
+ # The remote user won't get a chat
+ chat = Chat.get(author.id, recipient.ap_id)
+ refute chat
+
+ # The local user will get a chat
+ chat = Chat.get(recipient.id, author.ap_id)
+ assert chat
+
+ author = insert(:user, local: true)
+ recipient = insert(:user, local: true)
+
+ {:ok, chat_message_data, _meta} = Builder.chat_message(author, recipient.ap_id, "hey")
+
+ {:ok, create_activity_data, _meta} =
+ Builder.create(author, chat_message_data["id"], [recipient.ap_id])
+
+ {:ok, create_activity, _meta} = ActivityPub.persist(create_activity_data, local: false)
+
+ {:ok, _create_activity, _meta} =
+ SideEffects.handle(create_activity, local: false, object_data: chat_message_data)
+
+ # Both users are local and get the chat
+ chat = Chat.get(author.id, recipient.ap_id)
+ assert chat
+
+ chat = Chat.get(recipient.id, author.ap_id)
+ assert chat
+ end
+ end
+
describe "announce objects" do
setup do
poster = insert(:user)
diff --git a/test/web/activity_pub/transmogrifier/block_handling_test.exs b/test/web/activity_pub/transmogrifier/block_handling_test.exs
new file mode 100644
index 000000000..71f1a0ed5
--- /dev/null
+++ b/test/web/activity_pub/transmogrifier/block_handling_test.exs
@@ -0,0 +1,63 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ActivityPub.Transmogrifier.BlockHandlingTest do
+ use Pleroma.DataCase
+
+ alias Pleroma.Activity
+ alias Pleroma.User
+ alias Pleroma.Web.ActivityPub.Transmogrifier
+
+ import Pleroma.Factory
+
+ test "it works for incoming blocks" do
+ user = insert(:user)
+
+ data =
+ File.read!("test/fixtures/mastodon-block-activity.json")
+ |> Poison.decode!()
+ |> Map.put("object", user.ap_id)
+
+ blocker = insert(:user, ap_id: data["actor"])
+
+ {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
+
+ assert data["type"] == "Block"
+ assert data["object"] == user.ap_id
+ assert data["actor"] == "http://mastodon.example.org/users/admin"
+
+ assert User.blocks?(blocker, user)
+ end
+
+ test "incoming blocks successfully tear down any follow relationship" do
+ blocker = insert(:user)
+ blocked = insert(:user)
+
+ data =
+ File.read!("test/fixtures/mastodon-block-activity.json")
+ |> Poison.decode!()
+ |> Map.put("object", blocked.ap_id)
+ |> Map.put("actor", blocker.ap_id)
+
+ {:ok, blocker} = User.follow(blocker, blocked)
+ {:ok, blocked} = User.follow(blocked, blocker)
+
+ assert User.following?(blocker, blocked)
+ assert User.following?(blocked, blocker)
+
+ {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
+
+ assert data["type"] == "Block"
+ assert data["object"] == blocked.ap_id
+ assert data["actor"] == blocker.ap_id
+
+ blocker = User.get_cached_by_ap_id(data["actor"])
+ blocked = User.get_cached_by_ap_id(data["object"])
+
+ assert User.blocks?(blocker, blocked)
+
+ refute User.following?(blocker, blocked)
+ refute User.following?(blocked, blocker)
+ end
+end
diff --git a/test/web/activity_pub/transmogrifier/chat_message_test.exs b/test/web/activity_pub/transmogrifier/chat_message_test.exs
new file mode 100644
index 000000000..d6736dc3e
--- /dev/null
+++ b/test/web/activity_pub/transmogrifier/chat_message_test.exs
@@ -0,0 +1,153 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ActivityPub.Transmogrifier.ChatMessageTest do
+ use Pleroma.DataCase
+
+ import Pleroma.Factory
+
+ alias Pleroma.Activity
+ alias Pleroma.Chat
+ alias Pleroma.Object
+ alias Pleroma.Web.ActivityPub.Transmogrifier
+
+ describe "handle_incoming" do
+ test "handles chonks with attachment" do
+ data = %{
+ "@context" => "https://www.w3.org/ns/activitystreams",
+ "actor" => "https://honk.tedunangst.com/u/tedu",
+ "id" => "https://honk.tedunangst.com/u/tedu/honk/x6gt8X8PcyGkQcXxzg1T",
+ "object" => %{
+ "attachment" => [
+ %{
+ "mediaType" => "image/jpeg",
+ "name" => "298p3RG7j27tfsZ9RQ.jpg",
+ "summary" => "298p3RG7j27tfsZ9RQ.jpg",
+ "type" => "Document",
+ "url" => "https://honk.tedunangst.com/d/298p3RG7j27tfsZ9RQ.jpg"
+ }
+ ],
+ "attributedTo" => "https://honk.tedunangst.com/u/tedu",
+ "content" => "",
+ "id" => "https://honk.tedunangst.com/u/tedu/chonk/26L4wl5yCbn4dr4y1b",
+ "published" => "2020-05-18T01:13:03Z",
+ "to" => [
+ "https://dontbulling.me/users/lain"
+ ],
+ "type" => "ChatMessage"
+ },
+ "published" => "2020-05-18T01:13:03Z",
+ "to" => [
+ "https://dontbulling.me/users/lain"
+ ],
+ "type" => "Create"
+ }
+
+ _user = insert(:user, ap_id: data["actor"])
+ _user = insert(:user, ap_id: hd(data["to"]))
+
+ assert {:ok, _activity} = Transmogrifier.handle_incoming(data)
+ end
+
+ test "it rejects messages that don't contain content" do
+ data =
+ File.read!("test/fixtures/create-chat-message.json")
+ |> Poison.decode!()
+
+ object =
+ data["object"]
+ |> Map.delete("content")
+
+ data =
+ data
+ |> Map.put("object", object)
+
+ _author =
+ insert(:user, ap_id: data["actor"], local: false, last_refreshed_at: DateTime.utc_now())
+
+ _recipient =
+ insert(:user,
+ ap_id: List.first(data["to"]),
+ local: true,
+ last_refreshed_at: DateTime.utc_now()
+ )
+
+ {:error, _} = Transmogrifier.handle_incoming(data)
+ end
+
+ test "it rejects messages that don't concern local users" do
+ data =
+ File.read!("test/fixtures/create-chat-message.json")
+ |> Poison.decode!()
+
+ _author =
+ insert(:user, ap_id: data["actor"], local: false, last_refreshed_at: DateTime.utc_now())
+
+ _recipient =
+ insert(:user,
+ ap_id: List.first(data["to"]),
+ local: false,
+ last_refreshed_at: DateTime.utc_now()
+ )
+
+ {:error, _} = Transmogrifier.handle_incoming(data)
+ end
+
+ test "it rejects messages where the `to` field of activity and object don't match" do
+ data =
+ File.read!("test/fixtures/create-chat-message.json")
+ |> Poison.decode!()
+
+ author = insert(:user, ap_id: data["actor"])
+ _recipient = insert(:user, ap_id: List.first(data["to"]))
+
+ data =
+ data
+ |> Map.put("to", author.ap_id)
+
+ assert match?({:error, _}, Transmogrifier.handle_incoming(data))
+ refute Object.get_by_ap_id(data["object"]["id"])
+ end
+
+ test "it fetches the actor if they aren't in our system" do
+ Tesla.Mock.mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
+
+ data =
+ File.read!("test/fixtures/create-chat-message.json")
+ |> Poison.decode!()
+ |> Map.put("actor", "http://mastodon.example.org/users/admin")
+ |> put_in(["object", "actor"], "http://mastodon.example.org/users/admin")
+
+ _recipient = insert(:user, ap_id: List.first(data["to"]), local: true)
+
+ {:ok, %Activity{} = _activity} = Transmogrifier.handle_incoming(data)
+ end
+
+ test "it inserts it and creates a chat" do
+ data =
+ File.read!("test/fixtures/create-chat-message.json")
+ |> Poison.decode!()
+
+ author =
+ insert(:user, ap_id: data["actor"], local: false, last_refreshed_at: DateTime.utc_now())
+
+ recipient = insert(:user, ap_id: List.first(data["to"]), local: true)
+
+ {:ok, %Activity{} = activity} = Transmogrifier.handle_incoming(data)
+ assert activity.local == false
+
+ assert activity.actor == author.ap_id
+ assert activity.recipients == [recipient.ap_id, author.ap_id]
+
+ %Object{} = object = Object.get_by_ap_id(activity.data["object"])
+
+ assert object
+ assert object.data["content"] == "You expected a cute girl? Too bad. alert('XSS')"
+ assert match?(%{"firefox" => _}, object.data["emoji"])
+
+ refute Chat.get(author.id, recipient.ap_id)
+ assert Chat.get(recipient.id, author.ap_id)
+ end
+ end
+end
diff --git a/test/web/activity_pub/transmogrifier/follow_handling_test.exs b/test/web/activity_pub/transmogrifier/follow_handling_test.exs
index 967389fae..06c39eed6 100644
--- a/test/web/activity_pub/transmogrifier/follow_handling_test.exs
+++ b/test/web/activity_pub/transmogrifier/follow_handling_test.exs
@@ -5,6 +5,7 @@
defmodule Pleroma.Web.ActivityPub.Transmogrifier.FollowHandlingTest do
use Pleroma.DataCase
alias Pleroma.Activity
+ alias Pleroma.Notification
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Transmogrifier
@@ -12,6 +13,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.FollowHandlingTest do
import Pleroma.Factory
import Ecto.Query
+ import Mock
setup_all do
Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
@@ -57,9 +59,12 @@ test "it works for incoming follow requests" do
activity = Repo.get(Activity, activity.id)
assert activity.data["state"] == "accept"
assert User.following?(User.get_cached_by_ap_id(data["actor"]), user)
+
+ [notification] = Notification.for_user(user)
+ assert notification.type == "follow"
end
- test "with locked accounts, it does not create a follow or an accept" do
+ test "with locked accounts, it does create a Follow, but not an Accept" do
user = insert(:user, locked: true)
data =
@@ -81,6 +86,9 @@ test "with locked accounts, it does not create a follow or an accept" do
|> Repo.all()
assert Enum.empty?(accepts)
+
+ [notification] = Notification.for_user(user)
+ assert notification.type == "follow_request"
end
test "it works for follow requests when you are already followed, creating a new accept activity" do
@@ -144,6 +152,23 @@ test "it rejects incoming follow requests from blocked users when deny_follow_bl
assert activity.data["state"] == "reject"
end
+ test "it rejects incoming follow requests if the following errors for some reason" do
+ user = insert(:user)
+
+ data =
+ File.read!("test/fixtures/mastodon-follow-activity.json")
+ |> Poison.decode!()
+ |> Map.put("object", user.ap_id)
+
+ with_mock Pleroma.User, [:passthrough], follow: fn _, _ -> {:error, :testing} end do
+ {:ok, %Activity{data: %{"id" => id}}} = Transmogrifier.handle_incoming(data)
+
+ %Activity{} = activity = Activity.get_by_ap_id(id)
+
+ assert activity.data["state"] == "reject"
+ end
+ end
+
test "it works for incoming follow requests from hubzilla" do
user = insert(:user)
diff --git a/test/web/activity_pub/transmogrifier/user_update_handling_test.exs b/test/web/activity_pub/transmogrifier/user_update_handling_test.exs
new file mode 100644
index 000000000..64636656c
--- /dev/null
+++ b/test/web/activity_pub/transmogrifier/user_update_handling_test.exs
@@ -0,0 +1,159 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ActivityPub.Transmogrifier.UserUpdateHandlingTest do
+ use Pleroma.DataCase
+
+ alias Pleroma.Activity
+ alias Pleroma.User
+ alias Pleroma.Web.ActivityPub.Transmogrifier
+
+ import Pleroma.Factory
+
+ test "it works for incoming update activities" do
+ user = insert(:user, local: false)
+
+ update_data = File.read!("test/fixtures/mastodon-update.json") |> Poison.decode!()
+
+ object =
+ update_data["object"]
+ |> Map.put("actor", user.ap_id)
+ |> Map.put("id", user.ap_id)
+
+ update_data =
+ update_data
+ |> Map.put("actor", user.ap_id)
+ |> Map.put("object", object)
+
+ {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(update_data)
+
+ assert data["id"] == update_data["id"]
+
+ user = User.get_cached_by_ap_id(data["actor"])
+ assert user.name == "gargle"
+
+ assert user.avatar["url"] == [
+ %{
+ "href" =>
+ "https://cd.niu.moe/accounts/avatars/000/033/323/original/fd7f8ae0b3ffedc9.jpeg"
+ }
+ ]
+
+ assert user.banner["url"] == [
+ %{
+ "href" =>
+ "https://cd.niu.moe/accounts/headers/000/033/323/original/850b3448fa5fd477.png"
+ }
+ ]
+
+ assert user.bio == "Some bio
"
+ end
+
+ test "it works with alsoKnownAs" do
+ %{ap_id: actor} = insert(:user, local: false)
+
+ assert User.get_cached_by_ap_id(actor).also_known_as == []
+
+ {:ok, _activity} =
+ "test/fixtures/mastodon-update.json"
+ |> File.read!()
+ |> Poison.decode!()
+ |> Map.put("actor", actor)
+ |> Map.update!("object", fn object ->
+ object
+ |> Map.put("actor", actor)
+ |> Map.put("id", actor)
+ |> Map.put("alsoKnownAs", [
+ "http://mastodon.example.org/users/foo",
+ "http://example.org/users/bar"
+ ])
+ end)
+ |> Transmogrifier.handle_incoming()
+
+ assert User.get_cached_by_ap_id(actor).also_known_as == [
+ "http://mastodon.example.org/users/foo",
+ "http://example.org/users/bar"
+ ]
+ end
+
+ test "it works with custom profile fields" do
+ user = insert(:user, local: false)
+
+ assert user.fields == []
+
+ update_data = File.read!("test/fixtures/mastodon-update.json") |> Poison.decode!()
+
+ object =
+ update_data["object"]
+ |> Map.put("actor", user.ap_id)
+ |> Map.put("id", user.ap_id)
+
+ update_data =
+ update_data
+ |> Map.put("actor", user.ap_id)
+ |> Map.put("object", object)
+
+ {:ok, _update_activity} = Transmogrifier.handle_incoming(update_data)
+
+ user = User.get_cached_by_ap_id(user.ap_id)
+
+ assert user.fields == [
+ %{"name" => "foo", "value" => "updated"},
+ %{"name" => "foo1", "value" => "updated"}
+ ]
+
+ Pleroma.Config.put([:instance, :max_remote_account_fields], 2)
+
+ update_data =
+ update_data
+ |> put_in(["object", "attachment"], [
+ %{"name" => "foo", "type" => "PropertyValue", "value" => "bar"},
+ %{"name" => "foo11", "type" => "PropertyValue", "value" => "bar11"},
+ %{"name" => "foo22", "type" => "PropertyValue", "value" => "bar22"}
+ ])
+ |> Map.put("id", update_data["id"] <> ".")
+
+ {:ok, _} = Transmogrifier.handle_incoming(update_data)
+
+ user = User.get_cached_by_ap_id(user.ap_id)
+
+ assert user.fields == [
+ %{"name" => "foo", "value" => "updated"},
+ %{"name" => "foo1", "value" => "updated"}
+ ]
+
+ update_data =
+ update_data
+ |> put_in(["object", "attachment"], [])
+ |> Map.put("id", update_data["id"] <> ".")
+
+ {:ok, _} = Transmogrifier.handle_incoming(update_data)
+
+ user = User.get_cached_by_ap_id(user.ap_id)
+
+ assert user.fields == []
+ end
+
+ test "it works for incoming update activities which lock the account" do
+ user = insert(:user, local: false)
+
+ update_data = File.read!("test/fixtures/mastodon-update.json") |> Poison.decode!()
+
+ object =
+ update_data["object"]
+ |> Map.put("actor", user.ap_id)
+ |> Map.put("id", user.ap_id)
+ |> Map.put("manuallyApprovesFollowers", true)
+
+ update_data =
+ update_data
+ |> Map.put("actor", user.ap_id)
+ |> Map.put("object", object)
+
+ {:ok, %Activity{local: false}} = Transmogrifier.handle_incoming(update_data)
+
+ user = User.get_cached_by_ap_id(user.ap_id)
+ assert user.locked == true
+ end
+end
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs
index 94d8552e8..6a53fd3f0 100644
--- a/test/web/activity_pub/transmogrifier_test.exs
+++ b/test/web/activity_pub/transmogrifier_test.exs
@@ -401,162 +401,6 @@ test "it strips internal reactions" do
refute Map.has_key?(object_data, "reaction_count")
end
- test "it works for incoming update activities" do
- data = File.read!("test/fixtures/mastodon-post-activity.json") |> Poison.decode!()
-
- {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
- update_data = File.read!("test/fixtures/mastodon-update.json") |> Poison.decode!()
-
- object =
- update_data["object"]
- |> Map.put("actor", data["actor"])
- |> Map.put("id", data["actor"])
-
- update_data =
- update_data
- |> Map.put("actor", data["actor"])
- |> Map.put("object", object)
-
- {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(update_data)
-
- assert data["id"] == update_data["id"]
-
- user = User.get_cached_by_ap_id(data["actor"])
- assert user.name == "gargle"
-
- assert user.avatar["url"] == [
- %{
- "href" =>
- "https://cd.niu.moe/accounts/avatars/000/033/323/original/fd7f8ae0b3ffedc9.jpeg"
- }
- ]
-
- assert user.banner["url"] == [
- %{
- "href" =>
- "https://cd.niu.moe/accounts/headers/000/033/323/original/850b3448fa5fd477.png"
- }
- ]
-
- assert user.bio == "Some bio
"
- end
-
- test "it works with alsoKnownAs" do
- {:ok, %Activity{data: %{"actor" => actor}}} =
- "test/fixtures/mastodon-post-activity.json"
- |> File.read!()
- |> Poison.decode!()
- |> Transmogrifier.handle_incoming()
-
- assert User.get_cached_by_ap_id(actor).also_known_as == ["http://example.org/users/foo"]
-
- {:ok, _activity} =
- "test/fixtures/mastodon-update.json"
- |> File.read!()
- |> Poison.decode!()
- |> Map.put("actor", actor)
- |> Map.update!("object", fn object ->
- object
- |> Map.put("actor", actor)
- |> Map.put("id", actor)
- |> Map.put("alsoKnownAs", [
- "http://mastodon.example.org/users/foo",
- "http://example.org/users/bar"
- ])
- end)
- |> Transmogrifier.handle_incoming()
-
- assert User.get_cached_by_ap_id(actor).also_known_as == [
- "http://mastodon.example.org/users/foo",
- "http://example.org/users/bar"
- ]
- end
-
- test "it works with custom profile fields" do
- {:ok, activity} =
- "test/fixtures/mastodon-post-activity.json"
- |> File.read!()
- |> Poison.decode!()
- |> Transmogrifier.handle_incoming()
-
- user = User.get_cached_by_ap_id(activity.actor)
-
- assert user.fields == [
- %{"name" => "foo", "value" => "bar"},
- %{"name" => "foo1", "value" => "bar1"}
- ]
-
- update_data = File.read!("test/fixtures/mastodon-update.json") |> Poison.decode!()
-
- object =
- update_data["object"]
- |> Map.put("actor", user.ap_id)
- |> Map.put("id", user.ap_id)
-
- update_data =
- update_data
- |> Map.put("actor", user.ap_id)
- |> Map.put("object", object)
-
- {:ok, _update_activity} = Transmogrifier.handle_incoming(update_data)
-
- user = User.get_cached_by_ap_id(user.ap_id)
-
- assert user.fields == [
- %{"name" => "foo", "value" => "updated"},
- %{"name" => "foo1", "value" => "updated"}
- ]
-
- Pleroma.Config.put([:instance, :max_remote_account_fields], 2)
-
- update_data =
- put_in(update_data, ["object", "attachment"], [
- %{"name" => "foo", "type" => "PropertyValue", "value" => "bar"},
- %{"name" => "foo11", "type" => "PropertyValue", "value" => "bar11"},
- %{"name" => "foo22", "type" => "PropertyValue", "value" => "bar22"}
- ])
-
- {:ok, _} = Transmogrifier.handle_incoming(update_data)
-
- user = User.get_cached_by_ap_id(user.ap_id)
-
- assert user.fields == [
- %{"name" => "foo", "value" => "updated"},
- %{"name" => "foo1", "value" => "updated"}
- ]
-
- update_data = put_in(update_data, ["object", "attachment"], [])
-
- {:ok, _} = Transmogrifier.handle_incoming(update_data)
-
- user = User.get_cached_by_ap_id(user.ap_id)
-
- assert user.fields == []
- end
-
- test "it works for incoming update activities which lock the account" do
- data = File.read!("test/fixtures/mastodon-post-activity.json") |> Poison.decode!()
-
- {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
- update_data = File.read!("test/fixtures/mastodon-update.json") |> Poison.decode!()
-
- object =
- update_data["object"]
- |> Map.put("actor", data["actor"])
- |> Map.put("id", data["actor"])
- |> Map.put("manuallyApprovesFollowers", true)
-
- update_data =
- update_data
- |> Map.put("actor", data["actor"])
- |> Map.put("object", object)
-
- {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(update_data)
-
- user = User.get_cached_by_ap_id(data["actor"])
- assert user.locked == true
- end
-
test "it works for incomming unfollows with an existing follow" do
user = insert(:user)
@@ -601,56 +445,6 @@ test "it works for incoming follows to locked account" do
assert [^pending_follower] = User.get_follow_requests(user)
end
- test "it works for incoming blocks" do
- user = insert(:user)
-
- data =
- File.read!("test/fixtures/mastodon-block-activity.json")
- |> Poison.decode!()
- |> Map.put("object", user.ap_id)
-
- {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
-
- assert data["type"] == "Block"
- assert data["object"] == user.ap_id
- assert data["actor"] == "http://mastodon.example.org/users/admin"
-
- blocker = User.get_cached_by_ap_id(data["actor"])
-
- assert User.blocks?(blocker, user)
- end
-
- test "incoming blocks successfully tear down any follow relationship" do
- blocker = insert(:user)
- blocked = insert(:user)
-
- data =
- File.read!("test/fixtures/mastodon-block-activity.json")
- |> Poison.decode!()
- |> Map.put("object", blocked.ap_id)
- |> Map.put("actor", blocker.ap_id)
-
- {:ok, blocker} = User.follow(blocker, blocked)
- {:ok, blocked} = User.follow(blocked, blocker)
-
- assert User.following?(blocker, blocked)
- assert User.following?(blocked, blocker)
-
- {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
-
- assert data["type"] == "Block"
- assert data["object"] == blocked.ap_id
- assert data["actor"] == blocker.ap_id
-
- blocker = User.get_cached_by_ap_id(data["actor"])
- blocked = User.get_cached_by_ap_id(data["object"])
-
- assert User.blocks?(blocker, blocked)
-
- refute User.following?(blocker, blocked)
- refute User.following?(blocked, blocker)
- end
-
test "it works for incoming accepts which were pre-accepted" do
follower = insert(:user)
followed = insert(:user)
@@ -1571,9 +1365,6 @@ test "returns modified object when allowed incoming reply", %{data: data} do
assert modified_object["inReplyToAtomUri"] == "https://shitposter.club/notice/2827873"
- assert modified_object["conversation"] ==
- "tag:shitposter.club,2017-05-05:objectType=thread:nonce=3c16e9c2681f6d26"
-
assert modified_object["context"] ==
"tag:shitposter.club,2017-05-05:objectType=thread:nonce=3c16e9c2681f6d26"
end
diff --git a/test/web/activity_pub/utils_test.exs b/test/web/activity_pub/utils_test.exs
index 15f03f193..2f9ecb5a3 100644
--- a/test/web/activity_pub/utils_test.exs
+++ b/test/web/activity_pub/utils_test.exs
@@ -27,16 +27,6 @@ test "fetches the latest Follow activity" do
end
end
- describe "fetch the latest Block" do
- test "fetches the latest Block activity" do
- blocker = insert(:user)
- blocked = insert(:user)
- {:ok, activity} = ActivityPub.block(blocker, blocked)
-
- assert activity == Utils.fetch_latest_block(blocker, blocked)
- end
- end
-
describe "determine_explicit_mentions()" do
test "works with an object that has mentions" do
object = %{
@@ -344,9 +334,9 @@ test "fetches last block activities" do
user1 = insert(:user)
user2 = insert(:user)
- assert {:ok, %Activity{} = _} = ActivityPub.block(user1, user2)
- assert {:ok, %Activity{} = _} = ActivityPub.block(user1, user2)
- assert {:ok, %Activity{} = activity} = ActivityPub.block(user1, user2)
+ assert {:ok, %Activity{} = _} = CommonAPI.block(user1, user2)
+ assert {:ok, %Activity{} = _} = CommonAPI.block(user1, user2)
+ assert {:ok, %Activity{} = activity} = CommonAPI.block(user1, user2)
assert Utils.fetch_latest_block(user1, user2) == activity
end
diff --git a/test/web/activity_pub/views/user_view_test.exs b/test/web/activity_pub/views/user_view_test.exs
index 20b0f223c..bec15a996 100644
--- a/test/web/activity_pub/views/user_view_test.exs
+++ b/test/web/activity_pub/views/user_view_test.exs
@@ -158,35 +158,4 @@ test "sets correct totalItems when follows are hidden but the follow counter is
assert %{"totalItems" => 1} = UserView.render("following.json", %{user: user})
end
end
-
- test "activity collection page aginates correctly" do
- user = insert(:user)
-
- posts =
- for i <- 0..25 do
- {:ok, activity} = CommonAPI.post(user, %{status: "post #{i}"})
- activity
- end
-
- # outbox sorts chronologically, newest first, with ten per page
- posts = Enum.reverse(posts)
-
- %{"next" => next_url} =
- UserView.render("activity_collection_page.json", %{
- iri: "#{user.ap_id}/outbox",
- activities: Enum.take(posts, 10)
- })
-
- next_id = Enum.at(posts, 9).id
- assert next_url =~ next_id
-
- %{"next" => next_url} =
- UserView.render("activity_collection_page.json", %{
- iri: "#{user.ap_id}/outbox",
- activities: Enum.take(Enum.drop(posts, 10), 10)
- })
-
- next_id = Enum.at(posts, 19).id
- assert next_url =~ next_id
- end
end
diff --git a/test/web/admin_api/controllers/admin_api_controller_test.exs b/test/web/admin_api/controllers/admin_api_controller_test.exs
index ead840186..48fb108ec 100644
--- a/test/web/admin_api/controllers/admin_api_controller_test.exs
+++ b/test/web/admin_api/controllers/admin_api_controller_test.exs
@@ -12,15 +12,12 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
alias Pleroma.Activity
alias Pleroma.Config
- alias Pleroma.ConfigDB
alias Pleroma.HTML
alias Pleroma.MFA
alias Pleroma.ModerationLog
alias Pleroma.Repo
- alias Pleroma.ReportNote
alias Pleroma.Tests.ObanHelpers
alias Pleroma.User
- alias Pleroma.UserInviteToken
alias Pleroma.Web
alias Pleroma.Web.ActivityPub.Relay
alias Pleroma.Web.CommonAPI
@@ -340,7 +337,8 @@ test "Show", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
assert expected == json_response(conn, 200)
@@ -588,122 +586,6 @@ test "/:right DELETE, can remove from a permission group (multiple)", %{
end
end
- describe "POST /api/pleroma/admin/email_invite, with valid config" do
- setup do: clear_config([:instance, :registrations_open], false)
- setup do: clear_config([:instance, :invites_enabled], true)
-
- test "sends invitation and returns 204", %{admin: admin, conn: conn} do
- recipient_email = "foo@bar.com"
- recipient_name = "J. D."
-
- conn =
- post(
- conn,
- "/api/pleroma/admin/users/email_invite?email=#{recipient_email}&name=#{recipient_name}"
- )
-
- assert json_response(conn, :no_content)
-
- token_record = List.last(Repo.all(Pleroma.UserInviteToken))
- assert token_record
- refute token_record.used
-
- notify_email = Config.get([:instance, :notify_email])
- instance_name = Config.get([:instance, :name])
-
- email =
- Pleroma.Emails.UserEmail.user_invitation_email(
- admin,
- token_record,
- recipient_email,
- recipient_name
- )
-
- Swoosh.TestAssertions.assert_email_sent(
- from: {instance_name, notify_email},
- to: {recipient_name, recipient_email},
- html_body: email.html_body
- )
- end
-
- test "it returns 403 if requested by a non-admin" do
- non_admin_user = insert(:user)
- token = insert(:oauth_token, user: non_admin_user)
-
- conn =
- build_conn()
- |> assign(:user, non_admin_user)
- |> assign(:token, token)
- |> post("/api/pleroma/admin/users/email_invite?email=foo@bar.com&name=JD")
-
- assert json_response(conn, :forbidden)
- end
-
- test "email with +", %{conn: conn, admin: admin} do
- recipient_email = "foo+bar@baz.com"
-
- conn
- |> put_req_header("content-type", "application/json;charset=utf-8")
- |> post("/api/pleroma/admin/users/email_invite", %{email: recipient_email})
- |> json_response(:no_content)
-
- token_record =
- Pleroma.UserInviteToken
- |> Repo.all()
- |> List.last()
-
- assert token_record
- refute token_record.used
-
- notify_email = Config.get([:instance, :notify_email])
- instance_name = Config.get([:instance, :name])
-
- email =
- Pleroma.Emails.UserEmail.user_invitation_email(
- admin,
- token_record,
- recipient_email
- )
-
- Swoosh.TestAssertions.assert_email_sent(
- from: {instance_name, notify_email},
- to: recipient_email,
- html_body: email.html_body
- )
- end
- end
-
- describe "POST /api/pleroma/admin/users/email_invite, with invalid config" do
- setup do: clear_config([:instance, :registrations_open])
- setup do: clear_config([:instance, :invites_enabled])
-
- test "it returns 500 if `invites_enabled` is not enabled", %{conn: conn} do
- Config.put([:instance, :registrations_open], false)
- Config.put([:instance, :invites_enabled], false)
-
- conn = post(conn, "/api/pleroma/admin/users/email_invite?email=foo@bar.com&name=JD")
-
- assert json_response(conn, :bad_request) ==
- %{
- "error" =>
- "To send invites you need to set the `invites_enabled` option to true."
- }
- end
-
- test "it returns 500 if `registrations_open` is enabled", %{conn: conn} do
- Config.put([:instance, :registrations_open], true)
- Config.put([:instance, :invites_enabled], true)
-
- conn = post(conn, "/api/pleroma/admin/users/email_invite?email=foo@bar.com&name=JD")
-
- assert json_response(conn, :bad_request) ==
- %{
- "error" =>
- "To send invites you need to set the `registrations_open` option to false."
- }
- end
- end
-
test "/api/pleroma/admin/users/:nickname/password_reset", %{conn: conn} do
user = insert(:user)
@@ -733,7 +615,8 @@ test "renders users array for the first page", %{conn: conn, admin: admin} do
"tags" => [],
"avatar" => User.avatar_url(admin) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(admin.name || admin.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => admin.ap_id
},
%{
"deactivated" => user.deactivated,
@@ -744,7 +627,8 @@ test "renders users array for the first page", %{conn: conn, admin: admin} do
"tags" => ["foo", "bar"],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
|> Enum.sort_by(& &1["nickname"])
@@ -757,8 +641,8 @@ test "renders users array for the first page", %{conn: conn, admin: admin} do
end
test "pagination works correctly with service users", %{conn: conn} do
- service1 = insert(:user, ap_id: Web.base_url() <> "/relay")
- service2 = insert(:user, ap_id: Web.base_url() <> "/internal/fetch")
+ service1 = User.get_or_create_service_actor_by_ap_id(Web.base_url() <> "/meido", "meido")
+
insert_list(25, :user)
assert %{"count" => 26, "page_size" => 10, "users" => users1} =
@@ -767,8 +651,7 @@ test "pagination works correctly with service users", %{conn: conn} do
|> json_response(200)
assert Enum.count(users1) == 10
- assert service1 not in [users1]
- assert service2 not in [users1]
+ assert service1 not in users1
assert %{"count" => 26, "page_size" => 10, "users" => users2} =
conn
@@ -776,8 +659,7 @@ test "pagination works correctly with service users", %{conn: conn} do
|> json_response(200)
assert Enum.count(users2) == 10
- assert service1 not in [users2]
- assert service2 not in [users2]
+ assert service1 not in users2
assert %{"count" => 26, "page_size" => 10, "users" => users3} =
conn
@@ -785,8 +667,7 @@ test "pagination works correctly with service users", %{conn: conn} do
|> json_response(200)
assert Enum.count(users3) == 6
- assert service1 not in [users3]
- assert service2 not in [users3]
+ assert service1 not in users3
end
test "renders empty array for the second page", %{conn: conn} do
@@ -819,7 +700,8 @@ test "regular search", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
}
@@ -844,7 +726,8 @@ test "search by domain", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
}
@@ -869,7 +752,8 @@ test "search by full nickname", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
}
@@ -894,7 +778,8 @@ test "search by display name", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
}
@@ -919,7 +804,8 @@ test "search by email", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
}
@@ -944,7 +830,8 @@ test "regular search with page size", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
}
@@ -964,7 +851,8 @@ test "regular search with page size", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(user2) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user2.name || user2.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user2.ap_id
}
]
}
@@ -996,7 +884,8 @@ test "only local users" do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
}
@@ -1021,7 +910,8 @@ test "only local users with no query", %{conn: conn, admin: old_admin} do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
},
%{
"deactivated" => admin.deactivated,
@@ -1032,7 +922,8 @@ test "only local users with no query", %{conn: conn, admin: old_admin} do
"tags" => [],
"avatar" => User.avatar_url(admin) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(admin.name || admin.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => admin.ap_id
},
%{
"deactivated" => false,
@@ -1043,7 +934,8 @@ test "only local users with no query", %{conn: conn, admin: old_admin} do
"tags" => [],
"avatar" => User.avatar_url(old_admin) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(old_admin.name || old_admin.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => old_admin.ap_id
}
]
|> Enum.sort_by(& &1["nickname"])
@@ -1073,7 +965,8 @@ test "load only admins", %{conn: conn, admin: admin} do
"tags" => [],
"avatar" => User.avatar_url(admin) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(admin.name || admin.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => admin.ap_id
},
%{
"deactivated" => false,
@@ -1084,7 +977,8 @@ test "load only admins", %{conn: conn, admin: admin} do
"tags" => [],
"avatar" => User.avatar_url(second_admin) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(second_admin.name || second_admin.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => second_admin.ap_id
}
]
|> Enum.sort_by(& &1["nickname"])
@@ -1116,7 +1010,8 @@ test "load only moderators", %{conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(moderator) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(moderator.name || moderator.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => moderator.ap_id
}
]
}
@@ -1141,7 +1036,8 @@ test "load users with tags list", %{conn: conn} do
"tags" => ["first"],
"avatar" => User.avatar_url(user1) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user1.name || user1.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user1.ap_id
},
%{
"deactivated" => false,
@@ -1152,7 +1048,8 @@ test "load users with tags list", %{conn: conn} do
"tags" => ["second"],
"avatar" => User.avatar_url(user2) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user2.name || user2.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user2.ap_id
}
]
|> Enum.sort_by(& &1["nickname"])
@@ -1191,7 +1088,8 @@ test "it works with multiple filters" do
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
]
}
@@ -1215,7 +1113,8 @@ test "it omits relay user", %{admin: admin, conn: conn} do
"tags" => [],
"avatar" => User.avatar_url(admin) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(admin.name || admin.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => admin.ap_id
}
]
}
@@ -1277,7 +1176,8 @@ test "PATCH /api/pleroma/admin/users/:nickname/toggle_activation", %{admin: admi
"tags" => [],
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
"display_name" => HTML.strip_tags(user.name || user.nickname),
- "confirmation_pending" => false
+ "confirmation_pending" => false,
+ "url" => user.ap_id
}
log_entry = Repo.one(ModerationLog)
@@ -1318,1561 +1218,6 @@ test "returns 404 if user not found", %{conn: conn} do
end
end
- describe "POST /api/pleroma/admin/users/invite_token" do
- test "without options", %{conn: conn} do
- conn = post(conn, "/api/pleroma/admin/users/invite_token")
-
- invite_json = json_response(conn, 200)
- invite = UserInviteToken.find_by_token!(invite_json["token"])
- refute invite.used
- refute invite.expires_at
- refute invite.max_use
- assert invite.invite_type == "one_time"
- end
-
- test "with expires_at", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/users/invite_token", %{
- "expires_at" => Date.to_string(Date.utc_today())
- })
-
- invite_json = json_response(conn, 200)
- invite = UserInviteToken.find_by_token!(invite_json["token"])
-
- refute invite.used
- assert invite.expires_at == Date.utc_today()
- refute invite.max_use
- assert invite.invite_type == "date_limited"
- end
-
- test "with max_use", %{conn: conn} do
- conn = post(conn, "/api/pleroma/admin/users/invite_token", %{"max_use" => 150})
-
- invite_json = json_response(conn, 200)
- invite = UserInviteToken.find_by_token!(invite_json["token"])
- refute invite.used
- refute invite.expires_at
- assert invite.max_use == 150
- assert invite.invite_type == "reusable"
- end
-
- test "with max use and expires_at", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/users/invite_token", %{
- "max_use" => 150,
- "expires_at" => Date.to_string(Date.utc_today())
- })
-
- invite_json = json_response(conn, 200)
- invite = UserInviteToken.find_by_token!(invite_json["token"])
- refute invite.used
- assert invite.expires_at == Date.utc_today()
- assert invite.max_use == 150
- assert invite.invite_type == "reusable_date_limited"
- end
- end
-
- describe "GET /api/pleroma/admin/users/invites" do
- test "no invites", %{conn: conn} do
- conn = get(conn, "/api/pleroma/admin/users/invites")
-
- assert json_response(conn, 200) == %{"invites" => []}
- end
-
- test "with invite", %{conn: conn} do
- {:ok, invite} = UserInviteToken.create_invite()
-
- conn = get(conn, "/api/pleroma/admin/users/invites")
-
- assert json_response(conn, 200) == %{
- "invites" => [
- %{
- "expires_at" => nil,
- "id" => invite.id,
- "invite_type" => "one_time",
- "max_use" => nil,
- "token" => invite.token,
- "used" => false,
- "uses" => 0
- }
- ]
- }
- end
- end
-
- describe "POST /api/pleroma/admin/users/revoke_invite" do
- test "with token", %{conn: conn} do
- {:ok, invite} = UserInviteToken.create_invite()
-
- conn = post(conn, "/api/pleroma/admin/users/revoke_invite", %{"token" => invite.token})
-
- assert json_response(conn, 200) == %{
- "expires_at" => nil,
- "id" => invite.id,
- "invite_type" => "one_time",
- "max_use" => nil,
- "token" => invite.token,
- "used" => true,
- "uses" => 0
- }
- end
-
- test "with invalid token", %{conn: conn} do
- conn = post(conn, "/api/pleroma/admin/users/revoke_invite", %{"token" => "foo"})
-
- assert json_response(conn, :not_found) == %{"error" => "Not found"}
- end
- end
-
- describe "GET /api/pleroma/admin/reports/:id" do
- test "returns report by its id", %{conn: conn} do
- [reporter, target_user] = insert_pair(:user)
- activity = insert(:note_activity, user: target_user)
-
- {:ok, %{id: report_id}} =
- CommonAPI.report(reporter, %{
- account_id: target_user.id,
- comment: "I feel offended",
- status_ids: [activity.id]
- })
-
- response =
- conn
- |> get("/api/pleroma/admin/reports/#{report_id}")
- |> json_response(:ok)
-
- assert response["id"] == report_id
- end
-
- test "returns 404 when report id is invalid", %{conn: conn} do
- conn = get(conn, "/api/pleroma/admin/reports/test")
-
- assert json_response(conn, :not_found) == %{"error" => "Not found"}
- end
- end
-
- describe "PATCH /api/pleroma/admin/reports" do
- setup do
- [reporter, target_user] = insert_pair(:user)
- activity = insert(:note_activity, user: target_user)
-
- {:ok, %{id: report_id}} =
- CommonAPI.report(reporter, %{
- account_id: target_user.id,
- comment: "I feel offended",
- status_ids: [activity.id]
- })
-
- {:ok, %{id: second_report_id}} =
- CommonAPI.report(reporter, %{
- account_id: target_user.id,
- comment: "I feel very offended",
- status_ids: [activity.id]
- })
-
- %{
- id: report_id,
- second_report_id: second_report_id
- }
- end
-
- test "requires admin:write:reports scope", %{conn: conn, id: id, admin: admin} do
- read_token = insert(:oauth_token, user: admin, scopes: ["admin:read"])
- write_token = insert(:oauth_token, user: admin, scopes: ["admin:write:reports"])
-
- response =
- conn
- |> assign(:token, read_token)
- |> patch("/api/pleroma/admin/reports", %{
- "reports" => [%{"state" => "resolved", "id" => id}]
- })
- |> json_response(403)
-
- assert response == %{
- "error" => "Insufficient permissions: admin:write:reports."
- }
-
- conn
- |> assign(:token, write_token)
- |> patch("/api/pleroma/admin/reports", %{
- "reports" => [%{"state" => "resolved", "id" => id}]
- })
- |> json_response(:no_content)
- end
-
- test "mark report as resolved", %{conn: conn, id: id, admin: admin} do
- conn
- |> patch("/api/pleroma/admin/reports", %{
- "reports" => [
- %{"state" => "resolved", "id" => id}
- ]
- })
- |> json_response(:no_content)
-
- activity = Activity.get_by_id(id)
- assert activity.data["state"] == "resolved"
-
- log_entry = Repo.one(ModerationLog)
-
- assert ModerationLog.get_log_entry_message(log_entry) ==
- "@#{admin.nickname} updated report ##{id} with 'resolved' state"
- end
-
- test "closes report", %{conn: conn, id: id, admin: admin} do
- conn
- |> patch("/api/pleroma/admin/reports", %{
- "reports" => [
- %{"state" => "closed", "id" => id}
- ]
- })
- |> json_response(:no_content)
-
- activity = Activity.get_by_id(id)
- assert activity.data["state"] == "closed"
-
- log_entry = Repo.one(ModerationLog)
-
- assert ModerationLog.get_log_entry_message(log_entry) ==
- "@#{admin.nickname} updated report ##{id} with 'closed' state"
- end
-
- test "returns 400 when state is unknown", %{conn: conn, id: id} do
- conn =
- conn
- |> patch("/api/pleroma/admin/reports", %{
- "reports" => [
- %{"state" => "test", "id" => id}
- ]
- })
-
- assert hd(json_response(conn, :bad_request))["error"] == "Unsupported state"
- end
-
- test "returns 404 when report is not exist", %{conn: conn} do
- conn =
- conn
- |> patch("/api/pleroma/admin/reports", %{
- "reports" => [
- %{"state" => "closed", "id" => "test"}
- ]
- })
-
- assert hd(json_response(conn, :bad_request))["error"] == "not_found"
- end
-
- test "updates state of multiple reports", %{
- conn: conn,
- id: id,
- admin: admin,
- second_report_id: second_report_id
- } do
- conn
- |> patch("/api/pleroma/admin/reports", %{
- "reports" => [
- %{"state" => "resolved", "id" => id},
- %{"state" => "closed", "id" => second_report_id}
- ]
- })
- |> json_response(:no_content)
-
- activity = Activity.get_by_id(id)
- second_activity = Activity.get_by_id(second_report_id)
- assert activity.data["state"] == "resolved"
- assert second_activity.data["state"] == "closed"
-
- [first_log_entry, second_log_entry] = Repo.all(ModerationLog)
-
- assert ModerationLog.get_log_entry_message(first_log_entry) ==
- "@#{admin.nickname} updated report ##{id} with 'resolved' state"
-
- assert ModerationLog.get_log_entry_message(second_log_entry) ==
- "@#{admin.nickname} updated report ##{second_report_id} with 'closed' state"
- end
- end
-
- describe "GET /api/pleroma/admin/reports" do
- test "returns empty response when no reports created", %{conn: conn} do
- response =
- conn
- |> get("/api/pleroma/admin/reports")
- |> json_response(:ok)
-
- assert Enum.empty?(response["reports"])
- assert response["total"] == 0
- end
-
- test "returns reports", %{conn: conn} do
- [reporter, target_user] = insert_pair(:user)
- activity = insert(:note_activity, user: target_user)
-
- {:ok, %{id: report_id}} =
- CommonAPI.report(reporter, %{
- account_id: target_user.id,
- comment: "I feel offended",
- status_ids: [activity.id]
- })
-
- response =
- conn
- |> get("/api/pleroma/admin/reports")
- |> json_response(:ok)
-
- [report] = response["reports"]
-
- assert length(response["reports"]) == 1
- assert report["id"] == report_id
-
- assert response["total"] == 1
- end
-
- test "returns reports with specified state", %{conn: conn} do
- [reporter, target_user] = insert_pair(:user)
- activity = insert(:note_activity, user: target_user)
-
- {:ok, %{id: first_report_id}} =
- CommonAPI.report(reporter, %{
- account_id: target_user.id,
- comment: "I feel offended",
- status_ids: [activity.id]
- })
-
- {:ok, %{id: second_report_id}} =
- CommonAPI.report(reporter, %{
- account_id: target_user.id,
- comment: "I don't like this user"
- })
-
- CommonAPI.update_report_state(second_report_id, "closed")
-
- response =
- conn
- |> get("/api/pleroma/admin/reports", %{
- "state" => "open"
- })
- |> json_response(:ok)
-
- [open_report] = response["reports"]
-
- assert length(response["reports"]) == 1
- assert open_report["id"] == first_report_id
-
- assert response["total"] == 1
-
- response =
- conn
- |> get("/api/pleroma/admin/reports", %{
- "state" => "closed"
- })
- |> json_response(:ok)
-
- [closed_report] = response["reports"]
-
- assert length(response["reports"]) == 1
- assert closed_report["id"] == second_report_id
-
- assert response["total"] == 1
-
- response =
- conn
- |> get("/api/pleroma/admin/reports", %{
- "state" => "resolved"
- })
- |> json_response(:ok)
-
- assert Enum.empty?(response["reports"])
- assert response["total"] == 0
- end
-
- test "returns 403 when requested by a non-admin" do
- user = insert(:user)
- token = insert(:oauth_token, user: user)
-
- conn =
- build_conn()
- |> assign(:user, user)
- |> assign(:token, token)
- |> get("/api/pleroma/admin/reports")
-
- assert json_response(conn, :forbidden) ==
- %{"error" => "User is not an admin or OAuth admin scope is not granted."}
- end
-
- test "returns 403 when requested by anonymous" do
- conn = get(build_conn(), "/api/pleroma/admin/reports")
-
- assert json_response(conn, :forbidden) == %{"error" => "Invalid credentials."}
- end
- end
-
- describe "GET /api/pleroma/admin/config" do
- setup do: clear_config(:configurable_from_database, true)
-
- test "when configuration from database is off", %{conn: conn} do
- Config.put(:configurable_from_database, false)
- conn = get(conn, "/api/pleroma/admin/config")
-
- assert json_response(conn, 400) ==
- %{
- "error" => "To use this endpoint you need to enable configuration from database."
- }
- end
-
- test "with settings only in db", %{conn: conn} do
- config1 = insert(:config)
- config2 = insert(:config)
-
- conn = get(conn, "/api/pleroma/admin/config", %{"only_db" => true})
-
- %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => key1,
- "value" => _
- },
- %{
- "group" => ":pleroma",
- "key" => key2,
- "value" => _
- }
- ]
- } = json_response(conn, 200)
-
- assert key1 == config1.key
- assert key2 == config2.key
- end
-
- test "db is added to settings that are in db", %{conn: conn} do
- _config = insert(:config, key: ":instance", value: ConfigDB.to_binary(name: "Some name"))
-
- %{"configs" => configs} =
- conn
- |> get("/api/pleroma/admin/config")
- |> json_response(200)
-
- [instance_config] =
- Enum.filter(configs, fn %{"group" => group, "key" => key} ->
- group == ":pleroma" and key == ":instance"
- end)
-
- assert instance_config["db"] == [":name"]
- end
-
- test "merged default setting with db settings", %{conn: conn} do
- config1 = insert(:config)
- config2 = insert(:config)
-
- config3 =
- insert(:config,
- value: ConfigDB.to_binary(k1: :v1, k2: :v2)
- )
-
- %{"configs" => configs} =
- conn
- |> get("/api/pleroma/admin/config")
- |> json_response(200)
-
- assert length(configs) > 3
-
- received_configs =
- Enum.filter(configs, fn %{"group" => group, "key" => key} ->
- group == ":pleroma" and key in [config1.key, config2.key, config3.key]
- end)
-
- assert length(received_configs) == 3
-
- db_keys =
- config3.value
- |> ConfigDB.from_binary()
- |> Keyword.keys()
- |> ConfigDB.convert()
-
- Enum.each(received_configs, fn %{"value" => value, "db" => db} ->
- assert db in [[config1.key], [config2.key], db_keys]
-
- assert value in [
- ConfigDB.from_binary_with_convert(config1.value),
- ConfigDB.from_binary_with_convert(config2.value),
- ConfigDB.from_binary_with_convert(config3.value)
- ]
- end)
- end
-
- test "subkeys with full update right merge", %{conn: conn} do
- config1 =
- insert(:config,
- key: ":emoji",
- value: ConfigDB.to_binary(groups: [a: 1, b: 2], key: [a: 1])
- )
-
- config2 =
- insert(:config,
- key: ":assets",
- value: ConfigDB.to_binary(mascots: [a: 1, b: 2], key: [a: 1])
- )
-
- %{"configs" => configs} =
- conn
- |> get("/api/pleroma/admin/config")
- |> json_response(200)
-
- vals =
- Enum.filter(configs, fn %{"group" => group, "key" => key} ->
- group == ":pleroma" and key in [config1.key, config2.key]
- end)
-
- emoji = Enum.find(vals, fn %{"key" => key} -> key == ":emoji" end)
- assets = Enum.find(vals, fn %{"key" => key} -> key == ":assets" end)
-
- emoji_val = ConfigDB.transform_with_out_binary(emoji["value"])
- assets_val = ConfigDB.transform_with_out_binary(assets["value"])
-
- assert emoji_val[:groups] == [a: 1, b: 2]
- assert assets_val[:mascots] == [a: 1, b: 2]
- end
- end
-
- test "POST /api/pleroma/admin/config error", %{conn: conn} do
- conn = post(conn, "/api/pleroma/admin/config", %{"configs" => []})
-
- assert json_response(conn, 400) ==
- %{"error" => "To use this endpoint you need to enable configuration from database."}
- end
-
- describe "POST /api/pleroma/admin/config" do
- setup do
- http = Application.get_env(:pleroma, :http)
-
- on_exit(fn ->
- Application.delete_env(:pleroma, :key1)
- Application.delete_env(:pleroma, :key2)
- Application.delete_env(:pleroma, :key3)
- Application.delete_env(:pleroma, :key4)
- Application.delete_env(:pleroma, :keyaa1)
- Application.delete_env(:pleroma, :keyaa2)
- Application.delete_env(:pleroma, Pleroma.Web.Endpoint.NotReal)
- Application.delete_env(:pleroma, Pleroma.Captcha.NotReal)
- Application.put_env(:pleroma, :http, http)
- Application.put_env(:tesla, :adapter, Tesla.Mock)
- Restarter.Pleroma.refresh()
- end)
- end
-
- setup do: clear_config(:configurable_from_database, true)
-
- @tag capture_log: true
- test "create new config setting in db", %{conn: conn} do
- ueberauth = Application.get_env(:ueberauth, Ueberauth)
- on_exit(fn -> Application.put_env(:ueberauth, Ueberauth, ueberauth) end)
-
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{group: ":pleroma", key: ":key1", value: "value1"},
- %{
- group: ":ueberauth",
- key: "Ueberauth",
- value: [%{"tuple" => [":consumer_secret", "aaaa"]}]
- },
- %{
- group: ":pleroma",
- key: ":key2",
- value: %{
- ":nested_1" => "nested_value1",
- ":nested_2" => [
- %{":nested_22" => "nested_value222"},
- %{":nested_33" => %{":nested_44" => "nested_444"}}
- ]
- }
- },
- %{
- group: ":pleroma",
- key: ":key3",
- value: [
- %{"nested_3" => ":nested_3", "nested_33" => "nested_33"},
- %{"nested_4" => true}
- ]
- },
- %{
- group: ":pleroma",
- key: ":key4",
- value: %{":nested_5" => ":upload", "endpoint" => "https://example.com"}
- },
- %{
- group: ":idna",
- key: ":key5",
- value: %{"tuple" => ["string", "Pleroma.Captcha.NotReal", []]}
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => "value1",
- "db" => [":key1"]
- },
- %{
- "group" => ":ueberauth",
- "key" => "Ueberauth",
- "value" => [%{"tuple" => [":consumer_secret", "aaaa"]}],
- "db" => [":consumer_secret"]
- },
- %{
- "group" => ":pleroma",
- "key" => ":key2",
- "value" => %{
- ":nested_1" => "nested_value1",
- ":nested_2" => [
- %{":nested_22" => "nested_value222"},
- %{":nested_33" => %{":nested_44" => "nested_444"}}
- ]
- },
- "db" => [":key2"]
- },
- %{
- "group" => ":pleroma",
- "key" => ":key3",
- "value" => [
- %{"nested_3" => ":nested_3", "nested_33" => "nested_33"},
- %{"nested_4" => true}
- ],
- "db" => [":key3"]
- },
- %{
- "group" => ":pleroma",
- "key" => ":key4",
- "value" => %{"endpoint" => "https://example.com", ":nested_5" => ":upload"},
- "db" => [":key4"]
- },
- %{
- "group" => ":idna",
- "key" => ":key5",
- "value" => %{"tuple" => ["string", "Pleroma.Captcha.NotReal", []]},
- "db" => [":key5"]
- }
- ]
- }
-
- assert Application.get_env(:pleroma, :key1) == "value1"
-
- assert Application.get_env(:pleroma, :key2) == %{
- nested_1: "nested_value1",
- nested_2: [
- %{nested_22: "nested_value222"},
- %{nested_33: %{nested_44: "nested_444"}}
- ]
- }
-
- assert Application.get_env(:pleroma, :key3) == [
- %{"nested_3" => :nested_3, "nested_33" => "nested_33"},
- %{"nested_4" => true}
- ]
-
- assert Application.get_env(:pleroma, :key4) == %{
- "endpoint" => "https://example.com",
- nested_5: :upload
- }
-
- assert Application.get_env(:idna, :key5) == {"string", Pleroma.Captcha.NotReal, []}
- end
-
- test "save configs setting without explicit key", %{conn: conn} do
- level = Application.get_env(:quack, :level)
- meta = Application.get_env(:quack, :meta)
- webhook_url = Application.get_env(:quack, :webhook_url)
-
- on_exit(fn ->
- Application.put_env(:quack, :level, level)
- Application.put_env(:quack, :meta, meta)
- Application.put_env(:quack, :webhook_url, webhook_url)
- end)
-
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- group: ":quack",
- key: ":level",
- value: ":info"
- },
- %{
- group: ":quack",
- key: ":meta",
- value: [":none"]
- },
- %{
- group: ":quack",
- key: ":webhook_url",
- value: "https://hooks.slack.com/services/KEY"
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":quack",
- "key" => ":level",
- "value" => ":info",
- "db" => [":level"]
- },
- %{
- "group" => ":quack",
- "key" => ":meta",
- "value" => [":none"],
- "db" => [":meta"]
- },
- %{
- "group" => ":quack",
- "key" => ":webhook_url",
- "value" => "https://hooks.slack.com/services/KEY",
- "db" => [":webhook_url"]
- }
- ]
- }
-
- assert Application.get_env(:quack, :level) == :info
- assert Application.get_env(:quack, :meta) == [:none]
- assert Application.get_env(:quack, :webhook_url) == "https://hooks.slack.com/services/KEY"
- end
-
- test "saving config with partial update", %{conn: conn} do
- config = insert(:config, key: ":key1", value: :erlang.term_to_binary(key1: 1, key2: 2))
-
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{group: config.group, key: config.key, value: [%{"tuple" => [":key3", 3]}]}
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => [
- %{"tuple" => [":key1", 1]},
- %{"tuple" => [":key2", 2]},
- %{"tuple" => [":key3", 3]}
- ],
- "db" => [":key1", ":key2", ":key3"]
- }
- ]
- }
- end
-
- test "saving config which need pleroma reboot", %{conn: conn} do
- chat = Config.get(:chat)
- on_exit(fn -> Config.put(:chat, chat) end)
-
- assert post(
- conn,
- "/api/pleroma/admin/config",
- %{
- configs: [
- %{group: ":pleroma", key: ":chat", value: [%{"tuple" => [":enabled", true]}]}
- ]
- }
- )
- |> json_response(200) == %{
- "configs" => [
- %{
- "db" => [":enabled"],
- "group" => ":pleroma",
- "key" => ":chat",
- "value" => [%{"tuple" => [":enabled", true]}]
- }
- ],
- "need_reboot" => true
- }
-
- configs =
- conn
- |> get("/api/pleroma/admin/config")
- |> json_response(200)
-
- assert configs["need_reboot"]
-
- capture_log(fn ->
- assert conn |> get("/api/pleroma/admin/restart") |> json_response(200) == %{}
- end) =~ "pleroma restarted"
-
- configs =
- conn
- |> get("/api/pleroma/admin/config")
- |> json_response(200)
-
- assert configs["need_reboot"] == false
- end
-
- test "update setting which need reboot, don't change reboot flag until reboot", %{conn: conn} do
- chat = Config.get(:chat)
- on_exit(fn -> Config.put(:chat, chat) end)
-
- assert post(
- conn,
- "/api/pleroma/admin/config",
- %{
- configs: [
- %{group: ":pleroma", key: ":chat", value: [%{"tuple" => [":enabled", true]}]}
- ]
- }
- )
- |> json_response(200) == %{
- "configs" => [
- %{
- "db" => [":enabled"],
- "group" => ":pleroma",
- "key" => ":chat",
- "value" => [%{"tuple" => [":enabled", true]}]
- }
- ],
- "need_reboot" => true
- }
-
- assert post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{group: ":pleroma", key: ":key1", value: [%{"tuple" => [":key3", 3]}]}
- ]
- })
- |> json_response(200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => [
- %{"tuple" => [":key3", 3]}
- ],
- "db" => [":key3"]
- }
- ],
- "need_reboot" => true
- }
-
- capture_log(fn ->
- assert conn |> get("/api/pleroma/admin/restart") |> json_response(200) == %{}
- end) =~ "pleroma restarted"
-
- configs =
- conn
- |> get("/api/pleroma/admin/config")
- |> json_response(200)
-
- assert configs["need_reboot"] == false
- end
-
- test "saving config with nested merge", %{conn: conn} do
- config =
- insert(:config, key: ":key1", value: :erlang.term_to_binary(key1: 1, key2: [k1: 1, k2: 2]))
-
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- group: config.group,
- key: config.key,
- value: [
- %{"tuple" => [":key3", 3]},
- %{
- "tuple" => [
- ":key2",
- [
- %{"tuple" => [":k2", 1]},
- %{"tuple" => [":k3", 3]}
- ]
- ]
- }
- ]
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => [
- %{"tuple" => [":key1", 1]},
- %{"tuple" => [":key3", 3]},
- %{
- "tuple" => [
- ":key2",
- [
- %{"tuple" => [":k1", 1]},
- %{"tuple" => [":k2", 1]},
- %{"tuple" => [":k3", 3]}
- ]
- ]
- }
- ],
- "db" => [":key1", ":key3", ":key2"]
- }
- ]
- }
- end
-
- test "saving special atoms", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => [
- %{
- "tuple" => [
- ":ssl_options",
- [%{"tuple" => [":versions", [":tlsv1", ":tlsv1.1", ":tlsv1.2"]]}]
- ]
- }
- ]
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => [
- %{
- "tuple" => [
- ":ssl_options",
- [%{"tuple" => [":versions", [":tlsv1", ":tlsv1.1", ":tlsv1.2"]]}]
- ]
- }
- ],
- "db" => [":ssl_options"]
- }
- ]
- }
-
- assert Application.get_env(:pleroma, :key1) == [
- ssl_options: [versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]]
- ]
- end
-
- test "saving full setting if value is in full_key_update list", %{conn: conn} do
- backends = Application.get_env(:logger, :backends)
- on_exit(fn -> Application.put_env(:logger, :backends, backends) end)
-
- config =
- insert(:config,
- group: ":logger",
- key: ":backends",
- value: :erlang.term_to_binary([])
- )
-
- Pleroma.Config.TransferTask.load_and_update_env([], false)
-
- assert Application.get_env(:logger, :backends) == []
-
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- group: config.group,
- key: config.key,
- value: [":console"]
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":logger",
- "key" => ":backends",
- "value" => [
- ":console"
- ],
- "db" => [":backends"]
- }
- ]
- }
-
- assert Application.get_env(:logger, :backends) == [
- :console
- ]
- end
-
- test "saving full setting if value is not keyword", %{conn: conn} do
- config =
- insert(:config,
- group: ":tesla",
- key: ":adapter",
- value: :erlang.term_to_binary(Tesla.Adapter.Hackey)
- )
-
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{group: config.group, key: config.key, value: "Tesla.Adapter.Httpc"}
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":tesla",
- "key" => ":adapter",
- "value" => "Tesla.Adapter.Httpc",
- "db" => [":adapter"]
- }
- ]
- }
- end
-
- test "update config setting & delete with fallback to default value", %{
- conn: conn,
- admin: admin,
- token: token
- } do
- ueberauth = Application.get_env(:ueberauth, Ueberauth)
- config1 = insert(:config, key: ":keyaa1")
- config2 = insert(:config, key: ":keyaa2")
-
- config3 =
- insert(:config,
- group: ":ueberauth",
- key: "Ueberauth"
- )
-
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{group: config1.group, key: config1.key, value: "another_value"},
- %{group: config2.group, key: config2.key, value: "another_value"}
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => config1.key,
- "value" => "another_value",
- "db" => [":keyaa1"]
- },
- %{
- "group" => ":pleroma",
- "key" => config2.key,
- "value" => "another_value",
- "db" => [":keyaa2"]
- }
- ]
- }
-
- assert Application.get_env(:pleroma, :keyaa1) == "another_value"
- assert Application.get_env(:pleroma, :keyaa2) == "another_value"
- assert Application.get_env(:ueberauth, Ueberauth) == ConfigDB.from_binary(config3.value)
-
- conn =
- build_conn()
- |> assign(:user, admin)
- |> assign(:token, token)
- |> post("/api/pleroma/admin/config", %{
- configs: [
- %{group: config2.group, key: config2.key, delete: true},
- %{
- group: ":ueberauth",
- key: "Ueberauth",
- delete: true
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => []
- }
-
- assert Application.get_env(:ueberauth, Ueberauth) == ueberauth
- refute Keyword.has_key?(Application.get_all_env(:pleroma), :keyaa2)
- end
-
- test "common config example", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- "group" => ":pleroma",
- "key" => "Pleroma.Captcha.NotReal",
- "value" => [
- %{"tuple" => [":enabled", false]},
- %{"tuple" => [":method", "Pleroma.Captcha.Kocaptcha"]},
- %{"tuple" => [":seconds_valid", 60]},
- %{"tuple" => [":path", ""]},
- %{"tuple" => [":key1", nil]},
- %{"tuple" => [":partial_chain", "&:hackney_connect.partial_chain/1"]},
- %{"tuple" => [":regex1", "~r/https:\/\/example.com/"]},
- %{"tuple" => [":regex2", "~r/https:\/\/example.com/u"]},
- %{"tuple" => [":regex3", "~r/https:\/\/example.com/i"]},
- %{"tuple" => [":regex4", "~r/https:\/\/example.com/s"]},
- %{"tuple" => [":name", "Pleroma"]}
- ]
- }
- ]
- })
-
- assert Config.get([Pleroma.Captcha.NotReal, :name]) == "Pleroma"
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => "Pleroma.Captcha.NotReal",
- "value" => [
- %{"tuple" => [":enabled", false]},
- %{"tuple" => [":method", "Pleroma.Captcha.Kocaptcha"]},
- %{"tuple" => [":seconds_valid", 60]},
- %{"tuple" => [":path", ""]},
- %{"tuple" => [":key1", nil]},
- %{"tuple" => [":partial_chain", "&:hackney_connect.partial_chain/1"]},
- %{"tuple" => [":regex1", "~r/https:\\/\\/example.com/"]},
- %{"tuple" => [":regex2", "~r/https:\\/\\/example.com/u"]},
- %{"tuple" => [":regex3", "~r/https:\\/\\/example.com/i"]},
- %{"tuple" => [":regex4", "~r/https:\\/\\/example.com/s"]},
- %{"tuple" => [":name", "Pleroma"]}
- ],
- "db" => [
- ":enabled",
- ":method",
- ":seconds_valid",
- ":path",
- ":key1",
- ":partial_chain",
- ":regex1",
- ":regex2",
- ":regex3",
- ":regex4",
- ":name"
- ]
- }
- ]
- }
- end
-
- test "tuples with more than two values", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- "group" => ":pleroma",
- "key" => "Pleroma.Web.Endpoint.NotReal",
- "value" => [
- %{
- "tuple" => [
- ":http",
- [
- %{
- "tuple" => [
- ":key2",
- [
- %{
- "tuple" => [
- ":_",
- [
- %{
- "tuple" => [
- "/api/v1/streaming",
- "Pleroma.Web.MastodonAPI.WebsocketHandler",
- []
- ]
- },
- %{
- "tuple" => [
- "/websocket",
- "Phoenix.Endpoint.CowboyWebSocket",
- %{
- "tuple" => [
- "Phoenix.Transports.WebSocket",
- %{
- "tuple" => [
- "Pleroma.Web.Endpoint",
- "Pleroma.Web.UserSocket",
- []
- ]
- }
- ]
- }
- ]
- },
- %{
- "tuple" => [
- ":_",
- "Phoenix.Endpoint.Cowboy2Handler",
- %{"tuple" => ["Pleroma.Web.Endpoint", []]}
- ]
- }
- ]
- ]
- }
- ]
- ]
- }
- ]
- ]
- }
- ]
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => "Pleroma.Web.Endpoint.NotReal",
- "value" => [
- %{
- "tuple" => [
- ":http",
- [
- %{
- "tuple" => [
- ":key2",
- [
- %{
- "tuple" => [
- ":_",
- [
- %{
- "tuple" => [
- "/api/v1/streaming",
- "Pleroma.Web.MastodonAPI.WebsocketHandler",
- []
- ]
- },
- %{
- "tuple" => [
- "/websocket",
- "Phoenix.Endpoint.CowboyWebSocket",
- %{
- "tuple" => [
- "Phoenix.Transports.WebSocket",
- %{
- "tuple" => [
- "Pleroma.Web.Endpoint",
- "Pleroma.Web.UserSocket",
- []
- ]
- }
- ]
- }
- ]
- },
- %{
- "tuple" => [
- ":_",
- "Phoenix.Endpoint.Cowboy2Handler",
- %{"tuple" => ["Pleroma.Web.Endpoint", []]}
- ]
- }
- ]
- ]
- }
- ]
- ]
- }
- ]
- ]
- }
- ],
- "db" => [":http"]
- }
- ]
- }
- end
-
- test "settings with nesting map", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => [
- %{"tuple" => [":key2", "some_val"]},
- %{
- "tuple" => [
- ":key3",
- %{
- ":max_options" => 20,
- ":max_option_chars" => 200,
- ":min_expiration" => 0,
- ":max_expiration" => 31_536_000,
- "nested" => %{
- ":max_options" => 20,
- ":max_option_chars" => 200,
- ":min_expiration" => 0,
- ":max_expiration" => 31_536_000
- }
- }
- ]
- }
- ]
- }
- ]
- })
-
- assert json_response(conn, 200) ==
- %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => [
- %{"tuple" => [":key2", "some_val"]},
- %{
- "tuple" => [
- ":key3",
- %{
- ":max_expiration" => 31_536_000,
- ":max_option_chars" => 200,
- ":max_options" => 20,
- ":min_expiration" => 0,
- "nested" => %{
- ":max_expiration" => 31_536_000,
- ":max_option_chars" => 200,
- ":max_options" => 20,
- ":min_expiration" => 0
- }
- }
- ]
- }
- ],
- "db" => [":key2", ":key3"]
- }
- ]
- }
- end
-
- test "value as map", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => %{"key" => "some_val"}
- }
- ]
- })
-
- assert json_response(conn, 200) ==
- %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":key1",
- "value" => %{"key" => "some_val"},
- "db" => [":key1"]
- }
- ]
- }
- end
-
- test "queues key as atom", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- "group" => ":oban",
- "key" => ":queues",
- "value" => [
- %{"tuple" => [":federator_incoming", 50]},
- %{"tuple" => [":federator_outgoing", 50]},
- %{"tuple" => [":web_push", 50]},
- %{"tuple" => [":mailer", 10]},
- %{"tuple" => [":transmogrifier", 20]},
- %{"tuple" => [":scheduled_activities", 10]},
- %{"tuple" => [":background", 5]}
- ]
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":oban",
- "key" => ":queues",
- "value" => [
- %{"tuple" => [":federator_incoming", 50]},
- %{"tuple" => [":federator_outgoing", 50]},
- %{"tuple" => [":web_push", 50]},
- %{"tuple" => [":mailer", 10]},
- %{"tuple" => [":transmogrifier", 20]},
- %{"tuple" => [":scheduled_activities", 10]},
- %{"tuple" => [":background", 5]}
- ],
- "db" => [
- ":federator_incoming",
- ":federator_outgoing",
- ":web_push",
- ":mailer",
- ":transmogrifier",
- ":scheduled_activities",
- ":background"
- ]
- }
- ]
- }
- end
-
- test "delete part of settings by atom subkeys", %{conn: conn} do
- config =
- insert(:config,
- key: ":keyaa1",
- value: :erlang.term_to_binary(subkey1: "val1", subkey2: "val2", subkey3: "val3")
- )
-
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- group: config.group,
- key: config.key,
- subkeys: [":subkey1", ":subkey3"],
- delete: true
- }
- ]
- })
-
- assert json_response(conn, 200) == %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":keyaa1",
- "value" => [%{"tuple" => [":subkey2", "val2"]}],
- "db" => [":subkey2"]
- }
- ]
- }
- end
-
- test "proxy tuple localhost", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- group: ":pleroma",
- key: ":http",
- value: [
- %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]}
- ]
- }
- ]
- })
-
- assert %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":http",
- "value" => value,
- "db" => db
- }
- ]
- } = json_response(conn, 200)
-
- assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]} in value
- assert ":proxy_url" in db
- end
-
- test "proxy tuple domain", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- group: ":pleroma",
- key: ":http",
- value: [
- %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]}
- ]
- }
- ]
- })
-
- assert %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":http",
- "value" => value,
- "db" => db
- }
- ]
- } = json_response(conn, 200)
-
- assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]} in value
- assert ":proxy_url" in db
- end
-
- test "proxy tuple ip", %{conn: conn} do
- conn =
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{
- group: ":pleroma",
- key: ":http",
- value: [
- %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]}
- ]
- }
- ]
- })
-
- assert %{
- "configs" => [
- %{
- "group" => ":pleroma",
- "key" => ":http",
- "value" => value,
- "db" => db
- }
- ]
- } = json_response(conn, 200)
-
- assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]} in value
- assert ":proxy_url" in db
- end
-
- @tag capture_log: true
- test "doesn't set keys not in the whitelist", %{conn: conn} do
- clear_config(:database_config_whitelist, [
- {:pleroma, :key1},
- {:pleroma, :key2},
- {:pleroma, Pleroma.Captcha.NotReal},
- {:not_real}
- ])
-
- post(conn, "/api/pleroma/admin/config", %{
- configs: [
- %{group: ":pleroma", key: ":key1", value: "value1"},
- %{group: ":pleroma", key: ":key2", value: "value2"},
- %{group: ":pleroma", key: ":key3", value: "value3"},
- %{group: ":pleroma", key: "Pleroma.Web.Endpoint.NotReal", value: "value4"},
- %{group: ":pleroma", key: "Pleroma.Captcha.NotReal", value: "value5"},
- %{group: ":not_real", key: ":anything", value: "value6"}
- ]
- })
-
- assert Application.get_env(:pleroma, :key1) == "value1"
- assert Application.get_env(:pleroma, :key2) == "value2"
- assert Application.get_env(:pleroma, :key3) == nil
- assert Application.get_env(:pleroma, Pleroma.Web.Endpoint.NotReal) == nil
- assert Application.get_env(:pleroma, Pleroma.Captcha.NotReal) == "value5"
- assert Application.get_env(:not_real, :anything) == "value6"
- end
- end
-
describe "GET /api/pleroma/admin/restart" do
setup do: clear_config(:configurable_from_database, true)
@@ -3254,14 +1599,14 @@ test "changes actor type from permitted list", %{conn: conn, user: user} do
assert patch(conn, "/api/pleroma/admin/users/#{user.nickname}/credentials", %{
"actor_type" => "Application"
})
- |> json_response(200) == %{"errors" => %{"actor_type" => "is invalid"}}
+ |> json_response(400) == %{"errors" => %{"actor_type" => "is invalid"}}
end
test "update non existing user", %{conn: conn} do
assert patch(conn, "/api/pleroma/admin/users/non-existing/credentials", %{
"password" => "new_password"
})
- |> json_response(200) == %{"error" => "Unable to update user."}
+ |> json_response(404) == %{"error" => "Not found"}
end
end
@@ -3281,57 +1626,6 @@ test "sets password_reset_pending to true", %{conn: conn} do
end
end
- describe "relays" do
- test "POST /relay", %{conn: conn, admin: admin} do
- conn =
- post(conn, "/api/pleroma/admin/relay", %{
- relay_url: "http://mastodon.example.org/users/admin"
- })
-
- assert json_response(conn, 200) == "http://mastodon.example.org/users/admin"
-
- log_entry = Repo.one(ModerationLog)
-
- assert ModerationLog.get_log_entry_message(log_entry) ==
- "@#{admin.nickname} followed relay: http://mastodon.example.org/users/admin"
- end
-
- test "GET /relay", %{conn: conn} do
- relay_user = Pleroma.Web.ActivityPub.Relay.get_actor()
-
- ["http://mastodon.example.org/users/admin", "https://mstdn.io/users/mayuutann"]
- |> Enum.each(fn ap_id ->
- {:ok, user} = User.get_or_fetch_by_ap_id(ap_id)
- User.follow(relay_user, user)
- end)
-
- conn = get(conn, "/api/pleroma/admin/relay")
-
- assert json_response(conn, 200)["relays"] -- ["mastodon.example.org", "mstdn.io"] == []
- end
-
- test "DELETE /relay", %{conn: conn, admin: admin} do
- post(conn, "/api/pleroma/admin/relay", %{
- relay_url: "http://mastodon.example.org/users/admin"
- })
-
- conn =
- delete(conn, "/api/pleroma/admin/relay", %{
- relay_url: "http://mastodon.example.org/users/admin"
- })
-
- assert json_response(conn, 200) == "http://mastodon.example.org/users/admin"
-
- [log_entry_one, log_entry_two] = Repo.all(ModerationLog)
-
- assert ModerationLog.get_log_entry_message(log_entry_one) ==
- "@#{admin.nickname} followed relay: http://mastodon.example.org/users/admin"
-
- assert ModerationLog.get_log_entry_message(log_entry_two) ==
- "@#{admin.nickname} unfollowed relay: http://mastodon.example.org/users/admin"
- end
- end
-
describe "instances" do
test "GET /instances/:instance/statuses", %{conn: conn} do
user = insert(:user, local: false, nickname: "archaeme@archae.me")
@@ -3421,116 +1715,6 @@ test "it resend emails for two users", %{conn: conn, admin: admin} do
end
end
- describe "POST /reports/:id/notes" do
- setup %{conn: conn, admin: admin} do
- [reporter, target_user] = insert_pair(:user)
- activity = insert(:note_activity, user: target_user)
-
- {:ok, %{id: report_id}} =
- CommonAPI.report(reporter, %{
- account_id: target_user.id,
- comment: "I feel offended",
- status_ids: [activity.id]
- })
-
- post(conn, "/api/pleroma/admin/reports/#{report_id}/notes", %{
- content: "this is disgusting!"
- })
-
- post(conn, "/api/pleroma/admin/reports/#{report_id}/notes", %{
- content: "this is disgusting2!"
- })
-
- %{
- admin_id: admin.id,
- report_id: report_id
- }
- end
-
- test "it creates report note", %{admin_id: admin_id, report_id: report_id} do
- [note, _] = Repo.all(ReportNote)
-
- assert %{
- activity_id: ^report_id,
- content: "this is disgusting!",
- user_id: ^admin_id
- } = note
- end
-
- test "it returns reports with notes", %{conn: conn, admin: admin} do
- conn = get(conn, "/api/pleroma/admin/reports")
-
- response = json_response(conn, 200)
- notes = hd(response["reports"])["notes"]
- [note, _] = notes
-
- assert note["user"]["nickname"] == admin.nickname
- assert note["content"] == "this is disgusting!"
- assert note["created_at"]
- assert response["total"] == 1
- end
-
- test "it deletes the note", %{conn: conn, report_id: report_id} do
- assert ReportNote |> Repo.all() |> length() == 2
-
- [note, _] = Repo.all(ReportNote)
-
- delete(conn, "/api/pleroma/admin/reports/#{report_id}/notes/#{note.id}")
-
- assert ReportNote |> Repo.all() |> length() == 1
- end
- end
-
- describe "GET /api/pleroma/admin/config/descriptions" do
- test "structure", %{conn: conn} do
- admin = insert(:user, is_admin: true)
-
- conn =
- assign(conn, :user, admin)
- |> get("/api/pleroma/admin/config/descriptions")
-
- assert [child | _others] = json_response(conn, 200)
-
- assert child["children"]
- assert child["key"]
- assert String.starts_with?(child["group"], ":")
- assert child["description"]
- end
-
- test "filters by database configuration whitelist", %{conn: conn} do
- clear_config(:database_config_whitelist, [
- {:pleroma, :instance},
- {:pleroma, :activitypub},
- {:pleroma, Pleroma.Upload},
- {:esshd}
- ])
-
- admin = insert(:user, is_admin: true)
-
- conn =
- assign(conn, :user, admin)
- |> get("/api/pleroma/admin/config/descriptions")
-
- children = json_response(conn, 200)
-
- assert length(children) == 4
-
- assert Enum.count(children, fn c -> c["group"] == ":pleroma" end) == 3
-
- instance = Enum.find(children, fn c -> c["key"] == ":instance" end)
- assert instance["children"]
-
- activitypub = Enum.find(children, fn c -> c["key"] == ":activitypub" end)
- assert activitypub["children"]
-
- web_endpoint = Enum.find(children, fn c -> c["key"] == "Pleroma.Upload" end)
- assert web_endpoint["children"]
-
- esshd = Enum.find(children, fn c -> c["group"] == ":esshd" end)
- assert esshd["children"]
- end
- end
-
describe "/api/pleroma/admin/stats" do
test "status visibility count", %{conn: conn} do
admin = insert(:user, is_admin: true)
@@ -3548,190 +1732,25 @@ test "status visibility count", %{conn: conn} do
assert %{"direct" => 0, "private" => 0, "public" => 1, "unlisted" => 2} =
response["status_visibility"]
end
- end
- describe "POST /api/pleroma/admin/oauth_app" do
- test "errors", %{conn: conn} do
- response = conn |> post("/api/pleroma/admin/oauth_app", %{}) |> json_response(200)
+ test "by instance", %{conn: conn} do
+ admin = insert(:user, is_admin: true)
+ user1 = insert(:user)
+ instance2 = "instance2.tld"
+ user2 = insert(:user, %{ap_id: "https://#{instance2}/@actor"})
- assert response == %{"name" => "can't be blank", "redirect_uris" => "can't be blank"}
- end
-
- test "success", %{conn: conn} do
- base_url = Web.base_url()
- app_name = "Trusted app"
+ CommonAPI.post(user1, %{visibility: "public", status: "hey"})
+ CommonAPI.post(user2, %{visibility: "unlisted", status: "hey"})
+ CommonAPI.post(user2, %{visibility: "private", status: "hey"})
response =
conn
- |> post("/api/pleroma/admin/oauth_app", %{
- name: app_name,
- redirect_uris: base_url
- })
+ |> assign(:user, admin)
+ |> get("/api/pleroma/admin/stats", instance: instance2)
|> json_response(200)
- assert %{
- "client_id" => _,
- "client_secret" => _,
- "name" => ^app_name,
- "redirect_uri" => ^base_url,
- "trusted" => false
- } = response
- end
-
- test "with trusted", %{conn: conn} do
- base_url = Web.base_url()
- app_name = "Trusted app"
-
- response =
- conn
- |> post("/api/pleroma/admin/oauth_app", %{
- name: app_name,
- redirect_uris: base_url,
- trusted: true
- })
- |> json_response(200)
-
- assert %{
- "client_id" => _,
- "client_secret" => _,
- "name" => ^app_name,
- "redirect_uri" => ^base_url,
- "trusted" => true
- } = response
- end
- end
-
- describe "GET /api/pleroma/admin/oauth_app" do
- setup do
- app = insert(:oauth_app)
- {:ok, app: app}
- end
-
- test "list", %{conn: conn} do
- response =
- conn
- |> get("/api/pleroma/admin/oauth_app")
- |> json_response(200)
-
- assert %{"apps" => apps, "count" => count, "page_size" => _} = response
-
- assert length(apps) == count
- end
-
- test "with page size", %{conn: conn} do
- insert(:oauth_app)
- page_size = 1
-
- response =
- conn
- |> get("/api/pleroma/admin/oauth_app", %{page_size: to_string(page_size)})
- |> json_response(200)
-
- assert %{"apps" => apps, "count" => _, "page_size" => ^page_size} = response
-
- assert length(apps) == page_size
- end
-
- test "search by client name", %{conn: conn, app: app} do
- response =
- conn
- |> get("/api/pleroma/admin/oauth_app", %{name: app.client_name})
- |> json_response(200)
-
- assert %{"apps" => [returned], "count" => _, "page_size" => _} = response
-
- assert returned["client_id"] == app.client_id
- assert returned["name"] == app.client_name
- end
-
- test "search by client id", %{conn: conn, app: app} do
- response =
- conn
- |> get("/api/pleroma/admin/oauth_app", %{client_id: app.client_id})
- |> json_response(200)
-
- assert %{"apps" => [returned], "count" => _, "page_size" => _} = response
-
- assert returned["client_id"] == app.client_id
- assert returned["name"] == app.client_name
- end
-
- test "only trusted", %{conn: conn} do
- app = insert(:oauth_app, trusted: true)
-
- response =
- conn
- |> get("/api/pleroma/admin/oauth_app", %{trusted: true})
- |> json_response(200)
-
- assert %{"apps" => [returned], "count" => _, "page_size" => _} = response
-
- assert returned["client_id"] == app.client_id
- assert returned["name"] == app.client_name
- end
- end
-
- describe "DELETE /api/pleroma/admin/oauth_app/:id" do
- test "with id", %{conn: conn} do
- app = insert(:oauth_app)
-
- response =
- conn
- |> delete("/api/pleroma/admin/oauth_app/" <> to_string(app.id))
- |> json_response(:no_content)
-
- assert response == ""
- end
-
- test "with non existance id", %{conn: conn} do
- response =
- conn
- |> delete("/api/pleroma/admin/oauth_app/0")
- |> json_response(:bad_request)
-
- assert response == ""
- end
- end
-
- describe "PATCH /api/pleroma/admin/oauth_app/:id" do
- test "with id", %{conn: conn} do
- app = insert(:oauth_app)
-
- name = "another name"
- url = "https://example.com"
- scopes = ["admin"]
- id = app.id
- website = "http://website.com"
-
- response =
- conn
- |> patch("/api/pleroma/admin/oauth_app/" <> to_string(app.id), %{
- name: name,
- trusted: true,
- redirect_uris: url,
- scopes: scopes,
- website: website
- })
- |> json_response(200)
-
- assert %{
- "client_id" => _,
- "client_secret" => _,
- "id" => ^id,
- "name" => ^name,
- "redirect_uri" => ^url,
- "trusted" => true,
- "website" => ^website
- } = response
- end
-
- test "without id", %{conn: conn} do
- response =
- conn
- |> patch("/api/pleroma/admin/oauth_app/0")
- |> json_response(:bad_request)
-
- assert response == ""
+ assert %{"direct" => 0, "private" => 1, "public" => 0, "unlisted" => 1} =
+ response["status_visibility"]
end
end
end
diff --git a/test/web/admin_api/controllers/config_controller_test.exs b/test/web/admin_api/controllers/config_controller_test.exs
new file mode 100644
index 000000000..064ef9bc7
--- /dev/null
+++ b/test/web/admin_api/controllers/config_controller_test.exs
@@ -0,0 +1,1388 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.AdminAPI.ConfigControllerTest do
+ use Pleroma.Web.ConnCase, async: true
+
+ import ExUnit.CaptureLog
+ import Pleroma.Factory
+
+ alias Pleroma.Config
+ alias Pleroma.ConfigDB
+
+ setup do
+ admin = insert(:user, is_admin: true)
+ token = insert(:oauth_admin_token, user: admin)
+
+ conn =
+ build_conn()
+ |> assign(:user, admin)
+ |> assign(:token, token)
+
+ {:ok, %{admin: admin, token: token, conn: conn}}
+ end
+
+ describe "GET /api/pleroma/admin/config" do
+ setup do: clear_config(:configurable_from_database, true)
+
+ test "when configuration from database is off", %{conn: conn} do
+ Config.put(:configurable_from_database, false)
+ conn = get(conn, "/api/pleroma/admin/config")
+
+ assert json_response_and_validate_schema(conn, 400) ==
+ %{
+ "error" => "To use this endpoint you need to enable configuration from database."
+ }
+ end
+
+ test "with settings only in db", %{conn: conn} do
+ config1 = insert(:config)
+ config2 = insert(:config)
+
+ conn = get(conn, "/api/pleroma/admin/config?only_db=true")
+
+ %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => key1,
+ "value" => _
+ },
+ %{
+ "group" => ":pleroma",
+ "key" => key2,
+ "value" => _
+ }
+ ]
+ } = json_response_and_validate_schema(conn, 200)
+
+ assert key1 == inspect(config1.key)
+ assert key2 == inspect(config2.key)
+ end
+
+ test "db is added to settings that are in db", %{conn: conn} do
+ _config = insert(:config, key: ":instance", value: [name: "Some name"])
+
+ %{"configs" => configs} =
+ conn
+ |> get("/api/pleroma/admin/config")
+ |> json_response_and_validate_schema(200)
+
+ [instance_config] =
+ Enum.filter(configs, fn %{"group" => group, "key" => key} ->
+ group == ":pleroma" and key == ":instance"
+ end)
+
+ assert instance_config["db"] == [":name"]
+ end
+
+ test "merged default setting with db settings", %{conn: conn} do
+ config1 = insert(:config)
+ config2 = insert(:config)
+
+ config3 =
+ insert(:config,
+ value: [k1: :v1, k2: :v2]
+ )
+
+ %{"configs" => configs} =
+ conn
+ |> get("/api/pleroma/admin/config")
+ |> json_response_and_validate_schema(200)
+
+ assert length(configs) > 3
+
+ saved_configs = [config1, config2, config3]
+ keys = Enum.map(saved_configs, &inspect(&1.key))
+
+ received_configs =
+ Enum.filter(configs, fn %{"group" => group, "key" => key} ->
+ group == ":pleroma" and key in keys
+ end)
+
+ assert length(received_configs) == 3
+
+ db_keys =
+ config3.value
+ |> Keyword.keys()
+ |> ConfigDB.to_json_types()
+
+ keys = Enum.map(saved_configs -- [config3], &inspect(&1.key))
+
+ values = Enum.map(saved_configs, &ConfigDB.to_json_types(&1.value))
+
+ mapset_keys = MapSet.new(keys ++ db_keys)
+
+ Enum.each(received_configs, fn %{"value" => value, "db" => db} ->
+ db = MapSet.new(db)
+ assert MapSet.subset?(db, mapset_keys)
+
+ assert value in values
+ end)
+ end
+
+ test "subkeys with full update right merge", %{conn: conn} do
+ insert(:config,
+ key: ":emoji",
+ value: [groups: [a: 1, b: 2], key: [a: 1]]
+ )
+
+ insert(:config,
+ key: ":assets",
+ value: [mascots: [a: 1, b: 2], key: [a: 1]]
+ )
+
+ %{"configs" => configs} =
+ conn
+ |> get("/api/pleroma/admin/config")
+ |> json_response_and_validate_schema(200)
+
+ vals =
+ Enum.filter(configs, fn %{"group" => group, "key" => key} ->
+ group == ":pleroma" and key in [":emoji", ":assets"]
+ end)
+
+ emoji = Enum.find(vals, fn %{"key" => key} -> key == ":emoji" end)
+ assets = Enum.find(vals, fn %{"key" => key} -> key == ":assets" end)
+
+ emoji_val = ConfigDB.to_elixir_types(emoji["value"])
+ assets_val = ConfigDB.to_elixir_types(assets["value"])
+
+ assert emoji_val[:groups] == [a: 1, b: 2]
+ assert assets_val[:mascots] == [a: 1, b: 2]
+ end
+ end
+
+ test "POST /api/pleroma/admin/config error", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{"configs" => []})
+
+ assert json_response_and_validate_schema(conn, 400) ==
+ %{"error" => "To use this endpoint you need to enable configuration from database."}
+ end
+
+ describe "POST /api/pleroma/admin/config" do
+ setup do
+ http = Application.get_env(:pleroma, :http)
+
+ on_exit(fn ->
+ Application.delete_env(:pleroma, :key1)
+ Application.delete_env(:pleroma, :key2)
+ Application.delete_env(:pleroma, :key3)
+ Application.delete_env(:pleroma, :key4)
+ Application.delete_env(:pleroma, :keyaa1)
+ Application.delete_env(:pleroma, :keyaa2)
+ Application.delete_env(:pleroma, Pleroma.Web.Endpoint.NotReal)
+ Application.delete_env(:pleroma, Pleroma.Captcha.NotReal)
+ Application.put_env(:pleroma, :http, http)
+ Application.put_env(:tesla, :adapter, Tesla.Mock)
+ Restarter.Pleroma.refresh()
+ end)
+ end
+
+ setup do: clear_config(:configurable_from_database, true)
+
+ @tag capture_log: true
+ test "create new config setting in db", %{conn: conn} do
+ ueberauth = Application.get_env(:ueberauth, Ueberauth)
+ on_exit(fn -> Application.put_env(:ueberauth, Ueberauth, ueberauth) end)
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{group: ":pleroma", key: ":key1", value: "value1"},
+ %{
+ group: ":ueberauth",
+ key: "Ueberauth",
+ value: [%{"tuple" => [":consumer_secret", "aaaa"]}]
+ },
+ %{
+ group: ":pleroma",
+ key: ":key2",
+ value: %{
+ ":nested_1" => "nested_value1",
+ ":nested_2" => [
+ %{":nested_22" => "nested_value222"},
+ %{":nested_33" => %{":nested_44" => "nested_444"}}
+ ]
+ }
+ },
+ %{
+ group: ":pleroma",
+ key: ":key3",
+ value: [
+ %{"nested_3" => ":nested_3", "nested_33" => "nested_33"},
+ %{"nested_4" => true}
+ ]
+ },
+ %{
+ group: ":pleroma",
+ key: ":key4",
+ value: %{":nested_5" => ":upload", "endpoint" => "https://example.com"}
+ },
+ %{
+ group: ":idna",
+ key: ":key5",
+ value: %{"tuple" => ["string", "Pleroma.Captcha.NotReal", []]}
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => "value1",
+ "db" => [":key1"]
+ },
+ %{
+ "group" => ":ueberauth",
+ "key" => "Ueberauth",
+ "value" => [%{"tuple" => [":consumer_secret", "aaaa"]}],
+ "db" => [":consumer_secret"]
+ },
+ %{
+ "group" => ":pleroma",
+ "key" => ":key2",
+ "value" => %{
+ ":nested_1" => "nested_value1",
+ ":nested_2" => [
+ %{":nested_22" => "nested_value222"},
+ %{":nested_33" => %{":nested_44" => "nested_444"}}
+ ]
+ },
+ "db" => [":key2"]
+ },
+ %{
+ "group" => ":pleroma",
+ "key" => ":key3",
+ "value" => [
+ %{"nested_3" => ":nested_3", "nested_33" => "nested_33"},
+ %{"nested_4" => true}
+ ],
+ "db" => [":key3"]
+ },
+ %{
+ "group" => ":pleroma",
+ "key" => ":key4",
+ "value" => %{"endpoint" => "https://example.com", ":nested_5" => ":upload"},
+ "db" => [":key4"]
+ },
+ %{
+ "group" => ":idna",
+ "key" => ":key5",
+ "value" => %{"tuple" => ["string", "Pleroma.Captcha.NotReal", []]},
+ "db" => [":key5"]
+ }
+ ],
+ "need_reboot" => false
+ }
+
+ assert Application.get_env(:pleroma, :key1) == "value1"
+
+ assert Application.get_env(:pleroma, :key2) == %{
+ nested_1: "nested_value1",
+ nested_2: [
+ %{nested_22: "nested_value222"},
+ %{nested_33: %{nested_44: "nested_444"}}
+ ]
+ }
+
+ assert Application.get_env(:pleroma, :key3) == [
+ %{"nested_3" => :nested_3, "nested_33" => "nested_33"},
+ %{"nested_4" => true}
+ ]
+
+ assert Application.get_env(:pleroma, :key4) == %{
+ "endpoint" => "https://example.com",
+ nested_5: :upload
+ }
+
+ assert Application.get_env(:idna, :key5) == {"string", Pleroma.Captcha.NotReal, []}
+ end
+
+ test "save configs setting without explicit key", %{conn: conn} do
+ level = Application.get_env(:quack, :level)
+ meta = Application.get_env(:quack, :meta)
+ webhook_url = Application.get_env(:quack, :webhook_url)
+
+ on_exit(fn ->
+ Application.put_env(:quack, :level, level)
+ Application.put_env(:quack, :meta, meta)
+ Application.put_env(:quack, :webhook_url, webhook_url)
+ end)
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":quack",
+ key: ":level",
+ value: ":info"
+ },
+ %{
+ group: ":quack",
+ key: ":meta",
+ value: [":none"]
+ },
+ %{
+ group: ":quack",
+ key: ":webhook_url",
+ value: "https://hooks.slack.com/services/KEY"
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":quack",
+ "key" => ":level",
+ "value" => ":info",
+ "db" => [":level"]
+ },
+ %{
+ "group" => ":quack",
+ "key" => ":meta",
+ "value" => [":none"],
+ "db" => [":meta"]
+ },
+ %{
+ "group" => ":quack",
+ "key" => ":webhook_url",
+ "value" => "https://hooks.slack.com/services/KEY",
+ "db" => [":webhook_url"]
+ }
+ ],
+ "need_reboot" => false
+ }
+
+ assert Application.get_env(:quack, :level) == :info
+ assert Application.get_env(:quack, :meta) == [:none]
+ assert Application.get_env(:quack, :webhook_url) == "https://hooks.slack.com/services/KEY"
+ end
+
+ test "saving config with partial update", %{conn: conn} do
+ insert(:config, key: ":key1", value: :erlang.term_to_binary(key1: 1, key2: 2))
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{group: ":pleroma", key: ":key1", value: [%{"tuple" => [":key3", 3]}]}
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => [
+ %{"tuple" => [":key1", 1]},
+ %{"tuple" => [":key2", 2]},
+ %{"tuple" => [":key3", 3]}
+ ],
+ "db" => [":key1", ":key2", ":key3"]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "saving config which need pleroma reboot", %{conn: conn} do
+ chat = Config.get(:chat)
+ on_exit(fn -> Config.put(:chat, chat) end)
+
+ assert conn
+ |> put_req_header("content-type", "application/json")
+ |> post(
+ "/api/pleroma/admin/config",
+ %{
+ configs: [
+ %{group: ":pleroma", key: ":chat", value: [%{"tuple" => [":enabled", true]}]}
+ ]
+ }
+ )
+ |> json_response_and_validate_schema(200) == %{
+ "configs" => [
+ %{
+ "db" => [":enabled"],
+ "group" => ":pleroma",
+ "key" => ":chat",
+ "value" => [%{"tuple" => [":enabled", true]}]
+ }
+ ],
+ "need_reboot" => true
+ }
+
+ configs =
+ conn
+ |> get("/api/pleroma/admin/config")
+ |> json_response_and_validate_schema(200)
+
+ assert configs["need_reboot"]
+
+ capture_log(fn ->
+ assert conn |> get("/api/pleroma/admin/restart") |> json_response(200) ==
+ %{}
+ end) =~ "pleroma restarted"
+
+ configs =
+ conn
+ |> get("/api/pleroma/admin/config")
+ |> json_response_and_validate_schema(200)
+
+ assert configs["need_reboot"] == false
+ end
+
+ test "update setting which need reboot, don't change reboot flag until reboot", %{conn: conn} do
+ chat = Config.get(:chat)
+ on_exit(fn -> Config.put(:chat, chat) end)
+
+ assert conn
+ |> put_req_header("content-type", "application/json")
+ |> post(
+ "/api/pleroma/admin/config",
+ %{
+ configs: [
+ %{group: ":pleroma", key: ":chat", value: [%{"tuple" => [":enabled", true]}]}
+ ]
+ }
+ )
+ |> json_response_and_validate_schema(200) == %{
+ "configs" => [
+ %{
+ "db" => [":enabled"],
+ "group" => ":pleroma",
+ "key" => ":chat",
+ "value" => [%{"tuple" => [":enabled", true]}]
+ }
+ ],
+ "need_reboot" => true
+ }
+
+ assert conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{group: ":pleroma", key: ":key1", value: [%{"tuple" => [":key3", 3]}]}
+ ]
+ })
+ |> json_response_and_validate_schema(200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => [
+ %{"tuple" => [":key3", 3]}
+ ],
+ "db" => [":key3"]
+ }
+ ],
+ "need_reboot" => true
+ }
+
+ capture_log(fn ->
+ assert conn |> get("/api/pleroma/admin/restart") |> json_response(200) ==
+ %{}
+ end) =~ "pleroma restarted"
+
+ configs =
+ conn
+ |> get("/api/pleroma/admin/config")
+ |> json_response_and_validate_schema(200)
+
+ assert configs["need_reboot"] == false
+ end
+
+ test "saving config with nested merge", %{conn: conn} do
+ insert(:config, key: :key1, value: [key1: 1, key2: [k1: 1, k2: 2]])
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":pleroma",
+ key: ":key1",
+ value: [
+ %{"tuple" => [":key3", 3]},
+ %{
+ "tuple" => [
+ ":key2",
+ [
+ %{"tuple" => [":k2", 1]},
+ %{"tuple" => [":k3", 3]}
+ ]
+ ]
+ }
+ ]
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => [
+ %{"tuple" => [":key1", 1]},
+ %{"tuple" => [":key3", 3]},
+ %{
+ "tuple" => [
+ ":key2",
+ [
+ %{"tuple" => [":k1", 1]},
+ %{"tuple" => [":k2", 1]},
+ %{"tuple" => [":k3", 3]}
+ ]
+ ]
+ }
+ ],
+ "db" => [":key1", ":key3", ":key2"]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "saving special atoms", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => [
+ %{
+ "tuple" => [
+ ":ssl_options",
+ [%{"tuple" => [":versions", [":tlsv1", ":tlsv1.1", ":tlsv1.2"]]}]
+ ]
+ }
+ ]
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => [
+ %{
+ "tuple" => [
+ ":ssl_options",
+ [%{"tuple" => [":versions", [":tlsv1", ":tlsv1.1", ":tlsv1.2"]]}]
+ ]
+ }
+ ],
+ "db" => [":ssl_options"]
+ }
+ ],
+ "need_reboot" => false
+ }
+
+ assert Application.get_env(:pleroma, :key1) == [
+ ssl_options: [versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]]
+ ]
+ end
+
+ test "saving full setting if value is in full_key_update list", %{conn: conn} do
+ backends = Application.get_env(:logger, :backends)
+ on_exit(fn -> Application.put_env(:logger, :backends, backends) end)
+
+ insert(:config,
+ group: :logger,
+ key: :backends,
+ value: []
+ )
+
+ Pleroma.Config.TransferTask.load_and_update_env([], false)
+
+ assert Application.get_env(:logger, :backends) == []
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":logger",
+ key: ":backends",
+ value: [":console"]
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":logger",
+ "key" => ":backends",
+ "value" => [
+ ":console"
+ ],
+ "db" => [":backends"]
+ }
+ ],
+ "need_reboot" => false
+ }
+
+ assert Application.get_env(:logger, :backends) == [
+ :console
+ ]
+ end
+
+ test "saving full setting if value is not keyword", %{conn: conn} do
+ insert(:config,
+ group: :tesla,
+ key: :adapter,
+ value: Tesla.Adapter.Hackey
+ )
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{group: ":tesla", key: ":adapter", value: "Tesla.Adapter.Httpc"}
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":tesla",
+ "key" => ":adapter",
+ "value" => "Tesla.Adapter.Httpc",
+ "db" => [":adapter"]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "update config setting & delete with fallback to default value", %{
+ conn: conn,
+ admin: admin,
+ token: token
+ } do
+ ueberauth = Application.get_env(:ueberauth, Ueberauth)
+ insert(:config, key: :keyaa1)
+ insert(:config, key: :keyaa2)
+
+ config3 =
+ insert(:config,
+ group: :ueberauth,
+ key: Ueberauth
+ )
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{group: ":pleroma", key: ":keyaa1", value: "another_value"},
+ %{group: ":pleroma", key: ":keyaa2", value: "another_value"}
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":keyaa1",
+ "value" => "another_value",
+ "db" => [":keyaa1"]
+ },
+ %{
+ "group" => ":pleroma",
+ "key" => ":keyaa2",
+ "value" => "another_value",
+ "db" => [":keyaa2"]
+ }
+ ],
+ "need_reboot" => false
+ }
+
+ assert Application.get_env(:pleroma, :keyaa1) == "another_value"
+ assert Application.get_env(:pleroma, :keyaa2) == "another_value"
+ assert Application.get_env(:ueberauth, Ueberauth) == config3.value
+
+ conn =
+ build_conn()
+ |> assign(:user, admin)
+ |> assign(:token, token)
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{group: ":pleroma", key: ":keyaa2", delete: true},
+ %{
+ group: ":ueberauth",
+ key: "Ueberauth",
+ delete: true
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [],
+ "need_reboot" => false
+ }
+
+ assert Application.get_env(:ueberauth, Ueberauth) == ueberauth
+ refute Keyword.has_key?(Application.get_all_env(:pleroma), :keyaa2)
+ end
+
+ test "common config example", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ "group" => ":pleroma",
+ "key" => "Pleroma.Captcha.NotReal",
+ "value" => [
+ %{"tuple" => [":enabled", false]},
+ %{"tuple" => [":method", "Pleroma.Captcha.Kocaptcha"]},
+ %{"tuple" => [":seconds_valid", 60]},
+ %{"tuple" => [":path", ""]},
+ %{"tuple" => [":key1", nil]},
+ %{"tuple" => [":partial_chain", "&:hackney_connect.partial_chain/1"]},
+ %{"tuple" => [":regex1", "~r/https:\/\/example.com/"]},
+ %{"tuple" => [":regex2", "~r/https:\/\/example.com/u"]},
+ %{"tuple" => [":regex3", "~r/https:\/\/example.com/i"]},
+ %{"tuple" => [":regex4", "~r/https:\/\/example.com/s"]},
+ %{"tuple" => [":name", "Pleroma"]}
+ ]
+ }
+ ]
+ })
+
+ assert Config.get([Pleroma.Captcha.NotReal, :name]) == "Pleroma"
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => "Pleroma.Captcha.NotReal",
+ "value" => [
+ %{"tuple" => [":enabled", false]},
+ %{"tuple" => [":method", "Pleroma.Captcha.Kocaptcha"]},
+ %{"tuple" => [":seconds_valid", 60]},
+ %{"tuple" => [":path", ""]},
+ %{"tuple" => [":key1", nil]},
+ %{"tuple" => [":partial_chain", "&:hackney_connect.partial_chain/1"]},
+ %{"tuple" => [":regex1", "~r/https:\\/\\/example.com/"]},
+ %{"tuple" => [":regex2", "~r/https:\\/\\/example.com/u"]},
+ %{"tuple" => [":regex3", "~r/https:\\/\\/example.com/i"]},
+ %{"tuple" => [":regex4", "~r/https:\\/\\/example.com/s"]},
+ %{"tuple" => [":name", "Pleroma"]}
+ ],
+ "db" => [
+ ":enabled",
+ ":method",
+ ":seconds_valid",
+ ":path",
+ ":key1",
+ ":partial_chain",
+ ":regex1",
+ ":regex2",
+ ":regex3",
+ ":regex4",
+ ":name"
+ ]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "tuples with more than two values", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ "group" => ":pleroma",
+ "key" => "Pleroma.Web.Endpoint.NotReal",
+ "value" => [
+ %{
+ "tuple" => [
+ ":http",
+ [
+ %{
+ "tuple" => [
+ ":key2",
+ [
+ %{
+ "tuple" => [
+ ":_",
+ [
+ %{
+ "tuple" => [
+ "/api/v1/streaming",
+ "Pleroma.Web.MastodonAPI.WebsocketHandler",
+ []
+ ]
+ },
+ %{
+ "tuple" => [
+ "/websocket",
+ "Phoenix.Endpoint.CowboyWebSocket",
+ %{
+ "tuple" => [
+ "Phoenix.Transports.WebSocket",
+ %{
+ "tuple" => [
+ "Pleroma.Web.Endpoint",
+ "Pleroma.Web.UserSocket",
+ []
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ %{
+ "tuple" => [
+ ":_",
+ "Phoenix.Endpoint.Cowboy2Handler",
+ %{"tuple" => ["Pleroma.Web.Endpoint", []]}
+ ]
+ }
+ ]
+ ]
+ }
+ ]
+ ]
+ }
+ ]
+ ]
+ }
+ ]
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => "Pleroma.Web.Endpoint.NotReal",
+ "value" => [
+ %{
+ "tuple" => [
+ ":http",
+ [
+ %{
+ "tuple" => [
+ ":key2",
+ [
+ %{
+ "tuple" => [
+ ":_",
+ [
+ %{
+ "tuple" => [
+ "/api/v1/streaming",
+ "Pleroma.Web.MastodonAPI.WebsocketHandler",
+ []
+ ]
+ },
+ %{
+ "tuple" => [
+ "/websocket",
+ "Phoenix.Endpoint.CowboyWebSocket",
+ %{
+ "tuple" => [
+ "Phoenix.Transports.WebSocket",
+ %{
+ "tuple" => [
+ "Pleroma.Web.Endpoint",
+ "Pleroma.Web.UserSocket",
+ []
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ %{
+ "tuple" => [
+ ":_",
+ "Phoenix.Endpoint.Cowboy2Handler",
+ %{"tuple" => ["Pleroma.Web.Endpoint", []]}
+ ]
+ }
+ ]
+ ]
+ }
+ ]
+ ]
+ }
+ ]
+ ]
+ }
+ ],
+ "db" => [":http"]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "settings with nesting map", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => [
+ %{"tuple" => [":key2", "some_val"]},
+ %{
+ "tuple" => [
+ ":key3",
+ %{
+ ":max_options" => 20,
+ ":max_option_chars" => 200,
+ ":min_expiration" => 0,
+ ":max_expiration" => 31_536_000,
+ "nested" => %{
+ ":max_options" => 20,
+ ":max_option_chars" => 200,
+ ":min_expiration" => 0,
+ ":max_expiration" => 31_536_000
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) ==
+ %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => [
+ %{"tuple" => [":key2", "some_val"]},
+ %{
+ "tuple" => [
+ ":key3",
+ %{
+ ":max_expiration" => 31_536_000,
+ ":max_option_chars" => 200,
+ ":max_options" => 20,
+ ":min_expiration" => 0,
+ "nested" => %{
+ ":max_expiration" => 31_536_000,
+ ":max_option_chars" => 200,
+ ":max_options" => 20,
+ ":min_expiration" => 0
+ }
+ }
+ ]
+ }
+ ],
+ "db" => [":key2", ":key3"]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "value as map", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => %{"key" => "some_val"}
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) ==
+ %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":key1",
+ "value" => %{"key" => "some_val"},
+ "db" => [":key1"]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "queues key as atom", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ "group" => ":oban",
+ "key" => ":queues",
+ "value" => [
+ %{"tuple" => [":federator_incoming", 50]},
+ %{"tuple" => [":federator_outgoing", 50]},
+ %{"tuple" => [":web_push", 50]},
+ %{"tuple" => [":mailer", 10]},
+ %{"tuple" => [":transmogrifier", 20]},
+ %{"tuple" => [":scheduled_activities", 10]},
+ %{"tuple" => [":background", 5]}
+ ]
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":oban",
+ "key" => ":queues",
+ "value" => [
+ %{"tuple" => [":federator_incoming", 50]},
+ %{"tuple" => [":federator_outgoing", 50]},
+ %{"tuple" => [":web_push", 50]},
+ %{"tuple" => [":mailer", 10]},
+ %{"tuple" => [":transmogrifier", 20]},
+ %{"tuple" => [":scheduled_activities", 10]},
+ %{"tuple" => [":background", 5]}
+ ],
+ "db" => [
+ ":federator_incoming",
+ ":federator_outgoing",
+ ":web_push",
+ ":mailer",
+ ":transmogrifier",
+ ":scheduled_activities",
+ ":background"
+ ]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "delete part of settings by atom subkeys", %{conn: conn} do
+ insert(:config,
+ key: :keyaa1,
+ value: [subkey1: "val1", subkey2: "val2", subkey3: "val3"]
+ )
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":pleroma",
+ key: ":keyaa1",
+ subkeys: [":subkey1", ":subkey3"],
+ delete: true
+ }
+ ]
+ })
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":keyaa1",
+ "value" => [%{"tuple" => [":subkey2", "val2"]}],
+ "db" => [":subkey2"]
+ }
+ ],
+ "need_reboot" => false
+ }
+ end
+
+ test "proxy tuple localhost", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":pleroma",
+ key: ":http",
+ value: [
+ %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]}
+ ]
+ }
+ ]
+ })
+
+ assert %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":http",
+ "value" => value,
+ "db" => db
+ }
+ ]
+ } = json_response_and_validate_schema(conn, 200)
+
+ assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "localhost", 1234]}]} in value
+ assert ":proxy_url" in db
+ end
+
+ test "proxy tuple domain", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":pleroma",
+ key: ":http",
+ value: [
+ %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]}
+ ]
+ }
+ ]
+ })
+
+ assert %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":http",
+ "value" => value,
+ "db" => db
+ }
+ ]
+ } = json_response_and_validate_schema(conn, 200)
+
+ assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "domain.com", 1234]}]} in value
+ assert ":proxy_url" in db
+ end
+
+ test "proxy tuple ip", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":pleroma",
+ key: ":http",
+ value: [
+ %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]}
+ ]
+ }
+ ]
+ })
+
+ assert %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => ":http",
+ "value" => value,
+ "db" => db
+ }
+ ]
+ } = json_response_and_validate_schema(conn, 200)
+
+ assert %{"tuple" => [":proxy_url", %{"tuple" => [":socks5", "127.0.0.1", 1234]}]} in value
+ assert ":proxy_url" in db
+ end
+
+ @tag capture_log: true
+ test "doesn't set keys not in the whitelist", %{conn: conn} do
+ clear_config(:database_config_whitelist, [
+ {:pleroma, :key1},
+ {:pleroma, :key2},
+ {:pleroma, Pleroma.Captcha.NotReal},
+ {:not_real}
+ ])
+
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{group: ":pleroma", key: ":key1", value: "value1"},
+ %{group: ":pleroma", key: ":key2", value: "value2"},
+ %{group: ":pleroma", key: ":key3", value: "value3"},
+ %{group: ":pleroma", key: "Pleroma.Web.Endpoint.NotReal", value: "value4"},
+ %{group: ":pleroma", key: "Pleroma.Captcha.NotReal", value: "value5"},
+ %{group: ":not_real", key: ":anything", value: "value6"}
+ ]
+ })
+
+ assert Application.get_env(:pleroma, :key1) == "value1"
+ assert Application.get_env(:pleroma, :key2) == "value2"
+ assert Application.get_env(:pleroma, :key3) == nil
+ assert Application.get_env(:pleroma, Pleroma.Web.Endpoint.NotReal) == nil
+ assert Application.get_env(:pleroma, Pleroma.Captcha.NotReal) == "value5"
+ assert Application.get_env(:not_real, :anything) == "value6"
+ end
+
+ test "args for Pleroma.Upload.Filter.Mogrify with custom tuples", %{conn: conn} do
+ clear_config(Pleroma.Upload.Filter.Mogrify)
+
+ assert conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":pleroma",
+ key: "Pleroma.Upload.Filter.Mogrify",
+ value: [
+ %{"tuple" => [":args", ["auto-orient", "strip"]]}
+ ]
+ }
+ ]
+ })
+ |> json_response_and_validate_schema(200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => "Pleroma.Upload.Filter.Mogrify",
+ "value" => [
+ %{"tuple" => [":args", ["auto-orient", "strip"]]}
+ ],
+ "db" => [":args"]
+ }
+ ],
+ "need_reboot" => false
+ }
+
+ assert Config.get(Pleroma.Upload.Filter.Mogrify) == [args: ["auto-orient", "strip"]]
+
+ assert conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/config", %{
+ configs: [
+ %{
+ group: ":pleroma",
+ key: "Pleroma.Upload.Filter.Mogrify",
+ value: [
+ %{
+ "tuple" => [
+ ":args",
+ [
+ "auto-orient",
+ "strip",
+ "{\"implode\", \"1\"}",
+ "{\"resize\", \"3840x1080>\"}"
+ ]
+ ]
+ }
+ ]
+ }
+ ]
+ })
+ |> json_response(200) == %{
+ "configs" => [
+ %{
+ "group" => ":pleroma",
+ "key" => "Pleroma.Upload.Filter.Mogrify",
+ "value" => [
+ %{
+ "tuple" => [
+ ":args",
+ [
+ "auto-orient",
+ "strip",
+ "{\"implode\", \"1\"}",
+ "{\"resize\", \"3840x1080>\"}"
+ ]
+ ]
+ }
+ ],
+ "db" => [":args"]
+ }
+ ],
+ "need_reboot" => false
+ }
+
+ assert Config.get(Pleroma.Upload.Filter.Mogrify) == [
+ args: ["auto-orient", "strip", {"implode", "1"}, {"resize", "3840x1080>"}]
+ ]
+ end
+ end
+
+ describe "GET /api/pleroma/admin/config/descriptions" do
+ test "structure", %{conn: conn} do
+ admin = insert(:user, is_admin: true)
+
+ conn =
+ assign(conn, :user, admin)
+ |> get("/api/pleroma/admin/config/descriptions")
+
+ assert [child | _others] = json_response_and_validate_schema(conn, 200)
+
+ assert child["children"]
+ assert child["key"]
+ assert String.starts_with?(child["group"], ":")
+ assert child["description"]
+ end
+
+ test "filters by database configuration whitelist", %{conn: conn} do
+ clear_config(:database_config_whitelist, [
+ {:pleroma, :instance},
+ {:pleroma, :activitypub},
+ {:pleroma, Pleroma.Upload},
+ {:esshd}
+ ])
+
+ admin = insert(:user, is_admin: true)
+
+ conn =
+ assign(conn, :user, admin)
+ |> get("/api/pleroma/admin/config/descriptions")
+
+ children = json_response_and_validate_schema(conn, 200)
+
+ assert length(children) == 4
+
+ assert Enum.count(children, fn c -> c["group"] == ":pleroma" end) == 3
+
+ instance = Enum.find(children, fn c -> c["key"] == ":instance" end)
+ assert instance["children"]
+
+ activitypub = Enum.find(children, fn c -> c["key"] == ":activitypub" end)
+ assert activitypub["children"]
+
+ web_endpoint = Enum.find(children, fn c -> c["key"] == "Pleroma.Upload" end)
+ assert web_endpoint["children"]
+
+ esshd = Enum.find(children, fn c -> c["group"] == ":esshd" end)
+ assert esshd["children"]
+ end
+ end
+end
diff --git a/test/web/admin_api/controllers/invite_controller_test.exs b/test/web/admin_api/controllers/invite_controller_test.exs
new file mode 100644
index 000000000..ab186c5e7
--- /dev/null
+++ b/test/web/admin_api/controllers/invite_controller_test.exs
@@ -0,0 +1,281 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.AdminAPI.InviteControllerTest do
+ use Pleroma.Web.ConnCase, async: true
+
+ import Pleroma.Factory
+
+ alias Pleroma.Config
+ alias Pleroma.Repo
+ alias Pleroma.UserInviteToken
+
+ setup do
+ admin = insert(:user, is_admin: true)
+ token = insert(:oauth_admin_token, user: admin)
+
+ conn =
+ build_conn()
+ |> assign(:user, admin)
+ |> assign(:token, token)
+
+ {:ok, %{admin: admin, token: token, conn: conn}}
+ end
+
+ describe "POST /api/pleroma/admin/users/email_invite, with valid config" do
+ setup do: clear_config([:instance, :registrations_open], false)
+ setup do: clear_config([:instance, :invites_enabled], true)
+
+ test "sends invitation and returns 204", %{admin: admin, conn: conn} do
+ recipient_email = "foo@bar.com"
+ recipient_name = "J. D."
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json;charset=utf-8")
+ |> post("/api/pleroma/admin/users/email_invite", %{
+ email: recipient_email,
+ name: recipient_name
+ })
+
+ assert json_response_and_validate_schema(conn, :no_content)
+
+ token_record = List.last(Repo.all(Pleroma.UserInviteToken))
+ assert token_record
+ refute token_record.used
+
+ notify_email = Config.get([:instance, :notify_email])
+ instance_name = Config.get([:instance, :name])
+
+ email =
+ Pleroma.Emails.UserEmail.user_invitation_email(
+ admin,
+ token_record,
+ recipient_email,
+ recipient_name
+ )
+
+ Swoosh.TestAssertions.assert_email_sent(
+ from: {instance_name, notify_email},
+ to: {recipient_name, recipient_email},
+ html_body: email.html_body
+ )
+ end
+
+ test "it returns 403 if requested by a non-admin" do
+ non_admin_user = insert(:user)
+ token = insert(:oauth_token, user: non_admin_user)
+
+ conn =
+ build_conn()
+ |> assign(:user, non_admin_user)
+ |> assign(:token, token)
+ |> put_req_header("content-type", "application/json;charset=utf-8")
+ |> post("/api/pleroma/admin/users/email_invite", %{
+ email: "foo@bar.com",
+ name: "JD"
+ })
+
+ assert json_response(conn, :forbidden)
+ end
+
+ test "email with +", %{conn: conn, admin: admin} do
+ recipient_email = "foo+bar@baz.com"
+
+ conn
+ |> put_req_header("content-type", "application/json;charset=utf-8")
+ |> post("/api/pleroma/admin/users/email_invite", %{email: recipient_email})
+ |> json_response_and_validate_schema(:no_content)
+
+ token_record =
+ Pleroma.UserInviteToken
+ |> Repo.all()
+ |> List.last()
+
+ assert token_record
+ refute token_record.used
+
+ notify_email = Config.get([:instance, :notify_email])
+ instance_name = Config.get([:instance, :name])
+
+ email =
+ Pleroma.Emails.UserEmail.user_invitation_email(
+ admin,
+ token_record,
+ recipient_email
+ )
+
+ Swoosh.TestAssertions.assert_email_sent(
+ from: {instance_name, notify_email},
+ to: recipient_email,
+ html_body: email.html_body
+ )
+ end
+ end
+
+ describe "POST /api/pleroma/admin/users/email_invite, with invalid config" do
+ setup do: clear_config([:instance, :registrations_open])
+ setup do: clear_config([:instance, :invites_enabled])
+
+ test "it returns 500 if `invites_enabled` is not enabled", %{conn: conn} do
+ Config.put([:instance, :registrations_open], false)
+ Config.put([:instance, :invites_enabled], false)
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/users/email_invite", %{
+ email: "foo@bar.com",
+ name: "JD"
+ })
+
+ assert json_response_and_validate_schema(conn, :bad_request) ==
+ %{
+ "error" =>
+ "To send invites you need to set the `invites_enabled` option to true."
+ }
+ end
+
+ test "it returns 500 if `registrations_open` is enabled", %{conn: conn} do
+ Config.put([:instance, :registrations_open], true)
+ Config.put([:instance, :invites_enabled], true)
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/users/email_invite", %{
+ email: "foo@bar.com",
+ name: "JD"
+ })
+
+ assert json_response_and_validate_schema(conn, :bad_request) ==
+ %{
+ "error" =>
+ "To send invites you need to set the `registrations_open` option to false."
+ }
+ end
+ end
+
+ describe "POST /api/pleroma/admin/users/invite_token" do
+ test "without options", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/users/invite_token")
+
+ invite_json = json_response_and_validate_schema(conn, 200)
+ invite = UserInviteToken.find_by_token!(invite_json["token"])
+ refute invite.used
+ refute invite.expires_at
+ refute invite.max_use
+ assert invite.invite_type == "one_time"
+ end
+
+ test "with expires_at", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/users/invite_token", %{
+ "expires_at" => Date.to_string(Date.utc_today())
+ })
+
+ invite_json = json_response_and_validate_schema(conn, 200)
+ invite = UserInviteToken.find_by_token!(invite_json["token"])
+
+ refute invite.used
+ assert invite.expires_at == Date.utc_today()
+ refute invite.max_use
+ assert invite.invite_type == "date_limited"
+ end
+
+ test "with max_use", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/users/invite_token", %{"max_use" => 150})
+
+ invite_json = json_response_and_validate_schema(conn, 200)
+ invite = UserInviteToken.find_by_token!(invite_json["token"])
+ refute invite.used
+ refute invite.expires_at
+ assert invite.max_use == 150
+ assert invite.invite_type == "reusable"
+ end
+
+ test "with max use and expires_at", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/users/invite_token", %{
+ "max_use" => 150,
+ "expires_at" => Date.to_string(Date.utc_today())
+ })
+
+ invite_json = json_response_and_validate_schema(conn, 200)
+ invite = UserInviteToken.find_by_token!(invite_json["token"])
+ refute invite.used
+ assert invite.expires_at == Date.utc_today()
+ assert invite.max_use == 150
+ assert invite.invite_type == "reusable_date_limited"
+ end
+ end
+
+ describe "GET /api/pleroma/admin/users/invites" do
+ test "no invites", %{conn: conn} do
+ conn = get(conn, "/api/pleroma/admin/users/invites")
+
+ assert json_response_and_validate_schema(conn, 200) == %{"invites" => []}
+ end
+
+ test "with invite", %{conn: conn} do
+ {:ok, invite} = UserInviteToken.create_invite()
+
+ conn = get(conn, "/api/pleroma/admin/users/invites")
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "invites" => [
+ %{
+ "expires_at" => nil,
+ "id" => invite.id,
+ "invite_type" => "one_time",
+ "max_use" => nil,
+ "token" => invite.token,
+ "used" => false,
+ "uses" => 0
+ }
+ ]
+ }
+ end
+ end
+
+ describe "POST /api/pleroma/admin/users/revoke_invite" do
+ test "with token", %{conn: conn} do
+ {:ok, invite} = UserInviteToken.create_invite()
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/users/revoke_invite", %{"token" => invite.token})
+
+ assert json_response_and_validate_schema(conn, 200) == %{
+ "expires_at" => nil,
+ "id" => invite.id,
+ "invite_type" => "one_time",
+ "max_use" => nil,
+ "token" => invite.token,
+ "used" => true,
+ "uses" => 0
+ }
+ end
+
+ test "with invalid token", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/users/revoke_invite", %{"token" => "foo"})
+
+ assert json_response_and_validate_schema(conn, :not_found) == %{"error" => "Not found"}
+ end
+ end
+end
diff --git a/test/web/admin_api/controllers/media_proxy_cache_controller_test.exs b/test/web/admin_api/controllers/media_proxy_cache_controller_test.exs
new file mode 100644
index 000000000..5ab6cb78a
--- /dev/null
+++ b/test/web/admin_api/controllers/media_proxy_cache_controller_test.exs
@@ -0,0 +1,145 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.AdminAPI.MediaProxyCacheControllerTest do
+ use Pleroma.Web.ConnCase
+
+ import Pleroma.Factory
+ import Mock
+
+ alias Pleroma.Web.MediaProxy
+
+ setup do: clear_config([:media_proxy])
+
+ setup do
+ on_exit(fn -> Cachex.clear(:banned_urls_cache) end)
+ end
+
+ setup do
+ admin = insert(:user, is_admin: true)
+ token = insert(:oauth_admin_token, user: admin)
+
+ conn =
+ build_conn()
+ |> assign(:user, admin)
+ |> assign(:token, token)
+
+ Config.put([:media_proxy, :enabled], true)
+ Config.put([:media_proxy, :invalidation, :enabled], true)
+ Config.put([:media_proxy, :invalidation, :provider], MediaProxy.Invalidation.Script)
+
+ {:ok, %{admin: admin, token: token, conn: conn}}
+ end
+
+ describe "GET /api/pleroma/admin/media_proxy_caches" do
+ test "shows banned MediaProxy URLs", %{conn: conn} do
+ MediaProxy.put_in_banned_urls([
+ "http://localhost:4001/media/a688346.jpg",
+ "http://localhost:4001/media/fb1f4d.jpg"
+ ])
+
+ MediaProxy.put_in_banned_urls("http://localhost:4001/media/gb1f44.jpg")
+ MediaProxy.put_in_banned_urls("http://localhost:4001/media/tb13f47.jpg")
+ MediaProxy.put_in_banned_urls("http://localhost:4001/media/wb1f46.jpg")
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/media_proxy_caches?page_size=2")
+ |> json_response_and_validate_schema(200)
+
+ assert response["urls"] == [
+ "http://localhost:4001/media/fb1f4d.jpg",
+ "http://localhost:4001/media/a688346.jpg"
+ ]
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/media_proxy_caches?page_size=2&page=2")
+ |> json_response_and_validate_schema(200)
+
+ assert response["urls"] == [
+ "http://localhost:4001/media/gb1f44.jpg",
+ "http://localhost:4001/media/tb13f47.jpg"
+ ]
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/media_proxy_caches?page_size=2&page=3")
+ |> json_response_and_validate_schema(200)
+
+ assert response["urls"] == ["http://localhost:4001/media/wb1f46.jpg"]
+ end
+ end
+
+ describe "POST /api/pleroma/admin/media_proxy_caches/delete" do
+ test "deleted MediaProxy URLs from banned", %{conn: conn} do
+ MediaProxy.put_in_banned_urls([
+ "http://localhost:4001/media/a688346.jpg",
+ "http://localhost:4001/media/fb1f4d.jpg"
+ ])
+
+ response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/media_proxy_caches/delete", %{
+ urls: ["http://localhost:4001/media/a688346.jpg"]
+ })
+ |> json_response_and_validate_schema(200)
+
+ assert response["urls"] == ["http://localhost:4001/media/a688346.jpg"]
+ refute MediaProxy.in_banned_urls("http://localhost:4001/media/a688346.jpg")
+ assert MediaProxy.in_banned_urls("http://localhost:4001/media/fb1f4d.jpg")
+ end
+ end
+
+ describe "POST /api/pleroma/admin/media_proxy_caches/purge" do
+ test "perform invalidates cache of MediaProxy", %{conn: conn} do
+ urls = [
+ "http://example.com/media/a688346.jpg",
+ "http://example.com/media/fb1f4d.jpg"
+ ]
+
+ with_mocks [
+ {MediaProxy.Invalidation.Script, [],
+ [
+ purge: fn _, _ -> {"ok", 0} end
+ ]}
+ ] do
+ response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/media_proxy_caches/purge", %{urls: urls, ban: false})
+ |> json_response_and_validate_schema(200)
+
+ assert response["urls"] == urls
+
+ refute MediaProxy.in_banned_urls("http://example.com/media/a688346.jpg")
+ refute MediaProxy.in_banned_urls("http://example.com/media/fb1f4d.jpg")
+ end
+ end
+
+ test "perform invalidates cache of MediaProxy and adds url to banned", %{conn: conn} do
+ urls = [
+ "http://example.com/media/a688346.jpg",
+ "http://example.com/media/fb1f4d.jpg"
+ ]
+
+ with_mocks [{MediaProxy.Invalidation.Script, [], [purge: fn _, _ -> {"ok", 0} end]}] do
+ response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/media_proxy_caches/purge", %{
+ urls: urls,
+ ban: true
+ })
+ |> json_response_and_validate_schema(200)
+
+ assert response["urls"] == urls
+
+ assert MediaProxy.in_banned_urls("http://example.com/media/a688346.jpg")
+ assert MediaProxy.in_banned_urls("http://example.com/media/fb1f4d.jpg")
+ end
+ end
+ end
+end
diff --git a/test/web/admin_api/controllers/oauth_app_controller_test.exs b/test/web/admin_api/controllers/oauth_app_controller_test.exs
new file mode 100644
index 000000000..ed7c4172c
--- /dev/null
+++ b/test/web/admin_api/controllers/oauth_app_controller_test.exs
@@ -0,0 +1,220 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.AdminAPI.OAuthAppControllerTest do
+ use Pleroma.Web.ConnCase, async: true
+ use Oban.Testing, repo: Pleroma.Repo
+
+ import Pleroma.Factory
+
+ alias Pleroma.Config
+ alias Pleroma.Web
+
+ setup do
+ admin = insert(:user, is_admin: true)
+ token = insert(:oauth_admin_token, user: admin)
+
+ conn =
+ build_conn()
+ |> assign(:user, admin)
+ |> assign(:token, token)
+
+ {:ok, %{admin: admin, token: token, conn: conn}}
+ end
+
+ describe "POST /api/pleroma/admin/oauth_app" do
+ test "errors", %{conn: conn} do
+ response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/oauth_app", %{})
+ |> json_response_and_validate_schema(400)
+
+ assert %{
+ "error" => "Missing field: name. Missing field: redirect_uris."
+ } = response
+ end
+
+ test "success", %{conn: conn} do
+ base_url = Web.base_url()
+ app_name = "Trusted app"
+
+ response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/oauth_app", %{
+ name: app_name,
+ redirect_uris: base_url
+ })
+ |> json_response_and_validate_schema(200)
+
+ assert %{
+ "client_id" => _,
+ "client_secret" => _,
+ "name" => ^app_name,
+ "redirect_uri" => ^base_url,
+ "trusted" => false
+ } = response
+ end
+
+ test "with trusted", %{conn: conn} do
+ base_url = Web.base_url()
+ app_name = "Trusted app"
+
+ response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/oauth_app", %{
+ name: app_name,
+ redirect_uris: base_url,
+ trusted: true
+ })
+ |> json_response_and_validate_schema(200)
+
+ assert %{
+ "client_id" => _,
+ "client_secret" => _,
+ "name" => ^app_name,
+ "redirect_uri" => ^base_url,
+ "trusted" => true
+ } = response
+ end
+ end
+
+ describe "GET /api/pleroma/admin/oauth_app" do
+ setup do
+ app = insert(:oauth_app)
+ {:ok, app: app}
+ end
+
+ test "list", %{conn: conn} do
+ response =
+ conn
+ |> get("/api/pleroma/admin/oauth_app")
+ |> json_response_and_validate_schema(200)
+
+ assert %{"apps" => apps, "count" => count, "page_size" => _} = response
+
+ assert length(apps) == count
+ end
+
+ test "with page size", %{conn: conn} do
+ insert(:oauth_app)
+ page_size = 1
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/oauth_app?page_size=#{page_size}")
+ |> json_response_and_validate_schema(200)
+
+ assert %{"apps" => apps, "count" => _, "page_size" => ^page_size} = response
+
+ assert length(apps) == page_size
+ end
+
+ test "search by client name", %{conn: conn, app: app} do
+ response =
+ conn
+ |> get("/api/pleroma/admin/oauth_app?name=#{app.client_name}")
+ |> json_response_and_validate_schema(200)
+
+ assert %{"apps" => [returned], "count" => _, "page_size" => _} = response
+
+ assert returned["client_id"] == app.client_id
+ assert returned["name"] == app.client_name
+ end
+
+ test "search by client id", %{conn: conn, app: app} do
+ response =
+ conn
+ |> get("/api/pleroma/admin/oauth_app?client_id=#{app.client_id}")
+ |> json_response_and_validate_schema(200)
+
+ assert %{"apps" => [returned], "count" => _, "page_size" => _} = response
+
+ assert returned["client_id"] == app.client_id
+ assert returned["name"] == app.client_name
+ end
+
+ test "only trusted", %{conn: conn} do
+ app = insert(:oauth_app, trusted: true)
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/oauth_app?trusted=true")
+ |> json_response_and_validate_schema(200)
+
+ assert %{"apps" => [returned], "count" => _, "page_size" => _} = response
+
+ assert returned["client_id"] == app.client_id
+ assert returned["name"] == app.client_name
+ end
+ end
+
+ describe "DELETE /api/pleroma/admin/oauth_app/:id" do
+ test "with id", %{conn: conn} do
+ app = insert(:oauth_app)
+
+ response =
+ conn
+ |> delete("/api/pleroma/admin/oauth_app/" <> to_string(app.id))
+ |> json_response_and_validate_schema(:no_content)
+
+ assert response == ""
+ end
+
+ test "with non existance id", %{conn: conn} do
+ response =
+ conn
+ |> delete("/api/pleroma/admin/oauth_app/0")
+ |> json_response_and_validate_schema(:bad_request)
+
+ assert response == ""
+ end
+ end
+
+ describe "PATCH /api/pleroma/admin/oauth_app/:id" do
+ test "with id", %{conn: conn} do
+ app = insert(:oauth_app)
+
+ name = "another name"
+ url = "https://example.com"
+ scopes = ["admin"]
+ id = app.id
+ website = "http://website.com"
+
+ response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/oauth_app/#{id}", %{
+ name: name,
+ trusted: true,
+ redirect_uris: url,
+ scopes: scopes,
+ website: website
+ })
+ |> json_response_and_validate_schema(200)
+
+ assert %{
+ "client_id" => _,
+ "client_secret" => _,
+ "id" => ^id,
+ "name" => ^name,
+ "redirect_uri" => ^url,
+ "trusted" => true,
+ "website" => ^website
+ } = response
+ end
+
+ test "without id", %{conn: conn} do
+ response =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/oauth_app/0")
+ |> json_response_and_validate_schema(:bad_request)
+
+ assert response == ""
+ end
+ end
+end
diff --git a/test/web/admin_api/controllers/relay_controller_test.exs b/test/web/admin_api/controllers/relay_controller_test.exs
new file mode 100644
index 000000000..64086adc5
--- /dev/null
+++ b/test/web/admin_api/controllers/relay_controller_test.exs
@@ -0,0 +1,92 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.AdminAPI.RelayControllerTest do
+ use Pleroma.Web.ConnCase
+
+ import Pleroma.Factory
+
+ alias Pleroma.Config
+ alias Pleroma.ModerationLog
+ alias Pleroma.Repo
+ alias Pleroma.User
+
+ setup_all do
+ Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
+
+ :ok
+ end
+
+ setup do
+ admin = insert(:user, is_admin: true)
+ token = insert(:oauth_admin_token, user: admin)
+
+ conn =
+ build_conn()
+ |> assign(:user, admin)
+ |> assign(:token, token)
+
+ {:ok, %{admin: admin, token: token, conn: conn}}
+ end
+
+ describe "relays" do
+ test "POST /relay", %{conn: conn, admin: admin} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/relay", %{
+ relay_url: "http://mastodon.example.org/users/admin"
+ })
+
+ assert json_response_and_validate_schema(conn, 200) ==
+ "http://mastodon.example.org/users/admin"
+
+ log_entry = Repo.one(ModerationLog)
+
+ assert ModerationLog.get_log_entry_message(log_entry) ==
+ "@#{admin.nickname} followed relay: http://mastodon.example.org/users/admin"
+ end
+
+ test "GET /relay", %{conn: conn} do
+ relay_user = Pleroma.Web.ActivityPub.Relay.get_actor()
+
+ ["http://mastodon.example.org/users/admin", "https://mstdn.io/users/mayuutann"]
+ |> Enum.each(fn ap_id ->
+ {:ok, user} = User.get_or_fetch_by_ap_id(ap_id)
+ User.follow(relay_user, user)
+ end)
+
+ conn = get(conn, "/api/pleroma/admin/relay")
+
+ assert json_response_and_validate_schema(conn, 200)["relays"] --
+ ["mastodon.example.org", "mstdn.io"] == []
+ end
+
+ test "DELETE /relay", %{conn: conn, admin: admin} do
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/relay", %{
+ relay_url: "http://mastodon.example.org/users/admin"
+ })
+
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> delete("/api/pleroma/admin/relay", %{
+ relay_url: "http://mastodon.example.org/users/admin"
+ })
+
+ assert json_response_and_validate_schema(conn, 200) ==
+ "http://mastodon.example.org/users/admin"
+
+ [log_entry_one, log_entry_two] = Repo.all(ModerationLog)
+
+ assert ModerationLog.get_log_entry_message(log_entry_one) ==
+ "@#{admin.nickname} followed relay: http://mastodon.example.org/users/admin"
+
+ assert ModerationLog.get_log_entry_message(log_entry_two) ==
+ "@#{admin.nickname} unfollowed relay: http://mastodon.example.org/users/admin"
+ end
+ end
+end
diff --git a/test/web/admin_api/controllers/report_controller_test.exs b/test/web/admin_api/controllers/report_controller_test.exs
new file mode 100644
index 000000000..940bce340
--- /dev/null
+++ b/test/web/admin_api/controllers/report_controller_test.exs
@@ -0,0 +1,374 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.AdminAPI.ReportControllerTest do
+ use Pleroma.Web.ConnCase
+
+ import Pleroma.Factory
+
+ alias Pleroma.Activity
+ alias Pleroma.Config
+ alias Pleroma.ModerationLog
+ alias Pleroma.Repo
+ alias Pleroma.ReportNote
+ alias Pleroma.Web.CommonAPI
+
+ setup do
+ admin = insert(:user, is_admin: true)
+ token = insert(:oauth_admin_token, user: admin)
+
+ conn =
+ build_conn()
+ |> assign(:user, admin)
+ |> assign(:token, token)
+
+ {:ok, %{admin: admin, token: token, conn: conn}}
+ end
+
+ describe "GET /api/pleroma/admin/reports/:id" do
+ test "returns report by its id", %{conn: conn} do
+ [reporter, target_user] = insert_pair(:user)
+ activity = insert(:note_activity, user: target_user)
+
+ {:ok, %{id: report_id}} =
+ CommonAPI.report(reporter, %{
+ account_id: target_user.id,
+ comment: "I feel offended",
+ status_ids: [activity.id]
+ })
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/reports/#{report_id}")
+ |> json_response_and_validate_schema(:ok)
+
+ assert response["id"] == report_id
+ end
+
+ test "returns 404 when report id is invalid", %{conn: conn} do
+ conn = get(conn, "/api/pleroma/admin/reports/test")
+
+ assert json_response_and_validate_schema(conn, :not_found) == %{"error" => "Not found"}
+ end
+ end
+
+ describe "PATCH /api/pleroma/admin/reports" do
+ setup do
+ [reporter, target_user] = insert_pair(:user)
+ activity = insert(:note_activity, user: target_user)
+
+ {:ok, %{id: report_id}} =
+ CommonAPI.report(reporter, %{
+ account_id: target_user.id,
+ comment: "I feel offended",
+ status_ids: [activity.id]
+ })
+
+ {:ok, %{id: second_report_id}} =
+ CommonAPI.report(reporter, %{
+ account_id: target_user.id,
+ comment: "I feel very offended",
+ status_ids: [activity.id]
+ })
+
+ %{
+ id: report_id,
+ second_report_id: second_report_id
+ }
+ end
+
+ test "requires admin:write:reports scope", %{conn: conn, id: id, admin: admin} do
+ read_token = insert(:oauth_token, user: admin, scopes: ["admin:read"])
+ write_token = insert(:oauth_token, user: admin, scopes: ["admin:write:reports"])
+
+ response =
+ conn
+ |> assign(:token, read_token)
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/reports", %{
+ "reports" => [%{"state" => "resolved", "id" => id}]
+ })
+ |> json_response_and_validate_schema(403)
+
+ assert response == %{
+ "error" => "Insufficient permissions: admin:write:reports."
+ }
+
+ conn
+ |> assign(:token, write_token)
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/reports", %{
+ "reports" => [%{"state" => "resolved", "id" => id}]
+ })
+ |> json_response_and_validate_schema(:no_content)
+ end
+
+ test "mark report as resolved", %{conn: conn, id: id, admin: admin} do
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/reports", %{
+ "reports" => [
+ %{"state" => "resolved", "id" => id}
+ ]
+ })
+ |> json_response_and_validate_schema(:no_content)
+
+ activity = Activity.get_by_id(id)
+ assert activity.data["state"] == "resolved"
+
+ log_entry = Repo.one(ModerationLog)
+
+ assert ModerationLog.get_log_entry_message(log_entry) ==
+ "@#{admin.nickname} updated report ##{id} with 'resolved' state"
+ end
+
+ test "closes report", %{conn: conn, id: id, admin: admin} do
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/reports", %{
+ "reports" => [
+ %{"state" => "closed", "id" => id}
+ ]
+ })
+ |> json_response_and_validate_schema(:no_content)
+
+ activity = Activity.get_by_id(id)
+ assert activity.data["state"] == "closed"
+
+ log_entry = Repo.one(ModerationLog)
+
+ assert ModerationLog.get_log_entry_message(log_entry) ==
+ "@#{admin.nickname} updated report ##{id} with 'closed' state"
+ end
+
+ test "returns 400 when state is unknown", %{conn: conn, id: id} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/reports", %{
+ "reports" => [
+ %{"state" => "test", "id" => id}
+ ]
+ })
+
+ assert "Unsupported state" =
+ hd(json_response_and_validate_schema(conn, :bad_request))["error"]
+ end
+
+ test "returns 404 when report is not exist", %{conn: conn} do
+ conn =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/reports", %{
+ "reports" => [
+ %{"state" => "closed", "id" => "test"}
+ ]
+ })
+
+ assert hd(json_response_and_validate_schema(conn, :bad_request))["error"] == "not_found"
+ end
+
+ test "updates state of multiple reports", %{
+ conn: conn,
+ id: id,
+ admin: admin,
+ second_report_id: second_report_id
+ } do
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> patch("/api/pleroma/admin/reports", %{
+ "reports" => [
+ %{"state" => "resolved", "id" => id},
+ %{"state" => "closed", "id" => second_report_id}
+ ]
+ })
+ |> json_response_and_validate_schema(:no_content)
+
+ activity = Activity.get_by_id(id)
+ second_activity = Activity.get_by_id(second_report_id)
+ assert activity.data["state"] == "resolved"
+ assert second_activity.data["state"] == "closed"
+
+ [first_log_entry, second_log_entry] = Repo.all(ModerationLog)
+
+ assert ModerationLog.get_log_entry_message(first_log_entry) ==
+ "@#{admin.nickname} updated report ##{id} with 'resolved' state"
+
+ assert ModerationLog.get_log_entry_message(second_log_entry) ==
+ "@#{admin.nickname} updated report ##{second_report_id} with 'closed' state"
+ end
+ end
+
+ describe "GET /api/pleroma/admin/reports" do
+ test "returns empty response when no reports created", %{conn: conn} do
+ response =
+ conn
+ |> get("/api/pleroma/admin/reports")
+ |> json_response_and_validate_schema(:ok)
+
+ assert Enum.empty?(response["reports"])
+ assert response["total"] == 0
+ end
+
+ test "returns reports", %{conn: conn} do
+ [reporter, target_user] = insert_pair(:user)
+ activity = insert(:note_activity, user: target_user)
+
+ {:ok, %{id: report_id}} =
+ CommonAPI.report(reporter, %{
+ account_id: target_user.id,
+ comment: "I feel offended",
+ status_ids: [activity.id]
+ })
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/reports")
+ |> json_response_and_validate_schema(:ok)
+
+ [report] = response["reports"]
+
+ assert length(response["reports"]) == 1
+ assert report["id"] == report_id
+
+ assert response["total"] == 1
+ end
+
+ test "returns reports with specified state", %{conn: conn} do
+ [reporter, target_user] = insert_pair(:user)
+ activity = insert(:note_activity, user: target_user)
+
+ {:ok, %{id: first_report_id}} =
+ CommonAPI.report(reporter, %{
+ account_id: target_user.id,
+ comment: "I feel offended",
+ status_ids: [activity.id]
+ })
+
+ {:ok, %{id: second_report_id}} =
+ CommonAPI.report(reporter, %{
+ account_id: target_user.id,
+ comment: "I don't like this user"
+ })
+
+ CommonAPI.update_report_state(second_report_id, "closed")
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/reports?state=open")
+ |> json_response_and_validate_schema(:ok)
+
+ assert [open_report] = response["reports"]
+
+ assert length(response["reports"]) == 1
+ assert open_report["id"] == first_report_id
+
+ assert response["total"] == 1
+
+ response =
+ conn
+ |> get("/api/pleroma/admin/reports?state=closed")
+ |> json_response_and_validate_schema(:ok)
+
+ assert [closed_report] = response["reports"]
+
+ assert length(response["reports"]) == 1
+ assert closed_report["id"] == second_report_id
+
+ assert response["total"] == 1
+
+ assert %{"total" => 0, "reports" => []} ==
+ conn
+ |> get("/api/pleroma/admin/reports?state=resolved", %{
+ "" => ""
+ })
+ |> json_response_and_validate_schema(:ok)
+ end
+
+ test "returns 403 when requested by a non-admin" do
+ user = insert(:user)
+ token = insert(:oauth_token, user: user)
+
+ conn =
+ build_conn()
+ |> assign(:user, user)
+ |> assign(:token, token)
+ |> get("/api/pleroma/admin/reports")
+
+ assert json_response(conn, :forbidden) ==
+ %{"error" => "User is not an admin or OAuth admin scope is not granted."}
+ end
+
+ test "returns 403 when requested by anonymous" do
+ conn = get(build_conn(), "/api/pleroma/admin/reports")
+
+ assert json_response(conn, :forbidden) == %{
+ "error" => "Invalid credentials."
+ }
+ end
+ end
+
+ describe "POST /api/pleroma/admin/reports/:id/notes" do
+ setup %{conn: conn, admin: admin} do
+ [reporter, target_user] = insert_pair(:user)
+ activity = insert(:note_activity, user: target_user)
+
+ {:ok, %{id: report_id}} =
+ CommonAPI.report(reporter, %{
+ account_id: target_user.id,
+ comment: "I feel offended",
+ status_ids: [activity.id]
+ })
+
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/reports/#{report_id}/notes", %{
+ content: "this is disgusting!"
+ })
+
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/pleroma/admin/reports/#{report_id}/notes", %{
+ content: "this is disgusting2!"
+ })
+
+ %{
+ admin_id: admin.id,
+ report_id: report_id
+ }
+ end
+
+ test "it creates report note", %{admin_id: admin_id, report_id: report_id} do
+ assert [note, _] = Repo.all(ReportNote)
+
+ assert %{
+ activity_id: ^report_id,
+ content: "this is disgusting!",
+ user_id: ^admin_id
+ } = note
+ end
+
+ test "it returns reports with notes", %{conn: conn, admin: admin} do
+ conn = get(conn, "/api/pleroma/admin/reports")
+
+ response = json_response_and_validate_schema(conn, 200)
+ notes = hd(response["reports"])["notes"]
+ [note, _] = notes
+
+ assert note["user"]["nickname"] == admin.nickname
+ assert note["content"] == "this is disgusting!"
+ assert note["created_at"]
+ assert response["total"] == 1
+ end
+
+ test "it deletes the note", %{conn: conn, report_id: report_id} do
+ assert ReportNote |> Repo.all() |> length() == 2
+ assert [note, _] = Repo.all(ReportNote)
+
+ delete(conn, "/api/pleroma/admin/reports/#{report_id}/notes/#{note.id}")
+
+ assert ReportNote |> Repo.all() |> length() == 1
+ end
+ end
+end
diff --git a/test/web/admin_api/controllers/status_controller_test.exs b/test/web/admin_api/controllers/status_controller_test.exs
index 124d8dc2e..eff78fb0a 100644
--- a/test/web/admin_api/controllers/status_controller_test.exs
+++ b/test/web/admin_api/controllers/status_controller_test.exs
@@ -42,6 +42,14 @@ test "shows activity", %{conn: conn} do
|> json_response_and_validate_schema(200)
assert response["id"] == activity.id
+
+ account = response["account"]
+ actor = User.get_by_ap_id(activity.actor)
+
+ assert account["id"] == actor.id
+ assert account["nickname"] == actor.nickname
+ assert account["deactivated"] == actor.deactivated
+ assert account["confirmation_pending"] == actor.confirmation_pending
end
end
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 2291f76dd..fc3bb845d 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -5,7 +5,9 @@
defmodule Pleroma.Web.CommonAPITest do
use Pleroma.DataCase
alias Pleroma.Activity
+ alias Pleroma.Chat
alias Pleroma.Conversation.Participation
+ alias Pleroma.Notification
alias Pleroma.Object
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
@@ -23,6 +25,196 @@ defmodule Pleroma.Web.CommonAPITest do
setup do: clear_config([:instance, :limit])
setup do: clear_config([:instance, :max_pinned_statuses])
+ describe "blocking" do
+ setup do
+ blocker = insert(:user)
+ blocked = insert(:user)
+ User.follow(blocker, blocked)
+ User.follow(blocked, blocker)
+ %{blocker: blocker, blocked: blocked}
+ end
+
+ test "it blocks and federates", %{blocker: blocker, blocked: blocked} do
+ clear_config([:instance, :federating], true)
+
+ with_mock Pleroma.Web.Federator,
+ publish: fn _ -> nil end do
+ assert {:ok, block} = CommonAPI.block(blocker, blocked)
+
+ assert block.local
+ assert User.blocks?(blocker, blocked)
+ refute User.following?(blocker, blocked)
+ refute User.following?(blocked, blocker)
+
+ assert called(Pleroma.Web.Federator.publish(block))
+ end
+ end
+
+ test "it blocks and does not federate if outgoing blocks are disabled", %{
+ blocker: blocker,
+ blocked: blocked
+ } do
+ clear_config([:instance, :federating], true)
+ clear_config([:activitypub, :outgoing_blocks], false)
+
+ with_mock Pleroma.Web.Federator,
+ publish: fn _ -> nil end do
+ assert {:ok, block} = CommonAPI.block(blocker, blocked)
+
+ assert block.local
+ assert User.blocks?(blocker, blocked)
+ refute User.following?(blocker, blocked)
+ refute User.following?(blocked, blocker)
+
+ refute called(Pleroma.Web.Federator.publish(block))
+ end
+ end
+ end
+
+ describe "posting chat messages" do
+ setup do: clear_config([:instance, :chat_limit])
+
+ test "it posts a chat message without content but with an attachment" do
+ author = insert(:user)
+ recipient = insert(:user)
+
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image.jpg"),
+ filename: "an_image.jpg"
+ }
+
+ {:ok, upload} = ActivityPub.upload(file, actor: author.ap_id)
+
+ with_mocks([
+ {
+ Pleroma.Web.Streamer,
+ [],
+ [
+ stream: fn _, _ ->
+ nil
+ end
+ ]
+ },
+ {
+ Pleroma.Web.Push,
+ [],
+ [
+ send: fn _ -> nil end
+ ]
+ }
+ ]) do
+ {:ok, activity} =
+ CommonAPI.post_chat_message(
+ author,
+ recipient,
+ nil,
+ media_id: upload.id
+ )
+
+ notification =
+ Notification.for_user_and_activity(recipient, activity)
+ |> Repo.preload(:activity)
+
+ assert called(Pleroma.Web.Push.send(notification))
+ assert called(Pleroma.Web.Streamer.stream(["user", "user:notification"], notification))
+ assert called(Pleroma.Web.Streamer.stream(["user", "user:pleroma_chat"], :_))
+
+ assert activity
+ end
+ end
+
+ test "it adds html newlines" do
+ author = insert(:user)
+ recipient = insert(:user)
+
+ other_user = insert(:user)
+
+ {:ok, activity} =
+ CommonAPI.post_chat_message(
+ author,
+ recipient,
+ "uguu\nuguuu"
+ )
+
+ assert other_user.ap_id not in activity.recipients
+
+ object = Object.normalize(activity, false)
+
+ assert object.data["content"] == "uguu
uguuu"
+ end
+
+ test "it linkifies" do
+ author = insert(:user)
+ recipient = insert(:user)
+
+ other_user = insert(:user)
+
+ {:ok, activity} =
+ CommonAPI.post_chat_message(
+ author,
+ recipient,
+ "https://example.org is the site of @#{other_user.nickname} #2hu"
+ )
+
+ assert other_user.ap_id not in activity.recipients
+
+ object = Object.normalize(activity, false)
+
+ assert object.data["content"] ==
+ "https://example.org is the site of @#{other_user.nickname} #2hu"
+ end
+
+ test "it posts a chat message" do
+ author = insert(:user)
+ recipient = insert(:user)
+
+ {:ok, activity} =
+ CommonAPI.post_chat_message(
+ author,
+ recipient,
+ "a test message :firefox:"
+ )
+
+ assert activity.data["type"] == "Create"
+ assert activity.local
+ object = Object.normalize(activity)
+
+ assert object.data["type"] == "ChatMessage"
+ assert object.data["to"] == [recipient.ap_id]
+
+ assert object.data["content"] ==
+ "a test message <script>alert('uuu')</script> :firefox:"
+
+ assert object.data["emoji"] == %{
+ "firefox" => "http://localhost:4001/emoji/Firefox.gif"
+ }
+
+ assert Chat.get(author.id, recipient.ap_id)
+ assert Chat.get(recipient.id, author.ap_id)
+
+ assert :ok == Pleroma.Web.Federator.perform(:publish, activity)
+ end
+
+ test "it reject messages over the local limit" do
+ Pleroma.Config.put([:instance, :chat_limit], 2)
+
+ author = insert(:user)
+ recipient = insert(:user)
+
+ {:error, message} =
+ CommonAPI.post_chat_message(
+ author,
+ recipient,
+ "123"
+ )
+
+ assert message == :content_too_long
+ end
+ end
+
describe "unblocking" do
test "it works even without an existing block activity" do
blocked = insert(:user)
diff --git a/test/web/fallback_test.exs b/test/web/fallback_test.exs
index 3919ef93a..a65865860 100644
--- a/test/web/fallback_test.exs
+++ b/test/web/fallback_test.exs
@@ -6,22 +6,56 @@ defmodule Pleroma.Web.FallbackTest do
use Pleroma.Web.ConnCase
import Pleroma.Factory
- test "GET /registration/:token", %{conn: conn} do
- assert conn
- |> get("/registration/foo")
- |> html_response(200) =~ ""
+ describe "neither preloaded data nor metadata attached to" do
+ test "GET /registration/:token", %{conn: conn} do
+ response = get(conn, "/registration/foo")
+
+ assert html_response(response, 200) =~ ""
+ end
+
+ test "GET /*path", %{conn: conn} do
+ assert conn
+ |> get("/foo")
+ |> html_response(200) =~ ""
+ end
end
- test "GET /:maybe_nickname_or_id", %{conn: conn} do
- user = insert(:user)
+ describe "preloaded data and metadata attached to" do
+ test "GET /:maybe_nickname_or_id", %{conn: conn} do
+ user = insert(:user)
+ user_missing = get(conn, "/foo")
+ user_present = get(conn, "/#{user.nickname}")
- assert conn
- |> get("/foo")
- |> html_response(200) =~ ""
+ assert(html_response(user_missing, 200) =~ "")
+ refute html_response(user_present, 200) =~ ""
+ assert html_response(user_present, 200) =~ "initial-results"
+ end
- refute conn
- |> get("/" <> user.nickname)
- |> html_response(200) =~ ""
+ test "GET /*path", %{conn: conn} do
+ assert conn
+ |> get("/foo")
+ |> html_response(200) =~ ""
+
+ refute conn
+ |> get("/foo/bar")
+ |> html_response(200) =~ ""
+ end
+ end
+
+ describe "preloaded data is attached to" do
+ test "GET /main/public", %{conn: conn} do
+ public_page = get(conn, "/main/public")
+
+ refute html_response(public_page, 200) =~ ""
+ assert html_response(public_page, 200) =~ "initial-results"
+ end
+
+ test "GET /main/all", %{conn: conn} do
+ public_page = get(conn, "/main/all")
+
+ refute html_response(public_page, 200) =~ ""
+ assert html_response(public_page, 200) =~ "initial-results"
+ end
end
test "GET /api*path", %{conn: conn} do
@@ -34,16 +68,6 @@ test "GET /pleroma/admin -> /pleroma/admin/", %{conn: conn} do
assert redirected_to(get(conn, "/pleroma/admin")) =~ "/pleroma/admin/"
end
- test "GET /*path", %{conn: conn} do
- assert conn
- |> get("/foo")
- |> html_response(200) =~ ""
-
- assert conn
- |> get("/foo/bar")
- |> html_response(200) =~ ""
- end
-
test "OPTIONS /*path", %{conn: conn} do
assert conn
|> options("/foo")
diff --git a/test/web/federator_test.exs b/test/web/federator_test.exs
index de90aa6e0..592fdccd1 100644
--- a/test/web/federator_test.exs
+++ b/test/web/federator_test.exs
@@ -23,7 +23,7 @@ defmodule Pleroma.Web.FederatorTest do
setup_all do: clear_config([:instance, :federating], true)
setup do: clear_config([:instance, :allow_relay])
- setup do: clear_config([:instance, :rewrite_policy])
+ setup do: clear_config([:mrf, :policies])
setup do: clear_config([:mrf_keyword])
describe "Publish an activity" do
@@ -158,7 +158,7 @@ test "it does not crash if MRF rejects the post" do
Pleroma.Config.put([:mrf_keyword, :reject], ["lain"])
Pleroma.Config.put(
- [:instance, :rewrite_policy],
+ [:mrf, :policies],
Pleroma.Web.ActivityPub.MRF.KeywordPolicy
)
diff --git a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs
index 696228203..31f0edf97 100644
--- a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs
+++ b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs
@@ -8,6 +8,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
use Pleroma.Web.ConnCase
+ import Mock
import Pleroma.Factory
setup do: clear_config([:instance, :max_account_fields])
@@ -52,33 +53,39 @@ test "sets user settings in a generic way", %{conn: conn} do
user = Repo.get(User, user_data["id"])
- res_conn =
- conn
- |> assign(:user, user)
- |> patch("/api/v1/accounts/update_credentials", %{
- "pleroma_settings_store" => %{
- masto_fe: %{
- theme: "blub"
+ clear_config([:instance, :federating], true)
+
+ with_mock Pleroma.Web.Federator,
+ publish: fn _activity -> :ok end do
+ res_conn =
+ conn
+ |> assign(:user, user)
+ |> patch("/api/v1/accounts/update_credentials", %{
+ "pleroma_settings_store" => %{
+ masto_fe: %{
+ theme: "blub"
+ }
}
- }
- })
+ })
- assert user_data = json_response_and_validate_schema(res_conn, 200)
+ assert user_data = json_response_and_validate_schema(res_conn, 200)
- assert user_data["pleroma"]["settings_store"] ==
- %{
- "pleroma_fe" => %{"theme" => "bla"},
- "masto_fe" => %{"theme" => "blub"}
- }
+ assert user_data["pleroma"]["settings_store"] ==
+ %{
+ "pleroma_fe" => %{"theme" => "bla"},
+ "masto_fe" => %{"theme" => "blub"}
+ }
+
+ assert_called(Pleroma.Web.Federator.publish(:_))
+ end
end
test "updates the user's bio", %{conn: conn} do
user2 = insert(:user)
- conn =
- patch(conn, "/api/v1/accounts/update_credentials", %{
- "note" => "I drink #cofe with @#{user2.nickname}\n\nsuya.."
- })
+ raw_bio = "I drink #cofe with @#{user2.nickname}\n\nsuya.."
+
+ conn = patch(conn, "/api/v1/accounts/update_credentials", %{"note" => raw_bio})
assert user_data = json_response_and_validate_schema(conn, 200)
@@ -86,6 +93,12 @@ test "updates the user's bio", %{conn: conn} do
~s(I drink #cofe with @#{user2.nickname}
suya..)
+
+ assert user_data["source"]["note"] == raw_bio
+
+ user = Repo.get(User, user_data["id"])
+
+ assert user.raw_bio == raw_bio
end
test "updates the user's locking status", %{conn: conn} do
@@ -203,10 +216,20 @@ test "updates the user's avatar", %{user: user, conn: conn} do
filename: "an_image.jpg"
}
- conn = patch(conn, "/api/v1/accounts/update_credentials", %{"avatar" => new_avatar})
+ res =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{"avatar" => new_avatar})
- assert user_response = json_response_and_validate_schema(conn, 200)
+ assert user_response = json_response_and_validate_schema(res, 200)
assert user_response["avatar"] != User.avatar_url(user)
+
+ # Also removes it
+ res =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{"avatar" => nil})
+
+ assert user_response = json_response_and_validate_schema(res, 200)
+ assert user_response["avatar"] == User.avatar_url(user)
end
test "updates the user's banner", %{user: user, conn: conn} do
@@ -216,10 +239,21 @@ test "updates the user's banner", %{user: user, conn: conn} do
filename: "an_image.jpg"
}
- conn = patch(conn, "/api/v1/accounts/update_credentials", %{"header" => new_header})
+ res =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{"header" => new_header})
- assert user_response = json_response_and_validate_schema(conn, 200)
+ assert user_response = json_response_and_validate_schema(res, 200)
assert user_response["header"] != User.banner_url(user)
+
+ # Also removes it
+
+ res =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{"header" => nil})
+
+ assert user_response = json_response_and_validate_schema(res, 200)
+ assert user_response["header"] == User.banner_url(user)
end
test "updates the user's background", %{conn: conn} do
@@ -229,13 +263,25 @@ test "updates the user's background", %{conn: conn} do
filename: "an_image.jpg"
}
- conn =
- patch(conn, "/api/v1/accounts/update_credentials", %{
+ res =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{
"pleroma_background_image" => new_header
})
- assert user_response = json_response_and_validate_schema(conn, 200)
+ assert user_response = json_response_and_validate_schema(res, 200)
assert user_response["pleroma"]["background_image"]
+
+ # Also removes it
+
+ res =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{
+ "pleroma_background_image" => nil
+ })
+
+ assert user_response = json_response_and_validate_schema(res, 200)
+ refute user_response["pleroma"]["background_image"]
end
test "requires 'write:accounts' permission" do
@@ -387,4 +433,71 @@ test "update fields when invalid request", %{conn: conn} do
|> json_response_and_validate_schema(403)
end
end
+
+ describe "Mark account as bot" do
+ setup do: oauth_access(["write:accounts"])
+ setup :request_content_type
+
+ test "changing actor_type to Service makes account a bot", %{conn: conn} do
+ account =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{actor_type: "Service"})
+ |> json_response_and_validate_schema(200)
+
+ assert account["bot"]
+ assert account["source"]["pleroma"]["actor_type"] == "Service"
+ end
+
+ test "changing actor_type to Person makes account a human", %{conn: conn} do
+ account =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{actor_type: "Person"})
+ |> json_response_and_validate_schema(200)
+
+ refute account["bot"]
+ assert account["source"]["pleroma"]["actor_type"] == "Person"
+ end
+
+ test "changing actor_type to Application causes error", %{conn: conn} do
+ response =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{actor_type: "Application"})
+ |> json_response_and_validate_schema(403)
+
+ assert %{"error" => "Invalid request"} == response
+ end
+
+ test "changing bot field to true changes actor_type to Service", %{conn: conn} do
+ account =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{bot: "true"})
+ |> json_response_and_validate_schema(200)
+
+ assert account["bot"]
+ assert account["source"]["pleroma"]["actor_type"] == "Service"
+ end
+
+ test "changing bot field to false changes actor_type to Person", %{conn: conn} do
+ account =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{bot: "false"})
+ |> json_response_and_validate_schema(200)
+
+ refute account["bot"]
+ assert account["source"]["pleroma"]["actor_type"] == "Person"
+ end
+
+ test "actor_type field has a higher priority than bot", %{conn: conn} do
+ account =
+ conn
+ |> patch("/api/v1/accounts/update_credentials", %{
+ actor_type: "Person",
+ bot: "true"
+ })
+ |> json_response_and_validate_schema(200)
+
+ refute account["bot"]
+ assert account["source"]["pleroma"]["actor_type"] == "Person"
+ end
+ end
end
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs
index 1ce97378d..260ad2306 100644
--- a/test/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/web/mastodon_api/controllers/account_controller_test.exs
@@ -127,6 +127,15 @@ test "returns 404 for internal.fetch actor", %{conn: conn} do
|> get("/api/v1/accounts/internal.fetch")
|> json_response_and_validate_schema(404)
end
+
+ test "returns 404 for deactivated user", %{conn: conn} do
+ user = insert(:user, deactivated: true)
+
+ assert %{"error" => "Can't find user"} =
+ conn
+ |> get("/api/v1/accounts/#{user.id}")
+ |> json_response_and_validate_schema(:not_found)
+ end
end
defp local_and_remote_users do
@@ -143,15 +152,15 @@ defp local_and_remote_users do
setup do: clear_config([:restrict_unauthenticated, :profiles, :remote], true)
test "if user is unauthenticated", %{conn: conn, local: local, remote: remote} do
- assert %{"error" => "Can't find user"} ==
+ assert %{"error" => "This API requires an authenticated user"} ==
conn
|> get("/api/v1/accounts/#{local.id}")
- |> json_response_and_validate_schema(:not_found)
+ |> json_response_and_validate_schema(:unauthorized)
- assert %{"error" => "Can't find user"} ==
+ assert %{"error" => "This API requires an authenticated user"} ==
conn
|> get("/api/v1/accounts/#{remote.id}")
- |> json_response_and_validate_schema(:not_found)
+ |> json_response_and_validate_schema(:unauthorized)
end
test "if user is authenticated", %{local: local, remote: remote} do
@@ -173,8 +182,8 @@ test "if user is authenticated", %{local: local, remote: remote} do
test "if user is unauthenticated", %{conn: conn, local: local, remote: remote} do
res_conn = get(conn, "/api/v1/accounts/#{local.id}")
- assert json_response_and_validate_schema(res_conn, :not_found) == %{
- "error" => "Can't find user"
+ assert json_response_and_validate_schema(res_conn, :unauthorized) == %{
+ "error" => "This API requires an authenticated user"
}
res_conn = get(conn, "/api/v1/accounts/#{remote.id}")
@@ -203,8 +212,8 @@ test "if user is unauthenticated", %{conn: conn, local: local, remote: remote} d
res_conn = get(conn, "/api/v1/accounts/#{remote.id}")
- assert json_response_and_validate_schema(res_conn, :not_found) == %{
- "error" => "Can't find user"
+ assert json_response_and_validate_schema(res_conn, :unauthorized) == %{
+ "error" => "This API requires an authenticated user"
}
end
@@ -249,6 +258,24 @@ test "works with announces that are just addressed to public", %{conn: conn} do
assert id == announce.id
end
+ test "deactivated user", %{conn: conn} do
+ user = insert(:user, deactivated: true)
+
+ assert %{"error" => "Can't find user"} ==
+ conn
+ |> get("/api/v1/accounts/#{user.id}/statuses")
+ |> json_response_and_validate_schema(:not_found)
+ end
+
+ test "returns 404 when user is invisible", %{conn: conn} do
+ user = insert(:user, %{invisible: true})
+
+ assert %{"error" => "Can't find user"} =
+ conn
+ |> get("/api/v1/accounts/#{user.id}")
+ |> json_response_and_validate_schema(404)
+ end
+
test "respects blocks", %{user: user_one, conn: conn} do
user_two = insert(:user)
user_three = insert(:user)
@@ -350,9 +377,10 @@ test "unimplemented pinned statuses feature", %{conn: conn} do
assert json_response_and_validate_schema(conn, 200) == []
end
- test "gets an users media", %{conn: conn} do
+ test "gets an users media, excludes reblogs", %{conn: conn} do
note = insert(:note_activity)
user = User.get_cached_by_ap_id(note.data["actor"])
+ other_user = insert(:user)
file = %Plug.Upload{
content_type: "image/jpg",
@@ -364,6 +392,13 @@ test "gets an users media", %{conn: conn} do
{:ok, %{id: image_post_id}} = CommonAPI.post(user, %{status: "cofe", media_ids: [media_id]})
+ {:ok, %{id: media_id}} = ActivityPub.upload(file, actor: other_user.ap_id)
+
+ {:ok, %{id: other_image_post_id}} =
+ CommonAPI.post(other_user, %{status: "cofe2", media_ids: [media_id]})
+
+ {:ok, _announce} = CommonAPI.repeat(other_image_post_id, user)
+
conn = get(conn, "/api/v1/accounts/#{user.id}/statuses?only_media=true")
assert [%{"id" => ^image_post_id}] = json_response_and_validate_schema(conn, 200)
@@ -422,15 +457,15 @@ defp local_and_remote_activities(%{local: local, remote: remote}) do
setup do: clear_config([:restrict_unauthenticated, :profiles, :remote], true)
test "if user is unauthenticated", %{conn: conn, local: local, remote: remote} do
- assert %{"error" => "Can't find user"} ==
+ assert %{"error" => "This API requires an authenticated user"} ==
conn
|> get("/api/v1/accounts/#{local.id}/statuses")
- |> json_response_and_validate_schema(:not_found)
+ |> json_response_and_validate_schema(:unauthorized)
- assert %{"error" => "Can't find user"} ==
+ assert %{"error" => "This API requires an authenticated user"} ==
conn
|> get("/api/v1/accounts/#{remote.id}/statuses")
- |> json_response_and_validate_schema(:not_found)
+ |> json_response_and_validate_schema(:unauthorized)
end
test "if user is authenticated", %{local: local, remote: remote} do
@@ -451,10 +486,10 @@ test "if user is authenticated", %{local: local, remote: remote} do
setup do: clear_config([:restrict_unauthenticated, :profiles, :local], true)
test "if user is unauthenticated", %{conn: conn, local: local, remote: remote} do
- assert %{"error" => "Can't find user"} ==
+ assert %{"error" => "This API requires an authenticated user"} ==
conn
|> get("/api/v1/accounts/#{local.id}/statuses")
- |> json_response_and_validate_schema(:not_found)
+ |> json_response_and_validate_schema(:unauthorized)
res_conn = get(conn, "/api/v1/accounts/#{remote.id}/statuses")
assert length(json_response_and_validate_schema(res_conn, 200)) == 1
@@ -481,10 +516,10 @@ test "if user is unauthenticated", %{conn: conn, local: local, remote: remote} d
res_conn = get(conn, "/api/v1/accounts/#{local.id}/statuses")
assert length(json_response_and_validate_schema(res_conn, 200)) == 1
- assert %{"error" => "Can't find user"} ==
+ assert %{"error" => "This API requires an authenticated user"} ==
conn
|> get("/api/v1/accounts/#{remote.id}/statuses")
- |> json_response_and_validate_schema(:not_found)
+ |> json_response_and_validate_schema(:unauthorized)
end
test "if user is authenticated", %{local: local, remote: remote} do
@@ -745,7 +780,6 @@ test "with notifications", %{conn: conn} do
assert %{"id" => _id, "muting" => true, "muting_notifications" => true} =
conn
- |> put_req_header("content-type", "application/json")
|> post("/api/v1/accounts/#{other_user.id}/mute")
|> json_response_and_validate_schema(200)
diff --git a/test/web/mastodon_api/controllers/conversation_controller_test.exs b/test/web/mastodon_api/controllers/conversation_controller_test.exs
index 693ba51e5..3e21e6bf1 100644
--- a/test/web/mastodon_api/controllers/conversation_controller_test.exs
+++ b/test/web/mastodon_api/controllers/conversation_controller_test.exs
@@ -12,84 +12,88 @@ defmodule Pleroma.Web.MastodonAPI.ConversationControllerTest do
setup do: oauth_access(["read:statuses"])
- test "returns a list of conversations", %{user: user_one, conn: conn} do
- user_two = insert(:user)
- user_three = insert(:user)
+ describe "returns a list of conversations" do
+ setup(%{user: user_one, conn: conn}) do
+ user_two = insert(:user)
+ user_three = insert(:user)
- {:ok, user_two} = User.follow(user_two, user_one)
+ {:ok, user_two} = User.follow(user_two, user_one)
- assert User.get_cached_by_id(user_two.id).unread_conversation_count == 0
+ {:ok, %{user: user_one, user_two: user_two, user_three: user_three, conn: conn}}
+ end
- {:ok, direct} =
- CommonAPI.post(user_one, %{
- status: "Hi @#{user_two.nickname}, @#{user_three.nickname}!",
- visibility: "direct"
- })
+ test "returns correct conversations", %{
+ user: user_one,
+ user_two: user_two,
+ user_three: user_three,
+ conn: conn
+ } do
+ assert User.get_cached_by_id(user_two.id).unread_conversation_count == 0
+ {:ok, direct} = create_direct_message(user_one, [user_two, user_three])
- assert User.get_cached_by_id(user_two.id).unread_conversation_count == 1
+ assert User.get_cached_by_id(user_two.id).unread_conversation_count == 1
- {:ok, _follower_only} =
- CommonAPI.post(user_one, %{
- status: "Hi @#{user_two.nickname}!",
- visibility: "private"
- })
+ {:ok, _follower_only} =
+ CommonAPI.post(user_one, %{
+ status: "Hi @#{user_two.nickname}!",
+ visibility: "private"
+ })
- res_conn = get(conn, "/api/v1/conversations")
+ res_conn = get(conn, "/api/v1/conversations")
- assert response = json_response_and_validate_schema(res_conn, 200)
+ assert response = json_response_and_validate_schema(res_conn, 200)
- assert [
- %{
- "id" => res_id,
- "accounts" => res_accounts,
- "last_status" => res_last_status,
- "unread" => unread
- }
- ] = response
+ assert [
+ %{
+ "id" => res_id,
+ "accounts" => res_accounts,
+ "last_status" => res_last_status,
+ "unread" => unread
+ }
+ ] = response
- account_ids = Enum.map(res_accounts, & &1["id"])
- assert length(res_accounts) == 2
- assert user_two.id in account_ids
- assert user_three.id in account_ids
- assert is_binary(res_id)
- assert unread == false
- assert res_last_status["id"] == direct.id
- assert User.get_cached_by_id(user_one.id).unread_conversation_count == 0
+ account_ids = Enum.map(res_accounts, & &1["id"])
+ assert length(res_accounts) == 2
+ assert user_two.id in account_ids
+ assert user_three.id in account_ids
+ assert is_binary(res_id)
+ assert unread == false
+ assert res_last_status["id"] == direct.id
+ assert User.get_cached_by_id(user_one.id).unread_conversation_count == 0
+ end
+
+ test "observes limit params", %{
+ user: user_one,
+ user_two: user_two,
+ user_three: user_three,
+ conn: conn
+ } do
+ {:ok, _} = create_direct_message(user_one, [user_two, user_three])
+ {:ok, _} = create_direct_message(user_two, [user_one, user_three])
+ {:ok, _} = create_direct_message(user_three, [user_two, user_one])
+
+ res_conn = get(conn, "/api/v1/conversations?limit=1")
+
+ assert response = json_response_and_validate_schema(res_conn, 200)
+
+ assert Enum.count(response) == 1
+
+ res_conn = get(conn, "/api/v1/conversations?limit=2")
+
+ assert response = json_response_and_validate_schema(res_conn, 200)
+
+ assert Enum.count(response) == 2
+ end
end
test "filters conversations by recipients", %{user: user_one, conn: conn} do
user_two = insert(:user)
user_three = insert(:user)
-
- {:ok, direct1} =
- CommonAPI.post(user_one, %{
- status: "Hi @#{user_two.nickname}!",
- visibility: "direct"
- })
-
- {:ok, _direct2} =
- CommonAPI.post(user_one, %{
- status: "Hi @#{user_three.nickname}!",
- visibility: "direct"
- })
-
- {:ok, direct3} =
- CommonAPI.post(user_one, %{
- status: "Hi @#{user_two.nickname}, @#{user_three.nickname}!",
- visibility: "direct"
- })
-
- {:ok, _direct4} =
- CommonAPI.post(user_two, %{
- status: "Hi @#{user_three.nickname}!",
- visibility: "direct"
- })
-
- {:ok, direct5} =
- CommonAPI.post(user_two, %{
- status: "Hi @#{user_one.nickname}!",
- visibility: "direct"
- })
+ {:ok, direct1} = create_direct_message(user_one, [user_two])
+ {:ok, _direct2} = create_direct_message(user_one, [user_three])
+ {:ok, direct3} = create_direct_message(user_one, [user_two, user_three])
+ {:ok, _direct4} = create_direct_message(user_two, [user_three])
+ {:ok, direct5} = create_direct_message(user_two, [user_one])
assert [conversation1, conversation2] =
conn
@@ -109,12 +113,7 @@ test "filters conversations by recipients", %{user: user_one, conn: conn} do
test "updates the last_status on reply", %{user: user_one, conn: conn} do
user_two = insert(:user)
-
- {:ok, direct} =
- CommonAPI.post(user_one, %{
- status: "Hi @#{user_two.nickname}",
- visibility: "direct"
- })
+ {:ok, direct} = create_direct_message(user_one, [user_two])
{:ok, direct_reply} =
CommonAPI.post(user_two, %{
@@ -133,12 +132,7 @@ test "updates the last_status on reply", %{user: user_one, conn: conn} do
test "the user marks a conversation as read", %{user: user_one, conn: conn} do
user_two = insert(:user)
-
- {:ok, direct} =
- CommonAPI.post(user_one, %{
- status: "Hi @#{user_two.nickname}",
- visibility: "direct"
- })
+ {:ok, direct} = create_direct_message(user_one, [user_two])
assert User.get_cached_by_id(user_one.id).unread_conversation_count == 0
assert User.get_cached_by_id(user_two.id).unread_conversation_count == 1
@@ -194,15 +188,22 @@ test "the user marks a conversation as read", %{user: user_one, conn: conn} do
test "(vanilla) Mastodon frontend behaviour", %{user: user_one, conn: conn} do
user_two = insert(:user)
-
- {:ok, direct} =
- CommonAPI.post(user_one, %{
- status: "Hi @#{user_two.nickname}!",
- visibility: "direct"
- })
+ {:ok, direct} = create_direct_message(user_one, [user_two])
res_conn = get(conn, "/api/v1/statuses/#{direct.id}/context")
assert %{"ancestors" => [], "descendants" => []} == json_response(res_conn, 200)
end
+
+ defp create_direct_message(sender, recips) do
+ hellos =
+ recips
+ |> Enum.map(fn s -> "@#{s.nickname}" end)
+ |> Enum.join(", ")
+
+ CommonAPI.post(sender, %{
+ status: "Hi #{hellos}!",
+ visibility: "direct"
+ })
+ end
end
diff --git a/test/web/mastodon_api/controllers/notification_controller_test.exs b/test/web/mastodon_api/controllers/notification_controller_test.exs
index e278d61f5..70ef0e8b5 100644
--- a/test/web/mastodon_api/controllers/notification_controller_test.exs
+++ b/test/web/mastodon_api/controllers/notification_controller_test.exs
@@ -54,6 +54,27 @@ test "list of notifications" do
assert response == expected_response
end
+ test "by default, does not contain pleroma:chat_mention" do
+ %{user: user, conn: conn} = oauth_access(["read:notifications"])
+ other_user = insert(:user)
+
+ {:ok, _activity} = CommonAPI.post_chat_message(other_user, user, "hey")
+
+ result =
+ conn
+ |> get("/api/v1/notifications")
+ |> json_response_and_validate_schema(200)
+
+ assert [] == result
+
+ result =
+ conn
+ |> get("/api/v1/notifications?include_types[]=pleroma:chat_mention")
+ |> json_response_and_validate_schema(200)
+
+ assert [_] = result
+ end
+
test "getting a single notification" do
%{user: user, conn: conn} = oauth_access(["read:notifications"])
other_user = insert(:user)
@@ -292,6 +313,33 @@ test "filters notifications for Announce activities" do
assert public_activity.id in activity_ids
refute unlisted_activity.id in activity_ids
end
+
+ test "doesn't return less than the requested amount of records when the user's reply is liked" do
+ user = insert(:user)
+ %{user: other_user, conn: conn} = oauth_access(["read:notifications"])
+
+ {:ok, mention} =
+ CommonAPI.post(user, %{status: "@#{other_user.nickname}", visibility: "public"})
+
+ {:ok, activity} = CommonAPI.post(user, %{status: ".", visibility: "public"})
+
+ {:ok, reply} =
+ CommonAPI.post(other_user, %{
+ status: ".",
+ visibility: "public",
+ in_reply_to_status_id: activity.id
+ })
+
+ {:ok, _favorite} = CommonAPI.favorite(user, reply.id)
+
+ activity_ids =
+ conn
+ |> get("/api/v1/notifications?exclude_visibilities[]=direct&limit=2")
+ |> json_response_and_validate_schema(200)
+ |> Enum.map(& &1["status"]["id"])
+
+ assert [reply.id, mention.id] == activity_ids
+ end
end
test "filters notifications using exclude_types" do
diff --git a/test/web/mastodon_api/controllers/search_controller_test.exs b/test/web/mastodon_api/controllers/search_controller_test.exs
index 7d0cafccc..826f37fbc 100644
--- a/test/web/mastodon_api/controllers/search_controller_test.exs
+++ b/test/web/mastodon_api/controllers/search_controller_test.exs
@@ -71,10 +71,102 @@ test "search", %{conn: conn} do
get(conn, "/api/v2/search?q=天子")
|> json_response_and_validate_schema(200)
+ assert results["hashtags"] == [
+ %{"name" => "天子", "url" => "#{Web.base_url()}/tag/天子"}
+ ]
+
[status] = results["statuses"]
assert status["id"] == to_string(activity.id)
end
+ test "constructs hashtags from search query", %{conn: conn} do
+ results =
+ conn
+ |> get("/api/v2/search?#{URI.encode_query(%{q: "some text with #explicit #hashtags"})}")
+ |> json_response_and_validate_schema(200)
+
+ assert results["hashtags"] == [
+ %{"name" => "explicit", "url" => "#{Web.base_url()}/tag/explicit"},
+ %{"name" => "hashtags", "url" => "#{Web.base_url()}/tag/hashtags"}
+ ]
+
+ results =
+ conn
+ |> get("/api/v2/search?#{URI.encode_query(%{q: "john doe JOHN DOE"})}")
+ |> json_response_and_validate_schema(200)
+
+ assert results["hashtags"] == [
+ %{"name" => "john", "url" => "#{Web.base_url()}/tag/john"},
+ %{"name" => "doe", "url" => "#{Web.base_url()}/tag/doe"},
+ %{"name" => "JohnDoe", "url" => "#{Web.base_url()}/tag/JohnDoe"}
+ ]
+
+ results =
+ conn
+ |> get("/api/v2/search?#{URI.encode_query(%{q: "accident-prone"})}")
+ |> json_response_and_validate_schema(200)
+
+ assert results["hashtags"] == [
+ %{"name" => "accident", "url" => "#{Web.base_url()}/tag/accident"},
+ %{"name" => "prone", "url" => "#{Web.base_url()}/tag/prone"},
+ %{"name" => "AccidentProne", "url" => "#{Web.base_url()}/tag/AccidentProne"}
+ ]
+
+ results =
+ conn
+ |> get("/api/v2/search?#{URI.encode_query(%{q: "https://shpposter.club/users/shpuld"})}")
+ |> json_response_and_validate_schema(200)
+
+ assert results["hashtags"] == [
+ %{"name" => "shpuld", "url" => "#{Web.base_url()}/tag/shpuld"}
+ ]
+
+ results =
+ conn
+ |> get(
+ "/api/v2/search?#{
+ URI.encode_query(%{
+ q:
+ "https://www.washingtonpost.com/sports/2020/06/10/" <>
+ "nascar-ban-display-confederate-flag-all-events-properties/"
+ })
+ }"
+ )
+ |> json_response_and_validate_schema(200)
+
+ assert results["hashtags"] == [
+ %{"name" => "nascar", "url" => "#{Web.base_url()}/tag/nascar"},
+ %{"name" => "ban", "url" => "#{Web.base_url()}/tag/ban"},
+ %{"name" => "display", "url" => "#{Web.base_url()}/tag/display"},
+ %{"name" => "confederate", "url" => "#{Web.base_url()}/tag/confederate"},
+ %{"name" => "flag", "url" => "#{Web.base_url()}/tag/flag"},
+ %{"name" => "all", "url" => "#{Web.base_url()}/tag/all"},
+ %{"name" => "events", "url" => "#{Web.base_url()}/tag/events"},
+ %{"name" => "properties", "url" => "#{Web.base_url()}/tag/properties"},
+ %{
+ "name" => "NascarBanDisplayConfederateFlagAllEventsProperties",
+ "url" =>
+ "#{Web.base_url()}/tag/NascarBanDisplayConfederateFlagAllEventsProperties"
+ }
+ ]
+ end
+
+ test "supports pagination of hashtags search results", %{conn: conn} do
+ results =
+ conn
+ |> get(
+ "/api/v2/search?#{
+ URI.encode_query(%{q: "#some #text #with #hashtags", limit: 2, offset: 1})
+ }"
+ )
+ |> json_response_and_validate_schema(200)
+
+ assert results["hashtags"] == [
+ %{"name" => "text", "url" => "#{Web.base_url()}/tag/text"},
+ %{"name" => "with", "url" => "#{Web.base_url()}/tag/with"}
+ ]
+ end
+
test "excludes a blocked users from search results", %{conn: conn} do
user = insert(:user)
user_smith = insert(:user, %{nickname: "Agent", name: "I love 2hu"})
@@ -179,7 +271,7 @@ test "search", %{conn: conn} do
[account | _] = results["accounts"]
assert account["id"] == to_string(user_three.id)
- assert results["hashtags"] == []
+ assert results["hashtags"] == ["2hu"]
[status] = results["statuses"]
assert status["id"] == to_string(activity.id)
diff --git a/test/web/mastodon_api/controllers/status_controller_test.exs b/test/web/mastodon_api/controllers/status_controller_test.exs
index 700c82e4f..a98e939e8 100644
--- a/test/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/web/mastodon_api/controllers/status_controller_test.exs
@@ -1541,14 +1541,49 @@ test "context" do
} = response
end
+ test "favorites paginate correctly" do
+ %{user: user, conn: conn} = oauth_access(["read:favourites"])
+ other_user = insert(:user)
+ {:ok, first_post} = CommonAPI.post(other_user, %{status: "bla"})
+ {:ok, second_post} = CommonAPI.post(other_user, %{status: "bla"})
+ {:ok, third_post} = CommonAPI.post(other_user, %{status: "bla"})
+
+ {:ok, _first_favorite} = CommonAPI.favorite(user, third_post.id)
+ {:ok, _second_favorite} = CommonAPI.favorite(user, first_post.id)
+ {:ok, third_favorite} = CommonAPI.favorite(user, second_post.id)
+
+ result =
+ conn
+ |> get("/api/v1/favourites?limit=1")
+
+ assert [%{"id" => post_id}] = json_response_and_validate_schema(result, 200)
+ assert post_id == second_post.id
+
+ # Using the header for pagination works correctly
+ [next, _] = get_resp_header(result, "link") |> hd() |> String.split(", ")
+ [_, max_id] = Regex.run(~r/max_id=([^&]+)/, next)
+
+ assert max_id == third_favorite.id
+
+ result =
+ conn
+ |> get("/api/v1/favourites?max_id=#{max_id}")
+
+ assert [%{"id" => first_post_id}, %{"id" => third_post_id}] =
+ json_response_and_validate_schema(result, 200)
+
+ assert first_post_id == first_post.id
+ assert third_post_id == third_post.id
+ end
+
test "returns the favorites of a user" do
%{user: user, conn: conn} = oauth_access(["read:favourites"])
other_user = insert(:user)
{:ok, _} = CommonAPI.post(other_user, %{status: "bla"})
- {:ok, activity} = CommonAPI.post(other_user, %{status: "traps are happy"})
+ {:ok, activity} = CommonAPI.post(other_user, %{status: "trees are happy"})
- {:ok, _} = CommonAPI.favorite(user, activity.id)
+ {:ok, last_like} = CommonAPI.favorite(user, activity.id)
first_conn = get(conn, "/api/v1/favourites")
@@ -1566,9 +1601,7 @@ test "returns the favorites of a user" do
{:ok, _} = CommonAPI.favorite(user, second_activity.id)
- last_like = status["id"]
-
- second_conn = get(conn, "/api/v1/favourites?since_id=#{last_like}")
+ second_conn = get(conn, "/api/v1/favourites?since_id=#{last_like.id}")
assert [second_status] = json_response_and_validate_schema(second_conn, 200)
assert second_status["id"] == to_string(second_activity.id)
diff --git a/test/web/mastodon_api/controllers/subscription_controller_test.exs b/test/web/mastodon_api/controllers/subscription_controller_test.exs
index 4aa260663..d36bb1ae8 100644
--- a/test/web/mastodon_api/controllers/subscription_controller_test.exs
+++ b/test/web/mastodon_api/controllers/subscription_controller_test.exs
@@ -58,7 +58,9 @@ test "successful creation", %{conn: conn} do
result =
conn
|> post("/api/v1/push/subscription", %{
- "data" => %{"alerts" => %{"mention" => true, "test" => true}},
+ "data" => %{
+ "alerts" => %{"mention" => true, "test" => true, "pleroma:chat_mention" => true}
+ },
"subscription" => @sub
})
|> json_response_and_validate_schema(200)
@@ -66,7 +68,7 @@ test "successful creation", %{conn: conn} do
[subscription] = Pleroma.Repo.all(Subscription)
assert %{
- "alerts" => %{"mention" => true},
+ "alerts" => %{"mention" => true, "pleroma:chat_mention" => true},
"endpoint" => subscription.endpoint,
"id" => to_string(subscription.id),
"server_key" => @server_key
diff --git a/test/web/mastodon_api/controllers/timeline_controller_test.exs b/test/web/mastodon_api/controllers/timeline_controller_test.exs
index 2375ac8e8..f069390c1 100644
--- a/test/web/mastodon_api/controllers/timeline_controller_test.exs
+++ b/test/web/mastodon_api/controllers/timeline_controller_test.exs
@@ -60,9 +60,9 @@ test "the home timeline when the direct messages are excluded", %{user: user, co
describe "public" do
@tag capture_log: true
test "the public timeline", %{conn: conn} do
- following = insert(:user)
+ user = insert(:user)
- {:ok, _activity} = CommonAPI.post(following, %{status: "test"})
+ {:ok, activity} = CommonAPI.post(user, %{status: "test"})
_activity = insert(:note_activity, local: false)
@@ -77,6 +77,13 @@ test "the public timeline", %{conn: conn} do
conn = get(build_conn(), "/api/v1/timelines/public?local=1")
assert [%{"content" => "test"}] = json_response_and_validate_schema(conn, :ok)
+
+ # does not contain repeats
+ {:ok, _} = CommonAPI.repeat(activity.id, user)
+
+ conn = get(build_conn(), "/api/v1/timelines/public?local=true")
+
+ assert [_] = json_response_and_validate_schema(conn, :ok)
end
test "the public timeline includes only public statuses for an authenticated user" do
@@ -90,6 +97,49 @@ test "the public timeline includes only public statuses for an authenticated use
res_conn = get(conn, "/api/v1/timelines/public")
assert length(json_response_and_validate_schema(res_conn, 200)) == 1
end
+
+ test "doesn't return replies if follower is posting with blocked user" do
+ %{conn: conn, user: blocker} = oauth_access(["read:statuses"])
+ [blockee, friend] = insert_list(2, :user)
+ {:ok, blocker} = User.follow(blocker, friend)
+ {:ok, _} = User.block(blocker, blockee)
+
+ conn = assign(conn, :user, blocker)
+
+ {:ok, %{id: activity_id} = activity} = CommonAPI.post(friend, %{status: "hey!"})
+
+ {:ok, reply_from_blockee} =
+ CommonAPI.post(blockee, %{status: "heya", in_reply_to_status_id: activity})
+
+ {:ok, _reply_from_friend} =
+ CommonAPI.post(friend, %{status: "status", in_reply_to_status_id: reply_from_blockee})
+
+ res_conn = get(conn, "/api/v1/timelines/public")
+ [%{"id" => ^activity_id}] = json_response_and_validate_schema(res_conn, 200)
+ end
+
+ test "doesn't return replies if follow is posting with users from blocked domain" do
+ %{conn: conn, user: blocker} = oauth_access(["read:statuses"])
+ friend = insert(:user)
+ blockee = insert(:user, ap_id: "https://example.com/users/blocked")
+ {:ok, blocker} = User.follow(blocker, friend)
+ {:ok, blocker} = User.block_domain(blocker, "example.com")
+
+ conn = assign(conn, :user, blocker)
+
+ {:ok, %{id: activity_id} = activity} = CommonAPI.post(friend, %{status: "hey!"})
+
+ {:ok, reply_from_blockee} =
+ CommonAPI.post(blockee, %{status: "heya", in_reply_to_status_id: activity})
+
+ {:ok, _reply_from_friend} =
+ CommonAPI.post(friend, %{status: "status", in_reply_to_status_id: reply_from_blockee})
+
+ res_conn = get(conn, "/api/v1/timelines/public")
+
+ activities = json_response_and_validate_schema(res_conn, 200)
+ [%{"id" => ^activity_id}] = activities
+ end
end
defp local_and_remote_activities do
diff --git a/test/web/mastodon_api/views/account_view_test.exs b/test/web/mastodon_api/views/account_view_test.exs
index f91333e5c..80b1f734c 100644
--- a/test/web/mastodon_api/views/account_view_test.exs
+++ b/test/web/mastodon_api/views/account_view_test.exs
@@ -33,7 +33,8 @@ test "Represent a user account" do
bio:
"valid html. a
b
c
d
f '&<>\"",
inserted_at: ~N[2017-08-15 15:47:06.597036],
- emoji: %{"karjalanpiirakka" => "/file.png"}
+ emoji: %{"karjalanpiirakka" => "/file.png"},
+ raw_bio: "valid html. a\nb\nc\nd\nf '&<>\""
})
expected = %{
@@ -72,6 +73,7 @@ test "Represent a user account" do
fields: []
},
pleroma: %{
+ ap_id: user.ap_id,
background_image: "https://example.com/images/asuka_hospital.png",
confirmation_pending: false,
tags: [],
@@ -148,6 +150,7 @@ test "Represent a Service(bot) account" do
fields: []
},
pleroma: %{
+ ap_id: user.ap_id,
background_image: nil,
confirmation_pending: false,
tags: [],
diff --git a/test/web/mastodon_api/views/conversation_view_test.exs b/test/web/mastodon_api/views/conversation_view_test.exs
index 6f84366f8..2e8203c9b 100644
--- a/test/web/mastodon_api/views/conversation_view_test.exs
+++ b/test/web/mastodon_api/views/conversation_view_test.exs
@@ -15,8 +15,17 @@ test "represents a Mastodon Conversation entity" do
user = insert(:user)
other_user = insert(:user)
+ {:ok, parent} = CommonAPI.post(user, %{status: "parent"})
+
{:ok, activity} =
- CommonAPI.post(user, %{status: "hey @#{other_user.nickname}", visibility: "direct"})
+ CommonAPI.post(user, %{
+ status: "hey @#{other_user.nickname}",
+ visibility: "direct",
+ in_reply_to_id: parent.id
+ })
+
+ {:ok, _reply_activity} =
+ CommonAPI.post(user, %{status: "hu", visibility: "public", in_reply_to_id: parent.id})
[participation] = Participation.for_user_with_last_activity_id(user)
diff --git a/test/web/mastodon_api/views/notification_view_test.exs b/test/web/mastodon_api/views/notification_view_test.exs
index f15be1df1..8e0e58538 100644
--- a/test/web/mastodon_api/views/notification_view_test.exs
+++ b/test/web/mastodon_api/views/notification_view_test.exs
@@ -6,7 +6,10 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
use Pleroma.DataCase
alias Pleroma.Activity
+ alias Pleroma.Chat
+ alias Pleroma.Chat.MessageReference
alias Pleroma.Notification
+ alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Web.CommonAPI
@@ -14,6 +17,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
alias Pleroma.Web.MastodonAPI.AccountView
alias Pleroma.Web.MastodonAPI.NotificationView
alias Pleroma.Web.MastodonAPI.StatusView
+ alias Pleroma.Web.PleromaAPI.Chat.MessageReferenceView
import Pleroma.Factory
defp test_notifications_rendering(notifications, user, expected_result) do
@@ -31,6 +35,30 @@ defp test_notifications_rendering(notifications, user, expected_result) do
assert expected_result == result
end
+ test "ChatMessage notification" do
+ user = insert(:user)
+ recipient = insert(:user)
+ {:ok, activity} = CommonAPI.post_chat_message(user, recipient, "what's up my dude")
+
+ {:ok, [notification]} = Notification.create_notifications(activity)
+
+ object = Object.normalize(activity)
+ chat = Chat.get(recipient.id, user.ap_id)
+
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ expected = %{
+ id: to_string(notification.id),
+ pleroma: %{is_seen: false, is_muted: false},
+ type: "pleroma:chat_mention",
+ account: AccountView.render("show.json", %{user: user, for: recipient}),
+ chat_message: MessageReferenceView.render("show.json", %{chat_message_reference: cm_ref}),
+ created_at: Utils.to_masto_date(notification.inserted_at)
+ }
+
+ test_notifications_rendering([notification], recipient, [expected])
+ end
+
test "Mention notification" do
user = insert(:user)
mentioned_user = insert(:user)
@@ -40,7 +68,7 @@ test "Mention notification" do
expected = %{
id: to_string(notification.id),
- pleroma: %{is_seen: false},
+ pleroma: %{is_seen: false, is_muted: false},
type: "mention",
account:
AccountView.render("show.json", %{
@@ -64,7 +92,7 @@ test "Favourite notification" do
expected = %{
id: to_string(notification.id),
- pleroma: %{is_seen: false},
+ pleroma: %{is_seen: false, is_muted: false},
type: "favourite",
account: AccountView.render("show.json", %{user: another_user, for: user}),
status: StatusView.render("show.json", %{activity: create_activity, for: user}),
@@ -84,7 +112,7 @@ test "Reblog notification" do
expected = %{
id: to_string(notification.id),
- pleroma: %{is_seen: false},
+ pleroma: %{is_seen: false, is_muted: false},
type: "reblog",
account: AccountView.render("show.json", %{user: another_user, for: user}),
status: StatusView.render("show.json", %{activity: reblog_activity, for: user}),
@@ -102,7 +130,7 @@ test "Follow notification" do
expected = %{
id: to_string(notification.id),
- pleroma: %{is_seen: false},
+ pleroma: %{is_seen: false, is_muted: false},
type: "follow",
account: AccountView.render("show.json", %{user: follower, for: followed}),
created_at: Utils.to_masto_date(notification.inserted_at)
@@ -111,9 +139,7 @@ test "Follow notification" do
test_notifications_rendering([notification], followed, [expected])
User.perform(:delete, follower)
- notification = Notification |> Repo.one() |> Repo.preload(:activity)
-
- test_notifications_rendering([notification], followed, [])
+ refute Repo.one(Notification)
end
@tag capture_log: true
@@ -145,7 +171,7 @@ test "Move notification" do
expected = %{
id: to_string(notification.id),
- pleroma: %{is_seen: false},
+ pleroma: %{is_seen: false, is_muted: false},
type: "move",
account: AccountView.render("show.json", %{user: old_user, for: follower}),
target: AccountView.render("show.json", %{user: new_user, for: follower}),
@@ -170,7 +196,7 @@ test "EmojiReact notification" do
expected = %{
id: to_string(notification.id),
- pleroma: %{is_seen: false},
+ pleroma: %{is_seen: false, is_muted: false},
type: "pleroma:emoji_reaction",
emoji: "☕",
account: AccountView.render("show.json", %{user: other_user, for: user}),
@@ -180,4 +206,26 @@ test "EmojiReact notification" do
test_notifications_rendering([notification], user, [expected])
end
+
+ test "muted notification" do
+ user = insert(:user)
+ another_user = insert(:user)
+
+ {:ok, _} = Pleroma.UserRelationship.create_mute(user, another_user)
+ {:ok, create_activity} = CommonAPI.post(user, %{status: "hey"})
+ {:ok, favorite_activity} = CommonAPI.favorite(another_user, create_activity.id)
+ {:ok, [notification]} = Notification.create_notifications(favorite_activity)
+ create_activity = Activity.get_by_id(create_activity.id)
+
+ expected = %{
+ id: to_string(notification.id),
+ pleroma: %{is_seen: false, is_muted: true},
+ type: "favourite",
+ account: AccountView.render("show.json", %{user: another_user, for: user}),
+ status: StatusView.render("show.json", %{activity: create_activity, for: user}),
+ created_at: Utils.to_masto_date(notification.inserted_at)
+ }
+
+ test_notifications_rendering([notification], user, [expected])
+ end
end
diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs
index 5cbadf0fc..f90a0c273 100644
--- a/test/web/mastodon_api/views/status_view_test.exs
+++ b/test/web/mastodon_api/views/status_view_test.exs
@@ -226,7 +226,8 @@ test "a note activity" do
expires_at: nil,
direct_conversation_id: nil,
thread_muted: false,
- emoji_reactions: []
+ emoji_reactions: [],
+ parent_visible: false
}
}
@@ -620,4 +621,20 @@ test "visibility/list" do
assert status.visibility == "list"
end
+
+ test "has a field for parent visibility" do
+ user = insert(:user)
+ poster = insert(:user)
+
+ {:ok, invisible} = CommonAPI.post(poster, %{status: "hey", visibility: "private"})
+
+ {:ok, visible} =
+ CommonAPI.post(poster, %{status: "hey", visibility: "private", in_reply_to_id: invisible.id})
+
+ status = StatusView.render("show.json", activity: visible, for: user)
+ refute status.pleroma.parent_visible
+
+ status = StatusView.render("show.json", activity: visible, for: poster)
+ assert status.pleroma.parent_visible
+ end
end
diff --git a/test/web/media_proxy/invalidation_test.exs b/test/web/media_proxy/invalidation_test.exs
new file mode 100644
index 000000000..926ae74ca
--- /dev/null
+++ b/test/web/media_proxy/invalidation_test.exs
@@ -0,0 +1,64 @@
+defmodule Pleroma.Web.MediaProxy.InvalidationTest do
+ use ExUnit.Case
+ use Pleroma.Tests.Helpers
+
+ alias Pleroma.Config
+ alias Pleroma.Web.MediaProxy.Invalidation
+
+ import ExUnit.CaptureLog
+ import Mock
+ import Tesla.Mock
+
+ setup do: clear_config([:media_proxy])
+
+ setup do
+ on_exit(fn -> Cachex.clear(:banned_urls_cache) end)
+ end
+
+ describe "Invalidation.Http" do
+ test "perform request to clear cache" do
+ Config.put([:media_proxy, :enabled], false)
+ Config.put([:media_proxy, :invalidation, :enabled], true)
+ Config.put([:media_proxy, :invalidation, :provider], Invalidation.Http)
+
+ Config.put([Invalidation.Http], method: :purge, headers: [{"x-refresh", 1}])
+ image_url = "http://example.com/media/example.jpg"
+ Pleroma.Web.MediaProxy.put_in_banned_urls(image_url)
+
+ mock(fn
+ %{
+ method: :purge,
+ url: "http://example.com/media/example.jpg",
+ headers: [{"x-refresh", 1}]
+ } ->
+ %Tesla.Env{status: 200}
+ end)
+
+ assert capture_log(fn ->
+ assert Pleroma.Web.MediaProxy.in_banned_urls(image_url)
+ assert Invalidation.purge([image_url]) == {:ok, [image_url]}
+ assert Pleroma.Web.MediaProxy.in_banned_urls(image_url)
+ end) =~ "Running cache purge: [\"#{image_url}\"]"
+ end
+ end
+
+ describe "Invalidation.Script" do
+ test "run script to clear cache" do
+ Config.put([:media_proxy, :enabled], false)
+ Config.put([:media_proxy, :invalidation, :enabled], true)
+ Config.put([:media_proxy, :invalidation, :provider], Invalidation.Script)
+ Config.put([Invalidation.Script], script_path: "purge-nginx")
+
+ image_url = "http://example.com/media/example.jpg"
+ Pleroma.Web.MediaProxy.put_in_banned_urls(image_url)
+
+ with_mocks [{System, [], [cmd: fn _, _ -> {"ok", 0} end]}] do
+ assert capture_log(fn ->
+ assert Pleroma.Web.MediaProxy.in_banned_urls(image_url)
+ assert Invalidation.purge([image_url]) == {:ok, [image_url]}
+ assert Pleroma.Web.MediaProxy.in_banned_urls(image_url)
+ end) =~ "Running cache purge: [\"#{image_url}\"]"
+ end
+ end
+ end
+end
diff --git a/test/web/media_proxy/invalidations/http_test.exs b/test/web/media_proxy/invalidations/http_test.exs
index 8a3b4141c..a1bef5237 100644
--- a/test/web/media_proxy/invalidations/http_test.exs
+++ b/test/web/media_proxy/invalidations/http_test.exs
@@ -5,6 +5,10 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.HttpTest do
import ExUnit.CaptureLog
import Tesla.Mock
+ setup do
+ on_exit(fn -> Cachex.clear(:banned_urls_cache) end)
+ end
+
test "logs hasn't error message when request is valid" do
mock(fn
%{method: :purge, url: "http://example.com/media/example.jpg"} ->
@@ -14,8 +18,8 @@ test "logs hasn't error message when request is valid" do
refute capture_log(fn ->
assert Invalidation.Http.purge(
["http://example.com/media/example.jpg"],
- %{}
- ) == {:ok, "success"}
+ []
+ ) == {:ok, ["http://example.com/media/example.jpg"]}
end) =~ "Error while cache purge"
end
@@ -28,8 +32,8 @@ test "it write error message in logs when request invalid" do
assert capture_log(fn ->
assert Invalidation.Http.purge(
["http://example.com/media/example1.jpg"],
- %{}
- ) == {:ok, "success"}
+ []
+ ) == {:ok, ["http://example.com/media/example1.jpg"]}
end) =~ "Error while cache purge: url - http://example.com/media/example1.jpg"
end
end
diff --git a/test/web/media_proxy/invalidations/script_test.exs b/test/web/media_proxy/invalidations/script_test.exs
index 1358963ab..51833ab18 100644
--- a/test/web/media_proxy/invalidations/script_test.exs
+++ b/test/web/media_proxy/invalidations/script_test.exs
@@ -4,17 +4,23 @@ defmodule Pleroma.Web.MediaProxy.Invalidation.ScriptTest do
import ExUnit.CaptureLog
+ setup do
+ on_exit(fn -> Cachex.clear(:banned_urls_cache) end)
+ end
+
test "it logger error when script not found" do
assert capture_log(fn ->
assert Invalidation.Script.purge(
["http://example.com/media/example.jpg"],
- %{script_path: "./example"}
- ) == {:error, "\"%ErlangError{original: :enoent}\""}
- end) =~ "Error while cache purge: \"%ErlangError{original: :enoent}\""
+ script_path: "./example"
+ ) == {:error, "%ErlangError{original: :enoent}"}
+ end) =~ "Error while cache purge: %ErlangError{original: :enoent}"
- assert Invalidation.Script.purge(
- ["http://example.com/media/example.jpg"],
- %{}
- ) == {:error, "not found script path"}
+ capture_log(fn ->
+ assert Invalidation.Script.purge(
+ ["http://example.com/media/example.jpg"],
+ []
+ ) == {:error, "\"not found script path\""}
+ end)
end
end
diff --git a/test/web/media_proxy/media_proxy_controller_test.exs b/test/web/media_proxy/media_proxy_controller_test.exs
index da79d38a5..d61cef83b 100644
--- a/test/web/media_proxy/media_proxy_controller_test.exs
+++ b/test/web/media_proxy/media_proxy_controller_test.exs
@@ -10,6 +10,10 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
setup do: clear_config(:media_proxy)
setup do: clear_config([Pleroma.Web.Endpoint, :secret_key_base])
+ setup do
+ on_exit(fn -> Cachex.clear(:banned_urls_cache) end)
+ end
+
test "it returns 404 when MediaProxy disabled", %{conn: conn} do
Config.put([:media_proxy, :enabled], false)
@@ -66,4 +70,16 @@ test "it performs ReverseProxy.call when signature valid", %{conn: conn} do
assert %Plug.Conn{status: :success} = get(conn, url)
end
end
+
+ test "it returns 404 when url contains in banned_urls cache", %{conn: conn} do
+ Config.put([:media_proxy, :enabled], true)
+ Config.put([Pleroma.Web.Endpoint, :secret_key_base], "00000000000")
+ url = Pleroma.Web.MediaProxy.encode_url("https://google.fn/test.png")
+ Pleroma.Web.MediaProxy.put_in_banned_urls("https://google.fn/test.png")
+
+ with_mock Pleroma.ReverseProxy,
+ call: fn _conn, _url, _opts -> %Plug.Conn{status: :success} end do
+ assert %Plug.Conn{status: 404, resp_body: "Not Found"} = get(conn, url)
+ end
+ end
end
diff --git a/test/web/node_info_test.exs b/test/web/node_info_test.exs
index 9bcc07b37..06b33607f 100644
--- a/test/web/node_info_test.exs
+++ b/test/web/node_info_test.exs
@@ -67,10 +67,10 @@ test "returns software.repository field in nodeinfo 2.1", %{conn: conn} do
end
test "returns fieldsLimits field", %{conn: conn} do
- Config.put([:instance, :max_account_fields], 10)
- Config.put([:instance, :max_remote_account_fields], 15)
- Config.put([:instance, :account_field_name_length], 255)
- Config.put([:instance, :account_field_value_length], 2048)
+ clear_config([:instance, :max_account_fields], 10)
+ clear_config([:instance, :max_remote_account_fields], 15)
+ clear_config([:instance, :account_field_name_length], 255)
+ clear_config([:instance, :account_field_value_length], 2048)
response =
conn
@@ -84,8 +84,7 @@ test "returns fieldsLimits field", %{conn: conn} do
end
test "it returns the safe_dm_mentions feature if enabled", %{conn: conn} do
- option = Config.get([:instance, :safe_dm_mentions])
- Config.put([:instance, :safe_dm_mentions], true)
+ clear_config([:instance, :safe_dm_mentions], true)
response =
conn
@@ -102,8 +101,6 @@ test "it returns the safe_dm_mentions feature if enabled", %{conn: conn} do
|> json_response(:ok)
refute "safe_dm_mentions" in response["metadata"]["features"]
-
- Config.put([:instance, :safe_dm_mentions], option)
end
describe "`metadata/federation/enabled`" do
@@ -145,7 +142,8 @@ test "it shows default features flags", %{conn: conn} do
"shareable_emoji_packs",
"multifetch",
"pleroma_emoji_reactions",
- "pleroma:api/v1/notifications:include_types_filter"
+ "pleroma:api/v1/notifications:include_types_filter",
+ "pleroma_chat_messages"
]
assert MapSet.subset?(
@@ -155,14 +153,11 @@ test "it shows default features flags", %{conn: conn} do
end
test "it shows MRF transparency data if enabled", %{conn: conn} do
- config = Config.get([:instance, :rewrite_policy])
- Config.put([:instance, :rewrite_policy], [Pleroma.Web.ActivityPub.MRF.SimplePolicy])
-
- option = Config.get([:instance, :mrf_transparency])
- Config.put([:instance, :mrf_transparency], true)
+ clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.SimplePolicy])
+ clear_config([:mrf, :transparency], true)
simple_config = %{"reject" => ["example.com"]}
- Config.put(:mrf_simple, simple_config)
+ clear_config(:mrf_simple, simple_config)
response =
conn
@@ -170,26 +165,17 @@ test "it shows MRF transparency data if enabled", %{conn: conn} do
|> json_response(:ok)
assert response["metadata"]["federation"]["mrf_simple"] == simple_config
-
- Config.put([:instance, :rewrite_policy], config)
- Config.put([:instance, :mrf_transparency], option)
- Config.put(:mrf_simple, %{})
end
test "it performs exclusions from MRF transparency data if configured", %{conn: conn} do
- config = Config.get([:instance, :rewrite_policy])
- Config.put([:instance, :rewrite_policy], [Pleroma.Web.ActivityPub.MRF.SimplePolicy])
-
- option = Config.get([:instance, :mrf_transparency])
- Config.put([:instance, :mrf_transparency], true)
-
- exclusions = Config.get([:instance, :mrf_transparency_exclusions])
- Config.put([:instance, :mrf_transparency_exclusions], ["other.site"])
+ clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.SimplePolicy])
+ clear_config([:mrf, :transparency], true)
+ clear_config([:mrf, :transparency_exclusions], ["other.site"])
simple_config = %{"reject" => ["example.com", "other.site"]}
- expected_config = %{"reject" => ["example.com"]}
+ clear_config(:mrf_simple, simple_config)
- Config.put(:mrf_simple, simple_config)
+ expected_config = %{"reject" => ["example.com"]}
response =
conn
@@ -198,10 +184,5 @@ test "it performs exclusions from MRF transparency data if configured", %{conn:
assert response["metadata"]["federation"]["mrf_simple"] == expected_config
assert response["metadata"]["federation"]["exclusions"] == true
-
- Config.put([:instance, :rewrite_policy], config)
- Config.put([:instance, :mrf_transparency], option)
- Config.put([:instance, :mrf_transparency_exclusions], exclusions)
- Config.put(:mrf_simple, %{})
end
end
diff --git a/test/web/pleroma_api/controllers/chat_controller_test.exs b/test/web/pleroma_api/controllers/chat_controller_test.exs
new file mode 100644
index 000000000..82e16741d
--- /dev/null
+++ b/test/web/pleroma_api/controllers/chat_controller_test.exs
@@ -0,0 +1,336 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+defmodule Pleroma.Web.PleromaAPI.ChatControllerTest do
+ use Pleroma.Web.ConnCase, async: true
+
+ alias Pleroma.Chat
+ alias Pleroma.Chat.MessageReference
+ alias Pleroma.Object
+ alias Pleroma.User
+ alias Pleroma.Web.ActivityPub.ActivityPub
+ alias Pleroma.Web.CommonAPI
+
+ import Pleroma.Factory
+
+ describe "POST /api/v1/pleroma/chats/:id/messages/:message_id/read" do
+ setup do: oauth_access(["write:chats"])
+
+ test "it marks one message as read", %{conn: conn, user: user} do
+ other_user = insert(:user)
+
+ {:ok, create} = CommonAPI.post_chat_message(other_user, user, "sup")
+ {:ok, _create} = CommonAPI.post_chat_message(other_user, user, "sup part 2")
+ {:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
+ object = Object.normalize(create, false)
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ assert cm_ref.unread == true
+
+ result =
+ conn
+ |> post("/api/v1/pleroma/chats/#{chat.id}/messages/#{cm_ref.id}/read")
+ |> json_response_and_validate_schema(200)
+
+ assert result["unread"] == false
+
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ assert cm_ref.unread == false
+ end
+ end
+
+ describe "POST /api/v1/pleroma/chats/:id/read" do
+ setup do: oauth_access(["write:chats"])
+
+ test "given a `last_read_id`, it marks everything until then as read", %{
+ conn: conn,
+ user: user
+ } do
+ other_user = insert(:user)
+
+ {:ok, create} = CommonAPI.post_chat_message(other_user, user, "sup")
+ {:ok, _create} = CommonAPI.post_chat_message(other_user, user, "sup part 2")
+ {:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
+ object = Object.normalize(create, false)
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ assert cm_ref.unread == true
+
+ result =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/pleroma/chats/#{chat.id}/read", %{"last_read_id" => cm_ref.id})
+ |> json_response_and_validate_schema(200)
+
+ assert result["unread"] == 1
+
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ assert cm_ref.unread == false
+ end
+ end
+
+ describe "POST /api/v1/pleroma/chats/:id/messages" do
+ setup do: oauth_access(["write:chats"])
+
+ test "it posts a message to the chat", %{conn: conn, user: user} do
+ other_user = insert(:user)
+
+ {:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
+
+ result =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/pleroma/chats/#{chat.id}/messages", %{"content" => "Hallo!!"})
+ |> json_response_and_validate_schema(200)
+
+ assert result["content"] == "Hallo!!"
+ assert result["chat_id"] == chat.id |> to_string()
+ end
+
+ test "it fails if there is no content", %{conn: conn, user: user} do
+ other_user = insert(:user)
+
+ {:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
+
+ result =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/pleroma/chats/#{chat.id}/messages")
+ |> json_response_and_validate_schema(400)
+
+ assert result
+ end
+
+ test "it works with an attachment", %{conn: conn, user: user} do
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image.jpg"),
+ filename: "an_image.jpg"
+ }
+
+ {:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
+
+ other_user = insert(:user)
+
+ {:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
+
+ result =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/pleroma/chats/#{chat.id}/messages", %{
+ "media_id" => to_string(upload.id)
+ })
+ |> json_response_and_validate_schema(200)
+
+ assert result["attachment"]
+ end
+ end
+
+ describe "DELETE /api/v1/pleroma/chats/:id/messages/:message_id" do
+ setup do: oauth_access(["write:chats"])
+
+ test "it deletes a message from the chat", %{conn: conn, user: user} do
+ recipient = insert(:user)
+
+ {:ok, message} =
+ CommonAPI.post_chat_message(user, recipient, "Hello darkness my old friend")
+
+ {:ok, other_message} = CommonAPI.post_chat_message(recipient, user, "nico nico ni")
+
+ object = Object.normalize(message, false)
+
+ chat = Chat.get(user.id, recipient.ap_id)
+
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ # Deleting your own message removes the message and the reference
+ result =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> delete("/api/v1/pleroma/chats/#{chat.id}/messages/#{cm_ref.id}")
+ |> json_response_and_validate_schema(200)
+
+ assert result["id"] == cm_ref.id
+ refute MessageReference.get_by_id(cm_ref.id)
+ assert %{data: %{"type" => "Tombstone"}} = Object.get_by_id(object.id)
+
+ # Deleting other people's messages just removes the reference
+ object = Object.normalize(other_message, false)
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ result =
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> delete("/api/v1/pleroma/chats/#{chat.id}/messages/#{cm_ref.id}")
+ |> json_response_and_validate_schema(200)
+
+ assert result["id"] == cm_ref.id
+ refute MessageReference.get_by_id(cm_ref.id)
+ assert Object.get_by_id(object.id)
+ end
+ end
+
+ describe "GET /api/v1/pleroma/chats/:id/messages" do
+ setup do: oauth_access(["read:chats"])
+
+ test "it paginates", %{conn: conn, user: user} do
+ recipient = insert(:user)
+
+ Enum.each(1..30, fn _ ->
+ {:ok, _} = CommonAPI.post_chat_message(user, recipient, "hey")
+ end)
+
+ chat = Chat.get(user.id, recipient.ap_id)
+
+ result =
+ conn
+ |> get("/api/v1/pleroma/chats/#{chat.id}/messages")
+ |> json_response_and_validate_schema(200)
+
+ assert length(result) == 20
+
+ result =
+ conn
+ |> get("/api/v1/pleroma/chats/#{chat.id}/messages?max_id=#{List.last(result)["id"]}")
+ |> json_response_and_validate_schema(200)
+
+ assert length(result) == 10
+ end
+
+ test "it returns the messages for a given chat", %{conn: conn, user: user} do
+ other_user = insert(:user)
+ third_user = insert(:user)
+
+ {:ok, _} = CommonAPI.post_chat_message(user, other_user, "hey")
+ {:ok, _} = CommonAPI.post_chat_message(user, third_user, "hey")
+ {:ok, _} = CommonAPI.post_chat_message(user, other_user, "how are you?")
+ {:ok, _} = CommonAPI.post_chat_message(other_user, user, "fine, how about you?")
+
+ chat = Chat.get(user.id, other_user.ap_id)
+
+ result =
+ conn
+ |> get("/api/v1/pleroma/chats/#{chat.id}/messages")
+ |> json_response_and_validate_schema(200)
+
+ result
+ |> Enum.each(fn message ->
+ assert message["chat_id"] == chat.id |> to_string()
+ end)
+
+ assert length(result) == 3
+
+ # Trying to get the chat of a different user
+ result =
+ conn
+ |> assign(:user, other_user)
+ |> get("/api/v1/pleroma/chats/#{chat.id}/messages")
+
+ assert result |> json_response(404)
+ end
+ end
+
+ describe "POST /api/v1/pleroma/chats/by-account-id/:id" do
+ setup do: oauth_access(["write:chats"])
+
+ test "it creates or returns a chat", %{conn: conn} do
+ other_user = insert(:user)
+
+ result =
+ conn
+ |> post("/api/v1/pleroma/chats/by-account-id/#{other_user.id}")
+ |> json_response_and_validate_schema(200)
+
+ assert result["id"]
+ end
+ end
+
+ describe "GET /api/v1/pleroma/chats/:id" do
+ setup do: oauth_access(["read:chats"])
+
+ test "it returns a chat", %{conn: conn, user: user} do
+ other_user = insert(:user)
+
+ {:ok, chat} = Chat.get_or_create(user.id, other_user.ap_id)
+
+ result =
+ conn
+ |> get("/api/v1/pleroma/chats/#{chat.id}")
+ |> json_response_and_validate_schema(200)
+
+ assert result["id"] == to_string(chat.id)
+ end
+ end
+
+ describe "GET /api/v1/pleroma/chats" do
+ setup do: oauth_access(["read:chats"])
+
+ test "it does not return chats with users you blocked", %{conn: conn, user: user} do
+ recipient = insert(:user)
+
+ {:ok, _} = Chat.get_or_create(user.id, recipient.ap_id)
+
+ result =
+ conn
+ |> get("/api/v1/pleroma/chats")
+ |> json_response_and_validate_schema(200)
+
+ assert length(result) == 1
+
+ User.block(user, recipient)
+
+ result =
+ conn
+ |> get("/api/v1/pleroma/chats")
+ |> json_response_and_validate_schema(200)
+
+ assert length(result) == 0
+ end
+
+ test "it returns all chats", %{conn: conn, user: user} do
+ Enum.each(1..30, fn _ ->
+ recipient = insert(:user)
+ {:ok, _} = Chat.get_or_create(user.id, recipient.ap_id)
+ end)
+
+ result =
+ conn
+ |> get("/api/v1/pleroma/chats")
+ |> json_response_and_validate_schema(200)
+
+ assert length(result) == 30
+ end
+
+ test "it return a list of chats the current user is participating in, in descending order of updates",
+ %{conn: conn, user: user} do
+ har = insert(:user)
+ jafnhar = insert(:user)
+ tridi = insert(:user)
+
+ {:ok, chat_1} = Chat.get_or_create(user.id, har.ap_id)
+ :timer.sleep(1000)
+ {:ok, _chat_2} = Chat.get_or_create(user.id, jafnhar.ap_id)
+ :timer.sleep(1000)
+ {:ok, chat_3} = Chat.get_or_create(user.id, tridi.ap_id)
+ :timer.sleep(1000)
+
+ # bump the second one
+ {:ok, chat_2} = Chat.bump_or_create(user.id, jafnhar.ap_id)
+
+ result =
+ conn
+ |> get("/api/v1/pleroma/chats")
+ |> json_response_and_validate_schema(200)
+
+ ids = Enum.map(result, & &1["id"])
+
+ assert ids == [
+ chat_2.id |> to_string(),
+ chat_3.id |> to_string(),
+ chat_1.id |> to_string()
+ ]
+ end
+ end
+end
diff --git a/test/web/pleroma_api/controllers/emoji_pack_controller_test.exs b/test/web/pleroma_api/controllers/emoji_pack_controller_test.exs
index ee3d281a0..df58a5eb6 100644
--- a/test/web/pleroma_api/controllers/emoji_pack_controller_test.exs
+++ b/test/web/pleroma_api/controllers/emoji_pack_controller_test.exs
@@ -30,15 +30,55 @@ defmodule Pleroma.Web.PleromaAPI.EmojiPackControllerTest do
test "GET /api/pleroma/emoji/packs", %{conn: conn} do
resp = conn |> get("/api/pleroma/emoji/packs") |> json_response_and_validate_schema(200)
- shared = resp["test_pack"]
- assert shared["files"] == %{"blank" => "blank.png"}
+ assert resp["count"] == 3
+
+ assert resp["packs"]
+ |> Map.keys()
+ |> length() == 3
+
+ shared = resp["packs"]["test_pack"]
+ assert shared["files"] == %{"blank" => "blank.png", "blank2" => "blank2.png"}
assert Map.has_key?(shared["pack"], "download-sha256")
assert shared["pack"]["can-download"]
assert shared["pack"]["share-files"]
- non_shared = resp["test_pack_nonshared"]
+ non_shared = resp["packs"]["test_pack_nonshared"]
assert non_shared["pack"]["share-files"] == false
assert non_shared["pack"]["can-download"] == false
+
+ resp =
+ conn
+ |> get("/api/pleroma/emoji/packs?page_size=1")
+ |> json_response_and_validate_schema(200)
+
+ assert resp["count"] == 3
+
+ packs = Map.keys(resp["packs"])
+
+ assert length(packs) == 1
+
+ [pack1] = packs
+
+ resp =
+ conn
+ |> get("/api/pleroma/emoji/packs?page_size=1&page=2")
+ |> json_response_and_validate_schema(200)
+
+ assert resp["count"] == 3
+ packs = Map.keys(resp["packs"])
+ assert length(packs) == 1
+ [pack2] = packs
+
+ resp =
+ conn
+ |> get("/api/pleroma/emoji/packs?page_size=1&page=3")
+ |> json_response_and_validate_schema(200)
+
+ assert resp["count"] == 3
+ packs = Map.keys(resp["packs"])
+ assert length(packs) == 1
+ [pack3] = packs
+ assert [pack1, pack2, pack3] |> Enum.uniq() |> length() == 3
end
describe "GET /api/pleroma/emoji/packs/remote" do
@@ -332,7 +372,7 @@ test "for a pack with a fallback source", ctx do
Map.put(
new_data,
"fallback-src-sha256",
- "74409E2674DAA06C072729C6C8426C4CB3B7E0B85ED77792DB7A436E11D76DAF"
+ "1967BB4E42BCC34BCC12D57BE7811D3B7BE52F965BCE45C87BD377B9499CE11D"
)
assert ctx[:admin_conn]
@@ -398,7 +438,7 @@ test "don't rewrite old emoji", %{admin_conn: admin_conn} do
assert admin_conn
|> put_req_header("content-type", "multipart/form-data")
|> post("/api/pleroma/emoji/packs/test_pack/files", %{
- shortcode: "blank2",
+ shortcode: "blank3",
filename: "dir/blank.png",
file: %Plug.Upload{
filename: "blank.png",
@@ -407,7 +447,8 @@ test "don't rewrite old emoji", %{admin_conn: admin_conn} do
})
|> json_response_and_validate_schema(200) == %{
"blank" => "blank.png",
- "blank2" => "dir/blank.png"
+ "blank2" => "blank2.png",
+ "blank3" => "dir/blank.png"
}
assert File.exists?("#{@emoji_path}/test_pack/dir/blank.png")
@@ -431,7 +472,7 @@ test "rewrite old emoji with force option", %{admin_conn: admin_conn} do
assert admin_conn
|> put_req_header("content-type", "multipart/form-data")
|> post("/api/pleroma/emoji/packs/test_pack/files", %{
- shortcode: "blank2",
+ shortcode: "blank3",
filename: "dir/blank.png",
file: %Plug.Upload{
filename: "blank.png",
@@ -440,7 +481,8 @@ test "rewrite old emoji with force option", %{admin_conn: admin_conn} do
})
|> json_response_and_validate_schema(200) == %{
"blank" => "blank.png",
- "blank2" => "dir/blank.png"
+ "blank2" => "blank2.png",
+ "blank3" => "dir/blank.png"
}
assert File.exists?("#{@emoji_path}/test_pack/dir/blank.png")
@@ -448,14 +490,15 @@ test "rewrite old emoji with force option", %{admin_conn: admin_conn} do
assert admin_conn
|> put_req_header("content-type", "multipart/form-data")
|> patch("/api/pleroma/emoji/packs/test_pack/files", %{
- shortcode: "blank2",
- new_shortcode: "blank3",
+ shortcode: "blank3",
+ new_shortcode: "blank4",
new_filename: "dir_2/blank_3.png",
force: true
})
|> json_response_and_validate_schema(200) == %{
"blank" => "blank.png",
- "blank3" => "dir_2/blank_3.png"
+ "blank2" => "blank2.png",
+ "blank4" => "dir_2/blank_3.png"
}
assert File.exists?("#{@emoji_path}/test_pack/dir_2/blank_3.png")
@@ -481,7 +524,7 @@ test "add file with not loaded pack", %{admin_conn: admin_conn} do
assert admin_conn
|> put_req_header("content-type", "multipart/form-data")
|> post("/api/pleroma/emoji/packs/not_loaded/files", %{
- shortcode: "blank2",
+ shortcode: "blank3",
filename: "dir/blank.png",
file: %Plug.Upload{
filename: "blank.png",
@@ -535,7 +578,8 @@ test "new with shortcode as file with update", %{admin_conn: admin_conn} do
})
|> json_response_and_validate_schema(200) == %{
"blank" => "blank.png",
- "blank4" => "dir/blank.png"
+ "blank4" => "dir/blank.png",
+ "blank2" => "blank2.png"
}
assert File.exists?("#{@emoji_path}/test_pack/dir/blank.png")
@@ -549,7 +593,8 @@ test "new with shortcode as file with update", %{admin_conn: admin_conn} do
})
|> json_response_and_validate_schema(200) == %{
"blank3" => "dir_2/blank_3.png",
- "blank" => "blank.png"
+ "blank" => "blank.png",
+ "blank2" => "blank2.png"
}
refute File.exists?("#{@emoji_path}/test_pack/dir/")
@@ -557,7 +602,10 @@ test "new with shortcode as file with update", %{admin_conn: admin_conn} do
assert admin_conn
|> delete("/api/pleroma/emoji/packs/test_pack/files?shortcode=blank3")
- |> json_response_and_validate_schema(200) == %{"blank" => "blank.png"}
+ |> json_response_and_validate_schema(200) == %{
+ "blank" => "blank.png",
+ "blank2" => "blank2.png"
+ }
refute File.exists?("#{@emoji_path}/test_pack/dir_2/")
@@ -581,7 +629,8 @@ test "new with shortcode from url", %{admin_conn: admin_conn} do
})
|> json_response_and_validate_schema(200) == %{
"blank_url" => "blank_url.png",
- "blank" => "blank.png"
+ "blank" => "blank.png",
+ "blank2" => "blank2.png"
}
assert File.exists?("#{@emoji_path}/test_pack/blank_url.png")
@@ -602,15 +651,16 @@ test "new without shortcode", %{admin_conn: admin_conn} do
})
|> json_response_and_validate_schema(200) == %{
"shortcode" => "shortcode.png",
- "blank" => "blank.png"
+ "blank" => "blank.png",
+ "blank2" => "blank2.png"
}
end
test "remove non existing shortcode in pack.json", %{admin_conn: admin_conn} do
assert admin_conn
- |> delete("/api/pleroma/emoji/packs/test_pack/files?shortcode=blank2")
+ |> delete("/api/pleroma/emoji/packs/test_pack/files?shortcode=blank3")
|> json_response_and_validate_schema(:bad_request) == %{
- "error" => "Emoji \"blank2\" does not exist"
+ "error" => "Emoji \"blank3\" does not exist"
}
end
@@ -618,12 +668,12 @@ test "update non existing emoji", %{admin_conn: admin_conn} do
assert admin_conn
|> put_req_header("content-type", "multipart/form-data")
|> patch("/api/pleroma/emoji/packs/test_pack/files", %{
- shortcode: "blank2",
- new_shortcode: "blank3",
+ shortcode: "blank3",
+ new_shortcode: "blank4",
new_filename: "dir_2/blank_3.png"
})
|> json_response_and_validate_schema(:bad_request) == %{
- "error" => "Emoji \"blank2\" does not exist"
+ "error" => "Emoji \"blank3\" does not exist"
}
end
@@ -651,7 +701,8 @@ test "creating and deleting a pack", %{admin_conn: admin_conn} do
assert Jason.decode!(File.read!("#{@emoji_path}/test_created/pack.json")) == %{
"pack" => %{},
- "files" => %{}
+ "files" => %{},
+ "files_count" => 0
}
assert admin_conn
@@ -709,14 +760,14 @@ test "filesystem import", %{admin_conn: admin_conn, conn: conn} do
resp = conn |> get("/api/pleroma/emoji/packs") |> json_response_and_validate_schema(200)
- refute Map.has_key?(resp, "test_pack_for_import")
+ refute Map.has_key?(resp["packs"], "test_pack_for_import")
assert admin_conn
|> get("/api/pleroma/emoji/packs/import")
|> json_response_and_validate_schema(200) == ["test_pack_for_import"]
resp = conn |> get("/api/pleroma/emoji/packs") |> json_response_and_validate_schema(200)
- assert resp["test_pack_for_import"]["files"] == %{"blank" => "blank.png"}
+ assert resp["packs"]["test_pack_for_import"]["files"] == %{"blank" => "blank.png"}
File.rm!("#{@emoji_path}/test_pack_for_import/pack.json")
refute File.exists?("#{@emoji_path}/test_pack_for_import/pack.json")
@@ -736,7 +787,7 @@ test "filesystem import", %{admin_conn: admin_conn, conn: conn} do
resp = conn |> get("/api/pleroma/emoji/packs") |> json_response_and_validate_schema(200)
- assert resp["test_pack_for_import"]["files"] == %{
+ assert resp["packs"]["test_pack_for_import"]["files"] == %{
"blank" => "blank.png",
"blank2" => "blank.png",
"foo" => "blank.png"
@@ -746,7 +797,8 @@ test "filesystem import", %{admin_conn: admin_conn, conn: conn} do
describe "GET /api/pleroma/emoji/packs/:name" do
test "shows pack.json", %{conn: conn} do
assert %{
- "files" => %{"blank" => "blank.png"},
+ "files" => files,
+ "files_count" => 2,
"pack" => %{
"can-download" => true,
"description" => "Test description",
@@ -759,6 +811,28 @@ test "shows pack.json", %{conn: conn} do
conn
|> get("/api/pleroma/emoji/packs/test_pack")
|> json_response_and_validate_schema(200)
+
+ assert files == %{"blank" => "blank.png", "blank2" => "blank2.png"}
+
+ assert %{
+ "files" => files,
+ "files_count" => 2
+ } =
+ conn
+ |> get("/api/pleroma/emoji/packs/test_pack?page_size=1")
+ |> json_response_and_validate_schema(200)
+
+ assert files |> Map.keys() |> length() == 1
+
+ assert %{
+ "files" => files,
+ "files_count" => 2
+ } =
+ conn
+ |> get("/api/pleroma/emoji/packs/test_pack?page_size=1&page=2")
+ |> json_response_and_validate_schema(200)
+
+ assert files |> Map.keys() |> length() == 1
end
test "non existing pack", %{conn: conn} do
diff --git a/test/web/pleroma_api/views/chat/message_reference_view_test.exs b/test/web/pleroma_api/views/chat/message_reference_view_test.exs
new file mode 100644
index 000000000..e5b165255
--- /dev/null
+++ b/test/web/pleroma_api/views/chat/message_reference_view_test.exs
@@ -0,0 +1,61 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.PleromaAPI.Chat.MessageReferenceViewTest do
+ use Pleroma.DataCase
+
+ alias Pleroma.Chat
+ alias Pleroma.Chat.MessageReference
+ alias Pleroma.Object
+ alias Pleroma.Web.ActivityPub.ActivityPub
+ alias Pleroma.Web.CommonAPI
+ alias Pleroma.Web.PleromaAPI.Chat.MessageReferenceView
+
+ import Pleroma.Factory
+
+ test "it displays a chat message" do
+ user = insert(:user)
+ recipient = insert(:user)
+
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image.jpg"),
+ filename: "an_image.jpg"
+ }
+
+ {:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
+ {:ok, activity} = CommonAPI.post_chat_message(user, recipient, "kippis :firefox:")
+
+ chat = Chat.get(user.id, recipient.ap_id)
+
+ object = Object.normalize(activity)
+
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ chat_message = MessageReferenceView.render("show.json", chat_message_reference: cm_ref)
+
+ assert chat_message[:id] == cm_ref.id
+ assert chat_message[:content] == "kippis :firefox:"
+ assert chat_message[:account_id] == user.id
+ assert chat_message[:chat_id]
+ assert chat_message[:created_at]
+ assert chat_message[:unread] == false
+ assert match?([%{shortcode: "firefox"}], chat_message[:emojis])
+
+ {:ok, activity} = CommonAPI.post_chat_message(recipient, user, "gkgkgk", media_id: upload.id)
+
+ object = Object.normalize(activity)
+
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+
+ chat_message_two = MessageReferenceView.render("show.json", chat_message_reference: cm_ref)
+
+ assert chat_message_two[:id] == cm_ref.id
+ assert chat_message_two[:content] == "gkgkgk"
+ assert chat_message_two[:account_id] == recipient.id
+ assert chat_message_two[:chat_id] == chat_message[:chat_id]
+ assert chat_message_two[:attachment]
+ assert chat_message_two[:unread] == true
+ end
+end
diff --git a/test/web/pleroma_api/views/chat_view_test.exs b/test/web/pleroma_api/views/chat_view_test.exs
new file mode 100644
index 000000000..14eecb1bd
--- /dev/null
+++ b/test/web/pleroma_api/views/chat_view_test.exs
@@ -0,0 +1,48 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.PleromaAPI.ChatViewTest do
+ use Pleroma.DataCase
+
+ alias Pleroma.Chat
+ alias Pleroma.Chat.MessageReference
+ alias Pleroma.Object
+ alias Pleroma.Web.CommonAPI
+ alias Pleroma.Web.CommonAPI.Utils
+ alias Pleroma.Web.MastodonAPI.AccountView
+ alias Pleroma.Web.PleromaAPI.Chat.MessageReferenceView
+ alias Pleroma.Web.PleromaAPI.ChatView
+
+ import Pleroma.Factory
+
+ test "it represents a chat" do
+ user = insert(:user)
+ recipient = insert(:user)
+
+ {:ok, chat} = Chat.get_or_create(user.id, recipient.ap_id)
+
+ represented_chat = ChatView.render("show.json", chat: chat)
+
+ assert represented_chat == %{
+ id: "#{chat.id}",
+ account: AccountView.render("show.json", user: recipient),
+ unread: 0,
+ last_message: nil,
+ updated_at: Utils.to_masto_date(chat.updated_at)
+ }
+
+ {:ok, chat_message_creation} = CommonAPI.post_chat_message(user, recipient, "hello")
+
+ chat_message = Object.normalize(chat_message_creation, false)
+
+ {:ok, chat} = Chat.get_or_create(user.id, recipient.ap_id)
+
+ represented_chat = ChatView.render("show.json", chat: chat)
+
+ cm_ref = MessageReference.for_chat_and_object(chat, chat_message)
+
+ assert represented_chat[:last_message] ==
+ MessageReferenceView.render("show.json", chat_message_reference: cm_ref)
+ end
+end
diff --git a/test/web/preload/instance_test.exs b/test/web/preload/instance_test.exs
new file mode 100644
index 000000000..a46f28312
--- /dev/null
+++ b/test/web/preload/instance_test.exs
@@ -0,0 +1,48 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.Preload.Providers.InstanceTest do
+ use Pleroma.DataCase
+ alias Pleroma.Web.Preload.Providers.Instance
+
+ setup do: {:ok, Instance.generate_terms(nil)}
+
+ test "it renders the info", %{"/api/v1/instance" => info} do
+ assert %{
+ description: description,
+ email: "admin@example.com",
+ registrations: true
+ } = info
+
+ assert String.equivalent?(description, "Pleroma: An efficient and flexible fediverse server")
+ end
+
+ test "it renders the panel", %{"/instance/panel.html" => panel} do
+ assert String.contains?(
+ panel,
+ "Welcome to Pleroma!
"
+ )
+ end
+
+ test "it works with overrides" do
+ clear_config([:instance, :static_dir], "test/fixtures/preload_static")
+
+ %{"/instance/panel.html" => panel} = Instance.generate_terms(nil)
+
+ assert String.contains?(
+ panel,
+ "HEY!"
+ )
+ end
+
+ test "it renders the node_info", %{"/nodeinfo/2.0.json" => nodeinfo} do
+ %{
+ metadata: metadata,
+ version: "2.0"
+ } = nodeinfo
+
+ assert metadata.private == false
+ assert metadata.suggestions == %{enabled: false}
+ end
+end
diff --git a/test/web/preload/status_net_test.exs b/test/web/preload/status_net_test.exs
new file mode 100644
index 000000000..df7acdb11
--- /dev/null
+++ b/test/web/preload/status_net_test.exs
@@ -0,0 +1,15 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.Preload.Providers.StatusNetTest do
+ use Pleroma.DataCase
+ alias Pleroma.Web.Preload.Providers.StatusNet
+
+ setup do: {:ok, StatusNet.generate_terms(nil)}
+
+ test "it renders the info", %{"/api/statusnet/config.json" => info} do
+ assert {:ok, res} = Jason.decode(info)
+ assert res["site"]
+ end
+end
diff --git a/test/web/preload/timeline_test.exs b/test/web/preload/timeline_test.exs
new file mode 100644
index 000000000..fea95a6a4
--- /dev/null
+++ b/test/web/preload/timeline_test.exs
@@ -0,0 +1,74 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.Preload.Providers.TimelineTest do
+ use Pleroma.DataCase
+ import Pleroma.Factory
+
+ alias Pleroma.Web.CommonAPI
+ alias Pleroma.Web.Preload.Providers.Timelines
+
+ @public_url "/api/v1/timelines/public"
+
+ describe "unauthenticated timeliness when restricted" do
+ setup do
+ svd_config = Pleroma.Config.get([:restrict_unauthenticated, :timelines])
+ Pleroma.Config.put([:restrict_unauthenticated, :timelines], %{local: true, federated: true})
+
+ on_exit(fn ->
+ Pleroma.Config.put([:restrict_unauthenticated, :timelines], svd_config)
+ end)
+
+ :ok
+ end
+
+ test "return nothing" do
+ tl_data = Timelines.generate_terms(%{})
+
+ refute Map.has_key?(tl_data, "/api/v1/timelines/public")
+ end
+ end
+
+ describe "unauthenticated timeliness when unrestricted" do
+ setup do
+ svd_config = Pleroma.Config.get([:restrict_unauthenticated, :timelines])
+
+ Pleroma.Config.put([:restrict_unauthenticated, :timelines], %{
+ local: false,
+ federated: false
+ })
+
+ on_exit(fn ->
+ Pleroma.Config.put([:restrict_unauthenticated, :timelines], svd_config)
+ end)
+
+ {:ok, user: insert(:user)}
+ end
+
+ test "returns the timeline when not restricted" do
+ assert Timelines.generate_terms(%{})
+ |> Map.has_key?(@public_url)
+ end
+
+ test "returns public items", %{user: user} do
+ {:ok, _} = CommonAPI.post(user, %{status: "it's post 1!"})
+ {:ok, _} = CommonAPI.post(user, %{status: "it's post 2!"})
+ {:ok, _} = CommonAPI.post(user, %{status: "it's post 3!"})
+
+ assert Timelines.generate_terms(%{})
+ |> Map.fetch!(@public_url)
+ |> Enum.count() == 3
+ end
+
+ test "does not return non-public items", %{user: user} do
+ {:ok, _} = CommonAPI.post(user, %{status: "it's post 1!", visibility: "unlisted"})
+ {:ok, _} = CommonAPI.post(user, %{status: "it's post 2!", visibility: "direct"})
+ {:ok, _} = CommonAPI.post(user, %{status: "it's post 3!"})
+
+ assert Timelines.generate_terms(%{})
+ |> Map.fetch!(@public_url)
+ |> Enum.count() == 1
+ end
+ end
+end
diff --git a/test/web/preload/user_test.exs b/test/web/preload/user_test.exs
new file mode 100644
index 000000000..83f065e27
--- /dev/null
+++ b/test/web/preload/user_test.exs
@@ -0,0 +1,33 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.Preload.Providers.UserTest do
+ use Pleroma.DataCase
+ import Pleroma.Factory
+ alias Pleroma.Web.Preload.Providers.User
+
+ describe "returns empty when user doesn't exist" do
+ test "nil user specified" do
+ assert User.generate_terms(%{user: nil}) == %{}
+ end
+
+ test "missing user specified" do
+ assert User.generate_terms(%{user: :not_a_user}) == %{}
+ end
+ end
+
+ describe "specified user exists" do
+ setup do
+ user = insert(:user)
+
+ terms = User.generate_terms(%{user: user})
+ %{terms: terms, user: user}
+ end
+
+ test "account is rendered", %{terms: terms, user: user} do
+ account = terms["/api/v1/accounts/#{user.id}"]
+ assert %{acct: user, username: user} = account
+ end
+ end
+end
diff --git a/test/web/push/impl_test.exs b/test/web/push/impl_test.exs
index a826b24c9..b48952b29 100644
--- a/test/web/push/impl_test.exs
+++ b/test/web/push/impl_test.exs
@@ -5,8 +5,10 @@
defmodule Pleroma.Web.Push.ImplTest do
use Pleroma.DataCase
+ alias Pleroma.Notification
alias Pleroma.Object
alias Pleroma.User
+ alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.Push.Impl
alias Pleroma.Web.Push.Subscription
@@ -60,7 +62,8 @@ test "performs sending notifications" do
notif =
insert(:notification,
user: user,
- activity: activity
+ activity: activity,
+ type: "mention"
)
assert Impl.perform(notif) == {:ok, [:ok, :ok]}
@@ -126,7 +129,7 @@ test "renders title and body for create activity" do
) ==
"@Bob: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..."
- assert Impl.format_title(%{activity: activity}) ==
+ assert Impl.format_title(%{activity: activity, type: "mention"}) ==
"New Mention"
end
@@ -136,9 +139,10 @@ test "renders title and body for follow activity" do
{:ok, _, _, activity} = CommonAPI.follow(user, other_user)
object = Object.normalize(activity, false)
- assert Impl.format_body(%{activity: activity}, user, object) == "@Bob has followed you"
+ assert Impl.format_body(%{activity: activity, type: "follow"}, user, object) ==
+ "@Bob has followed you"
- assert Impl.format_title(%{activity: activity}) ==
+ assert Impl.format_title(%{activity: activity, type: "follow"}) ==
"New Follower"
end
@@ -157,7 +161,7 @@ test "renders title and body for announce activity" do
assert Impl.format_body(%{activity: announce_activity}, user, object) ==
"@#{user.nickname} repeated: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..."
- assert Impl.format_title(%{activity: announce_activity}) ==
+ assert Impl.format_title(%{activity: announce_activity, type: "reblog"}) ==
"New Repeat"
end
@@ -173,9 +177,10 @@ test "renders title and body for like activity" do
{:ok, activity} = CommonAPI.favorite(user, activity.id)
object = Object.normalize(activity)
- assert Impl.format_body(%{activity: activity}, user, object) == "@Bob has favorited your post"
+ assert Impl.format_body(%{activity: activity, type: "favourite"}, user, object) ==
+ "@Bob has favorited your post"
- assert Impl.format_title(%{activity: activity}) ==
+ assert Impl.format_title(%{activity: activity, type: "favourite"}) ==
"New Favorite"
end
@@ -193,6 +198,46 @@ test "renders title for create activity with direct visibility" do
end
describe "build_content/3" do
+ test "builds content for chat messages" do
+ user = insert(:user)
+ recipient = insert(:user)
+
+ {:ok, chat} = CommonAPI.post_chat_message(user, recipient, "hey")
+ object = Object.normalize(chat, false)
+ [notification] = Notification.for_user(recipient)
+
+ res = Impl.build_content(notification, user, object)
+
+ assert res == %{
+ body: "@#{user.nickname}: hey",
+ title: "New Chat Message"
+ }
+ end
+
+ test "builds content for chat messages with no content" do
+ user = insert(:user)
+ recipient = insert(:user)
+
+ file = %Plug.Upload{
+ content_type: "image/jpg",
+ path: Path.absname("test/fixtures/image.jpg"),
+ filename: "an_image.jpg"
+ }
+
+ {:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
+
+ {:ok, chat} = CommonAPI.post_chat_message(user, recipient, nil, media_id: upload.id)
+ object = Object.normalize(chat, false)
+ [notification] = Notification.for_user(recipient)
+
+ res = Impl.build_content(notification, user, object)
+
+ assert res == %{
+ body: "@#{user.nickname}: (Attachment)",
+ title: "New Chat Message"
+ }
+ end
+
test "hides details for notifications when privacy option enabled" do
user = insert(:user, nickname: "Bob")
user2 = insert(:user, nickname: "Rob", notification_settings: %{privacy_option: true})
@@ -218,7 +263,7 @@ test "hides details for notifications when privacy option enabled" do
status: "Lorem ipsum dolor sit amet, consectetur :firefox: adipiscing elit. Fusce sagittis finibus turpis."
})
- notif = insert(:notification, user: user2, activity: activity)
+ notif = insert(:notification, user: user2, activity: activity, type: "mention")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
object = Object.normalize(activity)
@@ -281,7 +326,7 @@ test "returns regular content for notifications with privacy option disabled" do
{:ok, activity} = CommonAPI.favorite(user, activity.id)
- notif = insert(:notification, user: user2, activity: activity)
+ notif = insert(:notification, user: user2, activity: activity, type: "favourite")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
object = Object.normalize(activity)
diff --git a/test/web/rich_media/parser_test.exs b/test/web/rich_media/parser_test.exs
index e54a13bc8..420a612c6 100644
--- a/test/web/rich_media/parser_test.exs
+++ b/test/web/rich_media/parser_test.exs
@@ -60,19 +60,19 @@ test "returns error when no metadata present" do
test "doesn't just add a title" do
assert Pleroma.Web.RichMedia.Parser.parse("http://example.com/non-ogp") ==
{:error,
- "Found metadata was invalid or incomplete: %{url: \"http://example.com/non-ogp\"}"}
+ "Found metadata was invalid or incomplete: %{\"url\" => \"http://example.com/non-ogp\"}"}
end
test "parses ogp" do
assert Pleroma.Web.RichMedia.Parser.parse("http://example.com/ogp") ==
{:ok,
%{
- image: "http://ia.media-imdb.com/images/rock.jpg",
- title: "The Rock",
- description:
+ "image" => "http://ia.media-imdb.com/images/rock.jpg",
+ "title" => "The Rock",
+ "description" =>
"Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed Harris, John Spencer.",
- type: "video.movie",
- url: "http://example.com/ogp"
+ "type" => "video.movie",
+ "url" => "http://example.com/ogp"
}}
end
@@ -80,12 +80,12 @@ test "falls back to when ogp:title is missing" do
assert Pleroma.Web.RichMedia.Parser.parse("http://example.com/ogp-missing-title") ==
{:ok,
%{
- image: "http://ia.media-imdb.com/images/rock.jpg",
- title: "The Rock (1996)",
- description:
+ "image" => "http://ia.media-imdb.com/images/rock.jpg",
+ "title" => "The Rock (1996)",
+ "description" =>
"Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed Harris, John Spencer.",
- type: "video.movie",
- url: "http://example.com/ogp-missing-title"
+ "type" => "video.movie",
+ "url" => "http://example.com/ogp-missing-title"
}}
end
@@ -93,12 +93,12 @@ test "parses twitter card" do
assert Pleroma.Web.RichMedia.Parser.parse("http://example.com/twitter-card") ==
{:ok,
%{
- card: "summary",
- site: "@flickr",
- image: "https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg",
- title: "Small Island Developing States Photo Submission",
- description: "View the album on Flickr.",
- url: "http://example.com/twitter-card"
+ "card" => "summary",
+ "site" => "@flickr",
+ "image" => "https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg",
+ "title" => "Small Island Developing States Photo Submission",
+ "description" => "View the album on Flickr.",
+ "url" => "http://example.com/twitter-card"
}}
end
@@ -106,27 +106,28 @@ test "parses OEmbed" do
assert Pleroma.Web.RichMedia.Parser.parse("http://example.com/oembed") ==
{:ok,
%{
- author_name: "bees",
- author_url: "https://www.flickr.com/photos/bees/",
- cache_age: 3600,
- flickr_type: "photo",
- height: "768",
- html:
+ "author_name" => "bees",
+ "author_url" => "https://www.flickr.com/photos/bees/",
+ "cache_age" => 3600,
+ "flickr_type" => "photo",
+ "height" => "768",
+ "html" =>
"",
- license: "All Rights Reserved",
- license_id: 0,
- provider_name: "Flickr",
- provider_url: "https://www.flickr.com/",
- thumbnail_height: 150,
- thumbnail_url: "https://farm4.staticflickr.com/3040/2362225867_4a87ab8baf_q.jpg",
- thumbnail_width: 150,
- title: "Bacon Lollys",
- type: "photo",
- url: "http://example.com/oembed",
- version: "1.0",
- web_page: "https://www.flickr.com/photos/bees/2362225867/",
- web_page_short_url: "https://flic.kr/p/4AK2sc",
- width: "1024"
+ "license" => "All Rights Reserved",
+ "license_id" => 0,
+ "provider_name" => "Flickr",
+ "provider_url" => "https://www.flickr.com/",
+ "thumbnail_height" => 150,
+ "thumbnail_url" =>
+ "https://farm4.staticflickr.com/3040/2362225867_4a87ab8baf_q.jpg",
+ "thumbnail_width" => 150,
+ "title" => "Bacon Lollys",
+ "type" => "photo",
+ "url" => "http://example.com/oembed",
+ "version" => "1.0",
+ "web_page" => "https://www.flickr.com/photos/bees/2362225867/",
+ "web_page_short_url" => "https://flic.kr/p/4AK2sc",
+ "width" => "1024"
}}
end
diff --git a/test/web/rich_media/parsers/twitter_card_test.exs b/test/web/rich_media/parsers/twitter_card_test.exs
index 87c767c15..219f005a2 100644
--- a/test/web/rich_media/parsers/twitter_card_test.exs
+++ b/test/web/rich_media/parsers/twitter_card_test.exs
@@ -7,8 +7,7 @@ defmodule Pleroma.Web.RichMedia.Parsers.TwitterCardTest do
alias Pleroma.Web.RichMedia.Parsers.TwitterCard
test "returns error when html not contains twitter card" do
- assert TwitterCard.parse([{"html", [], [{"head", [], []}, {"body", [], []}]}], %{}) ==
- {:error, "No twitter card metadata found"}
+ assert TwitterCard.parse([{"html", [], [{"head", [], []}, {"body", [], []}]}], %{}) == %{}
end
test "parses twitter card with only name attributes" do
@@ -17,15 +16,21 @@ test "parses twitter card with only name attributes" do
|> Floki.parse_document!()
assert TwitterCard.parse(html, %{}) ==
- {:ok,
- %{
- "app:id:googleplay": "com.nytimes.android",
- "app:name:googleplay": "NYTimes",
- "app:url:googleplay": "nytimes://reader/id/100000006583622",
- site: nil,
- title:
- "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database. - The New York Times"
- }}
+ %{
+ "app:id:googleplay" => "com.nytimes.android",
+ "app:name:googleplay" => "NYTimes",
+ "app:url:googleplay" => "nytimes://reader/id/100000006583622",
+ "site" => nil,
+ "description" =>
+ "With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers.",
+ "image" =>
+ "https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-facebookJumbo.jpg",
+ "type" => "article",
+ "url" =>
+ "https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html",
+ "title" =>
+ "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database."
+ }
end
test "parses twitter card with only property attributes" do
@@ -34,19 +39,19 @@ test "parses twitter card with only property attributes" do
|> Floki.parse_document!()
assert TwitterCard.parse(html, %{}) ==
- {:ok,
- %{
- card: "summary_large_image",
- description:
- "With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers.",
- image:
- "https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-videoSixteenByNineJumbo1600.jpg",
- "image:alt": "",
- title:
- "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database.",
- url:
- "https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html"
- }}
+ %{
+ "card" => "summary_large_image",
+ "description" =>
+ "With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers.",
+ "image" =>
+ "https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-videoSixteenByNineJumbo1600.jpg",
+ "image:alt" => "",
+ "title" =>
+ "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database.",
+ "url" =>
+ "https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html",
+ "type" => "article"
+ }
end
test "parses twitter card with name & property attributes" do
@@ -55,23 +60,23 @@ test "parses twitter card with name & property attributes" do
|> Floki.parse_document!()
assert TwitterCard.parse(html, %{}) ==
- {:ok,
- %{
- "app:id:googleplay": "com.nytimes.android",
- "app:name:googleplay": "NYTimes",
- "app:url:googleplay": "nytimes://reader/id/100000006583622",
- card: "summary_large_image",
- description:
- "With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers.",
- image:
- "https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-videoSixteenByNineJumbo1600.jpg",
- "image:alt": "",
- site: nil,
- title:
- "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database.",
- url:
- "https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html"
- }}
+ %{
+ "app:id:googleplay" => "com.nytimes.android",
+ "app:name:googleplay" => "NYTimes",
+ "app:url:googleplay" => "nytimes://reader/id/100000006583622",
+ "card" => "summary_large_image",
+ "description" =>
+ "With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers.",
+ "image" =>
+ "https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-videoSixteenByNineJumbo1600.jpg",
+ "image:alt" => "",
+ "site" => nil,
+ "title" =>
+ "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database.",
+ "url" =>
+ "https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html",
+ "type" => "article"
+ }
end
test "respect only first title tag on the page" do
@@ -84,14 +89,17 @@ test "respect only first title tag on the page" do
File.read!("test/fixtures/margaret-corbin-grave-west-point.html") |> Floki.parse_document!()
assert TwitterCard.parse(html, %{}) ==
- {:ok,
- %{
- site: "@atlasobscura",
- title:
- "The Missing Grave of Margaret Corbin, Revolutionary War Veteran - Atlas Obscura",
- card: "summary_large_image",
- image: image_path
- }}
+ %{
+ "site" => "@atlasobscura",
+ "title" => "The Missing Grave of Margaret Corbin, Revolutionary War Veteran",
+ "card" => "summary_large_image",
+ "image" => image_path,
+ "description" =>
+ "She's the only woman veteran honored with a monument at West Point. But where was she buried?",
+ "site_name" => "Atlas Obscura",
+ "type" => "article",
+ "url" => "http://www.atlasobscura.com/articles/margaret-corbin-grave-west-point"
+ }
end
test "takes first founded title in html head if there is html markup error" do
@@ -100,14 +108,20 @@ test "takes first founded title in html head if there is html markup error" do
|> Floki.parse_document!()
assert TwitterCard.parse(html, %{}) ==
- {:ok,
- %{
- site: nil,
- title:
- "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database. - The New York Times",
- "app:id:googleplay": "com.nytimes.android",
- "app:name:googleplay": "NYTimes",
- "app:url:googleplay": "nytimes://reader/id/100000006583622"
- }}
+ %{
+ "site" => nil,
+ "title" =>
+ "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database.",
+ "app:id:googleplay" => "com.nytimes.android",
+ "app:name:googleplay" => "NYTimes",
+ "app:url:googleplay" => "nytimes://reader/id/100000006583622",
+ "description" =>
+ "With little oversight, the N.Y.P.D. has been using powerful surveillance technology on photos of children and teenagers.",
+ "image" =>
+ "https://static01.nyt.com/images/2019/08/01/nyregion/01nypd-juveniles-promo/01nypd-juveniles-promo-facebookJumbo.jpg",
+ "type" => "article",
+ "url" =>
+ "https://www.nytimes.com/2019/08/01/nyregion/nypd-facial-recognition-children-teenagers.html"
+ }
end
end
diff --git a/test/web/streamer/streamer_test.exs b/test/web/streamer/streamer_test.exs
index 4cf640ce8..245f6e63f 100644
--- a/test/web/streamer/streamer_test.exs
+++ b/test/web/streamer/streamer_test.exs
@@ -7,11 +7,15 @@ defmodule Pleroma.Web.StreamerTest do
import Pleroma.Factory
+ alias Pleroma.Chat
+ alias Pleroma.Chat.MessageReference
alias Pleroma.Conversation.Participation
alias Pleroma.List
+ alias Pleroma.Object
alias Pleroma.User
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.Streamer
+ alias Pleroma.Web.StreamerView
@moduletag needs_streamer: true, capture_log: true
@@ -124,7 +128,7 @@ test "it streams boosts of mastodon user in the 'user' stream", %{user: user} do
|> Map.put("object", activity.data["object"])
|> Map.put("actor", user.ap_id)
- {:ok, %Pleroma.Activity{data: data, local: false} = announce} =
+ {:ok, %Pleroma.Activity{data: _data, local: false} = announce} =
Pleroma.Web.ActivityPub.Transmogrifier.handle_incoming(data)
assert_receive {:render_with_user, Pleroma.Web.StreamerView, "update.json", ^announce}
@@ -145,6 +149,57 @@ test "it sends notify to in the 'user:notification' stream", %{user: user, notif
refute Streamer.filtered_by_user?(user, notify)
end
+ test "it sends chat messages to the 'user:pleroma_chat' stream", %{user: user} do
+ other_user = insert(:user)
+
+ {:ok, create_activity} = CommonAPI.post_chat_message(other_user, user, "hey cirno")
+ object = Object.normalize(create_activity, false)
+ chat = Chat.get(user.id, other_user.ap_id)
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+ cm_ref = %{cm_ref | chat: chat, object: object}
+
+ Streamer.get_topic_and_add_socket("user:pleroma_chat", user)
+ Streamer.stream("user:pleroma_chat", {user, cm_ref})
+
+ text = StreamerView.render("chat_update.json", %{chat_message_reference: cm_ref})
+
+ assert text =~ "hey cirno"
+ assert_receive {:text, ^text}
+ end
+
+ test "it sends chat messages to the 'user' stream", %{user: user} do
+ other_user = insert(:user)
+
+ {:ok, create_activity} = CommonAPI.post_chat_message(other_user, user, "hey cirno")
+ object = Object.normalize(create_activity, false)
+ chat = Chat.get(user.id, other_user.ap_id)
+ cm_ref = MessageReference.for_chat_and_object(chat, object)
+ cm_ref = %{cm_ref | chat: chat, object: object}
+
+ Streamer.get_topic_and_add_socket("user", user)
+ Streamer.stream("user", {user, cm_ref})
+
+ text = StreamerView.render("chat_update.json", %{chat_message_reference: cm_ref})
+
+ assert text =~ "hey cirno"
+ assert_receive {:text, ^text}
+ end
+
+ test "it sends chat message notifications to the 'user:notification' stream", %{user: user} do
+ other_user = insert(:user)
+
+ {:ok, create_activity} = CommonAPI.post_chat_message(other_user, user, "hey")
+
+ notify =
+ Repo.get_by(Pleroma.Notification, user_id: user.id, activity_id: create_activity.id)
+ |> Repo.preload(:activity)
+
+ Streamer.get_topic_and_add_socket("user:notification", user)
+ Streamer.stream("user:notification", notify)
+ assert_receive {:render_with_user, _, _, ^notify}
+ refute Streamer.filtered_by_user?(user, notify)
+ end
+
test "it doesn't send notify to the 'user:notification' stream when a user is blocked", %{
user: user
} do
diff --git a/test/workers/cron/purge_expired_activities_worker_test.exs b/test/workers/cron/purge_expired_activities_worker_test.exs
index 5864f9e5f..b1db59fdf 100644
--- a/test/workers/cron/purge_expired_activities_worker_test.exs
+++ b/test/workers/cron/purge_expired_activities_worker_test.exs
@@ -11,7 +11,9 @@ defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorkerTest do
import Pleroma.Factory
import ExUnit.CaptureLog
- setup do: clear_config([ActivityExpiration, :enabled])
+ setup do
+ clear_config([ActivityExpiration, :enabled])
+ end
test "deletes an expiration activity" do
Pleroma.Config.put([ActivityExpiration, :enabled], true)
@@ -36,6 +38,32 @@ test "deletes an expiration activity" do
refute Pleroma.Repo.get(Pleroma.ActivityExpiration, expiration.id)
end
+ test "works with ActivityExpirationPolicy" do
+ Pleroma.Config.put([ActivityExpiration, :enabled], true)
+
+ clear_config([:mrf, :policies], Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy)
+
+ user = insert(:user)
+
+ days = Pleroma.Config.get([:mrf_activity_expiration, :days], 365)
+
+ {:ok, %{id: id} = activity} = Pleroma.Web.CommonAPI.post(user, %{status: "cofe"})
+
+ past_date =
+ NaiveDateTime.utc_now() |> Timex.shift(days: -days) |> NaiveDateTime.truncate(:second)
+
+ activity
+ |> Repo.preload(:expiration)
+ |> Map.get(:expiration)
+ |> Ecto.Changeset.change(%{scheduled_at: past_date})
+ |> Repo.update!()
+
+ Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker.perform(:ops, :pid)
+
+ assert [%{data: %{"type" => "Delete", "deleted_activity_id" => ^id}}] =
+ Pleroma.Repo.all(Pleroma.Activity)
+ end
+
describe "delete_activity/1" do
test "adds log message if activity isn't find" do
assert capture_log([level: :error], fn ->