-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from JustAnotherID/feat/friend-event
- Loading branch information
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package event | ||
|
||
import ( | ||
"github.com/LagrangeDev/LagrangeGo/packets/pb/message" | ||
) | ||
|
||
type ( | ||
FriendRequest struct { | ||
SourceUin uint32 | ||
SourceUid string | ||
Msg string | ||
Source string | ||
} | ||
|
||
FriendRecall struct { | ||
FromUid string | ||
Sequence uint64 | ||
Time uint32 | ||
Random uint32 | ||
} | ||
) | ||
|
||
func ParseFriendRequestNotice(msg *message.PushMsg, event *message.FriendRequest) *FriendRequest { | ||
info := event.Info | ||
return &FriendRequest{ | ||
SourceUin: msg.Message.ResponseHead.FromUin, | ||
SourceUid: info.SourceUid, | ||
Msg: info.Message, | ||
Source: info.Source, | ||
} | ||
} | ||
|
||
func ParseFriendRecallEvent(event *message.FriendRecall) *FriendRecall { | ||
info := event.Info | ||
return &FriendRecall{ | ||
FromUid: info.FromUid, | ||
Sequence: uint64(info.Sequence), | ||
Time: info.Time, | ||
Random: info.Random, | ||
} | ||
} |