You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
26 KiB

  1. (()=>{var e,s,a,n={15340:()=>{},33114:(t,e,s)=>{"use strict";s.d(e,{A:()=>i});var a=s(85168),n=s(53334),r=s(95353),o=s(45369);const i={computed:{...(0,r.aH)({statusType:t=>t.userStatus.status,statusIsUserDefined:t=>t.userStatus.statusIsUserDefined,customIcon:t=>t.userStatus.icon,customMessage:t=>t.userStatus.message}),visibleMessage(){if(this.customIcon&&this.customMessage)return`${this.customIcon} ${this.customMessage}`;if(this.customMessage)return this.customMessage;if(this.statusIsUserDefined)switch(this.statusType){case"online":return(0,n.t)("user_status","Online");case"away":case"busy":return(0,n.t)("user_status","Away");case"dnd":return(0,n.t)("user_status","Do not disturb");case"invisible":return(0,n.t)("user_status","Invisible");case"offline":return(0,n.t)("user_status","Offline")}return(0,n.t)("user_status","Set status")}},methods:{async changeStatus(t){try{await this.$store.dispatch("setStatus",{statusType:t})}catch(t){(0,a.Qg)((0,n.t)("user_status","There was an error saving the new status")),o.v.debug(t)}}}}},45369:(t,e,s)=>{"use strict";s.d(e,{v:()=>a});const a=(0,s(35947).YK)().detectLogLevel().setApp("user_status").build()},47790:()=>{},51069:()=>{},53611:(t,e,s)=>{"use strict";s.d(e,{A:()=>a.N});var a=s(12318)},61913:(t,e,s)=>{"use strict";function a(){return new Date}s.d(e,{R:()=>a})},63779:()=>{},64688:()=>{},66089:()=>{},67789:(t,e,s)=>{"use strict";s.d(e,{A:()=>i});var a=s(71354),n=s.n(a),r=s(76314),o=s.n(r)()(n());o.push([t.id,".user-status-icon[data-v-3ecfc87b]{width:20px;height:20px;margin:calc((var(--default-clickable-area) - 20px)/2);opacity:1 !important;background-size:20px;vertical-align:middle !important}","",{version:3,sources:["webpack://./apps/user_status/src/UserStatus.vue"],names:[],mappings:"AACA,mCACC,UAAA,CACA,WAAA,CACA,qDAAA,CACA,oBAAA,CACA,oBAAA,CACA,gCAAA",sourcesContent:["\n.user-status-icon {\n\twidth: 20px;\n\theight: 20px;\n\tmargin: calc((var(--default-clickable-area) - 20px) / 2); // 20px icon size\n\topacity: 1 !important;\n\tbackground-size: 20px;\n\tvertical-align: middle !important;\n}\n"],sourceRoot:""}]);const i=o},73776:()=>{},77199:()=>{},77965:()=>{},78982:()=>{},79368:()=>{},79838:()=>{},82495:(e,s,a)=>{"use strict";var n=a(21777),r=a(61338),o=a(85471),i=a(17334),u=a.n(i),c=a(54914),l=a(74095),d=a(1522),f=a(53611),p=a(45369),m=a(33114),h=a(19051),g=a(63814);const v={name:"UserStatus",components:{Fragment:c.F,NcButton:l.A,NcListItem:d.A,NcUserStatusIcon:f.A,SetStatusModal:()=>Promise.all([a.e(4208),a.e(5133)]).then(a.bind(a,25750))},mixins:[m.A],props:{inline:{type:Boolean,default:!1}},data:()=>({heartbeatInterval:null,isAway:!1,isModalOpen:!1,mouseMoveListener:null,setAwayTimeout:null}),mounted(){this.$store.dispatch("loadStatusFromInitialState"),OC.config.session_keepalive&&(this.heartbeatInterval=setInterval(this._backgroundHeartbeat.bind(this),3e5),this.setAwayTimeout=()=>{this.isAway=!0},this.mouseMoveListener=u()(()=>{const t=this.isAway;this.isAway=!1,clearTimeout(this.setAwayTimeout),setTimeout(this.setAwayTimeout,12e4),t&&this._backgroundHeartbeat()},2e3,!0),window.addEventListener("mousemove",this.mouseMoveListener,{capture:!0,passive:!0}),this._backgroundHeartbeat()),(0,r.B1)("user_status:status.updated",this.handleUserStatusUpdated)},beforeDestroy(){window.removeEventListener("mouseMove",this.mouseMoveListener),clearInterval(this.heartbeatInterval),(0,r.al)("user_status:status.updated",this.handleUserStatusUpdated)},methods:{openModal(){this.isModalOpen=!0},closeModal(){this.isModalOpen=!1},async _backgroundHeartbeat(){try{const t=await async function(t){const e=(0,g.KT)("apps/user_status/api/v1/heartbeat?format=json");return(await h.Ay.put(e,{status:t?"away":"online"})).data.ocs.data}(this.isAway);t?.userId?this.$store.dispatch("setStatusFromHeartbeat",t):await this.$store.dispatch("reFetchStatusFromServer")}catch(t){p.v.debug("Failed sending heartbeat, got: "+t.response?.status)}},handleUserStatusUpdated(t){(0,n.HW)()?.uid===t.userId&&this.$store.dispatch("setStatusFromObject",{status:t.status,icon:t.icon,message:t.message})}}};var y=a(85072),b=a.n(y),_
  2. //# sourceMappingURL=user_status-menu.js.map?v=a5d4208d0a8b7975bce2