User attached to !me topic, get the current state of topics he is interested in
()
| 1038 | |
| 1039 | // User attached to !me topic, get the current state of topics he is interested in |
| 1040 | func (me *Topic) presSnapshot() error { |
| 1041 | subs, err := store.Users.GetSubs(me.appid, me.owner, nil) |
| 1042 | if err != nil { |
| 1043 | log.Println("Presence: topic me: error loading user's subscriptions ", err) |
| 1044 | return err |
| 1045 | } |
| 1046 | |
| 1047 | var count = 0 |
| 1048 | if len(subs) > 0 { |
| 1049 | list := make([]string, len(subs)) |
| 1050 | |
| 1051 | for _, sub := range subs { |
| 1052 | if (sub.ModeGiven & sub.ModeWant & types.ModePres) != 0 { |
| 1053 | list = append(list, sub.Topic) |
| 1054 | count++ |
| 1055 | } |
| 1056 | } |
| 1057 | |
| 1058 | if count > 0 { |
| 1059 | |
| 1060 | } |
| 1061 | } |
| 1062 | |
| 1063 | return nil |
| 1064 | } |
| 1065 | |
| 1066 | func msgOpts2storeOpts(req *MsgBrowseOpts, tag string, lastSeen time.Time) *types.BrowseOpt { |
| 1067 | var opts *types.BrowseOpt |
no test coverage detected