Commit Graph

862 Commits (98b70c6b8e5a86f7d01b39cecb02673bf7701a8d)

Author SHA1 Message Date
Barış Soner Uşaklı f9d6912b4a refactor: async/await file
Barış Soner Uşaklı 96ab8d05aa fix: only allow png/jpg/bmp in cover/profile images
Baris Usakli ecf39727cc fix:
Opliko b9583ed838 Add privilege for accessing user information ()
* Add view users info global privilege

* Show user ip only to global mods and admins

* fix missing comma

* Hide link for users without correct privilege

* move getting privilege information to getAllData

* Hide the link from Global Moderators as well

* Give Global Moderator view:users:info privilege

* Restrict ip in post menu to view:users:info

* add some trailing commas....

* Add privilege to categories test

* Add group privilege to categories test

* add upgrade script

* fix style for TravisCI

* more styling - change spaces to tabs

* some more styling fixes (hopefully final one)

* fix style for Travis CI

* hide ip in chat messages

* Don't show even hidden ips on user profile page
Barış Soner Uşaklı de4619689b fix: change params
Julian Lam 1796b65d34 feat: option to restrict group leaving, closes
Julian Lam 30a86ed553 fix: , dissociation on post purge
Barış Soner Uşaklı aea04de094
feat: update LESS to v3.x, ()
* feat: 

* fix: tests
Barış Soner Uşaklı f15c7f12b3 refactor: async/await
Barış Soner Uşaklı 1e0190abef fix: , groups.invite works with an array of uids
Barış Soner Uşaklı fa26855671 feat: , make isInvited, isPending work with uids
Julian Lam c44bf48c01 fix: removed console.logs
Julian Lam f736f0b382 fix: broken tests from 71b205a889
Barış Soner Uşaklı 23046bab9a Merge branch 'master' of https://github.com/NodeBB/NodeBB
Baris Usakli 2abe244b6e fix: newPostEditDuration
Barış Soner Uşaklı dec8040c09 feat: widgets/index.js
enable widget-essentials in tests
fix widget test
Barış Soner Uşaklı 3c32d8600f
fix: No new posts ()
* feat: debug no-new-posts

* feat: add test for user delete

* fix: timeout for flag test

* feat: shorter
Julian Lam 79eed9ae60 feat: meta/templates.js
Barış Soner Uşaklı 0b498acdcf fix:
Barış Soner Uşaklı 2f0a331f02 fix: don't return promise
Barış Soner Uşaklı 44a3352003 fix: socket.io methods calling callbacks twice if method returns promise
Julian Lam 4fb271c684
System chat messages ()
* fix: removed duplicate checkContent call in addMessage

addMessage is called in one place (sendMessage), and the checks
are already contained there. addMessage is the lower level call
and so should be called only from within core itself.

* feat:  chat system messages for join, leave, rename

* fix: add back content checking in .addMessage();

* fix: tests, and added .addSystemMessage() method

Tests were relying on message indices that changed due to the
new system messages.

* feat: add tests for system chat messages

* refactor: rewrite half of src/messaging/rooms.js, fix tests

* feat:  messaging/room.js

* fix: tests for messaging/room.js, 

* fix: trying to fix tests

* fix: omg :rage2:
Barış Soner Uşaklı c0c6c652be feat: , finish post module
Barış Soner Uşaklı 1b2b308a7e feat: , posts module
Barış Soner Uşaklı cd80c2638c feat:
user/password
user/picture
Barış Soner Uşaklı 0a690c5710 feat:
user/online.js
Barış Soner Uşaklı fe4c048198 feat:
user/index.js
user/info.js
user/invite.js
user/jobs.js
Barış Soner Uşaklı cd2e68cb2d feat: remove unused code, add 2 tests
Barış Soner Uşaklı 53e1b349ae
Change post owner ()
* feat: , allow array of keys for setObject

* feat: sortedSetRemoveBulk

* feat: test for bulk remove

* feat: , ability to change post ownership

* feat: , fix tid:<tid>:posters

* feat: , front end

* fix: , psql methods

* fix: add missing await

* fix: maybe psql
Barış Soner Uşaklı 4170abfd6b feat: add utils.promiseParallel
Barış Soner Uşaklı 805dcd7ca2
Async refactor in place ()
* feat: allow both callback&and await

* feat: ignore async key

