<commit_before>//
//  AppDelegate.swift
//  Rocket.Chat
//
//  Created by <NAME> on 7/5/16.
//  Copyright © 2016 Rocket.Chat. All rights reserved.
//

import UIKit
import RealmSwift
import UserNotifications

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    var notificationWindow: TransparentToTouchesWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        Launcher().prepareToLaunch(with: launchOptions)

        PushManager.setupNotificationCenter()
        application.registerForRemoteNotifications()
        if let launchOptions = launchOptions,
           let notification = launchOptions[.remoteNotification] as? [AnyHashable: Any] {
            PushManager.handleNotification(raw: notification)
        }

        // If user is authenticated, open the chat right away
        // but if not, just open the authentication screen.
        if let auth = AuthManager.isAuthenticated() {
            AuthManager.persistAuthInformation(auth)
            AuthSettingsManager.shared.updateCachedSettings()
            WindowManager.open(.subscriptions)

            if let user = auth.user {
                BugTrackingCoordinator.identifyCrashReports(withUser: user)
            }
        } else {
            WindowManager.open(.auth(serverUrl: "", credentials: nil))
        }<commit_msg>Present register username screen when lauching the app with a valid session without username<commit_after>//
//  AppDelegate.swift
//  Rocket.Chat
//
//  Created by <NAME> on 7/5/16.
//  Copyright © 2016 Rocket.Chat. All rights reserved.
//

import UIKit
import RealmSwift
import UserNotifications

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    var notificationWindow: TransparentToTouchesWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        Launcher().prepareToLaunch(with: launchOptions)

        PushManager.setupNotificationCenter()
        application.registerForRemoteNotifications()
        if let launchOptions = launchOptions,
           let notification = launchOptions[.remoteNotification] as? [AnyHashable: Any] {
            PushManager.handleNotification(raw: notification)
        }

        // If user is authenticated, open the chat right away
        // but if not, just open the authentication screen.
        if let auth = AuthManager.isAuthenticated() {
            if AuthManager.currentUser()?.username != nil {
                AuthManager.persistAuthInformation(auth)
                AuthSettingsManager.shared.updateCachedSettings()
                WindowManager.open(.subscriptions)

                if let user = auth.user {
                    BugTrackingCoordinator.identifyCrashReports(withUser: user)
                }
            } else {
                WindowManager.open(.auth(serverUrl: "", credentials: nil), viewControllerIdentifier: "RegisterUsernameNav")
            }
        } else {
            WindowManager.open(.auth(serverUrl: "", credentials: nil))
        }
{'fraction_non_alphanumeric': 0.08302354399008674, 'fraction_numerical': 0.004956629491945477, 'mean_word_length': 2.7943595769682728, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '96608', 'n_tokens_mistral': 837, 'n_tokens_neox': 782, 'n_words': 204}