Commit graph

63 commits

Author SHA1 Message Date
Emmanuel Gil Peyrot
332a5c2553 Move the src directory to poezio, for better cython compatibility. 2016-06-11 20:49:43 +01:00
mathieui
99d5e25f9b
Fix various roster count issues
disconnections not clearing the number of connected contacts, leading to
an ever-increasing count, and roster count not always being setup
2015-09-23 20:29:56 +02:00
mathieui
3b0cddd368
Micro-optimize the roster refresh
The roster wrapper sucks and is way too slow. Halve refresh time by more
than 50% using manually managed counters.
2015-06-27 22:39:15 +02:00
mathieui
1c1ab3cb83
Merge branch 'master' of git.poez.io:poezio into slix
Conflicts:
	src/bookmark.py
	src/config.py
	src/connection.py
	src/core/commands.py
	src/core/core.py
	src/core/handlers.py
	src/windows/info_bar.py
	src/windows/muc.py
	src/windows/roster_win.py
	src/windows/text_win.py
	src/xhtml.py
2014-10-31 19:16:44 +01:00
mathieui
f9734cde56
Remove the (sometimes wrong) default values in the config.get() calls 2014-10-20 21:21:04 +02:00
Florent Le Coz
9c3fece96b Use slixmpp 2014-07-24 02:11:45 +02:00
mathieui
e216fd2112 Code cleanup
fixes whitespace issues, some builtin overrides, and some enormous lines

might make poezio run nanoseconds faster!
2014-04-06 19:58:57 +02:00
mathieui
218c71dfbf Do not instantiate the roster at module level
.
2014-04-06 17:30:52 +02:00
mathieui
186803d9a9 Fix formatting, some typos, and unused code, and add docstrings
- No idea why subclasses of ConversationTab were working before
    (info_header was overriden with None in __init__)
- Or why the date parsing worked (“Exeception”)
- Some more reformatting with pylint indications
- Document each module in the tabs module
2014-03-23 00:15:01 +01:00
Mathieu Pasquet
b245ff6e2d Fix /export 2013-09-16 13:08:28 +02:00
mathieui
33a9f1434f Fix contact removal 2013-07-24 21:34:14 +02:00
mathieui
8fe39540a4 Fix an issue with roster loading
(why did that even work before)
2013-07-01 17:58:49 +02:00
mathieui
f4a4b79986 fix #2327 (don’t include chatrooms in the roster)
it might be a little slower than before (more checks)
2013-06-24 23:22:42 +02:00
mathieui
833faa4f37 Improve the roster search
- now case-insensitive
- search in the bare jid instead of userpart only (and still in roster
  names)
- do not display groups when searching
- display offline contacts
- do not expand resources if they were before the search
2013-06-13 01:00:53 +02:00
mathieui
a1ef835a37 Handle the roster order cache as a real cache
When an external (or internal) event may cause the order of the
cache to be modified, or new elements to be added, schedule it
for a rebuild. Otherwise, don’t, and only rebuild it when
refreshing (that should improve refresh speed a lot).

Also, if the position in the roster is further than the total size
of the roster, go back to the top instead of displaying an empty
window with “+++”.
2013-05-11 20:51:11 +02:00
mathieui
91b960b797 Handle I/O errors better
- Do not crash because of low disk space
- Notify the user whenever it happens
- A few functions now return a boolean instead of nothing
- Config.silent_set is Config.set_and_save without toggle and returning
  strings. It is used whenever we don’t need set_and_save
- Config.set_and_save now returns a tuple (that can be passed directly
  to core.information())

TODO: display the precise error to the user (instead of “unable to…”)
2013-04-05 23:57:53 +02:00
mathieui
27d85a0961 Fix the folding of contacts in multiple groups
(add a defaultdict to keep the folded state in each group)
2013-02-03 23:55:13 +01:00
mathieui
4a7e08f1c2 Make the search usable again
- Disable the history when searching
- → allow moving the cursor around to select a contact when searching
- fix refresh issues
2012-11-22 00:29:44 +01:00
Florent Le Coz
bcd6976cd5 Catch IqTimeout exception when removing a contact from the roster. 2012-11-05 13:54:02 +00:00
mathieui
cbaa469298 Fix the number of connected contacts/total number in the roster 2012-10-15 14:32:08 +02:00
mathieui
0bd55a27f2 Fix TBs when the system is not in utf-8 by default
(force every file opening to be with the utf-8 encoding)
2012-09-13 09:50:48 +02:00
mathieui
e2a62bbbe7 Give an empty name to a group if it hasn’t got one 2012-08-31 23:06:46 +02:00
mathieui
84887d17af Fix a traceback when a group has no name and a crash when dns gets interrupted
- http://pastebin.archlinux.fr/449676
2012-08-31 22:41:36 +02:00
mathieui
e8dce570ea Take care of the race condition "node@groupchat_server is now online/offline"
- get rid of the ugly blacklist thing that didn’t work sometimes
2012-08-07 11:05:28 +02:00
mathieui
7a485ef4d0 Add a common.safeJID function, and use it everywhere 2012-08-06 15:38:09 +02:00
mathieui
9905646184 Various changes to the roster sorting
- Change the separator from _ to :
- Move the functions away in another module to avoir cluttering the
  roster code
