Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
d4e30292
by lovetox at 2022-06-21T19:03:33+02:00
1 changed file:
Changes:
| ... | ... | @@ -175,7 +175,7 @@ def _get_new_rows(self) -> set[OutcastRow]: |
| 175 | 175 | reason=row[Column.REASON]))
|
| 176 | 176 | return rows
|
| 177 | 177 | |
| 178 | - def _get_diff(self) -> list[OutcastRow]:
|
|
| 178 | + def _get_diff(self) -> tuple[list[OutcastRow], list[OutcastRow]]:
|
|
| 179 | 179 | |
| 180 | 180 | new_rows = self._get_new_rows()
|
| 181 | 181 | |
| ... | ... | @@ -192,17 +192,20 @@ def _get_diff(self) -> list[OutcastRow]: |
| 192 | 192 | same_rows = {row for row in new_rows if row.jid in same}
|
| 193 | 193 | modified_rows = list(same_rows - self._current_rows)
|
| 194 | 194 | |
| 195 | - return removed_rows + added_rows + modified_rows
|
|
| 195 | + return removed_rows, added_rows + modified_rows
|
|
| 196 | 196 | |
| 197 | 197 | def _set_outcasts(self) -> None:
|
| 198 | - diff_rows = self._get_diff()
|
|
| 198 | + removed_rows, other_rows = self._get_diff()
|
|
| 199 | 199 | |
| 200 | 200 | outcasts = {}
|
| 201 | - for row in diff_rows:
|
|
| 201 | + for row in other_rows:
|
|
| 202 | 202 | outcasts[row.jid] = {'affiliation': 'outcast'}
|
| 203 | 203 | if row.reason:
|
| 204 | 204 | outcasts[row.jid]['reason'] = row.reason
|
| 205 | 205 | |
| 206 | + for row in removed_rows:
|
|
| 207 | + outcasts[row.jid] = {'affiliation': 'none'}
|
|
| 208 | + |
|
| 206 | 209 | self._client.get_module('MUC').set_affiliation(
|
| 207 | 210 | self._contact.jid,
|
| 208 | 211 | outcasts,
|