Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
messages.getLastActivity, entities from @vknet/vk
Browse files Browse the repository at this point in the history
  • Loading branch information
kasthack committed Dec 3, 2014
1 parent 9f52502 commit e4d34c8
Show file tree
Hide file tree
Showing 25 changed files with 156 additions and 47 deletions.
3 changes: 2 additions & 1 deletion Sources/VKSharp/Api/Generated/ImplementedMethods.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Implemented 145 methods
Implemented 146 methods
* Account
* account.banUser
* account.getAppPermissions
Expand Down Expand Up @@ -85,6 +85,7 @@ Implemented 145 methods
* messages.addChatUser
* messages.delete
* messages.deleteDialog
* messages.getLastActivity
* messages.markAsImportant
* messages.markAsRead
* messages.removeChatUser
Expand Down
4 changes: 4 additions & 0 deletions Sources/VKSharp/Api/Generated/RawApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ public async Task<string> RestoreAsync( int messageId ){
return await _parent.Executor.ExecRawAsync( _parent._reqapi.MessagesRestore( messageId ) );
}

public async Task<string> GetLastActivityAsync( int userId ){
return await _parent.Executor.ExecRawAsync( _parent._reqapi.MessagesGetLastActivity( userId ) );
}

public async Task<string> DeleteDialogAsync( uint userId , uint offset = 0, uint count = 100 ){
return await _parent.Executor.ExecRawAsync( _parent._reqapi.MessagesDeleteDialog( userId,offset,count ) );
}
Expand Down
13 changes: 13 additions & 0 deletions Sources/VKSharp/Api/Generated/RequestApi1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,19 @@ int messageId

