Skip to main content

author_of

Function author_of 

Source
async fn author_of(
    host: &dyn SlackHost,
    api: &dyn SlackApi,
    workspace: &str,
    message: &SlackHistoryMessage,
    names: &mut HashMap<String, Option<String>>,
    own: &mut OwnIdentity<'_>,
) -> Result<Option<String>, SlackError>
Expand description

The name to show for a message’s author, asked once per user per conversation, or None when no name is known - the block drops the clause rather than printing a raw id.

The conversation owns the memo so the same author costs one lookup however many messages he sent; the host owns the longer memory, because a name is worth keeping across sweeps. What the host keeps is only what Slack settled: that a user has no name, or none worth showing. A lookup that failed for any other reason - a dead socket, a 5xx, a throttled call - says nothing about the user, so it is not remembered and the next message asks again.