* feat: callbackify and promisify in same file

* Revert "feat: callbackify and promisify in same file"

This reverts commit cea206a9b8e6d8295310074b18cc82a504487862.

* feat: no need to store .callbackify

* feat: change getTopics to async

* feat: remove .async

* fix: byScore

* feat: rewrite topics/index and social with async/await

* fix: rewrite topics/data.js

fix issue with async.waterfall, only pass result if its not undefined

* feat: add callbackify to redis/psql

* feat: psql use await

* fix: redis 🌋

* feat: less returns

* feat: more await rewrite

* fix: redis tests

* feat: convert sortedSetAdd

rewrite psql transaction to async/await

* feat: 🐶

* feat: test

* feat: log client and query

* feat: log bind

* feat: more logs

* feat: more logs

* feat: check perform

* feat: dont callbackify transaction

* feat: remove logs

* fix: main functions

* feat: more logs

* fix: increment

* fix: rename

* feat: remove cls

* fix: remove console.log

* feat: add deprecation message to .async usage

* feat: update more dbal methods

* fix: redis :voodoo:

* feat:  fix redis zrem, convert setObject

* feat: upgrade getObject methods

* fix: psql getObjectField

* fix: redis tests

* feat: getObjectKeys

* feat: getObjectValues

* feat: isObjectField

* fix: add missing return

* feat: delObjectField

* feat: incrObjectField

* fix: add missing await

* feat: remove exposed helpers

* feat: list methods

* feat: flush/empty

* feat: delete

* fix: redis delete all

* feat: get/set

* feat: incr/rename

* feat: type

* feat: expire

* feat: setAdd

* feat: setRemove

* feat: isSetMember

* feat: getSetMembers

* feat: setCount, setRemoveRandom

* feat: zcard,zcount

* feat: sortedSetRank

* feat: isSortedSetMember

* feat: zincrby

* feat: sortedSetLex

* feat: processSortedSet

* fix: add mising await

* feat: debug psql

* fix: psql test

* fix: test

* fix: another test

* fix: test fix

* fix: psql tests

* feat: remove logs

* feat: user arrow func

use builtin async promises

* feat: topic bookmarks

* feat: topic.delete

* feat: topic.restore

* feat: topics.purge

* feat: merge

* feat: suggested

* feat: topics/user.js

* feat: topics modules

* feat: topics/follow

* fix: deprecation msg

* feat: fork

* feat: topics/posts

* feat: sorted/recent

* feat: topic/teaser

* feat: topics/tools

* feat: topics/unread

* feat: add back node versions

disable deprecation notice
wrap async controllers in try/catch

* feat: use db directly

* feat: promisify in place

* fix: redis/psql

* feat: deprecation message

logs for psql

* feat: more logs

* feat: more logs

* feat: logs again

* feat: more logs

* fix: call release

* feat: restore travis, remove logs

* fix: loops

* feat: remove .async. usage
Julian Lam 8a6a58ee43
feat: added new admin option newbiePostEditDuration ()
* feat: added new admin option newbiePostEditDuration

Also:
  - Grammar-checked a couple language strings
  - Moved a couple form inputs around in new user restrictions
  - Added a test for the new option
  - fix: 'defore' typo
Barış Soner Uşaklı bd640a1107
Topic await errors ()
* feat: derp await

* feat: restore user.getSettings

* feat: cleanup

* feat: make tid const

* feat: cleanup

* fix: tests

* feat: deprecate filter:controllers.topic.get

* feat: rewrite post-index logic

* feat: change calculation to match others

* fix: use .async

* feat: remove try/catch wrapper
Barış Soner Uşaklı 3ecd703ea3 feat: , added sortedSetAddBulk
Barış Soner Uşaklı a39f0ef592 fix: , create per category user post zsets
Julian Lam 289dada5f7 fix(deps): update to eslint@6
Aziz Khoury a6436716ea feat: hooks can now return promise or call callbacks
* hooks can now return promise or call callbacks, either way works

* cleanups

* moar cleanups and fix callback 1st null arg

* rm unnessesary spread
Barış Soner Uşaklı 4b843ba16f fix: , allow invite and approval at the same time
Baris Usakli 31ccc860d3 feat: allow multiple scores in sortedSetsAdd
Barış Soner Uşaklı 8aef689f05 fix: no need for moderate bit for global mods and admins
Barış Soner Uşaklı 035f624758
Remove implicit mod privs. closes ()
* feat: add upgrade script to give mods privs

