Skip to content

Commit

Permalink
getbans
Browse files Browse the repository at this point in the history
  • Loading branch information
j-bitmaker committed Dec 29, 2023
1 parent a08dabe commit 3acbb65
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 5 deletions.
66 changes: 65 additions & 1 deletion js/satolist.js
Original file line number Diff line number Diff line change
Expand Up @@ -8609,6 +8609,65 @@ Platform = function (app, listofnodes) {

},

getbans : function(clbk){

var address = self.app.platform.sdk.address && self.app.platform.sdk.address.pnet().address;

console.log('getbans', address);

var params = [address];

self.app.api.rpc('getbans', params).then(d => {

console.log('DDDD', d);

var ban = d && d[0];

if (ban && ban.reason){

var showBanDialog = content => {

console.log('dddd', content);

console.log('currentblock', self.currentBlock);

var endDate = new Date(new Date().getTime() - (ban.ending - self.currentBlock) * 60 * 1000);


var formattedDate = convertDate(dateToStr(endDate));

new dialog({
html: self.app.localization.e('accountBanned') + '<br><br>' + self.app.localization.e('reason') + '<br><b>' + self.app.localization.e('lowstar_reason_' + ban.reason) + '. </b><br><br>' + self.app.localization.e('unlockDate') + '<br><b>' + formattedDate + '</b><br><br>' + self.app.localization.e('accountBannedActions'),
btn1text: 'OK',

class: 'zindex one',

})

self.app.platform.sdk.user.blocked = true;

if (clbk)
clbk();

}

self.app.api.rpc('getcontents', [ban.contentid]).then(showBanDialog)
.catch(e => {

showBanDialog(null, e);

})



}



})

},

getfullfb: function (clbk, update) {

self.sdk.users.getone(app.user.address.value, (user, error) => {
Expand Down Expand Up @@ -8808,6 +8867,8 @@ Platform = function (app, listofnodes) {

reputationBlockedMe : function(address, count){

if (self.app.platform.sdk.user.blocked) return true;

if(!address) address = self.app.user.address.value

return self.app.platform.sdk.user.itisme(address) && self.app.platform.sdk.user.reputationBlocked(address, count)
Expand Down Expand Up @@ -14638,12 +14699,15 @@ Platform = function (app, listofnodes) {

return self.app.api.rpc('getnodeinfo').then(d => {

debugger;

var t = deep(d, 'time') || 0

self.currentBlock = 0
self.timeDifference = 0;

try{

self.currentBlock = deep(d, 'lastblock.height') || localStorage['lastblock'] || 0
localStorage['lastblock'] = self.currentBlock
}catch(e){
Expand Down Expand Up @@ -22535,7 +22599,7 @@ Platform = function (app, listofnodes) {

setTimeout(function(){
self.sdk.tags.cloud()
self.sdk.node.get.time()
self.sdk.node.get.time(self.sdk.user.getbans);
}, 1000)

self.sdk.videos.init()
Expand Down
7 changes: 6 additions & 1 deletion localization/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -2782,4 +2782,9 @@ _l.registration_blocked = _l.lockedaccount
_l.horizontalSearchUsers = "Accounts"
_l.information = "Information"
_l.sendcoins = "Send PKOIN"
_l.notificationsTurnOffQ = 'Are you sure you want to turn off notifications from this user?'
_l.notificationsTurnOffQ = 'Are you sure you want to turn off notifications from this user?'

_l.accountBanned = "Your account has been blocked for actions contrary to the Bastyon rules.";
_l.reason = "Reason: ";
_l.accountBannedActions = "You can't post, comment, and do other similar activities, but you can continue to use your wallet.";
_l.unlockDate = "Unlock date:";
7 changes: 6 additions & 1 deletion localization/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -2567,4 +2567,9 @@ _l.registration_blocked = _l.lockedaccount
_l.horizontalSearchUsers = "Пользователи"
_l.information = "Информация"
_l.sendcoins = "Отправить PKOIN"
_l.notificationsTurnOffQ = 'Вы действительно хотите отключить уведомления от данного пользователя?'
_l.notificationsTurnOffQ = 'Вы действительно хотите отключить уведомления от данного пользователя?'

_l.accountBanned = "Ваш аккаут заблокирован за действия, противорчающие правилам пользования Bastyon. ";
_l.reason = "Причина: ";
_l.accountBannedActions = "Вы не можете публиковать сообщения, комментировать и совершать другие подобные действия, но можете продолжать использовать свой кошелек.";
_l.unlockDate = "Дата снятия блокировки:";
8 changes: 6 additions & 2 deletions proxy16/node/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ const publics = {
getalljury: true,
getjuryassigned: true,
getjurymoderators: true,
getaccountearning : true
getaccountearning : true,

getbans : true

}

Expand Down Expand Up @@ -512,7 +514,9 @@ RpcClient.callspec = {
getalljury: '',
getjuryassigned: 'str',
getjurymoderators: 'str',
getaccountearning : 'str int int'
getaccountearning : 'str int int',

getbans: 'str'
};

var slice = function(arr, start, end) {
Expand Down

0 comments on commit 3acbb65

Please sign in to comment.