| 150 | var DefaultReactions = []string{"👍", "👎", "❤️", "🎉", "😄", "😕", "😢", "😡"} |
| 151 | |
| 152 | func (s *Store) GetInstanceMemoRelatedSetting(ctx context.Context) (*storepb.InstanceMemoRelatedSetting, error) { |
| 153 | instanceSetting, err := s.GetInstanceSetting(ctx, &FindInstanceSetting{ |
| 154 | Name: storepb.InstanceSettingKey_MEMO_RELATED.String(), |
| 155 | }) |
| 156 | if err != nil { |
| 157 | return nil, errors.Wrap(err, "failed to get instance general setting") |
| 158 | } |
| 159 | |
| 160 | instanceMemoRelatedSetting := &storepb.InstanceMemoRelatedSetting{} |
| 161 | if instanceSetting != nil { |
| 162 | instanceMemoRelatedSetting = instanceSetting.GetMemoRelatedSetting() |
| 163 | } |
| 164 | if instanceMemoRelatedSetting.ContentLengthLimit < DefaultContentLengthLimit { |
| 165 | instanceMemoRelatedSetting.ContentLengthLimit = DefaultContentLengthLimit |
| 166 | } |
| 167 | if len(instanceMemoRelatedSetting.Reactions) == 0 { |
| 168 | instanceMemoRelatedSetting.Reactions = append(instanceMemoRelatedSetting.Reactions, DefaultReactions...) |
| 169 | } |
| 170 | s.instanceSettingCache.Set(ctx, storepb.InstanceSettingKey_MEMO_RELATED.String(), &storepb.InstanceSetting{ |
| 171 | Key: storepb.InstanceSettingKey_MEMO_RELATED, |
| 172 | Value: &storepb.InstanceSetting_MemoRelatedSetting{MemoRelatedSetting: instanceMemoRelatedSetting}, |
| 173 | }) |
| 174 | return instanceMemoRelatedSetting, nil |
| 175 | } |
| 176 | |
| 177 | func (s *Store) GetInstanceTagsSetting(ctx context.Context) (*storepb.InstanceTagsSetting, error) { |
| 178 | instanceSetting, err := s.GetInstanceSetting(ctx, &FindInstanceSetting{ |