* feat: give all privileges when making a moderator

* feat: remove implicit privs

* feat: give global mods default privs

* feat: more priv fixes

* feat: use lodash

* fix: remove implicit mod priv from topic delete

* fix: more privs

* fix: posts.canEdit

* fix: canDelete and canEdit

* fix: tests, remove console.log

* feat: shorter functions

* feat: add tests

* fix: uids

* fix: redis random test fail
Baris Usakli 64679b37cc fix: , fix getModeratorUids
sets.groupNames is an array that contains other arrays of groupnames so passing it to getMembersOfGroups returned wrong results when there were more than 1 element in it.
Barış Soner Uşaklı dfab231afd
Copy group privs ()
* feat: ability to copy a groups privileges

ability to copy a group's privileges to all categories, or children of current category

* feat: switch to dropdown

added copy from category to groups

* fix: indents
Barış Soner Uşaklı b990312088 fix: test
Barış Soner Uşaklı 2c98dd5f9d
Object cache refactor ()
* fix: cache refactor

db.getObjectField no longer loads entire object
db.getObjectsFields only clones data once
more tests

* feat: add back cache to redis

db.getObjectField no longer loads entire object
Julian Lam 808c4909a4
fix: only apply whitelist when fields request empty ()
* fix:  only apply whitelist when fields request empty

* feat: explicit password retrieval denied via getUsersFields
Aziz Khoury 3fbb6faf28 feat: update unban logic/invocation and refactor User.bans module
* auto unban when User.getUsersFields is called and the user is banned but has expired

* cleanups and removal of expiry_readable

* expiry_readable make an alias for backward compatibility

* User.bans.func vs User.*ban*Func

* console.log cleanups, plus todo message added

* use code util.deprecate

* fix: remove ununsed winston require
Barış Soner Uşaklı 2ee2cd528f feat:
Barış Soner Uşaklı b52dba5c92 fix:
Barış Soner Uşaklı c12e1d19a7 fix: tests
Julian Lam 697a6597f3
fix: Re-factor handling of og:image tags ()
* fix: display proper site logo or og-image with sizes in head

* fix: refactor og:image logic, 

- Updated logic to set additional og:image tags based on more
  factors
- logo.png fallback

* feat: save image sizes on post upload, re: 

* fix: awaiting addTags in topic controller

* fix: pass strings to meta tags object

* fix: sending absolute image url to meta tag

* fix: removed unneeded async and requiring sync db

* feat: upgrade to calculate image sizes for all post uploads tracked

* fix: tests
Julian Lam 745a9589e9
Use topics:read privilege for topic filtering use cases ()
* fix: use topics:read privilege for topic filtering use cases

* fix: tests

* fix: more broken tests
Baris Usakli f9d92db5d5 fix: typo
Baris Usakli e71ae80cbc fix: tests
Baris Usakli 23da300958 feat: pass options to digest
Julian Lam d3a10628e7 fix: broken 50% border radius on emails, failing tests
Julian Lam 3a7f1c192b fix: failing tests from revamped-emails branch
Barış Soner Uşaklı c6ad8fae2a fix:
Barış Soner Uşaklı 5917dec288
fix: only allow numbers as scores ()
* zadd score checks

* fix: only allow numbers as scores

* fix: convert values to strings
Julian Lam 0c09b7402d feat: logging password resets and errors into event log
closes , also adds tests for password reset socket calls
Barış Soner Uşaklı c72da5595a fix:
3 new global privileges
view:users
view:tags
view:groups
Barış Soner Uşaklı ae779ea4f9 fix:
Barış Soner Uşaklı 9d1fcf4e36 fix: closes
Barış Soner Uşaklı 5353960ae7 fix:
Barış Soner Uşaklı bc41848adb fix: test
renovate[bot] 8a64667ff8 fix(deps): update dependency sharp to v0.21.3 ()
* fix(deps): update dependency sharp to v0.21.3

* fix: tests for new sharp version errors
Julian Lam c831ff0de3
fix: removal of timeago fallback middleware ()
* fix: removal of timeago fallback middleware

Instead of loading English fallback on missing language, we opt
to not send a script tag for a missing language to begin with.

Timeago already loads with English as default, so it will just
continue to use English.

