Skip to content

Commit bc1fd00

Browse files
committed
in progress
1 parent 8c1fb7f commit bc1fd00

File tree

51 files changed

+95
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+95
-168
lines changed

projects/sample-app/src/app/app.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ export class AppComponent implements AfterViewInit {
5959
: environment.userToken,
6060
{ timeout: 10000 }
6161
);
62+
this.channelService.activeChannel$.subscribe((c) => {
63+
console.log(c?.data?.image);
64+
console.log(c?.state?.messages[0]?.color);
65+
console.log(c?.data?.color);
66+
});
6267
void this.channelService.init(
6368
environment.channelsFilter || {
6469
type: 'messaging',
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'stream-chat';
2+
3+
declare module 'stream-chat' {
4+
interface CustomChannelData {
5+
color: string;
6+
}
7+
8+
interface CustomMessageData {
9+
color: string;
10+
}
11+
}

projects/stream-chat-angular/src/lib/@types/stream-chat-common-custom-data.d.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

projects/stream-chat-angular/src/lib/attachment-configuration.service.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
22
import { Attachment } from 'stream-chat';
33
import {
44
AttachmentConfigration,
5-
DefaultStreamChatGenerics,
65
ImageAttachmentConfiguration,
76
VideoAttachmentConfiguration,
87
} from './types';
@@ -66,10 +65,8 @@ export class AttachmentConfigurationService {
6665
}
6766

6867
const defaultOriginalDimension = 1000000;
69-
const urlString = (attachment.img_url ||
70-
attachment.thumb_url ||
71-
attachment.image_url ||
72-
'') as string;
68+
const urlString =
69+
attachment.img_url || attachment.thumb_url || attachment.image_url || '';
7370
let url: URL;
7471
try {
7572
url = new URL(urlString);

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import { ChannelService } from '../channel.service';
1111
import { StreamI18nService } from '../stream-i18n.service';
1212
import { AttachmentListComponent } from './attachment-list.component';
1313
import { Attachment } from 'stream-chat';
14-
import {
15-
CustomAttachmentListContext,
16-
DefaultStreamChatGenerics,
17-
} from '../types';
14+
import { CustomAttachmentListContext } from '../types';
1815
import { AttachmentConfigurationService } from '../attachment-configuration.service';
1916
import {
2017
AfterViewInit,

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
import { Action, Attachment } from 'stream-chat';
1515
import {
1616
ModalContext,
17-
DefaultStreamChatGenerics,
1817
AttachmentConfigration,
1918
VideoAttachmentConfiguration,
2019
ImageAttachmentConfiguration,

projects/stream-chat-angular/src/lib/attachment.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AppSettings, Attachment } from 'stream-chat';
44
import { AttachmentService } from './attachment.service';
55
import { ChannelService } from './channel.service';
66
import { NotificationService } from './notification.service';
7-
import { AttachmentUpload, DefaultStreamChatGenerics } from './types';
7+
import { AttachmentUpload } from './types';
88
import { Subject } from 'rxjs';
99
import { ChatClientService } from './chat-client.service';
1010
import { MessageService } from './message.service';

projects/stream-chat-angular/src/lib/attachment.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ export class AttachmentService {
206206
*
207207
* Note: If you just want to use your own CDN for file uploads, you don't necessary need this method, you can just specify you own upload function in the [`ChannelService`](/chat/docs/sdk/angular/services/ChannelService/)
208208
* @param attachment
209+
*
210+
* Will set `isCustomAttachment` to `true` on the attachment. This is a non-standard field, other SDKs will ignore this property.
209211
*/
210212
addAttachment(attachment: Attachment) {
211-
// @ts-expect-error this is an internal field
212213
attachment.isCustomAttachment = true;
213214
this.createFromAttachments([attachment]);
214215
}

projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
22
import { By } from '@angular/platform-browser';
33
import { Channel } from 'stream-chat';
44
import { AvatarComponent } from '../avatar/avatar.component';
5-
import { DefaultStreamChatGenerics } from '../types';
65

76
import { AvatarPlaceholderComponent } from './avatar-placeholder.component';
87

projects/stream-chat-angular/src/lib/avatar-placeholder/avatar-placeholder.component.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { Component, Input, OnChanges } from '@angular/core';
22
import { Channel, User } from 'stream-chat';
33
import { CustomTemplatesService } from '../custom-templates.service';
4-
import {
5-
AvatarContext,
6-
AvatarLocation,
7-
AvatarType,
8-
DefaultStreamChatGenerics,
9-
} from '../types';
4+
import { AvatarContext, AvatarLocation, AvatarType } from '../types';
105

116
/**
127
* The `AvatarPlaceholder` component displays the [default avatar](/chat/docs/sdk/angular/components/AvatarComponent/) unless a [custom template](/chat/docs/sdk/angular/services/CustomTemplatesService/) is provided. This component is used by the SDK internally, you likely won't need to use it.

0 commit comments

Comments
 (0)