def setMsg(id, topic, user, fn, photo, private, auth, anon, mode): return pb.ClientMsg(set=pb.ClientSet( id=str(id), topic=topic, query=pb.SetQuery(desc=pb.SetDesc(default_acs=pb.DefaultAcsMode( auth=auth, anon=anon), public=make_vcard(fn, photo), private=private), sub=pb.SetSub(user_id=user, mode=mode))))
def subMsg(id, topic, fn, photo, private, auth, anon, mode, tags, get_query): if get_query: get_query = pb.GetQuery(what=get_query.split(",").join(" ")) public = encode_to_bytes(make_vcard(fn, photo)) private = encode_to_bytes(private) return pb.ClientMsg(sub=pb.ClientSub(id=str(id), topic=topic, set_query=pb.SetQuery( desc=pb.SetDesc(public=public, private=private, default_acs=pb.DefaultAcsMode(auth=auth, anon=anon)), sub=pb.SetSub(mode=mode), tags=tags.split(",") if tags else None), get_query=get_query))
def setMsg(id, topic, user, fn, photo, public, private, auth, anon, mode, tags): if public == None: public = encode_to_bytes(make_vcard(fn, photo)) else: public = encode_to_bytes(public) private = encode_to_bytes(private) return pb.ClientMsg(set=pb.ClientSet(id=str(id), topic=topic, query=pb.SetQuery( desc=pb.SetDesc(default_acs=pb.DefaultAcsMode(auth=auth, anon=anon), public=public, private=private), sub=pb.SetSub(user_id=user, mode=mode), tags=tags)))