Skip to content

Commit 411255e

Browse files
committed
update mention handle parsing
1 parent 83d0ea8 commit 411255e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

connect/connectNotificationServer.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ const getNotificationsForMentionedUser = (eventConfig, content) => {
6666
}
6767

6868
let notifications = [];
69-
const regexUserId = /@([a-zA-Z0-9-_.{}\[\]]+)/g;
69+
const regexUserHandle = /title=\"@([a-zA-Z0-9-_.{}\[\]]+)\"/g;
7070
let handles=[];
71-
let matches = regexUserId.exec(content);
72-
console.log("matches"+matches)
71+
let matches = regexUserHandle.exec(content);
72+
console.log(content)
7373
while (matches) {
7474
let handle = matches[1].toString();
7575
notifications.push({
@@ -79,17 +79,15 @@ const getNotificationsForMentionedUser = (eventConfig, content) => {
7979
toUserHandle: true,
8080
},
8181
});
82-
matches = regexUserId.exec(content);
82+
matches = regexUserHandle.exec(content);
8383
handles.push(handle);
8484
}
8585
// only one per userHandle
8686
notifications = _.uniqBy(notifications, 'userHandle');
8787

8888
return new Promise((resolve)=>{
8989
service.getUsersByHandle(handles).then((users)=>{
90-
console.log(users);
9190
_.map(notifications,(notification)=>{
92-
console.log("userhandle: "+notification.userHandle);
9391
notification.userId = _.find(users,{handle:notification.userHandle}).userId;
9492
});
9593
resolve(notifications);

0 commit comments

Comments
 (0)