- Add a case-sensitive sort (“sname”)
2012-08-01 14:42:02 +02:00
mathieui
c890fefbc4 Add an "online" contact sorting method
- put the online contacts at the beginning of the list
- allows, e.g. jid_reverse_online_reverse, to put offline contacts at
  the start of the group, in alphabetical order
2012-08-01 01:36:18 +02:00
mathieui
47c593ddaf Sort the unavailable contacts at the end of the contact list 2012-08-01 01:24:42 +02:00
mathieui
71f813af28 Add a roster_group_sort option, which works like roster_sort
- defaults to "name" (sort by group name)
- document it
- also, micro-optimize get_nb_connected_contacts()
2012-08-01 01:06:57 +02:00
mathieui
1625a4f41f Add a roster_sort option to sort the contacts inside the roster groups
- defaults to jid_show (which means that they are sorted into sub-groups
  by show and are sorted by JID inside those)
- See the default config file or the documentation for details
2012-07-31 23:40:53 +02:00
mathieui
4096e7f427 Also sort the contacts alphabetically
Contacts are first sorted alphabetically, and then sorted again
depending on their show; since the python sorts are stable, the order
will remain and the sub-groups (corresponding to one show type) will be
sorted alphabetically too.
2012-07-31 21:12:59 +02:00
mathieui
4a7f6c5eaf Sort the contacts in the roster groups by show (xa/away/…) 2012-07-31 20:51:18 +02:00
mathieui
0af1c7fe9a Docstrings, and small cleanup 2012-05-21 02:14:25 +02:00
mathieui
c04f0e9783 Prevent the rooms from going “offline”
Add a blacklist inside the roster that contains the bare JIDs of all the
rooms ever joined in this session, so that no JID using this server will
ever be shown as getting “offline”.

If there is a cleaner way to do that (discriminating JIDs), I welcome it.
2012-05-16 02:01:50 +02:00
mathieui
f2377f747b Fix some roster length issues with group folding 2012-05-08 16:14:51 +02:00
mathieui
24341c8429 Prevent some iteration problems 2012-04-27 23:42:22 +02:00
mathieui
725a2245f3 Remove some debug info 2012-04-27 21:09:26 +02:00
mathieui
527e582fb0 New Roster class and new RosterGroup class
Removes for Roster:
    - empty() → Ø
    - get_contact_len() → Ø
    - remove_contact_from_group() → Ø
    - add_contact_to_group() → Ø
    - add_contact() → add()
    - remove_contact() → __delitem__()
    - get_contact_by_jid() → __getitem__()
    - edit_groups_of_contact() → update_contact_groups()

Removes for RosterGroup:
    - has_contact() → __contains__()
    - add_contact() → add()
    - remove_contact() → remove()
    - is_empty() → __len__()
2012-04-27 20:30:05 +02:00
mathieui
1f5d104834 -get -set +@property +@property.setter 2011-11-09 22:00:38 +01:00
mathieui
c3c67b5e0a Code cleanup (unused import, variables, undefined names, etc…) 2011-11-06 21:10:09 +01:00
Todd Eisenberger
d02c764c47 More contact management commands 2011-10-01 05:26:19 -07:00
Florent Le Coz
96794a4e49 Change license to zlib (MIT sucks :() 2011-09-11 17:10:05 +02:00
Florent Le Coz
d41634d4ea Change license to MIT 2011-09-06 02:45:53 +02:00
Florent Le Coz
c93815737f Empty roster on disconnect 2011-06-18 12:52:58 +02:00
mathieui
5d1953a807 fixes #2187 (import/export) 2011-05-24 20:33:37 +02:00
Florent Le Coz
36eed51b90 use config.get() only once instead of doing it at each iteration 2011-03-10 04:57:26 +01:00
mathieui
01f3409505 fixed #2115 2011-02-02 00:51:34 +01:00
Florent Le Coz
9f514d8c7d Avoid a traceback on remove_contact: 2011-01-12 07:50:12 +01:00
Florent Le Coz
469bbd2900 /add and /remove commands, yay 2011-01-12 06:49:33 +01:00
Florent Le Coz
749933fc16 /accept and /deny commands
User can now decide to accept or deny a subscription, in
the roster
2011-01-11 06:43:31 +01:00