You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
rip out unused mkPresence
it only serves to make the strict type checker complain
This commit is contained in:
@ -315,29 +315,6 @@ export function mkEvent(opts: MakeEventProps): MatrixEvent {
|
|||||||
return mxEvent;
|
return mxEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an m.presence event.
|
|
||||||
* @param {Object} opts Values for the presence.
|
|
||||||
* @return {Object|MatrixEvent} The event
|
|
||||||
*/
|
|
||||||
export function mkPresence(opts) {
|
|
||||||
if (!opts.user) {
|
|
||||||
throw new Error("Missing user");
|
|
||||||
}
|
|
||||||
const event = {
|
|
||||||
event_id: "$" + Math.random() + "-" + Math.random(),
|
|
||||||
type: "m.presence",
|
|
||||||
sender: opts.user,
|
|
||||||
content: {
|
|
||||||
avatar_url: opts.url,
|
|
||||||
displayname: opts.name,
|
|
||||||
last_active_ago: opts.ago,
|
|
||||||
presence: opts.presence || "offline",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return opts.event ? new MatrixEvent(event) : event;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an m.room.member event.
|
* Create an m.room.member event.
|
||||||
* @param {Object} opts Values for the membership.
|
* @param {Object} opts Values for the membership.
|
||||||
|
Reference in New Issue
Block a user