Commit Graph

118 Commits

Author SHA1 Message Date
Stephan Erb 3ddc5ce78e Use implicit delegation with __getattr__ instead of explicit delegation via method calls 2009-11-10 19:26:17 +01:00
Stephan Erb 2c296f3fe0 Create a GC_Contacts() class and move groupchat related behavior to it.
This is similar to what has been done with the MetacontactManager
2009-11-10 19:05:47 +01:00
Stephan Erb ba9ef8301b Remove superfluous clear_contacts method 2009-11-09 23:03:16 +01:00
Stephan Erb d5ac527f84 Filter duplicate groups centrally. 2009-11-09 21:51:43 +01:00
Stephan Erb cec93b6135 Push method to check if a specific ClientCaps supports a feature down to the caps module.
Public interfaces stay the same.
2009-11-09 21:26:56 +01:00
Stephan Erb 17af7902e4 Make it explicit whether an ordinary Contact, a Self Contact or a Not-In-Roster Contact is created. 2009-11-05 22:16:38 +01:00
Stephan Erb f297aa0a11 Make methods of MetacontactManager private if those are only used internally 2009-11-05 20:09:26 +01:00
Stephan Erb 0abb1dfd20 Extract class: MetacontactManager from Contacts
For easy migration, interface is still preserved.
2009-11-05 19:43:25 +01:00
Stephan Erb 8a127b4e4d Several small bugfixes: Add missing accout parameter to constructors. 2009-11-05 16:53:30 +01:00
Stephan Erb 89b1c6a7df Move method close to data.
gajim.contacts.contact_from_gc_contact(gc_contact) is now gc_contact.as_contact()
2009-11-05 16:25:13 +01:00
Stephan Erb 06129f45ef Let contact instances know their corresponding account.
contact.account and gc_contact.account contains the account name of the owning account. There is still code around in many placed which tries to workaround this missing information. Such code has to be migrated on per-need basis.
2009-11-05 15:57:43 +01:00
Stephan Erb 47f875a4bc Move CapsCache global from gajim.capscache to caps.capscache. 2009-10-30 23:01:25 +01:00
Stephan Erb bd714f66fc Move common part of Contact and GC_Contact into a new CommonContact class.
The CommonClass helps to spot easily where GC_Contacts and Contacts differ. This is just the first step a potential refactoring in this area.
2009-10-28 23:37:40 +01:00
Stephan Erb 33fe53ff7d Swtich from old to new caps API.
Now we do:

contact.supports(feauture) instead of gajim.capscache.is_supported(contact, feature)
2009-10-27 22:41:39 +01:00
Stephan Erb c7ff97703f Redistribute responsibility: Let contact instances check if features are supported 2009-10-27 20:31:09 +01:00
Stephan Erb 346953fd93 Duplicate 'supports' feature for GC_CONTACTS. TODO: Unify Contacts and GC_Contacts 2009-10-25 23:58:02 +01:00
Stephan Erb 700665151c Implement 'supports' on contact instances.
Usage:

	if contact.supports(NS_E2E):
		....
2009-10-25 23:56:14 +01:00
Yann Leboulanger d408610425 copy list before iterating on it in case we modify it. 2009-07-21 00:13:55 +02:00
Yann Leboulanger cd9eed6277 stupid me, calling .keys() on a dict ... 2009-07-20 23:51:17 +02:00
Yann Leboulanger e40a3b6272 prevent traceback when we remove contacts in iter_contacts() loop. 2009-07-20 23:47:59 +02:00
Yann Leboulanger 15b3ba35b1 restore metacontct correctly when we connect to server and we already have contacts in roster (stored locally). Fixes #5156 2009-07-12 13:33:29 +02:00
Yann Leboulanger 8514e51675 factorize send_file action in chat / groupchat / private chat. see #3948 2009-04-07 17:07:04 +00:00
Yann Leboulanger 0cf86f5a8f [Dicson] Fix meta contact order by DND. Fixes #4797, #4779 2009-02-11 17:55:00 +00:00
Yann Leboulanger e389e0b16b [thorstenp] remove whitespace at eol 2008-12-03 21:56:12 +00:00
Stephan Erb 246e549012 Improved "is_groupchat" logic. Fixes #4413. 2008-11-08 22:00:56 +00:00
Yann Leboulanger 66f8bab7d6 show number of participants in groupchats. fixes #3418 2008-09-02 07:00:35 +00:00
Stephan Erb 433fcafc52 Correctly sort metacontact data if one of the jids is a transport and not in our roster. Fixes #4208, #4195. 2008-08-19 21:41:43 +00:00
Julien Pivotto de4a23e751 See #4200.
* remove js from some headers
 * set coding:utf-8 to allow real names in headers
2008-08-15 17:31:51 +00:00
Julien Pivotto 8bc9bc29ae * Big headers review
* Remove some licencing problems
 * To do: same for images
 * See #4200
