]> git.giacomolli.uk - onechat/commitdiff
Fix two comments of the Telegram API and the view
authorAnderson A. Giacomolli <redacted>
Sat, 7 Nov 2026 17:36:56 +0000 (14:36 -0300)
committerAnderson A. Giacomolli <redacted>
Sat, 7 Nov 2026 17:36:56 +0000 (14:36 -0300)
The doc comment of TelegramAPI names its sendTimeout field, which limits
each send call, and not SendTimeout, which is no name in the code.

The doc comment of the test helper viewPush describes what the push does
to the rollback state list, and it does not name a file of the reference
design.

Issue: 947bddb

telegram_api.go
view_test.go

index 558d006cd1a1b04905afbe0fd94b6d89e71a1e5e..bb4ee2c07bc425eab5805176595def55c22c80c6 100644 (file)
@@ -74,9 +74,9 @@ func telegramRejected(err error) bool {
 }
 
 // TelegramAPI calls the Telegram Bot API. The bot token is a part of each URL,
-// so no error of TelegramAPI holds a URL, a net/http error, or the token.
-// SendTimeout limits each sendMessage, sendRichMessage, and sendChatAction
-// call.
+// so no error of TelegramAPI holds a URL, a net/http error, or the token. Its
+// sendTimeout field limits each sendMessage, sendRichMessage, and
+// sendChatAction call.
 type TelegramAPI struct {
        base        string
        token       string
index 39c8e116f5477d8a66f0cdd4c1dcd9c2bb4687ee..56abdd6b81e12e72d0db7ad5a5e72e4b6d5f9537 100644 (file)
@@ -197,7 +197,11 @@ func (p ViewPartTree) Node(level, index int) (Node, bool, error) {
        return treeTestNode(level, index, text), true, nil
 }
 
-// viewPush is the push of rollback_state_list.js.
+// viewPush adds state to the newest end of states and returns the new list. An
+// empty list gets one entry. When the newest entry is not kept, it becomes kept
+// with its own state, and state is dropped. When it is kept, state becomes a
+// new newest entry, and the state of the old newest entry goes to the older
+// entries by the same push.
 func viewPush(state int, states *ViewPushEntry) *ViewPushEntry {
        if states == nil {
                return &ViewPushEntry{