summary refs log tree commit diff stats
path: root/lib/pure/smtp.nim
Commit message (Expand)AuthorAgeFilesLines
* use single backtick (#17133)flywind2021-02-211-20/+20
* fix some warnings (#16952)flywind2021-02-081-1/+1
* Deprecate TaintedString (#15423)Juan Carlos2021-01-151-1/+1
* styleCheck: Fix some inconsistent identifiers (#16177)ee72020-12-211-8/+8
* Fix broken links in docs (#16336)Elliot Waite2020-12-141-2/+2
* fixes #15177, the error message is now what it should have been (#15195)Andreas Rumpf2020-08-171-3/+2
* smtp: Fix STARTTLS, request HELO once TLS is established (#15032)Mildred Ki'Lya2020-07-221-3/+9
* fix several newline problems (#15028) [backend]Miran2020-07-211-1/+26
* Make debugSend/debugRecv procs public. Fixes #12189 (#12190)Chris Heller2020-04-221-3/+37
* [backport] run nimpretty on web stuffnarimiran2019-09-301-4/+4
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
* smtp: renamed starttls to startTlsAraq2019-09-211-4/+4
* [bugfix] Fix smtp.nim unhandled exception (#11498)Phạm Ngọc Quang Nam2019-06-191-2/+1
* Add starttls for smtp (#11500)Phạm Ngọc Quang Nam2019-06-161-0/+27
* fixes #9728Araq2018-11-161-6/+16
* rework the exception hierarchy; refs #8363Andreas Rumpf2018-08-101-4/+2
* remove deprecated stuff from the stdlib; introduce better deprecation warningsAraq2018-05-051-2/+0
* SMTP sync/async deduplicationEmery Hemingway2017-03-071-114/+58
* Improve SMTP testingFederico Ceratto2016-11-241-19/+43
* Make SMTP example compiledef2016-04-241-5/+7
* lib: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-30/+30
* Don't run non-test code when defined(testing)Oleh Prypin2015-04-211-1/+1
* Fixed typo which prevented to send mails via AsyncSmtpjschweinsberg2015-03-221-1/+1
* Fix some deprecation warnings caused by renamesdef2014-11-131-20/+20
* Added async implementation for smtp module.Dominik Picheta2014-08-311-18/+106
* Async SSL support.Dominik Picheta2014-08-311-1/+4
* big renameAraq2014-08-271-11/+13
* fixes #735Araq2014-02-021-1/+3
* Fixed recvLine deprecation warnings.Dominik Picheta2013-04-141-13/+5
* Removes executable bit for text files.Grzegorz Adam Hankiewicz2013-03-161-0/+0
* Fixed compilation of smtp module.Dominik Picheta2012-07-251-1/+2
* Sockets are now buffered and have ssl support through openssl.Dominik Picheta2012-06-031-36/+19
* year 2012 for most copyright headersAraq2012-01-021-1/+1
* sockets.recv optimizations; stdlib now supports taint modeAraq2011-09-241-6/+6
* bugfixes; step one for 'var T' as return type supportAraq2011-07-281-6/+6
* preparations for 0.8.12Araq2011-07-101-0/+1
* non-nil AST; continue after errors for IDE supportAraq2011-02-121-0/+0
* cleanup: E_Base should not be used for inheriting exceptions; documentation g...Araq2011-01-151-1/+1
* Added a close function to the ssl module.dom962010-10-271-0/+5
* bugfix: typo in SMTP module; SCGI module finishedAraq2010-10-251-29/+45
* ssl.connect now returns the result of the certificate validation.dom962010-10-231-4/+3
* Added {.final.} to objects which are not meant to be inherited, and added an ...dom962010-10-231-2/+2
* Removed the assert()'s from ssl.nim, and limited lines to 80 chars.dom962010-10-231-8/+17
* Added an openssl wrapper, ssl module and smtp module.dom962010-10-231-0/+176
ff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
"""
This page describes functions that plugins may implement to be called from Profanity on certain events. All functions are optional.

Examples:
::
    def prof_on_start():
        prof.cons_show("Profanity has started...")

    def prof_pre_room_message_display(room, nick, message):
        prof.cons_show("Manipulating chat room message before display...")
        new_message = message + " (added by plugin)"
        return new_message

    def prof_on_contact_presence(barejid, resource, presence, status, priority):
        notify_message = barejid + " is " + presence
        prof.notify(notify_message, 5, "Presence")
"""

def prof_init(version, status, account_name, fulljid):
    """Called when a plugin is loaded, either when profanity is started, or when the ``/plugins load`` or ``/plugins install`` commands are called

    :param version: the version of Profanity
    :param status: the package status of Profanity, ``"development"`` or ``"release"``
    :param account_name: account name of the currently logged in account, or ``None`` if not logged in
    :param fulljid: the users full Jabber ID (barejid and resource) if logged in, ``None`` otherwise
    :type version: str or unicode
    :type status: str or unicode
    :type account_name: str, unicode or None
    :type fulljid: str, unicode or None
    """
    pass


def prof_on_start():
    """Called when Profanity is started
    """
    pass


def prof_on_shutdown():
    """Called when the user quits Profanity
    """
    pass


def prof_on_unload():
    """Called when a plugin is unloaded with the ``/plugins unload`` command
    """
    pass


def prof_on_connect(account_name, fulljid):
    """Called when the user connects with an account

    :param account_name: account name of the account used for logging in
    :param fulljid: the full Jabber ID (barejid and resource) of the account
    :type account_name: str or unicode
    :type fulljid: str or unicode
    """
    pass


def prof_on_disconnect(account_name, fulljid):
    """Called when the user disconnects an account

    :param account_name: account name of the account being disconnected
    :param fulljid: the full Jabber ID (barejid and resource) of the account
    :type account_name: str or unicode
    :type fulljid: str or unicode
    """
    pass


def prof_pre_chat_message_display(barejid, resource, message):
    """Called before a chat message is displayed

    :param barejid: Jabber ID of the message sender
    :param resource: resource of the message sender
    :param message: the received message
    :type barejid: str or unicode
    :type resource: str or unicode
    :type message: str or unicode
    :return: the new message to display, or ``None`` to preserve the original message 
    :rtype: str or unicode
    """
    pass


def prof_post_chat_message_display(barejid, resource, message):
    """Called after a chat message is displayed

    :param barejid: Jabber ID of the message sender
    :param resource: resource of the message sender
    :param message: the received message
    :type barejid: str or unicode
    :type resource: str or unicode
    :type message: str or unicode
    """
    pass


def prof_pre_chat_message_send(barejid, message):
    """Called before a chat message is sent

    :param barejid: Jabber ID of the message recipient
    :param message: the message to be sent
    :type barejid: str or unicode
    :type message: str or unicode
    :return: the modified or original message to send, or ``None`` to cancel sending of the message
    :rtype: str or unicode
    """
    pass


def prof_post_chat_message_send(barejid, message):
    """Called after a chat message has been sent

    :param barejid: Jabber ID of the message recipient
    :param message: the sent message
    :type barejid: str or unicode
    :type message: str or unicode
    """
    pass


def prof_pre_room_message_display(barejid, nick, message):
    """Called before a chat room message is displayed

    :param barejid: Jabber ID of the room
    :param nick: nickname of message sender
    :param message: the received message
    :type barejid: str or unicode
    :type nick: str or unicode
    :type message: str or unicode
    :return: the new message to display, or ``None`` to preserve the original message 
    :rtype: str or unicode
    """
    pass


def prof_post_room_message_display(barejid, nick, message):
    """Called after a chat room message is displayed

    :param barejid: Jabber ID of the room
    :param nick: nickname of the message sender 
    :param message: the received message
    :type barejid: str or unicode
    :type nick: str or unicode
    :type message: str or unicode
    """
    pass


def prof_pre_room_message_send(barejid, message):
    """Called before a chat room message is sent

    :param barejid: Jabber ID of the room
    :param message: the message to be sent
    :type barejid: str or unicode
    :type message: str or unicode
    :return: the modified or original message to send, or ``None`` to cancel sending of the message
    :rtype: str or unicode
    """
    pass


def prof_post_room_message_send(barejid, message):
    """Called after a chat room message has been sent

    :param barejid: Jabber ID of the room
    :param message: the sent message
    :type barejid: str or unicode
    :type message: str or unicode
    """
    pass


def prof_on_room_history_message(barejid, nick, message, timestamp):
    """Called when the server sends a chat room history message

    :param barejid: Jabber ID of the room
    :param nick: nickname of the message sender
    :param message: the message to be sent
    :param timestamp: time the message was originally sent to the room, in ISO8601 format
    :type barejid: str or unicode
    :type nick: str or unicode
    :type message: str or unicode
    :type timestamp: str or unicode
    """
    pass


def prof_pre_priv_message_display(barejid, nick, message):
    """Called before a private chat room message is displayed

    :param barejid: Jabber ID of the room
    :param nick: nickname of message sender
    :param message: the received message
    :type barejid: str or unicode
    :type nick: str or unicode
    :type message: str or unicode
    :return: the new message to display, or ``None`` to preserve the original message 
    :rtype: str or unicode
    """
    pass


def prof_post_priv_message_display(barejid, nick, message):
    """Called after a private chat room message is displayed

    :param barejid: Jabber ID of the room
    :param nick: nickname of the message sender 
    :param message: the received message
    :type barejid: str or unicode
    :type nick: str or unicode
    :type message: str or unicode
    """
    pass


def prof_pre_priv_message_send(barejid, nick, message):
    """Called before a private chat room message is sent

    :param barejid: Jabber ID of the room
    :param nick: nickname of message recipient
    :param message: the message to be sent
    :type barejid: str or unicode
    :type nick: str or unicode
    :type message: str or unicode
    :return: the modified or original message to send, or ``None`` to cancel sending of the message
    :rtype: str or unicode
    """
    pass


def prof_post_priv_message_send(barejid, nick, message):
    """Called after a private chat room message has been sent

    :param barejid: Jabber ID of the room
    :param nick: nickname of the message recipient
    :param message: the sent message
    :type barejid: str or unicode
    :type nick: str or unicode
    :type message: str or unicode
    """
    pass


def prof_on_message_stanza_send(stanza):
    """Called before an XMPP message stanza is sent

    :param stanza: The stanza to send
    :type stanza: str or unicode
    :return: The new stanza to send, or ``None`` to preserve the original stanza
    :rtype: str or unicode
    """
    pass


def prof_on_message_stanza_receive(stanza):
    """Called when an XMPP message stanza is received

    :param stanza: The stanza received
    :type stanza: str or unicode
    :return: ``True`` if Profanity should continue to process the message stanza, ``False`` otherwise
    :rtype: boolean
    """
    pass


def prof_on_presence_stanza_send(stanza):
    """Called before an XMPP presence stanza is sent

    :param stanza: The stanza to send
    :type stanza: str or unicode
    :return: The new stanza to send, or ``None`` to preserve the original stanza
    :rtype: str or unicode
    """
    pass


def prof_on_presence_stanza_receive(stanza):
    """Called when an XMPP presence stanza is received

    :param stanza: The stanza received
    :type stanza: str or unicode
    :return: ``True`` if Profanity should continue to process the presence stanza, ``False`` otherwise
    :rtype: boolean
    """
    pass


def prof_on_iq_stanza_send(stanza):
    """Called before an XMPP iq stanza is sent

    :param stanza: The stanza to send
    :type stanza: str or unicode
    :return: The new stanza to send, or ``None`` to preserve the original stanza
    :rtype: str or unicode
    """
    pass


def prof_on_iq_stanza_receive(stanza):
    """Called when an XMPP iq stanza is received

    :param stanza: The stanza received
    :type stanza: str or unicode
    :return: ``True`` if Profanity should continue to process the iq stanza, ``False`` otherwise
    :rtype: boolean
    """
    pass


def prof_on_contact_offline(barejid, resource, status):
    """Called when a contact goes offline

    :param barejid: Jabber ID of the contact
    :param resource: the resource being disconnected
    :param status: the status message received with the offline presence, or ``None``
    :type barejid: str or unicode
    :type resource: str or unicode
    :type status: str or unicode
    """
    pass


def prof_on_contact_presence(barejid, resource, presence, status, priority):
    """Called when a presence notification is received from a contact

    :param barejid: Jabber ID of the contact
    :param resource: the resource being disconnected
    :param presence: presence of the contact, one of ``"chat"``, ``"online"``, ``"away"``, ``"xa"`` or ``"dnd"``
    :param status: the status message received with the presence, or ``None``
    :param priority: the priority associated with the resource
    :type barejid: str or unicode
    :type resource: str or unicode
    :type presence: str or unicode
    :type status: str or unicode
    :type priority: int
    """
    pass


def prof_on_chat_win_focus(barejid):
    """Called when a chat window is focussed

    :param barejid: Jabber ID of the chat window recipient
    :type barejid: str or unicode
    """
    pass


def prof_on_room_win_focus(barejid):
    """Called when a chat room window is focussed

    :param barejid: Jabber ID of the room
    :type barejid: str or unicode
    """
    pass