ConsoleUser

Copyright (c) 2010-2023 Skaion Corporarion, www.skaion.com

This project was developed in part by numerous sponsorships from the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints of Governmental purposes notwithstanding any copyright notation thereon.

All content reflects those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government or Skaion Corporation.

class IMImpl.IMImpl(system, config)

Instant Messaging is its own communication style, and this is the public interface for classes that provide that funcationality.

Parameters:

  • system: a <no title> object to communicate with the target system

  • config: a <no title> object holding all our configuration

compose_new(recip, msg)

Send the message to a recipient. There may be an ongoing conversation with that recipient or not already.

Parameters:

  • recip: the recipient of the message

  • msg: the message to send

exit(save=False)

This is a stub that will often exit the application. Many applications should implement their own version of this, especially any that open dialogs. Because of the specific nature of saving applications, save here will always be ignored.

Parameters:

  • save: ignored here, accepted to preserve the common function prototype

has_unread()

Return True if there are unread messages, None if it cannot be determined, and False if it should be knowable but there are not any unread ones

read()

Read a random message that is available. Previously unread messages will get preferential selection.

reply(msg)

Send the given message as a response to the currently open message.

Parameters:

  • msg: the string to send as a response

IMImpl.get_im_client(system, config, im_type=None)

This is the Facotry_ method to create instances of IM clients.

Parameters:

  • system: a <no title> object connected to the target system

  • config: a <no title> object defining this User

  • im_type: optionally, the type of the client to create, overriding anything in config