(ctx context.Context, msgMeta *module.MsgMetadata)
| 68 | } |
| 69 | |
| 70 | func (g *Group) ModStateForMsg(ctx context.Context, msgMeta *module.MsgMetadata) (module.ModifierState, error) { |
| 71 | gs := groupState{} |
| 72 | for _, modifier := range g.Modifiers { |
| 73 | state, err := modifier.ModStateForMsg(ctx, msgMeta) |
| 74 | if err != nil { |
| 75 | // Free state objects we initialized already. |
| 76 | for _, state := range gs.states { |
| 77 | if err := state.Close(); err != nil { |
| 78 | log.DefaultLogger.Error("failed to close modifier state", err) |
| 79 | } |
| 80 | } |
| 81 | return nil, err |
| 82 | } |
| 83 | gs.states = append(gs.states, state) |
| 84 | } |
| 85 | return gs, nil |
| 86 | } |
| 87 | |
| 88 | func (gs groupState) RewriteSender(ctx context.Context, mailFrom string) (string, error) { |
| 89 | var err error |
nothing calls this directly
no test coverage detected