moderator-toolbox-nxg-for-reddit / modules/shared/usernotes/messageLinkCache
modules/shared/usernotes/messageLinkCache¶
Functions¶
clearMessageLinks()¶
clearMessageLinks():
void
Defined in: extension/data/modules/shared/usernotes/messageLinkCache.ts:67
Clears all cached message links (for tests).
Returns¶
void
getMessageLink()¶
getMessageLink(
permalink):string|undefined
Defined in: extension/data/modules/shared/usernotes/messageLinkCache.ts:61
Looks up the removal message URL recorded for a thing this page session.
Parameters¶
permalink¶
string
Any permalink form of the thing.
Returns¶
string | undefined
The message URL, or undefined when none was recorded.
normalizePermalinkKey()¶
normalizePermalinkKey(
permalink):string
Defined in: extension/data/modules/shared/usernotes/messageLinkCache.ts:25
Normalizes a permalink into a stable cache key. Permalinks for the same thing arrive in different shapes depending on the source (absolute vs subreddit-relative, with or without a trailing slash), so the key is the lowercased pathname with no trailing slash.
Parameters¶
permalink¶
string
Absolute URL or site-relative path; empty input yields ‘’.
Returns¶
string
rememberMessageLink()¶
rememberMessageLink(
permalinks,messageLink):void
Defined in: extension/data/modules/shared/usernotes/messageLinkCache.ts:48
Records the removal message URL for a removed thing, so later note creation can look it up by any permalink form of that thing.
Parameters¶
permalinks¶
(string | undefined)[]
Permalinks identifying the removed thing (e.g. the comment permalink and its parent post link); falsy entries are skipped.
messageLink¶
string
Full URL of the modmail conversation.
Returns¶
void