MCPcopy Index your code
hub / github.com/tinode/chat / subMsg

Function subMsg

tn-cli/commands.py:155–170  ·  view source on GitHub ↗
(id, cmd, ignored)

Source from the content-addressed store, hash-verified

153
154# {sub}
155def subMsg(id, cmd, ignored):
156 if not cmd.topic:
157 cmd.topic = tn_globals.DefaultTopic
158 if cmd.get_query:
159 cmd.get_query = pb.GetQuery(what=" ".join(cmd.get_query.split(",")))
160 cmd.public = encode_to_bytes(makeTheCard(cmd.fn, cmd.note, cmd.photo))
161 cmd.private = TINODE_DEL if cmd.private == DELETE_MARKER else encode_to_bytes(cmd.private)
162 return pb.ClientMsg(sub=pb.ClientSub(id=str(id), topic=cmd.topic,
163 set_query=pb.SetQuery(
164 desc=pb.SetDesc(public=cmd.public, private=cmd.private,
165 trusted=encode_to_bytes(parse_trusted(cmd.trusted)),
166 default_acs=pb.DefaultAcsMode(auth=cmd.auth, anon=cmd.anon)),
167 sub=pb.SetSub(mode=cmd.mode),
168 tags=cmd.tags.split(",") if cmd.tags else None),
169 get_query=cmd.get_query),
170 extra=pack_extra(cmd))
171
172
173# {leave}

Callers

nothing calls this directly

Calls 5

encode_to_bytesFunction · 0.90
makeTheCardFunction · 0.90
parse_trustedFunction · 0.90
pack_extraFunction · 0.85
GetQueryMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…