MCPcopy Create free account
hub / github.com/MathMan05/Fermi / updateStatus

Method updateStatus

src/webpage/user.ts:850–884  ·  view source on GitHub ↗
(status: HTMLDivElement)

Source from the content-addressed store, hash-verified

848 status.classList.remove("offlinestatus", "dndstatus", "onlinestatus", "typingstatus");
849 switch (this.getStatus()) {
850 case "offline":
851 case "invisible":
852 status.classList.add("offlinestatus");
853 break;
854 case "dnd":
855 status.classList.add("dndstatus");
856 break;
857 case "online":
858 default:
859 status.classList.add("onlinestatus");
860 break;
861 }
862 const m = this.contextMap.get(status);
863 if (m) {
864 let guild: Guild;
865 let channel: Channel | void = undefined;
866 if ("guild" in m) {
867 channel = m;
868 guild = m.guild;
869 } else {
870 guild = m;
871 }
872 const memb = this.members.get(guild);
873 if (memb && !(memb instanceof Promise) && channel) {
874 const typing = channel.typingmap.get(memb);
875
876 if (typing) {
877 status.classList.add("typingstatus");
878 }
879 }
880 }
881 }
882 statusChange() {
883 let has = false;
884 for (const ref of this.updateStatusSet) {
885 const elm = ref.deref();
886 if (!elm || !document.body.contains(elm)) {
887 this.updateStatusSet.delete(ref);

Callers 2

registerStatusMethod · 0.95
statusChangeMethod · 0.95

Calls 3

getStatusMethod · 0.95
addMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected