Commit afd428c0ab9173a5eed15c24496dff577c73b25e

Authored by Matti Virkkunen
1 parent aba83e3e

Document more sync plus clarify chats vs groups

Showing 1 changed file with 77 additions and 16 deletions
line-protocol.md
... ... @@ -55,9 +55,11 @@ type.
55 55 Internally any user is referred to as a Contact. Contacts are identified by a "mid" and the prefix
56 56 is "u" (presumably for "user")
57 57  
58   -Chats are called Rooms and are identified by a "mid" which is prefixed by "r" (for "room"). Groups
59   -are called Groups internally as well and are identified by an "id" which is prefixed with a "c"
60   -(presumably for "chat").
  58 +Chats are called Rooms and are identified by a "mid" which is prefixed by "r" (for "room"). Rooms
  59 +are the lightweight multi-user chats that are created when you invite an extra user to a plain IM
  60 +conversation with a contact. Groups are called Groups internally as well and are identified by an
  61 +"id" which is prefixed with a "c" (presumably for "chat"). Groups are more permanent than chats and
  62 +have extra data associated with them such as a name and an icon.
61 63  
62 64 Any message is represented by a Message object. Message IDs are numeric but they are stored as
63 65 strings.
... ... @@ -169,38 +171,48 @@ Initial sync
169 171  
170 172 After logging in the client sends out a sequence of requests to synchronize with the server. It
171 173 seems some messages are not always sent - the client could be storing data locally somewhere and
172   -comparing with the revision ID from getLastOpRevision()
  174 +comparing with the revision ID from getLastOpRevision(). The client runs multiple sync sequences in
  175 +parallel in order to make it faster.
173 176  
174   -(TODO: Update list for current client)
  177 +There is no requirement to implement all or any of these sync operations in a third-party client.
  178 +
  179 +### Sequence 1
  180 +
  181 +This seems to be the main sync sequence.
175 182  
176 183 getLastOpRevision()
177 184  
178 185 Gets the revision ID to use for the long poll return channel later. It's fetched first to ensure
179 186 nothing is missed even if something happens during the sync procedure.
180 187  
  188 + getDownloads()
  189 +
  190 +Mystery. Probably not related to software updates as that is a separate call. Could be related to
  191 +sticker downloads.
  192 +
181 193 getProfile()
182 194  
183 195 Gets the currently logged in user's profile, which includes their display name and status message
184 196 and so forth.
185 197  
186   - getBlockedContactIds()
  198 + getSettingsAttributes(8458272)
187 199  
188   -List of blocked user IDs.
  200 +Gets some of the stored settings (the bits are NOTIFICATION_INCOMING_CALL, IDENTITY_IDENTIFIER,
  201 +NOTIFICATION_DISABLED_WITH_SUB and PRIVACY_PROFILE_IMAGE_POST_TO_MYHOME)
189 202  
190   - getRecommendationIds()
  203 + getAllContactIds()
191 204  
192   -List of suggested friend IDs.
  205 +Gets all contact IDs added as friends.
193 206  
194   - getBlockedRecommendationIds()
  207 + getBlockedContactIds()
195 208  
196   -List of suggested friend IDs that have been dismissed (why can't the previous method just not
197   -return these...?)
  209 +List of blocked user IDs.
198 210  
199   - getAllContactIds()
  211 + fetchNotificationItems()
200 212  
201   -Gets all contact IDs added as friends.
  213 +Mystery.
202 214  
203   - getContacts(contactIds) - with IDs from the previous methods
  215 + getContacts(contactIds) - with IDs from the previous methods that fetched contact IDs
204 216  
205 217 Gets details for the users.
206 218  
... ... @@ -208,10 +220,59 @@ Gets details for the users.
208 220  
209 221 Gets all groups current user is a member of.
210 222  
211   - getGroups(groupIds) - with IDs from the previous method
  223 + getGroupIdsInvited()
  224 +
  225 +Gets all groups for which the user has a pending invitation.
  226 +
  227 + getGroups(groupIds) - with IDs from the previous methods
212 228  
213 229 Gets details for the groups. This included member lists.
214 230  
  231 + getMessageBoxCompactWrapUpList(1, 50)
  232 +
  233 +Returns a complicated structure with "current active chats". This returns a list of of rooms and
  234 +groups with partial information as well as the latest message(s) for them. This call seems to be the
  235 +only way to get a list of rooms the current user is a member of as there is no separate getRooms
  236 +method.
  237 +
  238 +### Sequence 2
  239 +
  240 + getActivePurchaseVersions(0, 1000, "en", "US")
  241 +
  242 +Mystery. Probably related to sticker versions.
  243 +
  244 + getConfigurations(...) - parameters involve country codes
  245 +
  246 +Returns a map of configuration settings with string keys. I do not have exact metadata for this
  247 +function. Example:
  248 +
  249 + {
  250 + "function.linecall.mobile_network_expire_period": "604800",
  251 + "function.linecall.store": "N",
  252 + "contact_ui.show_addressbook": "N",
  253 + "function.music": "N",
  254 + "group.max_size": "200",
  255 + "function.linecall.validate_caller_id": "N",
  256 + "function.linecall.spot": "N",
  257 + "main_tab.show_timeline": "N",
  258 + "function.linecall": "N",
  259 + "room.max_size": "100"
  260 + }
  261 +
  262 +Many of the settings seem to be related to features being enabled or disabled and maximum limits for
  263 +them.
  264 +
  265 + getRecommendationIds()
  266 +
  267 +List of suggested friend IDs.
  268 +
  269 + getBlockedRecommendationIds()
  270 +
  271 +List of suggested friend IDs that have been dismissed (why can't the previous method just not return
  272 +these...?)
  273 +
  274 + getContacts(contactIds) - with IDs from the previous methods
  275 +
215 276 Managing the contact list
216 277 -------------------------
217 278  
... ...