分析版本:Telegram 8.7.1

Telegram App.png
一、 聯(lián)系人模塊:ContactsController

image.png
-
DeviceContactInfoController:導(dǎo)航欄Navigation右上角按鈕,調(diào)用系統(tǒng)的創(chuàng)建聯(lián)系人。 -
PeersNearbyController:cellFind People Nearby的響應(yīng)界面,它的cellCreate a Local Group則是跳轉(zhuǎn)到PermissionController中間頁(yè),進(jìn)入創(chuàng)建當(dāng)前位置群聊的業(yè)務(wù)邏輯。 -
InviteContactsController:cellInvite Friends的響應(yīng)界面,邀請(qǐng)業(yè)務(wù)相關(guān)。
二、消息列表模塊:ChatListController

image.png
-
ComposeControllerl:導(dǎo)航欄Navigation右上角按鈕響應(yīng)控制器,功能為創(chuàng)建新的消息;其頁(yè)面有三個(gè) cell 響應(yīng)事件。
New Group:對(duì)應(yīng)控制器ContactMultiselectionController;
New Contact:對(duì)應(yīng)控制器DeviceContactInfoController,創(chuàng)建聯(lián)系人公用控制器。
New Channel:對(duì)應(yīng)控制器PermissionController,中間頁(yè)公用展示控制器,進(jìn)入創(chuàng)建 Channel 業(yè)務(wù)邏輯。 -
ChatController:消息列表被點(diǎn)擊,進(jìn)入聊天消息頁(yè)面,核心控制器,里面16000行代碼,各種邏輯嵌套,高度耦合,極難閱讀區(qū)分對(duì)應(yīng)功能模塊; 點(diǎn)擊導(dǎo)航欄Navigation右上角按鈕,進(jìn)入PeerInfoScreen對(duì)應(yīng)場(chǎng)景。
三、設(shè)置模塊:PeerInfoScreen

image.png
以默認(rèn)設(shè)置模塊為例:
-
@ Set Username:對(duì)應(yīng)UsernameSetupController;設(shè)置用戶名。 -
Saved Messages:對(duì)應(yīng)ChatController;收藏夾。 -
Recent Calls:對(duì)應(yīng)CallListController;最近呼叫。 -
Devices:對(duì)應(yīng)RecentSessionsController;設(shè)備。 -
Chat Folders:對(duì)應(yīng)ChatListFilterPresetListController;對(duì)話文件夾。 -
Notifications and Sounds:對(duì)應(yīng)NotificationsAndSoundsController;通知和聲音。 -
Privacy and Security:對(duì)應(yīng)PrivacyAndSecurityController;隱私和安全。 -
Data and Storage:對(duì)應(yīng)DataAndStorageSettingsController;數(shù)據(jù)和存儲(chǔ)。 -
Appearance:對(duì)應(yīng)ThemeSettingsController;外觀。 -
Language:對(duì)應(yīng)LocalizationListController;語(yǔ)言。 -
Stickers and Emoji:對(duì)應(yīng)InstalledStickerPacksController; -
Ask a Question:對(duì)應(yīng)ChatController;我有疑問(wèn)。 -
IM FAQ:跳轉(zhuǎn)web鏈接Url ;常見(jiàn)問(wèn)題。