[Bug 14540] Names interface - Aliasing replacement with separate nickname, local alias etc.
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Mar 7 12:58:31 CET 2012
https://bugs.freedesktop.org/show_bug.cgi?id=14540
--- Comment #17 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-03-07 03:58:31 PST ---
MC should special-case Names.Nickname and forbid it from appearing in
Account.Parameters, because the Account.Nickname property already exists.
Desired semantics for MC:
* If the protocol does not store nicknames (IRC, SIP), always set
the nickname at connect time.
* If the protocol stores nicknames (XMPP):
- if the nickname was changed locally since we were last connected,
and the stored nickname on the server is the same as it was when
we were last connected, change it
- if the nickname was not changed locally since we were last connected,
get the stored nickname from the server and save it locally
- if the nickname was changed locally, and was also changed on the server,
we could go either way; the local change could win, or the server could
win. I vaguely prefer "local change wins", I think.
Does this pseudocode look correct?
Pseudocode for "local change wins":
* Store an extra flag, NicknameChanged, in the account data.
It is initially FALSE.
* When we RequestConnection
- if Names.Nickname is a parameter, that means the protocol does not
store nicknames. Set NicknameChanged = FALSE if you like (but it
doesn't really matter). Add { Names.Nickname => Account.Nickname } to
the value of Parameters that will be used in RequestConnection.
- else the protocol does store nicknames.
+ if NicknameChanged == TRUE, as soon as possible, call
Set(Names, Nickname, Account.Nickname). On success, set
NicknameChanged = FALSE.
+ else, as soon as possible, call RequestNickname(SelfHandle).
Overwrite Account.Nickname with the result.
* When UI calls Set(Account, Nickname, x):
- set Account.Nickname = x
- set NicknameChanged = TRUE
- if we are currently connected, call
Set(Names, Nickname, Account.Nickname) on
the Connection, and on success, set NicknameChanged = FALSE
Pseudocode for "server change wins":
* Store an extra string, OldNickname, in the account data.
It is initially "".
* When we RequestConnection
- if Names.Nickname is a parameter, that means the protocol does not
store nicknames. Set OldNickname = "". Add
{ Names.Nickname => Account.Nickname } to the value of Parameters
that will be used in RequestConnection.
- else the protocol does store nicknames. As soon as possible,
call RequestNickname(SelfHandle).
+ if the result is either "" or the value of OldNickname,
call Set(Names, Nickname, Account.Nickname). On success,
set OldNickname = "".
+ else overwrite Account.Nickname with the value from the server
* When UI calls Set(Account, Nickname, x):
- if OldNickname == "", set it to Account.Nickname
- set Account.Nickname = x
- if we are currently connected, call
Set(Names, Nickname, Account.Nickname) on
the Connection, and on success, set OldNickname = ""
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
More information about the telepathy-bugs
mailing list