* fix: check userLang against supported language codes

* fix: cleaned up code as per @pitaj

* fix: added comments

* fix: more fixes as per @pitaj

* feat: added addl. test for timeago locales, fixed broken test
Julian Lam 70a87d4399
feat: support for one-click unsubscribe from email clients ()
* feat: sending notifs via ACP creates real notification

re: 

* feat: basic integration for one-click unsubscription 

* feat: tests for  + bugfix

* feat: added and organized digest unsub tests

closes 
renovate[bot] 84e228bbb8 fix(deps): update dependency diff to v4 ()
* fix(deps): update dependency diff to v4

* chore(deps): +diff@4.0.1

* fix: test for 
Baris Usakli 7809ba2800 fix: , closes
Barış Soner Uşaklı 3917022a48 fix:
Barış Soner Uşaklı 7e828404f6 fix:
dont save relative_path in db for group covers
Baris Usakli 0c1ac4d6a2 feat:
Barış Soner Uşaklı fef7e13c9e feat: small fixes
Barış Soner Uşaklı 99e0895e99 fix: move the check to get methods
all .post methods will have csrf
Barış Soner Uşaklı eb7ae54f81
Category watch state ()
* feat: wip, category watch change

* feat: pass data to client

* feat: allow changing state

* fix: account page categories

* fix: show in unread if topic is followed or category is watched

* feat: add default watch state to acp

* feat: save user category watch state

* feat: update unread recent pages

* fix: remove dupe code

* fix: flip conditions

* fix: handle empty arrays

* fix: ignore/watch on others profile

* feat: upgrade script for category states

if there are any users ignoring categories set their state in new zset and delete cid:<cid>:ignorers

* fix: upgrade

* fix: tests

* fix: redis count

* fix: more tests
Barış Soner Uşaklı 263c918088
feat: remove uid:<uid>:ignored:cids ()
use cid:<cid>:ignorers instead
Barış Soner Uşaklı 26ccd8f626 fix: db info page
if there is no connection to db, connect first
Barış Soner Uşaklı 81aa3a0b8a fix: don't crash in flags.validate if user blocked target
Barış Soner Uşaklı e55fb43703 fix:
Baris Usakli e65d40c937 dont return undefined from sortedSetsCard if keys is empty or falsy
Baris Usakli 76af8caf58 add missing semicolon
Baris Usakli 420227faae parseFloat scores
Julian Lam 5f3d1c76c8
fix: , autoLocale logic not playing nicely with no-refresh auths ()
* fix: , autoLocale logic not playing nicely with no-refresh auths

- on login, req.query.lang is deleted (since it seems to be left over)
- on logout, the middleware.autoLocale is executed, which resets
  req.query.lang
- middleware.autoLocale is new, just refactored existing logic in
  webserver.js into new middleware method.

* style: tests, use lodash

* fix: timeago strings not switching languages on login or out
Baris Usakli d3c6cba33f closes
Barış Soner Uşaklı a63ddbe2aa fix:
if category doesn't exist return null and 404
Barış Soner Uşaklı 1f918ca8f8
Home route ()
* fix: WIP home fix

* remove console.log

* fix: 

on redis run all tests in subfolder /forum
fix URI errors
fix sping/ping
Baris Usakli cd46febdd0 fix lint
Baris Usakli b86f155690 fix:
Peter Jaszkowiak ba619c7ec8 style(eslint): match operator-linebreak preferences
Barış Soner Uşaklı 00a066985a cache categories:cid and cid:<cid>:children
these rarely change, no need to go to db for them
Barış Soner Uşaklı c240733aee fix logs test
Barış Soner Uşaklı 0361849bb1 check status code
Barış Soner Uşaklı 47b2057f20
Barış Soner Uşaklı 53ad2bbd6e
Categories optimize ()
* WIP

* fix category page

* fix counts, and copyPrivileges

* fix lint

* more fixes,

* redis fix

* fix test

* fix  category test

* remove getParentsAndChildren
Barış Soner Uşaklı 9d28b935fd dont load uid 0, -1 from db
Barış Soner Uşaklı a6864a8055 add groupTitle test for guests
Barış Soner Uşaklı ca1e3a758b
Baris Usakli b83e50f286 remove delayImageLoading from api @julianlam
Barış Soner Uşaklı afa84023a2 closes