Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
229
mentioner.go1.08 kB
package mentioner import ( "context" "log/slog" "github.com/Southclaws/storyden/app/resources/account" "github.com/Southclaws/storyden/app/resources/datagraph" "github.com/Southclaws/storyden/app/resources/message" "github.com/Southclaws/storyden/app/services/authentication/session" "github.com/Southclaws/storyden/internal/infrastructure/pubsub" ) type Mentioner struct { logger *slog.Logger bus *pubsub.Bus } func New(logger *slog.Logger, bus *pubsub.Bus) *Mentioner { return &Mentioner{logger: logger, bus: bus} } func (n *Mentioner) Send(ctx context.Context, by account.AccountID, source datagraph.Ref, items ...*datagraph.Ref) { sender, err := session.GetAccountID(ctx) if err != nil { n.logger.Warn("cannot send notification without source session", slog.String("error", err.Error())) return } for _, i := range items { if i.Kind == datagraph.KindProfile && sender == account.AccountID(i.ID) { // Skip self-mentions continue } n.bus.Publish(ctx, &message.EventMemberMentioned{ By: by, Source: source, Item: *i, }) } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server