The way to edit user tags and desc by root user

51 views
Skip to first unread message

Dmitry Markelov

unread,
Jan 18, 2022, 11:09:39 AM1/18/22
to Tinode General
Hello everyone!

Is there any way to edit user's tags and desc by root user?
I try to do it like this, but I'm getting the error.

Request from client:
acc {
id: "37129"
user_id: "usr3mc90Ta_jAQ"
tags: "basic:+79147777890"
tags: "test_1"
}

Response from server:
ctrl {
id: "37129"
code: 400
text: "malformed"
}

Server logs:
2022/01/17 15:47:39 grpc in: acc:<id:"37129" user_id:"usr3mc90Ta_jAQ" tags:"basic:+79147777890" tags:"test_1" > j3ctkkdXj9g
2022/01/17 15:47:39 replyUpdateUser: failed to update user malformed j3ctkkdXj9g


Dmitry Markelov

unread,
Jan 19, 2022, 1:18:38 AM1/19/22
to Tinode General
I've found the solution.

You can't use "acc" message to edit tags or desc, but you can use "set" message with the attribute on_behalf_of.
It helps you to edit tags for user using root user.

For instance

set {
  id: "38969"
  topic: "me"
  query {
    tags: "basic:+79136000110"
    tags: "pes_1"
  }
}
on_behalf_of: "usr3mc90Ta_jAQ"
Reply all
Reply to author
Forward
0 new messages