return req;
}
public VKRequest<LastActivity> MessagesGetLastActivity(
int userId
){
var req = new VKRequest<LastActivity>{
MethodName = "messages.getLastActivity",
Parameters = new Dictionary<string, string> {
{ "user_id", userId.ToNCString() }
}
};
req.Token = CurrentToken;

return req;
}
public VKRequest<bool> MessagesDeleteDialog(
uint userId , uint offset = 0, uint count = 100
){
Expand Down
9 changes: 8 additions & 1 deletion Sources/VKSharp/Api/Generated/VKSharpFuncs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<Param Name="no_search" Type="bool?" Default="null" Params="false" />
</Params>
</Method>
<Method Name="audio.getAlbums">
<Method Name="audio.getAlbums">
<Request Type="EntityList&lt;AudioAlbum&gt;" NeedToken="false" />
<Return Parse="true" Multiple="false" />
<Params>
Expand Down Expand Up @@ -656,6 +656,13 @@
<Param Name="message_id" Type="int" Params="false" />
</Params>
</Method>
<Method Name="messages.getLastActivity">
<Request Type="LastActivity" NeedToken="true" />
<Return Parse="false" Multiple="false" />
<Params>
<Param Name="user_id" Type="int" Params="false" />
</Params>
</Method>
<Method Name="messages.deleteDialog">
<Request Type="bool" NeedToken="true" />
<Return Parse="false" Multiple="false" />
Expand Down
8 changes: 8 additions & 0 deletions Sources/VKSharp/Api/Generated/VkApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,14 @@ await _parent.Executor.ExecAsync(
)
)
;
}
public async Task GetLastActivityAsync( int userId ){
await _parent.Executor.ExecAsync(
_parent._reqapi.MessagesGetLastActivity(
userId
)
)
;
}
public async Task DeleteDialogAsync( uint userId , uint offset = 0, uint count = 100 ){
await _parent.Executor.ExecAsync(
Expand Down
5 changes: 2 additions & 3 deletions Sources/VKSharp/Core/Entities/BanInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
namespace VKSharp.Core.Entities {
public class BanInfo : IVKEntity<BanInfo> {
public uint AdminId{ get; set; }
public uint AddDate { get; set; }
public uint Date { get; set; }
public uint EndDate { get; set; }
public string Reason { get; set; }
public string Comment { get; set; }


public bool CommentVisible { get; set; }
}
}
15 changes: 15 additions & 0 deletions Sources/VKSharp/Core/Entities/Chat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VKSharp.Core.Entities {
public class Chat {
public long Id { get; set; }
public string Type { get; set; }
public string Title { get; set; }
public long? AdminId { get; set; }
public int[] Users { get; set; }
}
}
2 changes: 2 additions & 0 deletions Sources/VKSharp/Core/Entities/City.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace VKSharp.Core.Entities {
public class DatabaseCity : DatabaseEntry, IVKEntity<DatabaseCity> {
public string Area { get; set; }
public string Region { get; set; }
public bool Important { get; set; }
}
}
19 changes: 8 additions & 11 deletions Sources/VKSharp/Core/Entities/Comment.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
using VKSharp.Core.Interfaces;
using VKSharp.Core.EntityFragments;
using VKSharp.Core.Interfaces;

namespace VKSharp.Core.Entities {
public class Comment : IVKEntity<Comment> {

public Attachment[] Attachments { get; set; }
public CommentLikes Likes { get; set; }
public long Id{ get; set; }
public int FromId{ get; set; }
public int ReplyToId{ get; set; }
public int UserId{ get; set; }
public string Text { get; set; }
public uint Date { get; set; }
public uint Id{ get; set; }
public uint ReplyToCId{ get; set; }


public string Text { get; set; }
public int ReplyToUser{ get; set; }
public long ReplyToComment { get; set; }
public Attachment[] Attachments { get; set; }
public CommentLikes Likes { get; set; }
}
}
1 change: 0 additions & 1 deletion Sources/VKSharp/Core/Entities/Counter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace VKSharp.Core.Entities {
public class Counter : IVKEntity<Counter> {

public uint Count { get; set; }
}
}
3 changes: 0 additions & 3 deletions Sources/VKSharp/Core/Entities/DatabaseEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

namespace VKSharp.Core.Entities {
public class DatabaseEntry : IVKEntity<DatabaseEntry> {


public string Title { get; set; }

public int Id { get; set; }
}
}
13 changes: 7 additions & 6 deletions Sources/VKSharp/Core/Entities/Geo.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using VKSharp.Core.Interfaces;

namespace VKSharp.Core.Entities {
public class Geo:IVKEntity<Geo> {

//todo:check geo
public class Geo : IVKEntity<Geo> {

public string Address { get; set; }
public string Title { get; set; }
public string Type { get; set; }
public uint CityId{ get; set; }
public uint CountryId{ get; set; }
public uint PlaceId{ get; set; }
public uint CityId { get; set; }
public uint CountryId { get; set; }
public uint PlaceId { get; set; }



}
}
12 changes: 10 additions & 2 deletions Sources/VKSharp/Core/Entities/Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ public class Group:IVKEntity<Group> {

public bool IsAdmin { get; set; }
public bool IsClosed { get; set; }
public Deleted? Deactivated { get; set; }
public string Activity { get; set; }
public bool IsMember { get; set; }
public bool? CanCreateTopic { get; set; }
public bool? CanPost { get; set; }
public bool? CanUploadDoc { get; set; }
public bool? CanUploadVideo { get; set; }
public bool? CanSeeAllPosts { get; set; }
public bool? Verified { get; set; }
public GroupAdminLevel AdminLevel { get; set; }
public GroupCounters Counters { get; set; }
public PageType PageType { get; set; }
public Place Place { get; set; }
public ProfilePhotos Photos { get; set; }
//todo: photos mapping(50,100,200)
public string Contacts { get; set; }
public string Description { get; set; }
public string Links { get; set; }
public string Name { get; set; }
public string ScreeName { get; set; }
public string ScreenName { get; set; }
public string Site { get; set; }
public string Status { get; set; }
public string WikiPage { get; set; }
Expand All @@ -32,7 +37,10 @@ public class Group:IVKEntity<Group> {
public uint? MembersCount { get; set; }
public uint? PostId { get; set; }
public uint? StartDate { get; set; }
public uint? FinishDate { get; set; }
public uint? FixedPost { get; set; }
public long? MainAlbumId { get; set; }



}
}
4 changes: 1 addition & 3 deletions Sources/VKSharp/Core/Entities/Place.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

namespace VKSharp.Core.Entities {
public class Place:IVKEntity<Place> {
public uint Id { get; set; }
public uint Id { get; set; }
public uint Title { get; set; }
public uint Latitude { get; set; }
public uint Longitude { get; set; }
public uint Country { get; set; }
public string Type { get; set; }
public uint City { get; set; }
public string Address { get; set; }


}
}
3 changes: 2 additions & 1 deletion Sources/VKSharp/Core/Entities/Post.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using VKSharp.Core.Enums;
using VKSharp.Core.EntityFragments;
using VKSharp.Core.Enums;
using VKSharp.Core.Interfaces;

namespace VKSharp.Core.Entities {
Expand Down
1 change: 0 additions & 1 deletion Sources/VKSharp/Core/Entities/University.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ public class University: IVKEntity<University> {
public uint? Faculty { get; set; }
public ushort? Graduation { get; set; }


}
}
12 changes: 8 additions & 4 deletions Sources/VKSharp/Core/Entities/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public class User : IVKEntity<User>, IEquatable<User> {
public string Activities { get; set; }
public string Books { get; set; }
public string Domain { get; set; }
public string FacultyName { get; set; }
public string FirstName { get; set; }
public string Games { get; set; }
public string HomePhone { get; set; }
Expand All @@ -73,19 +72,24 @@ public class User : IVKEntity<User>, IEquatable<User> {
public string Site { get; set; }
public string Status { get; set; }
public string Tv { get; set; }
public string UniversityName { get; set; }
public StandInLife Personal { get; set;}
public uint? CommonCount { get; set; }
public uint Id { get; set; }
public GeoEntry City { get; set; }
public GeoEntry Country { get; set; }


//todo: move to education
public string UniversityName { get; set; }
public string FacultyName { get; set; }
public uint? Faculty { get; set; }
public uint? University { get; set; }
public ushort? Graduation { get; set; }

public uint? FollowersCount { get; set; }
public uint? OnlineApp { get; set; }
public uint? University { get; set; }
public uint[] Lists { get; set; }
public University[] Universities { get; set; }
public ushort? Graduation { get; set; }

public bool Equals( User other ) => !ReferenceEquals( other, null ) && Id == other.Id;

Expand Down
10 changes: 10 additions & 0 deletions Sources/VKSharp/Core/Entities/VideoAlbum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using VKSharp.Core.Interfaces;

namespace VKSharp.Core.Entities {
public class VideoAlbum : OwnedEntity<VideoAlbum> {
public string Title { get; set; }
public long? Count { get; set; }
public string Photo160 { get; set; }
public string Photo320 { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using VKSharp.Core.Interfaces;

namespace VKSharp.Core.Entities {
namespace VKSharp.Core.EntityFragments {
public class CommentLikes:IVKEntity<CommentLikes> {
public uint Count { get; set; }
public bool? UserLikes { get; set; }
public bool? CanLike { get; set; }


public bool? CanPublish { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using VKSharp.Core.Interfaces;

namespace VKSharp.Core.Entities {
namespace VKSharp.Core.EntityFragments {
public class PostComments:IVKEntity<PostComments> {
public uint Count { get; set; }
public bool? CanPost { get; set; }


}
}
15 changes: 15 additions & 0 deletions Sources/VKSharp/Core/Enums/ChangeNameStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VKSharp.Core.Enums {
public enum ChangeNameStatus {
Processing,
Declined,
Success,
WasAccepted,
WasDeclined
}
}
16 changes: 16 additions & 0 deletions Sources/VKSharp/Core/ResponseEntities/ChangeNameRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VKSharp.Core.Enums;

namespace VKSharp.Core.ResponseEntities {
public class ChangeNameRequest {
public int? Id { get; set; }
public ChangeNameStatus? Status { get; set; }
public string RepeatDate { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
}
7 changes: 7 additions & 0 deletions Sources/VKSharp/Core/ResponseEntities/LastActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System;
namespace VKSharp.Core.ResponseEntities {
public class LastActivity {
public bool? IsOnline { get; set; }
public long? Time { get; set; }
}
}
Loading

0 comments on commit e4d34c8

Please sign in to comment.