mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Don't let reddit users PM to '/u/' prefaced users
This is probably not a big deal, but at the moment if you PM the bot to tip another user on reddit, and you include /u/ prefixed to the user's name, the bot will send coins to an account that can't exist. For instance: !tip /u/jwinterm 1 would send coins to reddit:/u/jwinterm, but '/' is not a valid character for reddit usernames. This change presumes that the sender intended to send funds to jwinterm and strips of the '/u/' preceding the actual username.
This commit is contained in:
parent
fb105da6a0
commit
4a73c75722
1 changed files with 3 additions and 0 deletions
|
@ -160,6 +160,9 @@ class RedditNetwork(Network):
|
|||
while '' in cmd:
|
||||
cmd.remove('')
|
||||
cmd[0] = cmd[0].strip(' \t\n\r')
|
||||
if cmd[0] == u'tip' and cmd[1][0:3] == u'/u/':
|
||||
log_info("Subbing out /u/ from username")
|
||||
cmd[1] = cmd[1][3:]
|
||||
log_info('Found command from %s: %s' % (link.identity(), str(cmd)))
|
||||
if self.on_command:
|
||||
self.on_command(link,cmd)
|
||||
|
|
Loading…
Reference in a new issue