C# Класс Aura.Msgr.Database.MsgrDb

Показать файл Открыть проект

Открытые методы

Метод Описание
AddGroup ( Aura.Msgr.Database.User user, Aura.Msgr.Database.Group group ) : void

Adds group to database.

AddNote ( string sender, string receiver, string message ) : void

Adds note to database.

Blacklist ( int userId, int contactId ) : void

Creates friend entry for contact on user with the blacklist status.

ChangeGroup ( Aura.Msgr.Database.User user, int friendContactId, int groupId ) : void

Changes group the friend is in in the database.

CountFriends ( int contactId ) : long

Returns the amount of friends the given contact has.

DeleteFriend ( int contactId1, int contactId2 ) : void

Deletes friend entries between the two users.

DeleteGroup ( Aura.Msgr.Database.User user, int groupId ) : void

Deletes group from database and moves friends in that group to ETC.

DeleteNote ( string receiver, long noteId ) : void

Deletes note from database.

GetFriendFromUser ( string characterName, string server ) : Aura.Msgr.Database.Friend

Returns friend for invitation, or null if the user doesn't exist.

GetFriends ( Aura.Msgr.Database.User user ) : List

Returns list of friends for user.

GetGroups ( Aura.Msgr.Database.User user ) : ICollection

Returns list of all groups in user's friend list.

GetLatestUnreadNote ( string receiver, long noteId ) : Note

Returns first note with an id higher than the given one, or null if none exist.

GetNote ( long noteId ) : Note

Returns note with given id, or null on error.

GetNotes ( Aura.Msgr.Database.User user ) : List

Returns all notes for user.

GetOrCreateContact ( string accountId, long characterEntityId, string characterName, string server, string channelName ) : Aura.Msgr.Database.User

Returns a user for the given values, either from the db, or by creating a new one.

GetUserByCharacterId ( long characterEntityId ) : Aura.Msgr.Database.User

Returns contact with the given character id from the database or null if it wasn't found.

InviteFriend ( int userId, int friendId ) : void

Creates friend entries for user and friend with status inviting/invited.

IsBlacklisted ( int userId, int contactId ) : bool

Returns true if user blacklisted contact.

RenameGroup ( Aura.Msgr.Database.User user, int groupId, string groupName ) : void

Renames group in database.

SaveOptions ( Aura.Msgr.Database.User user ) : void

Saves user's options to database.

SetFriendshipStatus ( int contactId1, int contactId2, FriendshipStatus status ) : void

Updates friendship status between the two users.

SetFriendshipStatusOneSided ( int contactId1, int contactId2, FriendshipStatus status ) : void

Updates friendship status for contact 1.

SetNoteRead ( long noteId ) : void

Sets read flag for given note.

Приватные методы

Метод Описание
ReadNote ( MySqlDataReader reader ) : Note

Reads note from reader, returns null on error.

UpdateLastLogin ( Contact contact ) : void

Updates contact's last login time.

Описание методов

AddGroup() публичный Метод

Adds group to database.
public AddGroup ( Aura.Msgr.Database.User user, Aura.Msgr.Database.Group group ) : void
user Aura.Msgr.Database.User
group Aura.Msgr.Database.Group
Результат void

AddNote() публичный Метод

Adds note to database.
public AddNote ( string sender, string receiver, string message ) : void
sender string
receiver string
message string
Результат void

Blacklist() публичный Метод

Creates friend entry for contact on user with the blacklist status.
public Blacklist ( int userId, int contactId ) : void
userId int
contactId int
Результат void

ChangeGroup() публичный Метод

Changes group the friend is in in the database.
public ChangeGroup ( Aura.Msgr.Database.User user, int friendContactId, int groupId ) : void
user Aura.Msgr.Database.User
friendContactId int
groupId int
Результат void

CountFriends() публичный Метод

Returns the amount of friends the given contact has.
public CountFriends ( int contactId ) : long
contactId int
Результат long

DeleteFriend() публичный Метод

Deletes friend entries between the two users.
public DeleteFriend ( int contactId1, int contactId2 ) : void
contactId1 int
contactId2 int
Результат void

DeleteGroup() публичный Метод

Deletes group from database and moves friends in that group to ETC.
public DeleteGroup ( Aura.Msgr.Database.User user, int groupId ) : void
user Aura.Msgr.Database.User
groupId int
Результат void

DeleteNote() публичный Метод

Deletes note from database.
public DeleteNote ( string receiver, long noteId ) : void
receiver string
noteId long
Результат void

GetFriendFromUser() публичный Метод

Returns friend for invitation, or null if the user doesn't exist.
public GetFriendFromUser ( string characterName, string server ) : Aura.Msgr.Database.Friend
characterName string
server string
Результат Aura.Msgr.Database.Friend

GetFriends() публичный Метод

Returns list of friends for user.
public GetFriends ( Aura.Msgr.Database.User user ) : List
user Aura.Msgr.Database.User
Результат List

GetGroups() публичный Метод

Returns list of all groups in user's friend list.
public GetGroups ( Aura.Msgr.Database.User user ) : ICollection
user Aura.Msgr.Database.User
Результат ICollection

GetLatestUnreadNote() публичный Метод

Returns first note with an id higher than the given one, or null if none exist.
public GetLatestUnreadNote ( string receiver, long noteId ) : Note
receiver string
noteId long
Результат Note

GetNote() публичный Метод

Returns note with given id, or null on error.
public GetNote ( long noteId ) : Note
noteId long
Результат Note

GetNotes() публичный Метод

Returns all notes for user.
public GetNotes ( Aura.Msgr.Database.User user ) : List
user Aura.Msgr.Database.User
Результат List

GetOrCreateContact() публичный Метод

Returns a user for the given values, either from the db, or by creating a new one.
public GetOrCreateContact ( string accountId, long characterEntityId, string characterName, string server, string channelName ) : Aura.Msgr.Database.User
accountId string
characterEntityId long
characterName string
server string
channelName string
Результат Aura.Msgr.Database.User

GetUserByCharacterId() публичный Метод

Returns contact with the given character id from the database or null if it wasn't found.
public GetUserByCharacterId ( long characterEntityId ) : Aura.Msgr.Database.User
characterEntityId long
Результат Aura.Msgr.Database.User

InviteFriend() публичный Метод

Creates friend entries for user and friend with status inviting/invited.
public InviteFriend ( int userId, int friendId ) : void
userId int
friendId int
Результат void

IsBlacklisted() публичный Метод

Returns true if user blacklisted contact.
public IsBlacklisted ( int userId, int contactId ) : bool
userId int
contactId int
Результат bool

RenameGroup() публичный Метод

Renames group in database.
public RenameGroup ( Aura.Msgr.Database.User user, int groupId, string groupName ) : void
user Aura.Msgr.Database.User
groupId int
groupName string
Результат void

SaveOptions() публичный Метод

Saves user's options to database.
public SaveOptions ( Aura.Msgr.Database.User user ) : void
user Aura.Msgr.Database.User
Результат void

SetFriendshipStatus() публичный Метод

Updates friendship status between the two users.
public SetFriendshipStatus ( int contactId1, int contactId2, FriendshipStatus status ) : void
contactId1 int
contactId2 int
status FriendshipStatus
Результат void

SetFriendshipStatusOneSided() публичный Метод

Updates friendship status for contact 1.
public SetFriendshipStatusOneSided ( int contactId1, int contactId2, FriendshipStatus status ) : void
contactId1 int
contactId2 int
status FriendshipStatus
Результат void

SetNoteRead() публичный Метод

Sets read flag for given note.
public SetNoteRead ( long noteId ) : void
noteId long
Результат void