$ go list -m github.com/gotd/td github.com/gotd/td v0.33.3
Yes
Not 100% sure this is a bug but it's at least unexpected and inconsistent so leaning towards it being one. So sorry if i'm wrong!
I'm receiving message in a one to one chat via OnNewMessage dispatcher. When I send the first message the FromID is the user id of the first user (which is expected), but the response Message and all future messages from the other user, has the same FromID as the first user. So it looks like messages all come from the same user, the first one.
Here are two (abbreviated) json-encoded messages:
First:
{ "Flags": 0, "Out": false, "Mentioned": false, "MediaUnread": false, "Silent": false, "Post": false, "FromScheduled": false, "Legacy": false, "EditHide": false, "Pinned": false, "ID": 3402, "FromID": { "UserID": 56132410 }, "PeerID": { "UserID": 56132410 }, "Date": 1617977512, "Message": "Hello", }
Second:
{ "Flags": 0, "Out": true, "Mentioned": false, "MediaUnread": false, "Silent": false, "Post": false, "FromScheduled": false, "Legacy": false, "EditHide": false, "Pinned": false, "ID": 3407, "FromID": { "UserID": 56132410 }, "PeerID": { "UserID": 56132410 }, "Date": 1618004712, "Message": "Hi again", }
I expected the FromID to be the user id of the user who actually sent the message.
As you see in the above examples, both the from user id and the peer user id is the same in both messages, the id of the user who initiated the chat.
$ go version go version go1.16 darwin/amd64
go env
Output$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Library/Caches/go-build" GOENV="/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.16" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/j1/hgqrbz2n1xsgz6_2c0slq9nh0000gn/T/go-build3091972184=/tmp/go-build -gno-record-gcc-switches -fno-common"
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too