From 72ac78bca79873a9d3a476700da2337f1474b91f Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Tue, 7 Aug 2018 21:31:18 +0200 Subject: [PATCH] Output @ in channel change-log messages --- sam/service/channel.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sam/service/channel.go b/sam/service/channel.go index c7fcfddc9..1cd9ddd7c 100644 --- a/sam/service/channel.go +++ b/sam/service/channel.go @@ -143,8 +143,8 @@ func (svc channel) Create(ctx context.Context, in *types.Channel) (out *types.Ch // message service constraints msg, err = r.CreateMessage(svc.makeSystemMessage( out, - "%s created new %s channel, topic is: %s", - "", + "@%d created new %s channel, topic is: %s", + chCreatorID, "", "")) @@ -176,7 +176,7 @@ func (svc channel) Update(ctx context.Context, in *types.Channel) (out *types.Ch return errors.New("Not allowed to edit deleted channels") } - // var chCreatorID = auth.GetIdentityFromContext(ctx).Identity() + var chUpdatorId = auth.GetIdentityFromContext(ctx).Identity() // Copy values if out.Name != in.Name { @@ -185,7 +185,7 @@ func (svc channel) Update(ctx context.Context, in *types.Channel) (out *types.Ch return errors.New("Not allowed to rename channel") } else { msgs = append(msgs, svc.makeSystemMessage( - out, "%s renamed channel %s (was: %s)", "", out.Name, in.Name)) + out, "@%d renamed channel %s (was: %s)", chUpdatorId, out.Name, in.Name)) } out.Name = in.Name } @@ -196,7 +196,7 @@ func (svc channel) Update(ctx context.Context, in *types.Channel) (out *types.Ch return errors.New("Not allowed to change channel topic") } else { msgs = append(msgs, svc.makeSystemMessage( - out, "%s changed channel topic: %s (was: %s)", "", out.Topic, in.Topic)) + out, "@%d changed channel topic: %s (was: %s)", chUpdatorId, out.Topic, in.Topic)) } out.Topic = in.Topic