Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
449c83b
change login function
Hosam-Kawkgy May 10, 2026
3c6aa90
fix notification
Hosam-Kawkgy May 10, 2026
477bc1d
add icon to menu
Hosam-Kawkgy May 10, 2026
f534fee
open topic in new window
Hosam-Kawkgy May 10, 2026
46b1b89
fix: normalize topic separators, fix ReLink Topic display and instant…
Hosam-Kawkgy May 11, 2026
1f2788d
fix: add topic_color to all API get_topic_info endpoints, fix ChatSpa…
Hosam-Kawkgy May 11, 2026
86a2826
add open button to topic separator, hide topic menu in topic window, …
Hosam-Kawkgy May 11, 2026
f721046
change color for topic header
Ali-alammori May 12, 2026
22f2102
doctype mentions now add to existing topic instead of creating a new one
Ali-alammori May 12, 2026
2399432
remove scroll to first topic and make topic link open new chat window
Ali-alammori May 12, 2026
f8a94c3
add arabic translation for mobile app
Ali-alammori May 12, 2026
a16c8d5
fix edit link problem
Ali-alammori May 12, 2026
a109dcd
fix(chat): update topic edit dialog to exclude reference fields and s…
Ali-alammori May 13, 2026
734bcce
feat: improve closed topic behavior in chat topic window
Ali-alammori May 13, 2026
eed1560
feat(chat): improve topic relink menu and realtime behavior- Split th…
mohamadclefincode1998 May 14, 2026
9bef313
fix(chat): render topic link messages as separators
mohamadclefincode1998 May 14, 2026
0d47a8e
fix(chat): refine topic system message rendering
mohamadclefincode1998 May 14, 2026
ac169aa
feat: manage chat topics in separate window
clefincode May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
*.swp
tags
clefincode_chat/docs/current
node_modules/
node_modules/
/clefincode_chat/public/dist/
2 changes: 1 addition & 1 deletion clefincode_chat/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.3.902'
__version__ = '1.3.903'
685 changes: 629 additions & 56 deletions clefincode_chat/api/api_1_3_3/api.py

Large diffs are not rendered by default.

733 changes: 624 additions & 109 deletions clefincode_chat/api/api_1_3_4/api.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,65 @@
// Copyright (c) 2024, Ahmad Kamaleddin and contributors
// For license information, please see license.txt

