-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add API endpoints for sending messages with different types (t…
…ext, image, audio, video) in group and friend chats
- Loading branch information
Showing
25 changed files
with
303 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export default function ChatTalkTitleContent(props: { children: string }) { | ||
return <p>{props.children}</p>; | ||
import { AppStateType } from "../util/types.ts"; | ||
export default function ChatTalkTitleContent(props: { state: AppStateType }) { | ||
return <p>{props.state.roomName.value}</p>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//音声メッセージを送信 | ||
// POST /api/v2/client/talks/sending/audio | ||
// { audio: file, csrftoken: string, roomid: string, channel: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//画像を送信 | ||
// POST /api/v2/client/talks/sending/image | ||
// { image: file, csrftoken: string, roomid: string, channel: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//textメッセージを送信する | ||
// POST /api/v2/client/talks/sending/text | ||
// { text: string, csrftoken: string, roomid: string, channel: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//textメッセージを編集する | ||
// POST /api/v2/client/talks/sending/update | ||
// { text: string, csrftoken: string, roomid: string, channel: string, messageid: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//動画を送信するapi | ||
// POST /api/v2/client/talks/sending/video | ||
// { video: file, csrftoken: string, roomid: string, channel: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//音声メッセージを送信 | ||
// POST /api/v2/client/talks/sending/audio | ||
// { audio: file, csrftoken: string, roomid: string, channel: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//画像を送信 | ||
// POST /api/v2/client/talks/sending/image | ||
// { image: file, csrftoken: string, roomid: string, channel: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//textメッセージを送信する | ||
// POST /api/v2/client/talks/sending/text | ||
// { text: string, csrftoken: string, roomid: string, channel: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//textメッセージを編集する | ||
// POST /api/v2/client/talks/sending/update | ||
// { text: string, csrftoken: string, roomid: string, channel: string, messageid: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//動画を送信するapi | ||
// POST /api/v2/client/talks/sending/video | ||
// { video: file, csrftoken: string, roomid: string, channel: string } | ||
// -> { status: boolean, message: string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Cache the elements outside the function if they are used multiple times throughout the app | ||
let headerElement: HTMLElement | null; | ||
let chatmainElement: HTMLElement | null; | ||
let chatHeaderElement: HTMLElement | null; | ||
|
||
export const setIschoiseUser = (ischoiseUser: boolean, obj: any) => { | ||
if (!headerElement || !chatmainElement || !chatHeaderElement) { | ||
headerElement = document.getElementById("header"); | ||
chatmainElement = document.getElementById("chatmain"); | ||
chatHeaderElement = document.getElementById("chatHeader"); | ||
} | ||
if (ischoiseUser) { | ||
headerElement?.classList.add("is-inview"); | ||
chatmainElement?.classList.add("is-inview"); | ||
chatHeaderElement?.classList.remove("hidden"); | ||
} else { | ||
headerElement?.classList.remove("is-inview"); | ||
chatmainElement?.classList.remove("is-inview"); | ||
chatHeaderElement?.classList.add("hidden"); | ||
} | ||
// Only update obj.value if necessary | ||
if (obj.value !== ischoiseUser) { | ||
obj.value = ischoiseUser; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters