Add license headers across the project

This commit is contained in:
Evan Hahn 2020-10-30 15:34:04 -05:00 committed by Evan Hahn
parent 8c3da11996
commit 8bfaf598af
738 changed files with 2695 additions and 378 deletions

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as Backbone from 'backbone';
import * as moment from 'moment';
import { LocalizerType } from '../types/Util';

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as MIME from '../types/MIME';
interface MIMETypeSupportMap {

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import PQueue from 'p-queue';
import createTaskWithTimeout from '../textsecure/TaskWithTimeout';

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export type SoundOpts = {
loop?: boolean;
src: string;

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import is from '@sindresorhus/is';
import { MIMEType } from '../types/MIME';

View file

@ -1,3 +1,6 @@
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import PQueue from 'p-queue';
import { sleep } from './sleep';

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export async function requestCameraPermissions(): Promise<boolean> {
if (!(await window.getMediaCameraPermissions())) {
await window.showCallingPermissionsPopup(true);

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import PQueue from 'p-queue';
import { Sound } from './Sound';

View file

@ -1,3 +1,6 @@
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function cleanSearchTerm(searchTerm: string): string {
const lowercase = searchTerm.toLowerCase();
const withoutSpecialCharacters = lowercase.replace(

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
/* eslint-disable camelcase */
// We don't include unicode-12.1.0 because it's over 100MB in size

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { DeletesModelType } from '../model-types.d';
import { MessageModel } from '../models/messages';

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import {
AttachmentPointerClass,
DownloadAttachmentType,

View file

@ -1,3 +1,6 @@
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import moment from 'moment';
const HOUR = 1000 * 60 * 60;

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import moment from 'moment';
import { LocalizerType } from '../types/Util';

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const PNG_SIGNATURE = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);
const ACTL_CHUNK_BYTES = new TextEncoder().encode('acTL');
const IDAT_CHUNK_BYTES = new TextEncoder().encode('IDAT');

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const BAD_CHARACTERS = /[^A-Za-z\s]+/g;
const WHITESPACE = /\s+/g;

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import moment from 'moment';
import { LocalizerType } from '../types/Util';

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { LocalizerType } from '../types/Util';
export type ProfileNameChangeType = {

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { BodyRangesType } from '../types/Util';
export function getTextWithMentions(

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function getUserAgent(appVersion: string): string {
return `Signal-Desktop/${appVersion}`;
}

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const env = window.getEnvironment();
const NINETY_ONE_DAYS = 86400 * 91 * 1000;

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
import { ActionCreatorsMapObject, bindActionCreators } from 'redux';
import { useDispatch } from 'react-redux';

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import loadImage from 'blueimp-load-image';
import { encode } from 'blurhash';

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as GoogleChrome from './GoogleChrome';
import * as Registration from './registration';
import { arrayBufferToObjectURL } from './arrayBufferToObjectURL';

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
const DANGEROUS_FILE_TYPES = /\.(ADE|ADP|APK|BAT|CAB|CHM|CMD|COM|CPL|DIAGCAB|DLL|DMG|EXE|HTA|INF|INS|ISP|JAR|JS|JSE|LIB|LNK|MDE|MHT|MSC|MSI|MSP|MST|NSH|PIF|PS1|PSC1|PSM1|PSRC|REG|SCR|SCT|SETTINGCONTENT-MS|SHB|SYS|VB|VBE|VBS|VXD|WSC|WSF|WSH)\.?$/i;
export function isFileDangerous(fileName: string): boolean {

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function isMuted(muteExpiresAt: undefined | number): boolean {
return Boolean(muteExpiresAt && Date.now() < muteExpiresAt);
}

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
// This is inspired by the `is-path-inside` module on npm.
import * as path from 'path';

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import libphonenumber from 'google-libphonenumber';
const instance = libphonenumber.PhoneNumberUtil.getInstance();

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { join } from 'path';
import { fromPairs, groupBy, map } from 'lodash';

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
/* eslint-disable no-console */
import * as fs from 'fs';
import { join, relative } from 'path';

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { join } from 'path';
import { writeFileSync } from 'fs';

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
// Tool requirements:
// - Feed it a set of regular expressions with descriptions as to what the risks are
// - Feed it also a set of exceptions

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
/* eslint-disable no-console */
import { readFileSync } from 'fs';

View file

@ -1,3 +1,6 @@
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { fromPairs, map } from 'lodash';
export function makeLookup<T>(

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { ColorType } from '../types/Colors';
type OldColorType =

View file

@ -1,3 +1,6 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
// `missingCaseError` is useful for compile-time checking that all `case`s in
// a `switch` statement have been handled, e.g.
//

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import semver from 'semver';
type RemoteVersion = {

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function markEverDone(): void {
window.storage.put('chromiumRegistrationDoneEver', '');
}

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { ConversationType } from '../state/ducks/conversations';
export async function generateSecurityNumber(

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { LoggerType } from '../types/Logging';
function parseUrl(value: unknown, logger: LoggerType): null | URL {

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function sleep(ms: number): Promise<void> {
return new Promise(resolve => {
setTimeout(resolve, ms);

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import {
IMAGE_BMP,
IMAGE_GIF,

View file

@ -1,3 +1,6 @@
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { padStart } from 'lodash';
export function getIncrement(length: number): number {

View file

@ -1,3 +1,6 @@
// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import PQueue from 'p-queue';
import { sleep } from './sleep';

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as fs from 'fs';
import { isWindows } from '../OS';

View file

@ -1,3 +1,6 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import {
AuthCredential,
ClientZkAuthOperations,