-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support semi-anonymously forwarded messages better in the admins list editor #77
Comments
The current admins-list logic is to check if I propose having ntelebot check for The admins list editor can then check for target = None
if ctx.forward_from:
target = ctx.forward_from
elif ctx.forwarded:
msg.add("I can see that's a forwarded message, but I can't tell who sent it. If the user has their privacy settings set to disallow adding a link to forwarded messages, ...")
elif frame.text:
if frame.text.isdigit():
target = int(frame.text)
else:
msg.add("I'm not sure what <code>%s</code> is\u2014it's not a user id!", frame.text) but this doesn't handle the case of a user typing target = None
if ctx.forward_from:
target = ctx.forward_from
elif frame.text.isdigit():
target = int(frame.text)
elif ctx.forwarded:
msg.add("I can see that's a ...")
elif frame.text:
msg.add("I'm not sure what <code>%s</code> is\u2014it's not a user id!", frame.text) but this will require ntelebot to make |
…e` field, which catches forwarded channel posts, forwarded private messages, and forwarded anonymous messages. The `Context.forward_from` remains unchanged (except in the unlikely event of a message that contains `forward_from` but not `forward_date`). A new `Context.forwarded` marks whether the message is forwarded or not. For now, `Context.text` remains completely unset for all forwarded messages, but this may change in a followup (see nmlorg/metabot#77).
…d messages when editing the admins list. Followups should probably add support for toggling admins by @-username, and possibly allow the /whoami command's output to be forwarded from the user AND re-forwarded from the admin (right now doing so will add the bot to its own admins list). See #77.
If a user has changed their Settings > Privacy and Security > Forwarded Messages > Who can add a link to my account when forwarding messages? from Everybody to My Contacts or Nobody, adding them to a bot's admins list by forwarding a message from them won't work. Right now, the bot ignores the
forward_sender_name
field and, because it is missing theforward_from
field, it treats the forwarded message as being a normal message from the forwarder (which is actually a slight security risk, if the original sender sends a disruptive message and a bot admin obliviously forwards it)./whoami
?) that simply dumps the sender's userid. The alternate process could be to have the user send/whoami
to the bot, forward or copy/paste the number to the admin, who would then forward or copy/paste the number to the bot. If forwarded (once or twice), the fact that it's a valid userid should supercede the fact that it's forwarded (at least if it's semi-anonymously forwarded).The text was updated successfully, but these errors were encountered: