satanas / Turpial

Twitter client written in Python. Light, fast, fully functional and integrated to the user desktop
http://turpial.org.ve
GNU General Public License v3.0
175 stars 47 forks source link

Filter causes exception #391

Open HenryHu opened 8 years ago

HenryHu commented 8 years ago

If all the messages obtained in one update are filtered out, an exception occurs:

Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/turpial-3.5.9.dev0-py2.7.egg/turpial/ui/qt/main.py", line 772, in after_update_column self._container.updatecolumn(column.id, updates) File "/usr/local/lib/python2.7/site-packages/turpial-3.5.9.dev0-py2.7.egg/turpial/ui/qt/container.py", line 231, in update_column self.columns[column_id].update_statuses(statuses) File "/usr/local/lib/python2.7/site-packages/turpial-3.5.9.dev0-py2.7.egg/turpial/ui/qt/column.py", line 348, in update_statuses self.__set_last_status_id(statuses) File "/usr/local/lib/python2.7/site-packages/turpial-3.5.9.dev0-py2.7.egg/turpial/ui/qt/column.py", line 308, in __set_last_status_id if statuses[0].repeated_by: IndexError: list index out of range

The reason is clear. But to fix it, there are problems I'm not sure about:

satanas commented 8 years ago

Hey @HenryHu,

Yes, we should play the update sound and we should show a notification. For this specific case, notifications module has support to show how many tweets have been filtered. If you check notification.py#L49-L67, you'll see that calling something like:

notify.updates('my-column', 0, 10)

Should show a message like: No new tweets (10 tweets have been filtered). That way we let the user know that there is an active filter that is doing its job.

Any other doubt or concern, do not hesitate to contact me.

Cheers!