frappe.ui.form.on("ClefinCode ClefinCode Chat Channel", {
// refresh: function(frm) {
// }
frappe.ui.form.on("ClefinCode Chat Channel", {
refresh(frm) {
if (frm.is_new()) return;

frm.add_custom_button(__("Open Chat"), async () => {
try {
const r = await frappe.call({
method: "clefincode_chat.api.api_1_3_3.api.get_channel_open_context",
args: { chat_channel: frm.doc.name },
});

const ctx = r.message || {};

if (!ctx.can_open) {
frappe.msgprint({
title: __("Access Denied"),
message: __("You do not have access to this chat channel."),
indicator: "red",
});
return;
}

const room = ctx.room;

if (window.CCCheckIfChatWindowOpen(room, "room")) {
$(`.expand-chat-window[data-id|='${room}']`).click();
return;
}

const profile = {
is_admin: true,
user: frappe.session.user,
user_email: frappe.session.user_email || frappe.session.user,
room: room,
room_name: ctx.room_name || room,
room_type: ctx.room_type || "Group",
platform: ctx.platform || "Chat",
chat_status: ctx.chat_status,
is_removed: ctx.is_removed || 0,
remove_date: ctx.remove_date || null,
};

const chat_window = new window.CCChatWindow({
profile: { room },
});

new window.CCChatSpace({
$wrapper: chat_window.$chat_window,
profile,
chat_status: ctx.chat_status,
});
} catch (err) {
frappe.msgprint({
title: __("Error"),
message: __("Failed to open chat channel."),
indicator: "red",
});
console.error("[ClefinCode Chat] Open channel error", err);
}
});
},
});
Original file line number Diff line number Diff line change
@@ -1,8 +1,73 @@
// Copyright (c) 2024, Ahmad Kamaleddin and contributors
// For license information, please see license.txt

frappe.ui.form.on('ClefinCode Chat Message', {
// refresh: function(frm) {
frappe.ui.form.on("ClefinCode Chat Message", {
refresh(frm) {
if (frm.is_new()) return;

// }
frm.add_custom_button(__("Open Chat"), async () => {
try {
const r = await frappe.call({
method: "clefincode_chat.api.api_1_3_3.api.get_message_open_context",
args: { message_name: frm.doc.name },
});

const ctx = r.message || {};

if (ctx.can_open !== true) {
frappe.msgprint({
title: __("Not Allowed"),
message: __("You are not allowed to open this chat channel."),
indicator: "orange",
});
return;
}

const room = ctx.chat_channel;

if (window.CCCheckIfChatWindowOpen(room, "room")) {
$(`.expand-chat-window[data-id|='${room}']`).click();
setTimeout(() => {
const instances = window.CCChatSpaceInstances || [];
for (const cs of instances) {
if (cs && cs.profile?.room === room && typeof cs.jumpToMessage === "function") {
cs.jumpToMessage(ctx.message_name);
break;
}
}
}, 300);
return;
}

const profile = {
is_admin: true,
user: frappe.session.user,
user_email: frappe.session.user_email || frappe.session.user,
room: room,
room_name: ctx.room_name || room,
room_type: ctx.room_type || "Group",
platform: ctx.platform || "Chat",
chat_status: ctx.chat_status,
};

const chat_window = new window.CCChatWindow({
profile: { room },
});

new window.CCChatSpace({
$wrapper: chat_window.$chat_window,
profile,
chat_status: ctx.chat_status,
initial_message_to_scroll: ctx.message_name,
});
} catch (e) {
console.error("Failed to open chat message", e);
frappe.msgprint({
title: __("Error"),
message: __("Failed to open chat message."),
indicator: "red",
});
}
});
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"chat_platform",
"token",
"last_active",
"app_language",
"contact_details",
"registration_token",
"platform",
Expand Down Expand Up @@ -100,6 +101,12 @@
"fieldname": "chat_platform",
"fieldtype": "Data",
"label": "Chat Platform"
},
{
"fieldname": "app_language",
"fieldtype": "Link",
"label": "App Language ",
"options": "Language"
}
],
"index_web_pages_for_search": 1,
Expand All @@ -110,7 +117,7 @@
"link_fieldname": "name"
}
],
"modified": "2026-01-07 16:33:40.605746",
"modified": "2026-05-11 14:52:38.884237",
"modified_by": "Administrator",
"module": "ClefinCode Chat",
"name": "ClefinCode Chat Profile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,38 @@
// For license information, please see license.txt

frappe.ui.form.on('ClefinCode Chat Topic', {
// refresh: function(frm) {
after_save(frm) {
const topicName = frm.doc.name;
if (!topicName) return;

// }
$(".chat-space").each(function () {
const chatSpace = $(this).data("chat-space-instance");
if (chatSpace && chatSpace.refreshTopicColor) {
chatSpace.refreshTopicColor(topicName);
}
});
},

refresh(frm) {
if (frm.is_new()) return;

frm.add_custom_button(__("Open Chat"), async () => {
const openFn = window.CiCOpenTopicChatWindowFromContext;

if (typeof openFn !== "function") {
frappe.msgprint({
title: __("Error"),
message: __("Topic chat opener is not available."),
indicator: "red"
});
return;
}

await openFn({
chat_topic: frm.doc.name,
chat_topic_subject: frm.doc.subject || frm.doc.name,
topic_color: frm.doc.topic_color || null
});
});
}
});
Loading
Loading