replyGetAux returns topic's auxiliary set of key-value pairs.
(sess *Session, asUid types.Uid, msg *ClientComMessage)
| 3072 | |
| 3073 | // replyGetAux returns topic's auxiliary set of key-value pairs. |
| 3074 | func (t *Topic) replyGetAux(sess *Session, asUid types.Uid, msg *ClientComMessage) error { |
| 3075 | now := types.TimeNow() |
| 3076 | |
| 3077 | if t.cat != types.TopicCatP2P && t.cat != types.TopicCatGrp && t.cat != types.TopicCatSlf { |
| 3078 | sess.queueOut(ErrOperationNotAllowedReply(msg, now)) |
| 3079 | return errors.New("invalid topic category to query aux") |
| 3080 | } |
| 3081 | |
| 3082 | if len(t.aux) > 0 { |
| 3083 | sess.queueOut(&ServerComMessage{ |
| 3084 | Meta: &MsgServerMeta{ |
| 3085 | Id: msg.Id, |
| 3086 | Topic: t.original(asUid), |
| 3087 | Timestamp: &now, |
| 3088 | Aux: t.aux, |
| 3089 | }, |
| 3090 | }) |
| 3091 | return nil |
| 3092 | } |
| 3093 | |
| 3094 | // Inform the requester that there are no tags. |
| 3095 | sess.queueOut(NoContentParamsReply(msg, now, map[string]string{"what": "aux"})) |
| 3096 | |
| 3097 | return nil |
| 3098 | } |
| 3099 | |
| 3100 | // replyGetAux returns topic's auxiliary set of key-value pairs. |
| 3101 | func (t *Topic) replySetAux(sess *Session, asUid types.Uid, msg *ClientComMessage) error { |
no test coverage detected