2008-08-15 03:20:23 +00:00
Stephan Erb f5be05a14a Coding style 2008-08-06 20:19:16 +00:00
js 8605cd3f38 For historical reasons, we have a tab width of 3. This is strange, but
we have that in all files. To at least lesser the confusion a bit, add
vim tags for that.
Additionally, fix wrong #! in a few files.
2008-07-29 19:49:31 +00:00
Brendan Taylor 094052eb7c fix some issues with the difference between Contacts and GC_Contacts 2008-07-26 01:16:24 +00:00
Stephan Erb eda061e15d Don't crash when we receive contacts that have a group tag assigned multiple times.
Remove some usage of has_key() in the contacts module. It is a bit slower (method overhead) and will be deprecated soon.
In roster_window. make a small if-clause more pythonic.
2008-07-06 21:35:19 +00:00
Yann Leboulanger 2f857870f3 add caps_* arguments in create_contact 2008-07-05 19:16:04 +00:00
Yann Leboulanger 4c33f4d478 typo 2008-07-05 19:08:15 +00:00
Yann Leboulanger 74c53da32a fix arguments order in contacts.py, some coding standards. should fix #4081 2008-07-05 19:04:27 +00:00
Stephan Erb 0671e6c865 Correctly count metacontacts in non merged accounts mode if we have metacontacts over several accounts. 2008-07-05 06:33:49 +00:00
Stephan Erb 215fdc964a Count metacontacts only once.
Remove timing information for roster drawing.
2008-07-04 21:29:46 +00:00
Yann Leboulanger 2fd4ea7637 keep caps info when we create a contact instance from groupchat_contact instance 2008-07-03 21:43:28 +00:00
Stephan Erb 2cd24aa8ae Do not update metacontacts when nothing has changed. Fixes sending metacontact info to server when we expand a groupchat. 2008-06-26 14:09:27 +00:00
Yann Leboulanger ef0b115710 quick fix for private messages until we support caps for them. see #4033 2008-06-20 06:34:24 +00:00
js 9634f98250 * Implemented XEP-0184 section 5.
* Added NS_RECEIPTS to protocol namespace list.
* Show our support of XEP-0184 in caps.
* Added a big, fat warning to get_contact as this does not work as
  expected.
* There was some strangeness in our XEP-0022, it added an id tag to
  the x tag, which isn't mentioned anywhere in the XEP. And for some
  strange reason, that id even was the same all the time.
* Fixed a typo.
2008-06-17 16:03:21 +00:00
Stephan Erb c5f7922e29 Two roster sort fixes.
* Change metacontact ordering. Fallback to priority only if two contacts have the same show, not the other way round.
 * Move contacts that just signed out to the bottom of the group, not to the top.
2008-06-15 23:03:51 +00:00
Jean-Marie Traissard ca457a7ac2 groups :
-Use a method to get_shown_groups (possibly more work to do (special group attribute))
-Show contact only if contact.ask, not according to modified xep 0162 logic. (I don't get neither the xep
meaning, neither this modified logic, can you explain steve-e ?)
-Remove contact before we modify it req_sub(). Else we can't remove it because iter is not found.
-When removing a contact and we let him in see us (observer), manually set show to offline, so he is not set as
visible.
-Remove observer from observer group if we asked him auth (I mean before he answer). Xep 0162 say he is not an
observer then. Fix contact staying in observer group when we get auth later.
-Renaming groups seems fixed (it's an accident :p )

More work on group to follow
2008-06-15 21:48:13 +00:00
Jean-Marie Traissard f9c981df5d -Set General and Observer group directly in contact instance, instead of calculating it each time
-When creating self-contact contact instance, store it with group 'self_contact', so it never goes in General
-Make general group not be seen visible because of self contact even if self.regroup
-Remove the self contact instance itself too when WE deconnect or when IT deconnect, so we will
not see it as offline if refilling roster (regroup account for example)
2008-06-08 21:27:31 +00:00
Jean-Marie Traissard 9f613afd4f Don't traceback when refiltering during the model.clear (has a bad account name).
Fixes #3893.
2008-06-01 21:13:06 +00:00
Yann Leboulanger a3827fe5d0 new XEP-0115 implementation (version 1.5) 2008-04-20 22:58:47 +00:00
Stephan Erb 4e6bd4ee8f Port roster_window to gtk.TreeModelFilter.
Contacts are now online hidden when they connect/reconnect and not completely removed/readded. Should come with a great speed improvement for people with big rosters.
There are still a few known problems but non that should dalay this patch any longer. Related bugs will be tracked with 'modelfilter' keyword.

See #1201
2008-04-20 14:01:04 +00:00
Yann Leboulanger f3665cd689 don't remove metacontact when we reconnect. fixes #3771 2008-04-01 23:13:10 +00:00
Jean-Marie Traissard 75983ff571 Some "jep" -> "xep" 2008-03-30 20:35:02 +00:00