handleMeta implements logic handling meta requests received via the Topic.meta channel.
(msg *ClientComMessage)
| 461 | // handleMeta implements logic handling meta requests |
| 462 | // received via the Topic.meta channel. |
| 463 | func (t *Topic) handleMeta(msg *ClientComMessage) { |
| 464 | // Request to get/set topic metadata |
| 465 | asUid := types.ParseUserId(msg.AsUser) |
| 466 | authLevel := auth.Level(msg.AuthLvl) |
| 467 | asChan, err := t.verifyChannelAccess(msg.Original) |
| 468 | if err != nil { |
| 469 | // User should not be able to address non-channel topic as channel. |
| 470 | msg.sess.queueOut(ErrNotFoundReply(msg, types.TimeNow())) |
| 471 | return |
| 472 | } |
| 473 | switch { |
| 474 | case msg.Get != nil: |
| 475 | // Get request |
| 476 | t.handleMetaGet(msg, asUid, asChan, authLevel) |
| 477 | |
| 478 | case msg.Set != nil: |
| 479 | // Set request |
| 480 | t.handleMetaSet(msg, asUid, asChan, authLevel) |
| 481 | |
| 482 | case msg.Del != nil: |
| 483 | // Del request |
| 484 | t.handleMetaDel(msg, asUid, asChan, authLevel) |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | func (t *Topic) handleSessionUpdate(upd *sessionUpdate, currentUA *string, uaTimer *time.Timer) { |
| 489 | if upd.sess != nil { |