Fix mention message
This commit is contained in:
parent
9eadc918f0
commit
a9739c453b
2 changed files with 6 additions and 4 deletions
|
|
@ -15,9 +15,6 @@ class Post(Document):
|
|||
frappe.publish_realtime('global_pin', after_commit=True)
|
||||
|
||||
def after_insert(self):
|
||||
mentions = extract_mentions(self.content)
|
||||
for mention in mentions:
|
||||
frappe.publish_realtime('mention', "Someone mentioned you", user=mention, after_commit=True)
|
||||
frappe.publish_realtime('new_post', self.owner, after_commit=True)
|
||||
|
||||
@frappe.whitelist()
|
||||
|
|
|
|||
|
|
@ -11,5 +11,10 @@ class PostComment(Document):
|
|||
def after_insert(self):
|
||||
mentions = extract_mentions(self.content)
|
||||
for mention in mentions:
|
||||
frappe.publish_realtime('mention', "Someone mentioned you", user=mention, after_commit=True)
|
||||
if mention == self.owner: continue
|
||||
frappe.publish_realtime('mention', """{} mentioned you!
|
||||
<br><a class="text-muted text-small" href="desk#social/home">Check Social<a>"""
|
||||
.format(frappe.utils.get_fullname(self.owner)),
|
||||
user=mention,
|
||||
after_commit=True)
|
||||
frappe.publish_realtime('new_post_comment' + self.parent, self, after_commit=True)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue