mirror of
https://github.com/PretendoNetwork/friends.git
synced 2026-08-03 00:19:57 -05:00
Store friend requests
This commit is contained in:
parent
256ebe3b59
commit
57a54367a5
|
|
@ -103,6 +103,8 @@ func addFriendRequest(err error, client *nex.Client, callID uint32, pid uint32,
|
|||
friendInfo.LastOnline = nex.NewDateTime(0)
|
||||
friendInfo.Unknown = 0
|
||||
|
||||
saveFriendRequest(friendRequestID, senderPID, recipientPID, sentTime.Value(), expireTime.Value(), message)
|
||||
|
||||
recipientClient := client.Server().FindClientFromPID(recipientPID)
|
||||
|
||||
if recipientClient != nil {
|
||||
|
|
|
|||
|
|
@ -269,6 +269,12 @@ func isFriendRequestBlocked(requesterPID uint32, requestedPID uint32) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
func saveFriendRequest(friendRequestID uint64, senderPID uint32, recipientPID uint32, sentTime uint64, expireTime uint64, message string) {
|
||||
if err := cassandraClusterSession.Query(`INSERT INTO pretendo_friends.friend_requests (id, sender_pid, recipient_pid, sent_on, expires_on, message) VALUES (?, ?, ?, ?, ?, ?) IF NOT EXISTS`, friendRequestID, senderPID, recipientPID, sentTime, expireTime, message).Exec(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
// //
|
||||
// MongoDB database methods //
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user