+ """drop a message to be delivred when someone gets online.
+ !tell queue : messages in queue
+ !tell <nick> <msg> : append <msg> to <nick> in queue"""
+ if not len(args):
+ return 'Missing arguments:\n{}'.format(self.tell.__doc__)
+ if len(args) == 1 and args[0] == 'queue':
+ return '\n'.join(['{0}:\n\t{1}'.format(k, '\n'.join(v))
+ for k, v in self.inbox.items()])
+ if len(args) < 2:
+ return 'Please provide a message:\n{}'.format(self.tell.__doc__)
+ sender = message['from'].resource
+ recipient = message['body'].split()[1]
+ tell_msg = ' '.join(message['body'].split()[2:])
+ self.log.debug('{0}: {1}'.format(recipient, tell_msg))
+ letter = '{0}, {1} told me to tell you: {2}'.format(recipient, sender, tell_msg)
+ if recipient in self.online:
+ return
+ if recipient in self.inbox.keys():
+ self.inbox[recipient].append(letter)
+ else:
+ self.inbox[recipient] = [letter]
+