Some cleanups
[quassel.git] / src / core / core.h
index 420cc62..5f90917 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2016 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -493,6 +493,20 @@ public:
         return instance()->_storage->setBufferLastSeenMsg(user, bufferId, msgId);
     }
 
+    //! Get the auth username associated with a userId
+    /** \param user  The user to retrieve the username for
+     *  \return      The username for the user
+     */
+    static inline QString getAuthUserName(UserId user) {
+        return instance()->_storage->getAuthUserName(user);
+    }
+
+    //! Get a usable sysident for the given user in oidentd-strict mode
+    /** \param user    The user to retrieve the sysident for
+     *  \return The authusername
+     */
+    QString strictSysIdent(UserId user) const;
+
 
     //! Get a Hash of all last seen message ids
     /** This Method is called when the Quassel Core is started to restore the lastSeenMsgIds
@@ -539,7 +553,7 @@ public:
      * \param bufferId  The buffer id
      * \param MsgId     The Message id where the marker line should be placed
      */
-    static inline void setBufferActivity(UserId user, const BufferId &bufferId, const Message::Types &activity) {
+    static inline void setBufferActivity(UserId user, BufferId bufferId, Message::Types activity) {
         return instance()->_storage->setBufferActivity(user, bufferId, activity);
     }
 
@@ -561,7 +575,7 @@ public:
      * \param bufferId The buffer
      * \param lastSeenMsgId     The last seen message
      */
-    static inline Message::Types bufferActivity(BufferId &bufferId, const MsgId &lastSeenMsgId) {
+    static inline Message::Types bufferActivity(BufferId bufferId, MsgId lastSeenMsgId) {
         return instance()->_storage->bufferActivity(bufferId, lastSeenMsgId);
     }
 
@@ -576,6 +590,8 @@ public:
      */
     static bool reloadCerts();
 
+    static void cacheSysIdent();
+
     static QVariantList backendInfo();
     static QVariantList authenticatorInfo();
 
@@ -659,6 +675,7 @@ private:
     DeferredSharedPtr<Storage>       _storage;        ///< Active storage backend
     DeferredSharedPtr<Authenticator> _authenticator;  ///< Active authenticator
     QTimer _storageSyncTimer;
+    QMap<UserId, QString> _authUserNames;
 
 #ifdef HAVE_SSL
     SslServer _server, _v6server;