diff options
-rw-r--r-- | doc/source/commands.rst | 2 | ||||
-rw-r--r-- | doc/source/configuration.rst | 2 | ||||
-rw-r--r-- | doc/source/dev/events.rst | 2 | ||||
-rw-r--r-- | plugins/alias.py | 4 | ||||
-rw-r--r-- | plugins/amsg.py | 2 | ||||
-rw-r--r-- | plugins/otr.py | 2 | ||||
-rw-r--r-- | plugins/replace.py | 2 | ||||
-rw-r--r-- | plugins/simple_notify.py | 2 | ||||
-rw-r--r-- | poezio/common.py | 2 | ||||
-rw-r--r-- | poezio/core/commands.py | 12 | ||||
-rw-r--r-- | poezio/core/core.py | 9 | ||||
-rw-r--r-- | poezio/core/handlers.py | 18 | ||||
-rw-r--r-- | poezio/tabs/basetabs.py | 2 | ||||
-rw-r--r-- | poezio/tabs/conversationtab.py | 4 | ||||
-rw-r--r-- | poezio/tabs/data_forms.py | 2 | ||||
-rw-r--r-- | poezio/tabs/listtab.py | 2 | ||||
-rw-r--r-- | poezio/tabs/muctab.py | 42 | ||||
-rw-r--r-- | poezio/tabs/privatetab.py | 4 | ||||
-rw-r--r-- | poezio/tabs/rostertab.py | 21 | ||||
-rwxr-xr-x | poezio/theming.py | 2 | ||||
-rw-r--r-- | poezio/user.py | 4 | ||||
-rw-r--r-- | poezio/windows/data_forms.py | 2 | ||||
-rw-r--r-- | poezio/windows/image.py | 2 | ||||
-rw-r--r-- | poezio/windows/list.py | 2 |
24 files changed, 74 insertions, 74 deletions
diff --git a/doc/source/commands.rst b/doc/source/commands.rst index 4a45d15d..3f3bb475 100644 --- a/doc/source/commands.rst +++ b/doc/source/commands.rst @@ -428,7 +428,7 @@ MultiUserChat tab commands **Usage:** ``/info <nickname>`` Display some information about the user in the room: - his/her role, affiliation, status, and status message. + their role, affiliation, status, and status message. /version **Usage:** ``/version <nickname or jid>`` diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 3a5f2ef9..e394ee03 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -656,7 +656,7 @@ or the way messages are displayed. Some informational messages (error, a contact getting connected, etc) are sometimes added to the information buffer. These settings can make - that buffer grow temporarly so you can read these information when they + that buffer grow temporarily so you can read these information when they appear. A list of message types that should make the information buffer grow diff --git a/doc/source/dev/events.rst b/doc/source/dev/events.rst index a2e6ad9d..6dd2e65e 100644 --- a/doc/source/dev/events.rst +++ b/doc/source/dev/events.rst @@ -121,7 +121,7 @@ The following events are poezio-only events, for Slixmpp events, check out changing_nick - **presence:** :py:class:`~~slixmpp.Presence` to be sent - Triggered when the user changes his/her nickname on a MUC. The + Triggered when the user changes their nickname on a MUC. The presence can thus be modified before being sent. send_normal_presence diff --git a/plugins/alias.py b/plugins/alias.py index a10beb7c..459ce02c 100644 --- a/plugins/alias.py +++ b/plugins/alias.py @@ -128,7 +128,7 @@ class Plugin(BasePlugin): if update: self.api.information('Alias /%s updated' % alias, 'Info') else: - self.api.information('Alias /%s successfuly created' % alias, + self.api.information('Alias /%s successfully created' % alias, 'Info') def command_unalias(self, alias): @@ -139,7 +139,7 @@ class Plugin(BasePlugin): del self.commands[alias] self.api.del_command(alias) self.config.remove(alias) - self.api.information('Alias /%s successfuly deleted' % alias, + self.api.information('Alias /%s successfully deleted' % alias, 'Info') def completion_unalias(self, the_input): diff --git a/plugins/amsg.py b/plugins/amsg.py index b8ac4e26..4cd6c055 100644 --- a/plugins/amsg.py +++ b/plugins/amsg.py @@ -1,7 +1,7 @@ """ This plugin broadcasts a message to all your joined rooms. -.. note:: With great power comes great responsability. +.. note:: With great power comes great responsibility. Use with moderation. Command diff --git a/plugins/otr.py b/plugins/otr.py index 9c80f390..909a4ea5 100644 --- a/plugins/otr.py +++ b/plugins/otr.py @@ -306,7 +306,7 @@ MESSAGE_INVALID = _('%(info)sThe message from %(jid_c)s%(jid)s%(info)s' OTR_ERROR = _('%(info)sReceived the following error from ' '%(jid_c)s%(jid)s%(info)s:\x19o %(err)s') -POTR_ERROR = _('%(info)sAn unspecified error in the OTR plugin occured:\n' +POTR_ERROR = _('%(info)sAn unspecified error in the OTR plugin occurred:\n' '%(exc)s') TRUST_ADDED = _('%(info)sYou added %(jid_c)s%(bare_jid)s%(info)s with key ' diff --git a/plugins/replace.py b/plugins/replace.py index 3202721c..7e259dab 100644 --- a/plugins/replace.py +++ b/plugins/replace.py @@ -23,7 +23,7 @@ Add your own pattern -------------------- You can easily edit this plugin to add your own patterns. For example if -don’t want to search for an insult everytime you’re angry, you can create a +don’t want to search for an insult every time you’re angry, you can create a curse pattern this way: - In the init(self) method of the Plugin class, add something like diff --git a/plugins/simple_notify.py b/plugins/simple_notify.py index cfb65e9b..f4dfd2d2 100644 --- a/plugins/simple_notify.py +++ b/plugins/simple_notify.py @@ -117,7 +117,7 @@ class Plugin(BasePlugin): self.do_notify(message, fro) def on_muc_msg(self, message, tab): - # Dont notify if message is from yourself + # Don't notify if message is from yourself if message['from'].resource == tab.own_nick: return diff --git a/poezio/common.py b/poezio/common.py index 3a865054..a39f8145 100644 --- a/poezio/common.py +++ b/poezio/common.py @@ -394,7 +394,7 @@ def parse_secs_to_str(duration=0) -> str: def format_tune_string(infos: Dict[str, str]) -> str: """ - Contruct a string from a dict created from an "User tune" event. + Construct a string from a dict created from an "User tune" event. :param dict infos: Tune information :return: The formatted string diff --git a/poezio/core/commands.py b/poezio/core/commands.py index c9605987..4dbb5611 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -509,6 +509,16 @@ class CommandCore: else: self.core.information('No bookmark to remove', 'Info') + @command_args_parser.ignored + def command_reconnect(self): + """ + /reconnect + """ + if self.core.xmpp.is_connected(): + self.core.disconnect(reconnect=True) + else: + self.core.xmpp.connect() + @command_args_parser.quoted(0, 3) def set(self, args): """ @@ -687,7 +697,7 @@ class CommandCore: else: msg = 'The last activity of %s was %s ago%s' % ( from_, common.parse_secs_to_str(seconds), - (' and his/her last status was %s' % status) + (' and their last status was %s' % status) if status else '') self.core.information(msg, 'Info') diff --git a/poezio/core/core.py b/poezio/core/core.py index 9651a73b..6bb19d16 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -1220,7 +1220,7 @@ class Core: def rename_private_tabs(self, room_name: str, old_nick: str, user: User) -> None: """ - Call this method when someone changes his/her nick in a MUC, + Call this method when someone changes their nick in a MUC, this updates the name of all the opened private conversations with him/her """ @@ -1759,6 +1759,13 @@ class Core: shortdesc="Bookmark a room online.", completion=self.completion.bookmark) self.register_command( + 'reconnect', + self.command.command_reconnect, + usage="[reconnect]", + desc='Disconnect from the remote server if you are ' + 'currently connected and then connect to it again.', + shortdesc='Disconnect and reconnect to the server.') + self.register_command( 'set', self.command.set, usage="[plugin|][section] <option> [value]", diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index 6fa9935b..030a43e5 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -472,7 +472,7 @@ class HandlerCore: def on_nick_received(self, message): """ - Called when a pep notification for an user nickname + Called when a pep notification for a user nickname is received """ contact = roster[message['from'].bare] @@ -527,7 +527,7 @@ class HandlerCore: def on_mood_event(self, message): """ - Called when a pep notification for an user mood + Called when a pep notification for a user mood is received. """ contact = roster[message['from'].bare] @@ -561,11 +561,11 @@ class HandlerCore: 'Mood') else: self.core.information( - contact.bare_jid + ' stopped having his/her mood.', 'Mood') + contact.bare_jid + ' stopped having their mood.', 'Mood') def on_activity_event(self, message): """ - Called when a pep notification for an user activity + Called when a pep notification for a user activity is received. """ contact = roster[message['from'].bare] @@ -606,12 +606,12 @@ class HandlerCore: contact.activity, 'Activity') else: self.core.information( - contact.bare_jid + ' stopped doing his/her activity.', + contact.bare_jid + ' stopped doing their activity.', 'Activity') def on_tune_event(self, message): """ - Called when a pep notification for an user tune + Called when a pep notification for a user tune is received """ contact = roster[message['from'].bare] @@ -653,8 +653,6 @@ class HandlerCore: """ Triggered whenever a message is received from a multi-user chat room. """ - if message['subject']: - return room_from = message['from'].bare if message['type'] == 'error': # Check if it's an error @@ -1015,7 +1013,7 @@ class HandlerCore: contact.pending_out = False else: self.core.information( - '%s does not want you to receive his/her/its status anymore.' % + '%s does not want you to receive their/its status anymore.' % jid, 'Roster') self.core.tabs.first().state = 'highlight' if isinstance(self.core.tabs.current_tab, tabs.RosterInfoTab): @@ -1312,8 +1310,6 @@ class HandlerCore: """ Triggered when the topic is changed. """ - if message['body'] or message['thread']: - return nick_from = message['mucnick'] room_from = message.get_mucroom() tab = self.core.tabs.by_name_and_class(room_from, tabs.MucTab) diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 330b9913..213f39d7 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -241,7 +241,7 @@ class Tab: ['/%s' % (name) for name in sorted(self.commands)] the_input.new_completion(words, 0) # Do not try to cycle command completion if there was only - # one possibily. The next tab will complete the argument. + # one possibility. The next tab will complete the argument. # Otherwise we would need to add a useless space before being # able to complete the arguments. hit_copy = set(the_input.hit_list) diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py index 94f1d719..60106527 100644 --- a/poezio/tabs/conversationtab.py +++ b/poezio/tabs/conversationtab.py @@ -34,7 +34,7 @@ log = logging.getLogger(__name__) class ConversationTab(OneToOneTab): """ - The tab containg a normal conversation (not from a MUC) + The tab containing a normal conversation (not from a MUC) Must not be instantiated, use Static or Dynamic version only. """ plugin_commands = {} # type: Dict[str, Command] @@ -205,7 +205,7 @@ class ConversationTab(OneToOneTab): dump_tuple(get_theme().COLOR_INFORMATION_TEXT), from_, common.parse_secs_to_str(seconds), - (' and his/her last status was %s' % status) + (' and their last status was %s' % status) if status else '', ) self.add_message(msg) diff --git a/poezio/tabs/data_forms.py b/poezio/tabs/data_forms.py index 496863bc..f4ed63e5 100644 --- a/poezio/tabs/data_forms.py +++ b/poezio/tabs/data_forms.py @@ -14,7 +14,7 @@ log = logging.getLogger(__name__) class DataFormsTab(Tab): """ - A tab contaning various window type, displaying + A tab containing various window type, displaying a form that the user needs to fill. """ plugin_commands = {} # type: Dict[str, Command] diff --git a/poezio/tabs/listtab.py b/poezio/tabs/listtab.py index 07b3fe05..87e7d9f4 100644 --- a/poezio/tabs/listtab.py +++ b/poezio/tabs/listtab.py @@ -1,5 +1,5 @@ """ -A generic tab that displays a serie of items in a scrollable, searchable, +A generic tab that displays a series of items in a scrollable, searchable, sortable list. It should be inherited, to actually provide methods that insert items in the list, and that lets the user interact with them. """ diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index 80631388..17abb369 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -47,7 +47,7 @@ COMPARE_USERS_LAST_TALKED = lambda x: x.last_talked class MucTab(ChatTab): """ The tab containing a multi-user-chat room. - It contains an userlist, an input, a topic, an information and a chat zone + It contains a userlist, an input, a topic, an information and a chat zone """ message_type = 'groupchat' plugin_commands = {} # type: Dict[str, Command] @@ -124,14 +124,14 @@ class MucTab(ChatTab): def cancel_config(self, form): """ - The user do not want to send his/her config, send an iq cancel + The user do not want to send their config, send an iq cancel """ muc.cancel_config(self.core.xmpp, self.name) self.core.close_tab() def send_config(self, form): """ - The user sends his/her config to the server + The user sends their config to the server """ muc.configure_room(self.core.xmpp, self.name, form) self.core.close_tab() @@ -448,8 +448,9 @@ class MucTab(ChatTab): if presence['type'] == 'error': self.core.room_error(presence, self.name) elif not self.joined: - if '110' in status_codes or self.own_nick == presence['from'].resource: - self.process_presence_buffer(presence) + own = '110' in status_codes or self.own_nick == presence['from'].resource + if own or len(self.presence_buffer) >= 10: + self.process_presence_buffer(presence, own) else: self.presence_buffer.append(presence) return @@ -467,7 +468,7 @@ class MucTab(ChatTab): self.input.refresh() self.core.doupdate() - def process_presence_buffer(self, last_presence): + def process_presence_buffer(self, last_presence, own): """ Batch-process all the initial presences """ @@ -479,11 +480,13 @@ class MucTab(ChatTab): self.handle_presence_unjoined(stanza, deterministic) except PresenceError: self.core.room_error(stanza, stanza['from'].bare) - self.handle_presence_unjoined(last_presence, deterministic, own=True) + self.presence_buffer = [] + self.handle_presence_unjoined(last_presence, deterministic, own) self.users.sort() # Enable the self ping event, to regularly check if we # are still in the room. - self.enable_self_ping_event() + if own: + self.enable_self_ping_event() if self.core.tabs.current_tab is not self: self.refresh_tab_win() self.core.tabs.current_tab.refresh_input() @@ -888,7 +891,7 @@ class MucTab(ChatTab): from_room: JID, server_initiated=False): """ - When an user leaves a groupchat + When a user leaves a groupchat """ self.users.remove(user) if self.own_nick == user.nick: @@ -949,7 +952,7 @@ class MucTab(ChatTab): def on_user_change_status(self, user, from_nick, from_room, affiliation, role, show, status): """ - When an user changes her status + When a user changes her status """ # build the message display_message = False # flag to know if something significant enough @@ -1151,7 +1154,8 @@ class MucTab(ChatTab): timeout=timeout) def on_self_ping_result(self, iq): - if iq["type"] == "error" and iq["error"]["condition"] != "feature-not-implemented": + if iq["type"] == "error" and iq["error"]["condition"] not in \ + ("feature-not-implemented", "service-unavailable", "item-not-found"): self.command_cycle(iq["error"]["text"] or "not in this room") self.core.refresh_window() else: # Re-send a self-ping in a few seconds @@ -1563,7 +1567,7 @@ class MucTab(ChatTab): def command_role(self, args): """ /role <nick> <role> [reason] - Changes the role of an user + Changes the role of a user roles can be: none, visitor, participant, moderator """ @@ -1581,7 +1585,7 @@ class MucTab(ChatTab): def command_affiliation(self, args): """ /affiliation <nick or jid> <affiliation> - Changes the affiliation of an user + Changes the affiliation of a user affiliations can be: outcast, none, member, admin, owner """ @@ -1904,11 +1908,11 @@ class MucTab(ChatTab): self.command_role, 'usage': '<nick> <role> [reason]', - 'desc': ('Set the role of an user. Roles can be:' + 'desc': ('Set the role of a user. Roles can be:' ' none, visitor, participant, moderator.' ' You also can give an optional reason.'), 'shortdesc': - 'Set the role of an user.', + 'Set the role of a user.', 'completion': self.completion_role }, { @@ -1918,10 +1922,10 @@ class MucTab(ChatTab): self.command_affiliation, 'usage': '<nick or jid> <affiliation>', - 'desc': ('Set the affiliation of an user. Affiliations can be:' + 'desc': ('Set the affiliation of a user. Affiliations can be:' ' outcast, none, member, admin, owner.'), 'shortdesc': - 'Set the affiliation of an user.', + 'Set the affiliation of a user.', 'completion': self.completion_affiliation }, { @@ -2049,10 +2053,10 @@ class MucTab(ChatTab): 'usage': '<nickname>', 'desc': ('Display some information about the user ' - 'in the MUC: its/his/her role, affiliation,' + 'in the MUC: their role, affiliation,' ' status and status message.'), 'shortdesc': - 'Show an user\'s infos.', + 'Show a user\'s infos.', 'completion': self.completion_info }, { diff --git a/poezio/tabs/privatetab.py b/poezio/tabs/privatetab.py index 35e5feaa..cec68ac5 100644 --- a/poezio/tabs/privatetab.py +++ b/poezio/tabs/privatetab.py @@ -33,7 +33,7 @@ log = logging.getLogger(__name__) class PrivateTab(OneToOneTab): """ - The tab containg a private conversation (someone from a MUC) + The tab containing a private conversation (someone from a MUC) """ plugin_commands = {} # type: Dict[str, Command] plugin_keys = {} # type: Dict[str, Callable] @@ -55,7 +55,7 @@ class PrivateTab(OneToOneTab): 'info', self.command_info, desc= - 'Display some information about the user in the MUC: its/his/her role, affiliation, status and status message.', + 'Display some information about the user in the MUC: their role, affiliation, status and status message.', shortdesc='Info about the user.') self.register_command( 'version', diff --git a/poezio/tabs/rostertab.py b/poezio/tabs/rostertab.py index 768963af..7c941aa9 100644 --- a/poezio/tabs/rostertab.py +++ b/poezio/tabs/rostertab.py @@ -44,7 +44,7 @@ def deny_anonymous(func: Callable) -> Callable: class RosterInfoTab(Tab): """ - A tab, splitted in two, containing the roster and infos + A tab, split in two, containing the roster and infos """ plugin_commands = {} # type: Dict[str, Command] plugin_keys = {} # type: Dict[str, Callable] @@ -88,7 +88,7 @@ class RosterInfoTab(Tab): usage='[jid]', desc='Deny your presence to the provided JID (or the ' 'selected contact in your roster), who is asking' - 'you to be in his/here roster.', + 'you to be in their roster.', shortdesc='Deny a user your presence.', completion=self.completion_deny) self.register_command( @@ -165,13 +165,6 @@ class RosterInfoTab(Tab): self.command_password, usage='<password>', shortdesc='Change your password') - - self.register_command( - 'reconnect', - self.command_reconnect, - desc='Disconnect from the remote server if you are ' - 'currently connected and then connect to it again.', - shortdesc='Disconnect and reconnect to the server.') self.register_command( 'disconnect', self.command_disconnect, @@ -533,16 +526,6 @@ class RosterInfoTab(Tab): self.core.xmpp.plugin['xep_0191'].get_blocked(callback=callback) @command_args_parser.ignored - def command_reconnect(self): - """ - /reconnect - """ - if self.core.xmpp.is_connected(): - self.core.disconnect(reconnect=True) - else: - self.core.xmpp.connect() - - @command_args_parser.ignored def command_disconnect(self): """ /disconnect diff --git a/poezio/theming.py b/poezio/theming.py index db1ccb39..bbf2fb64 100755 --- a/poezio/theming.py +++ b/poezio/theming.py @@ -198,7 +198,7 @@ class Theme: COLOR_REVISIONS_MESSAGE = (3, -1, 'b') # Color for various important text. For example the "?" before JIDs in - # the roster that require an user action. + # the roster that require a user action. COLOR_IMPORTANT_TEXT = (3, 5, 'b') # Separators diff --git a/poezio/user.py b/poezio/user.py index 43832917..146a70da 100644 --- a/poezio/user.py +++ b/poezio/user.py @@ -6,7 +6,7 @@ # it under the terms of the zlib license. See the COPYING file. """ Define the user class. -An user is a MUC participant, not a roster contact (see contact.py) +A user is a MUC participant, not a roster contact (see contact.py) """ import logging @@ -26,7 +26,7 @@ ROLE_DICT = {'': 0, 'none': 0, 'visitor': 1, 'participant': 2, 'moderator': 3} class User: """ - keep trace of an user in a Room + keep track of a user in a Room """ __slots__ = ('last_talked', 'jid', 'chatstate', 'affiliation', 'show', 'status', 'role', 'nick', 'color') diff --git a/poezio/windows/data_forms.py b/poezio/windows/data_forms.py index 3ec44b97..7e746774 100644 --- a/poezio/windows/data_forms.py +++ b/poezio/windows/data_forms.py @@ -272,7 +272,7 @@ class ListMultiWin(FieldInputMixin): self._field.set_answer(values) def get_help_message(self): - return '←, →: Switch between the value. Space: select or unselect a value' + return '←, →: Switch between the value. Space: select or deselect a value' class ListSingleWin(FieldInputMixin): diff --git a/poezio/windows/image.py b/poezio/windows/image.py index 96636ec7..dfd2eae2 100644 --- a/poezio/windows/image.py +++ b/poezio/windows/image.py @@ -52,7 +52,7 @@ def render_svg(svg: bytes) -> Optional[Image.Image]: handle.render_cairo(context) data = surface.get_data() image = Image.frombytes('RGBA', (MAX_SIZE, MAX_SIZE), data.tobytes()) - # This is required because Cairo uses a BGRA (in host endianess) + # This is required because Cairo uses a BGRA (in host endianness) # format, and PIL an ABGR (in byte order) format. Yes, this is # confusing. b, g, r, a = image.split() diff --git a/poezio/windows/list.py b/poezio/windows/list.py index 350255c6..c427a79e 100644 --- a/poezio/windows/list.py +++ b/poezio/windows/list.py @@ -40,7 +40,7 @@ class ListWin(Win): def empty(self) -> None: """ - emtpy the list and reset some important values as well + empty the list and reset some important values as well """ self.lines = [] self._selected_row = 0 |